Пример #1
0
        private static NetworkPacket ReadPacketValues(ClientPacketType PacketType, NetworkPacket ReadFrom)
        {
            switch (PacketType)
            {
            //Account Management
            case (ClientPacketType.AccountLoginRequest):
                return(AccountManagementPacketHandler.GetValuesAccountLoginRequest(ReadFrom));

            case (ClientPacketType.AccountLogoutAlert):
                return(AccountManagementPacketHandler.GetValuesAccountLogoutAlert(ReadFrom));

            case (ClientPacketType.AccountRegistrationRequest):
                return(AccountManagementPacketHandler.GetValuesAccountRegisterRequest(ReadFrom));

            case (ClientPacketType.CharacterDataRequest):
                return(AccountManagementPacketHandler.GetValuesCharacterDataRequest(ReadFrom));

            case (ClientPacketType.CharacterCreationRequest):
                return(AccountManagementPacketHandler.GetValuesCreateCharacterRequest(ReadFrom));

            //Game World State
            case (ClientPacketType.EnterWorldRequest):
                return(GameWorldStatePacketHandler.GetValuesEnterWorldRequest(ReadFrom));

            case (ClientPacketType.PlayerReadyAlert):
                return(GameWorldStatePacketHandler.GetValuesNewPlayerReady(ReadFrom));

            //Player Communication
            case (ClientPacketType.PlayerChatMessage):
                return(PlayerCommunicationPacketHandler.GetValuesClientChatMessage(ReadFrom));

            //Player Management
            case (ClientPacketType.PlayerPositionUpdate):
                return(PlayerManagementPacketHandler.GetValuesPlayerPositionUpdate(ReadFrom));

            case (ClientPacketType.PlayerRotationUpdate):
                return(PlayerManagementPacketHandler.GetValuesPlayerRotationUpdate(ReadFrom));

            case (ClientPacketType.PlayerCameraUpdate):
                return(PlayerManagementPacketHandler.GetValuesPlayerCameraUpdate(ReadFrom));

            case (ClientPacketType.PlayAnimationAlert):
                return(PlayerManagementPacketHandler.GetValuesPlayAnimationAlert(ReadFrom));

            //System
            case (ClientPacketType.MissedPacketsRequest):
                return(SystemPacketHandler.GetValuesMissedPacketsRequest(ReadFrom));

            case (ClientPacketType.StillConnectedReply):
                return(SystemPacketHandler.GetValuesStillConnectedReply(ReadFrom));

            //Combat
            case (ClientPacketType.PlayerAttackAlert):
                return(CombatPacketHandler.GetValuesPlayerAttackAlert(ReadFrom));

            case (ClientPacketType.PlayerRespawnRequest):
                return(CombatPacketHandler.GetValuesPlayerRespawnRequest(ReadFrom));
            }
            return(new NetworkPacket());
        }
Пример #2
0
 void Awake()
 {
     Instance = this;
 }
Пример #3
0
    private NetworkPacket ReadPacketValues(ServerPacketType PacketType, NetworkPacket ReadFrom)
    {
        switch (PacketType)
        {
        //Account Management
        case (ServerPacketType.AccountLoginReply):
            return(AccountManagementPacketHandler.GetValuesAccountLoginReply(ReadFrom));

        case (ServerPacketType.AccountRegistrationReply):
            return(AccountManagementPacketHandler.GetValuesAccountRegistrationReply(ReadFrom));

        case (ServerPacketType.CharacterDataReply):
            return(AccountManagementPacketHandler.GetValuesCharacterDataReply(ReadFrom));

        case (ServerPacketType.CreateCharacterReply):
            return(AccountManagementPacketHandler.GetValuesCreateCharacterReply(ReadFrom));

        //Game World State
        case (ServerPacketType.ActivePlayerList):
            return(GameWorldStatePacketHandler.GetValuesActivePlayerList(ReadFrom));

        case (ServerPacketType.ActiveEntityList):
            return(GameWorldStatePacketHandler.GetValuesActiveEntityList(ReadFrom));

        case (ServerPacketType.ActiveItemList):
            return(GameWorldStatePacketHandler.GetValuesActiveItemList(ReadFrom));

        case (ServerPacketType.InventoryContents):
            return(GameWorldStatePacketHandler.GetValuesInventoryContents(ReadFrom));

        case (ServerPacketType.EquippedItems):
            return(GameWorldStatePacketHandler.GetValuesActivePlayerList(ReadFrom));

        case (ServerPacketType.SocketedAbilities):
            return(GameWorldStatePacketHandler.GetValuesSocketedAbilities(ReadFrom));

        //Player Communication
        case (ServerPacketType.PlayerChatMessage):
            return(PlayerCommunicationPacketHandler.GetValuesChatMessage(ReadFrom));

        //Player Management
        case (ServerPacketType.PlayerPositionUpdate):
            return(PlayerManagementPacketHandler.GetValuesPlayerPositionUpdate(ReadFrom));

        case (ServerPacketType.PlayerRotationUpdate):
            return(PlayerManagementPacketHandler.GetValuesPlayerRotationUpdate(ReadFrom));

        case (ServerPacketType.AddPlayer):
            return(PlayerManagementPacketHandler.GetValuesAddRemotePlayer(ReadFrom));

        case (ServerPacketType.RemovePlayer):
            return(PlayerManagementPacketHandler.GetValuesRemoveRemotePlayer(ReadFrom));

        case (ServerPacketType.AllowPlayerBegin):
            return(PlayerManagementPacketHandler.GetValuesAllowPlayerBegin(ReadFrom));

        case (ServerPacketType.PlayAnimationAlert):
            return(PlayerManagementPacketHandler.GetValuesRemotePlayerPlayAnimation(ReadFrom));

        //System
        case (ServerPacketType.StillConnectedCheck):
            return(SystemPacketHandler.GetValuesStillConnectedCheck(ReadFrom));

        case (ServerPacketType.MissingPacketsRequest):
            return(SystemPacketHandler.GetValuesMissingPacketsRequest(ReadFrom));

        case (ServerPacketType.KickedFromServer):
            return(SystemPacketHandler.GetValuesKickedFromServer(ReadFrom));

        case (ServerPacketType.UIMessage):
            return(SystemPacketHandler.GetValuesUIMessage(ReadFrom));

        //Combat
        case (ServerPacketType.LocalPlayerTakeHit):
            return(CombatPacketHandler.GetValuesLocalPlayerTakeHit(ReadFrom));

        case (ServerPacketType.RemotePlayerTakeHit):
            return(CombatPacketHandler.GetValuesRemotePlayerTakeHit(ReadFrom));

        case (ServerPacketType.LocalPlayerDead):
            return(CombatPacketHandler.GetValuesLocalPlayerDead(ReadFrom));

        case (ServerPacketType.RemotePlayerDead):
            return(CombatPacketHandler.GetValuesRemotePlayerDead(ReadFrom));

        case (ServerPacketType.LocalPlayerRespawn):
            return(CombatPacketHandler.GetValuesLocalPlayerRespawn(ReadFrom));

        case (ServerPacketType.RemotePlayerRespawn):
            return(CombatPacketHandler.GetValuesRemotePlayerRespawn(ReadFrom));
        }
        return(new NetworkPacket());
    }