Example #1
0
    public async Task <FtRequestData> JoinGame()
    {
        FtRequest request = new FtRequest(FtRequestType.JoinGame, new FtRequestData()
        {
            SenderGuid = OS.GetUniqueId(),
            SenderName = System.Environment.MachineName
        });

        HttpResponse response = await Global.Http.Request(Route("join-game"), 5, request.ToJson());

        FtRequestData data = JsonSerializer.Deserialize <FtRequestData>(response.Body);

        return(data);
    }
Example #2
0
    public async Task <FtRequestData> Sync(List <object> unitActions)
    {
        FtRequest request = new FtRequest(FtRequestType.Sync, new FtRequestData()
        {
            SenderGuid  = OS.GetUniqueId(),
            SenderName  = System.Environment.MachineName,
            UnitActions = unitActions
        });

        string json = request.ToJson();

        Global.Log(json);

        HttpResponse response = await Global.Http.Request(Route("sync"), 5, json);

        Global.Log(response.Body);
        FtRequestData data = JsonSerializer.Deserialize <FtRequestData>(response.Body);

        return(data);
    }