public virtual void ResponseListGame(byte[] buffer)
    {
        try
        {
            ProtoGameServer.ListGame responseListGame = ProtoHelper.ToProto <ProtoGameServer.ListGame>(buffer);

            mErrorCode = responseListGame.err;

            if (mErrorCode == ProtoGameServer.ERROR_CODE.ERR_NONE)
            {
                if (onResponseListGame != null)
                {
                    onResponseListGame(responseListGame);
                }
            }
            else
            {
                if (onResponseError != null)
                {
                    onResponseError(mErrorCode);
                }
            }
        }
        catch (Exception)
        {
        }
    }
Example #2
0
 static void OnResponseListGame(ProtoGameServer.ListGame responseListGame)
 {
     for (int indexGame = 0; indexGame < responseListGame.games.Count; indexGame++)
     {
         Console.WriteLine(string.Format(
                               "Game{0} private={1} mode={2} mapid={3} evaluation={4} players={5}/{6}",
                               responseListGame.games[indexGame].gameid,
                               responseListGame.games[indexGame].@private,
                               responseListGame.games[indexGame].mode,
                               responseListGame.games[indexGame].mapid,
                               responseListGame.games[indexGame].evaluation,
                               responseListGame.games[indexGame].curPlayers,
                               responseListGame.games[indexGame].maxPlayers));
     }
 }