Giter VIP home page Giter VIP logo

interactive-cpp's Introduction

NOTE: This repo is no longer being maintained by Microsoft.

You can find more information here: https://dev.mixer.com/blog/mixplaysdkchanges


Mixer Interactivity C++ SDK

The C++ Interactivity SDK supports client-side development with Mixer Interactivity. If you have not read through our Interactive Reference Documentation now is a great time to do that.

Documentation

Checkout the Project's Wiki for documentation, including a Getting Started guide.

Quick Start

Clone the interactive-cpp repository.

$ git clone https://github.com/mixer/interactive-cpp.git interactive-cpp

Copy the source directory into your C++ game project (you will likely want to rename it). Add interactivity.cpp to your compilation list and include interactivity.h to get started.

See the InteractiveSample for an example of how you might handle authorization and connect to an interactive session.

Authorization

If you don't plan on handling authorization yourself you can use the provided authorization helper functions. To do so you will need an OAuth client ID which you can obtain here: https://mixer.com/lab/oauth

Design choices

This source code was designed to be easily consumed by any game project. Some of major design decisions include:

  • A single header and unity build style cpp file.
  • An extern "C" interface.
  • No dependencies exposed in the header, all usage of STL and other libraries are quarantined from your game.
  • Callbacks on the caller's thread for easy memory management and managed language interop.
  • All interactive functions assume UTF-8 strings for input and output parameters.

Release Notes

The interactive-cpp repository is currently in a pre-release state. Please refer to the release notes for more information.

Contribute Back!

Is there a feature missing that you'd like to see, or have you found a bug that you have a fix for? Do you have an idea or just interest in helping out in building the library? Let us know and we'd love to work with you. For a good starting point on where we are headed and feature ideas, take a look at our requested features and bugs or backlog.

Big or small we'd like to take your contributions to help improve the Mixer Interactivity API for everyone.

Legacy SDK

If you are looking for the previous version of the SDK it is preserved here.

Having Trouble?

We'd love to get your review score, whether good or bad, but even more than that, we want to fix your problem. If you submit your issue as a Review, we won't be able to respond to your problem and ask any follow-up questions that may be necessary. The most efficient way to do that is to open an issue in our issue tracker.

Quick Links

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

interactive-cpp's People

Contributors

aechdub avatar arhoads avatar edjamesmsft avatar fritzbraun avatar joannaleecy avatar joshsnider avatar jsyarrow avatar k-rutkowski avatar mobius5150 avatar payzer avatar probableprime avatar quinndamerell-ms avatar sspiller-atg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

interactive-cpp's Issues

v2 interactive_control_trigger_cooldown seems to only work once per session per button

Test project with multiple buttons where the client responds to a button press by triggering a 5s cooldown on the pressed button. Each button runs its cooldown the first time it is pressed. Subsequence presses of the same button do not trigger a cooldown (as observed at mixer.com). The client does get an onControlUpdate message from the service in response to the cooldown request even when no cooldown occurs, but the value of the cooldown field remains unchanged after the first successful cooldown.

At a guess the problem is a missing seq field on the outgoing message.

Crash in interactive_get_user

I have encountered a crash when calling interactive_get_user.
The detail is as follows:
File : interactive_session.cpp(898)
Source : user.avatarUrl = responseDoc["avatarUrl"].GetString();
Message: Expression: IsString()

It looks data_.f.flags is 0 and fails on RAPIDJSON_ASSERT(IsString()).

The code works fine on Xbox One, but it crashes on PC.

Xbox sample unusable - fails activation request

Hi, trying to get started with the Xbox sample. Code is compiled and s_interactiveVersion set to my project's VersionID. My xbox is in developer mode, has latest recovery installed (and I've tried with and without sandbox set to XDKS.1). However every time I try to launch I get:

failed-activation

and on the devkit I see:

172 16 1 140_image_77

and this is the Output:
Starting Title...
Title failed to start
Error trying to debug Title

Thoughts?

Running the InteractiveSampleUWP throws exception

Running the InteractiveSampleUWP, I've set the CLIENT_ID, INTERACTIVE_ID, and SHARE_CODE, but when running it, I get an exception on startup at frame.cpp line 713.

InteractiveSampleUWP.exe has triggered a breakpoint. occurred

Any suggestions?

Access to the channel APIs

There is a request to make it easier to access Channel APIs from the SDK. Opening this issue to track that request. Channel APIs would be thinks like who's a moderation or sub events.

Input events need timestamps

"For joystick, it seems like interactive_reg_coordinate_input_handler callback will be triggered multiple times, potentially by different Participants. Since the application will have to aggregate and normalize multiple user input, it might be useful to have timestamps attached to these events which can be used in their aggregation algorithms. Right now, the application will likely have to queue activity for some time, and then operate on all entries assuming they were delivered in order โ€“ and having to attach their own sequencing."

Setting control background image doesn't change button

Setting the background image of a button is not changing the button. Should I need to do anything else 3esides calling the method?
auto result = ::interactive_control_set_property_string(_session, "Image1", "backgroundImage", "https://...");

Here is the debug trace : the result is MIXER_OK

Queueing method: {"id":7,"method":"updateControls","discard":true,"seq":10,"params":{"sceneID":"default","controls":[{"controlID":"Image1","backgroundImage":"https://tse3.mm.bing.net/th?id=OIP.6RGX1DlxvqSevMPOWizDSAHaJ6&pid=Api"}]}}
Sending websocket message: {"id":7,"method":"updateControls","discard":true,"seq":10,"params":{"sceneID":"default","controls":[{"controlID":"Image1","backgroundImage":"https://tse3.mm.bing.net/th?id=OIP.6RGX1DlxvqSevMPOWizDSAHaJ6&pid=Api"}]}}
Websocket message received: {"type":"method","method":"onControlUpdate","params":{"sceneID":"default","controls":[{"controlID":"Image1","kind":"button","etag":"","disabled":false,"cooldown":0,"cost":0,"backgroundColor":"#240be2","borderColor":"#f73e3e","meta":{},"position":[{"size":"large","width":17,"height":10,"x":25,"y":6}],"text":"Image1","backgroundImage":"https://tse3.mm.bing.net/th?id=OIP.6RGX1DlxvqSevMPOWizDSAHaJ6&pid=Api"}]},"id":0,"seq":12,"discard":true}

Thanks,
Michael

Need more async functions

  • interactive_open_session
  • interactive_set_ready
  • interactive_close_session
  • interactive_send_method
  • interactive_receive_reply
  • interactive_auth_get_short_code
  • interactive_auth_wait_short_code
  • interactive_auth_refresh_token

v2 label textSize property has unexpected type

interactive_control_get_property_int(MySession, "mylabel", "textSize", &outTextSize) returns MIXER_ERROR_INVALID_PROPERTY_TYPE. The property appears to be treated as a string internally, despite holding an integer value (36 in my case).

v2: simplewebsocketwin.cpp triggers C4800

Depending on warning level the lines below may trigger a warning (BOOL to bool conversion)

// line 113
bool status = WinHttpSetOption(requestHandle.get(), WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET, nullptr, 0);
// ...
// line 129
status = WinHttpSendRequest(requestHandle.get(), utf8_to_wstring(headers).c_str(), (DWORD)headers.length(), nullptr, 0, 0, 0);
// ...
// line 135
status = WinHttpReceiveResponse(requestHandle.get(), 0);

auto_ptr removed from c++17

I'm looking to move our codebase to c++17 and we have an issue with interactive_open_session as it uses auto_ptr which has been removed from the standard. It doesn't seem particularly useful where it is, can we have it removed?

Error Building SDK in Visual Studio for ARM64

Building the SDK for ARM64 in Visual Studio 2017 triggers a warning from the rapidjson.h library. Please advise on how to address this.

1>pch.cpp
1>interactivity.cpp
1>d:\source\repos\interactive-cpp\source\internal\rapidjson\rapidjson.h(244): fatal error C1189: #error: Unknown machine endianess detected. User needs to define RAPIDJSON_ENDIAN.

Thanks,
Michael

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.