public override void Process(PlayerJoiningMultiplayerSession packet, Connection connection)
        {
            Player player = playerManager.CreatePlayer(connection, packet.ReservationKey);

            player.SendPacket(new TimeChange(timeKeeper.GetCurrentTime()));

            escapePodManager.AssignPlayerToEscapePod(player.Id);

            BroadcastEscapePods broadcastEscapePods = new BroadcastEscapePods(escapePodManager.GetEscapePods());

            playerManager.SendPacketToAllPlayers(broadcastEscapePods);

            PlayerJoinedMultiplayerSession playerJoinedPacket = new PlayerJoinedMultiplayerSession(player.Id, player.Name, player.PlayerSettings);

            playerManager.SendPacketToOtherPlayers(playerJoinedPacket, player);

            foreach (Player otherPlayer in playerManager.GetPlayers())
            {
                if (!player.Equals(otherPlayer))
                {
                    playerJoinedPacket = new PlayerJoinedMultiplayerSession(otherPlayer.Id, otherPlayer.Name, otherPlayer.PlayerSettings);
                    player.SendPacket(playerJoinedPacket);
                }
            }
        }
Ejemplo n.º 2
0
        public override void Process(InitialPlayerSync packet)
        {
            EscapePodModel escapePod = packet.EscapePodsData.Find(x => x.Id.Equals(packet.AssignedEscapePodId));

            escapePodManager.AssignPlayerToEscapePod(escapePod);
            escapePodManager.SyncEscapePodIds(packet.EscapePodsData);
        }
Ejemplo n.º 3
0
        public override void Process(PlayerJoiningMultiplayerSession packet, Connection connection)
        {
            Player player = playerManager.CreatePlayer(connection, packet.ReservationKey);

            player.SendPacket(new TimeChange(timeKeeper.GetCurrentTime()));


            escapePodManager.AssignPlayerToEscapePod(player.Id);

            BroadcastEscapePods broadcastEscapePods = new BroadcastEscapePods(escapePodManager.GetEscapePods());

            playerManager.SendPacketToAllPlayers(broadcastEscapePods);

            PlayerJoinedMultiplayerSession playerJoinedPacket = new PlayerJoinedMultiplayerSession(player.PlayerContext);

            playerManager.SendPacketToOtherPlayers(playerJoinedPacket, player);

            InitialPlayerSync initialPlayerSync = new InitialPlayerSync(player.Id.ToString(),
                                                                        world.PlayerData.GetEquippedItemsForInitialSync(player.Name),
                                                                        world.BaseData.GetBasePiecesForNewlyConnectedPlayer(),
                                                                        world.VehicleData.GetVehiclesForInitialSync(),
                                                                        world.InventoryData.GetAllItemsForInitialSync(),
                                                                        world.GameData.PDAState.GetInitialPdaData(),
                                                                        world.PlayerData.PlayerSpawn(player.Name),
                                                                        world.PlayerData.GetSubRootGuid(player.Name),
                                                                        world.PlayerData.Stats(player.Name),
                                                                        getRemotePlayerData(player),
                                                                        world.EntityData.GetGlobalRootEntities());

            player.SendPacket(initialPlayerSync);
        }
        public override void Process(PlayerJoiningMultiplayerSession packet, Connection connection)
        {
            Player player = playerManager.CreatePlayer(connection, packet.ReservationKey);

            player.SendPacket(new TimeChange(timeKeeper.GetCurrentTime()));

            escapePodManager.AssignPlayerToEscapePod(player.Id);

            BroadcastEscapePods broadcastEscapePods = new BroadcastEscapePods(escapePodManager.GetEscapePods());

            playerManager.SendPacketToAllPlayers(broadcastEscapePods);

            PlayerJoinedMultiplayerSession playerJoinedPacket = new PlayerJoinedMultiplayerSession(player.PlayerContext);

            playerManager.SendPacketToOtherPlayers(playerJoinedPacket, player);

            InitialPlayerSync initialPlayerSync = new InitialPlayerSync(world.PlayerData.Inventory(player.Name),
                                                                        world.PlayerData.GetEquippedItemsForInitialSync(player.Name),
                                                                        world.BaseData.GetBasePiecesForNewlyConnectedPlayer(),
                                                                        world.VehicleData.GetVehiclesForInitialSync(),
                                                                        world.InventoryData.GetAllItemsForInitialSync());

            player.SendPacket(initialPlayerSync);

            foreach (Player otherPlayer in playerManager.GetPlayers())
            {
                if (!player.Equals(otherPlayer))
                {
                    playerJoinedPacket = new PlayerJoinedMultiplayerSession(otherPlayer.PlayerContext);
                    player.SendPacket(playerJoinedPacket);
                }
            }
        }
Ejemplo n.º 5
0
        public override IEnumerator Process(InitialPlayerSync packet, WaitScreen.ManualWaitItem waitScreenItem)
        {
            EscapePodModel escapePod = packet.EscapePodsData.Find(x => x.Id.Equals(packet.AssignedEscapePodId));

            escapePodManager.AssignPlayerToEscapePod(escapePod);
            yield return(null);

            escapePodManager.SyncEscapePodIds(packet.EscapePodsData);
        }
        public override void Process(ClaimPlayerSlotReservation packet, Connection connection)
        {
            Player player = playerManager.ClaimPlayerSlotReservation(connection, packet.ReservationKey, packet.CorrelationId);

            player.SendPacket(new TimeChange(timeKeeper.GetCurrentTime()));

            escapePodManager.AssignPlayerToEscapePod(player.Id);

            BroadcastEscapePods broadcastEscapePods = new BroadcastEscapePods(escapePodManager.GetEscapePods());

            playerManager.SendPacketToAllPlayers(broadcastEscapePods);
        }
Ejemplo n.º 7
0
        public override void Process(Authenticate packet, Connection connection)
        {
            Player player = playerManager.PlayerAuthenticated(connection, packet.PlayerId);

            player.SendPacket(new TimeChange(timeKeeper.GetCurrentTime()));

            escapePodManager.AssignPlayerToEscapePod(player.Id);

            BroadcastEscapePods broadcastEscapePods = new BroadcastEscapePods(escapePodManager.GetEscapePods());

            playerManager.SendPacketToAllPlayers(broadcastEscapePods);
        }