All URIs are relative to http://game.host/v1
| Method | HTTP request | Description |
|---|---|---|
| RegisterConsumer | POST /games/{game_id}/consumers | Register Consumers |
JoinResponse RegisterConsumer (int gameId, ConsumerRegistration consumerRegistration = null)
Register Consumers
Add a consumer to create a virtual (spectating) player to consume events
using System.Collections.Generic;
using System.Diagnostics;
using Tgm.Roborally.Api.Api;
using Tgm.Roborally.Api.Client;
using Tgm.Roborally.Api.Model;
namespace Example
{
public class RegisterConsumerExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://game.host/v1";
var apiInstance = new ConsumerApi(config);
var gameId = 56; // int | The id of the game to interact with
var consumerRegistration = new ConsumerRegistration(); // ConsumerRegistration | Information about the joining consumer (optional)
try
{
// Register Consumers
JoinResponse result = apiInstance.RegisterConsumer(gameId, consumerRegistration);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ConsumerApi.RegisterConsumer: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| gameId | int | The id of the game to interact with | |
| consumerRegistration | ConsumerRegistration | Information about the joining consumer | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Created | - |
| 410 | Consumer count limit reached | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]