SysLaunchServer
Launch a hosted server directly. Allows for the bypassing of brainCloud lobby matchmaking.
Service | Operation |
---|---|
roomServer | LAUNCH_SERVER |
Method Parameters
Parameter | Description |
---|---|
serverName | The type of server to launch as defined in App > Design > Servers > My Servers . |
scriptName | The name of the cloud code script to invoke for all hosted server launch events. Should be the whole path to the script. |
scriptData | Optional JSON object that will be sent as input to the associated cloud code script. |
regionId | Optional region id to target for the hosted server launch. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
var serverName = "my-server-type";
var scriptName = "script-name";
var scriptData = {
"abc": "xyz"
};
var regionId = "ca-central-1";
var roomServerProxy = bridge.getRoomserverServiceProxy();
var postResult = roomServerProxy.launchServer(serverName, scriptName, scriptData, regionId);
{
"service":"roomServer",
"operation":"LAUNCH_SERVER",
"data":{
"serverName":"my-server-type",
"scriptName":"script-name",
"scriptData":{
"abc":"xyz"
},
"regionId":"ca-central-1"
}
}
JSON Response
{
"data": {
"serverId": "23782:d1787dee-7a3a-42e1-a2ae-74e08ca507f5"
},
"status": 200
}