예제 #1
0
        private void Handler(SessionSendSimulationStatePacket sessionSendSimulationStatePacket)
        {
            var state = sessionSendSimulationStatePacket.SimulationState;


            ScreenManager.RemoveScreen(this);
            ScreenManager.AddScreen(new GameplayScreen(state, sessionSendSimulationStatePacket.PlayerUID), null);
        }
예제 #2
0
        /// <summary>
        /// Verifies a user is okay to enter the game and loading has been complete.
        /// </summary>
        /// <returns></returns>
        public bool VerifyGameLoad(NotifyLoadedGamePacket obj)
        {
            if (_secureTokensWaiting.Contains(obj.SecureToken))
            {
                // Verify this player has loaded the game
                _secureTokensWaiting.Remove(obj.SecureToken);

                ulong id = FindUser(obj);

                hasAnyoneLoaded = true;

                // Once a player has loaded, it's okay to send them them the game state
                var packet = new SessionSendSimulationStatePacket(_simulationState, id);
                ClientNetworkManager.Instance.SendPacket(packet, obj.Sender);

                // The minute we know this entity is good, use it

                return(true);
            }

            return(false);
        }