Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
RCON.c
Go to the documentation of this file.
2 {
3  ServerConfigMeta config;
4 
5  override void OnSuccess(int code)
6  {
7  Print("config downloaded");
8 
9  GameStateTransitions.RequestServerConfigChange(config);
10  }
11 
12  override void OnError(int code, int restCode, int apiCode)
13  {
14  Print("config download error");
15  }
16 
17 }
18 // -------------------------------------------------------------------------
19 class SCR_RCONCommander: RCONCommander
20 {
22 
23  override void ProcessCommand(string sCommand, int iRequestId)
24  {
25  ref array<string> commandSegments = new array<string>;
26  sCommand.Split(" ", commandSegments, true);
27 
28  if (commandSegments.Count() != 2)
29  {
30  Print("Invalid command format", LogLevel.ERROR);
31  }
32  else
33  {
34  switch(commandSegments[0])
35  {
36  case "config": {
37 
38  Print("config command received");
39 
40  string configId = commandSegments[1];
41 
42  ServerConfigApi ca = GetGame().GetBackendApi().GetServerConfigApi();
43  callback.config = ca.Download(configId, callback);
44 
45  break;
46  }
47 
48  default: Print("unknown command"); break;
49  }
50  }
51 
52 
53  }
54 }
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
GameStateTransitions
Definition: GameStateTransitions.c:12
ProcessCommand
override void ProcessCommand(string sCommand, int iRequestId)
Definition: RCON.c:23
DownloadConfigCallback
Definition: RCON.c:1
BackendCallback
Base server browser callback.
Definition: SCR_ServerListComponent.c:4
callback
DownloadConfigCallback callback