Пример #1
0
 public void ReadFromByteArray(ByteArray byteArray)
 {
     this.BattleMode = BattleModeHelper.ReadFromByteArray(byteArray);
     this.LinkMode   = BattleLinkModeHelper.ReadFromByteArray(byteArray);
     this.Rules      = new BattleRuleSequence();
     this.Rules.ReadFromByteArray(byteArray);
 }
Пример #2
0
        private static bool OnDirectBattle(ByteArray byteArray, IRoomClientService clientService)
        {
            int        server     = byteArray.ReadInt();
            BattleMode battleMode = BattleModeHelper.ReadFromByteArray(byteArray);

            clientService.OnDirectBattle(server, battleMode);
            return(true);
        }
Пример #3
0
        private static bool OnAgentBattle(ByteArray byteArray, IRoomClientService clientService)
        {
            int        identity       = byteArray.ReadInt();
            byte       playerPosition = byteArray.ReadByte();
            BattleMode battleMode     = BattleModeHelper.ReadFromByteArray(byteArray);

            clientService.OnAgentBattle(identity, playerPosition, battleMode);
            return(true);
        }
        private static bool OnLogon(int sessionID, ByteArray byteArray, IPokemonBattleServerService serverService)
        {
            string     identity    = byteArray.ReadUTF();
            BattleMode modeInfo    = BattleModeHelper.ReadFromByteArray(byteArray);
            string     versionInfo = byteArray.ReadUTF();

            serverService.OnLogon(sessionID, identity, modeInfo, versionInfo);
            return(true);
        }
Пример #5
0
        public static ByteArray Logon(string identity, BattleMode modeInfo, string versionInfo)
        {
            ByteArray byteArray = new ByteArray();

            byteArray.WriteInt(0x5bbe67ef);
            byteArray.WriteUTF(identity);
            BattleModeHelper.WriteToByteArray(byteArray, modeInfo);
            byteArray.WriteUTF(versionInfo);
            return(byteArray);
        }
Пример #6
0
 public void WriteToByteArray(ByteArray byteArray)
 {
     BattleModeHelper.WriteToByteArray(byteArray, this.BattleMode);
     BattleLinkModeHelper.WriteToByteArray(byteArray, this.LinkMode);
     this.Rules.WriteToByteArray(byteArray);
 }