Пример #1
0
        public void AsyncJoinToSavedGame()
        {
            UnifiedTestClient client  = null;
            UnifiedTestClient client2 = null;

            try
            {
                var roomName = GenerateRandomizedRoomName(MethodBase.GetCurrentMethod().Name);

                client = this.CreateMasterClientAndAuthenticate(Player1);

                // try join game on gameServer
                this.ConnectAndAuthenticate(client, this.GameServerAddress);

                client.CreateRoom(roomName, new RoomOptions(), TypedLobby.Default, null, true, "SaveLoadStateTestPlugin");

                Thread.Sleep(1000);
                client.Disconnect();
                Thread.Sleep(1000);

                // try join game on master
                client2 = this.CreateMasterClientAndAuthenticate(Player2);
                client2.JoinGame(roomName);

                // try join game on gameServer
                this.ConnectAndAuthenticate(client2, this.GameServerAddress);
                var joinGameRequest = new JoinGameRequest
                {
                    GameId  = roomName,
                    Plugins = new[] { "SaveLoadStateTestPlugin" }
                };
                client2.WaitTimeout = 3000000;
                client2.JoinGame(joinGameRequest);
            }
            finally
            {
                DisposeClients(client, client2);
            }
        }