All URIs are relative to http://game.host/v1
Method | HTTP request | Description |
---|---|---|
ChooseRobot | PATCH /games/{game_id}/players/{player_id} | Set Robots |
GetAllPlayers | GET /games/{game_id}/players/ | Get all players |
GetPlayer | GET /games/{game_id}/players/{player_id} | Get player |
Join | POST /games/{game_id}/players/ | Join game |
KickPlayer | DELETE /games/{game_id}/players/{player_id} | Remove Player |
void ChooseRobot (int gameId, int playerId, List robots = null)
Set Robots
DEPRECATET > This feature is useless in this version. It will be usefull in newer versions Sets the type of robot(s) the player is controlling
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 ChooseRobotExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://game.host/v1";
// Configure API key authorization: player-auth
config.AddApiKey("pat", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("pat", "Bearer");
var apiInstance = new PlayersApi(config);
var gameId = 56; // int | The id of the game to interact with
var playerId = 56; // int | the id of the player to interact with
var robots = new List<Robots>(); // List<Robots> | The robots assigned to the player (optional)
try
{
// Set Robots
apiInstance.ChooseRobot(gameId, playerId, robots);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PlayersApi.ChooseRobot: " + 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 | |
playerId | int | the id of the player to interact with | |
robots | List<Robots> | The robots assigned to the player | [optional] |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<int> GetAllPlayers (int gameId)
Get all players
Returns the index of all players
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 GetAllPlayersExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://game.host/v1";
// Configure API key authorization: player-auth
config.AddApiKey("pat", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("pat", "Bearer");
var apiInstance = new PlayersApi(config);
var gameId = 56; // int | The id of the game to interact with
try
{
// Get all players
List<int> result = apiInstance.GetAllPlayers(gameId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PlayersApi.GetAllPlayers: " + 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 |
List
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Player GetPlayer (int gameId, int playerId)
Get player
Get closer information about the player
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 GetPlayerExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://game.host/v1";
// Configure API key authorization: player-auth
config.AddApiKey("pat", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("pat", "Bearer");
var apiInstance = new PlayersApi(config);
var gameId = 56; // int | The id of the game to interact with
var playerId = 56; // int | the id of the player to interact with
try
{
// Get player
Player result = apiInstance.GetPlayer(gameId, playerId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PlayersApi.GetPlayer: " + 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 | |
playerId | int | the id of the player to interact with |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
JoinResponse Join (int gameId, string password = null, string name = null)
Join game
Join the given game. You will get your ID by doing this, if you already in the game you can get your ID again if you lost it.
The id is neccessary for any further API calls
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 JoinExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://game.host/v1";
var apiInstance = new PlayersApi(config);
var gameId = 56; // int | The id of the game to interact with
var password = password_example; // string | The password of the game if the lobby is password protected (optional)
var name = name_example; // string | The name to be displayed as username (optional)
try
{
// Join game
JoinResponse result = apiInstance.Join(gameId, password, name);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PlayersApi.Join: " + 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 | |
password | string | The password of the game if the lobby is password protected | [optional] |
name | string | The name to be displayed as username | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Joined | - |
401 | Wrong/No password | - |
404 | Not Found | - |
409 | Not Joinable | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void KickPlayer (int gameId, int playerId)
Remove Player
Removes a player from the game. This can be done by the player itsself or by the host.
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 KickPlayerExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://game.host/v1";
// Configure API key authorization: admin-access
config.AddApiKey("skey", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("skey", "Bearer");
// Configure API key authorization: player-auth
config.AddApiKey("pat", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("pat", "Bearer");
var apiInstance = new PlayersApi(config);
var gameId = 56; // int | The id of the game to interact with
var playerId = 56; // int | the id of the player to interact with
try
{
// Remove Player
apiInstance.KickPlayer(gameId, playerId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PlayersApi.KickPlayer: " + 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 | |
playerId | int | the id of the player to interact with |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]