示例#1
0
        public void SendGameData(GameDataArgs gameData)
        {
            BeginPacket(HPacketType.GameData_Response);
            for (int i = 0; i < gameData.TowerFloors.Length; i++)
            {
                _outgoingBW.Write(gameData.TowerFloors[i]);
            }

            _outgoingBW.Write(gameData.Level);
            _outgoingBW.Write(gameData.Exp);
            _outgoingBW.Write(gameData.Tutorial);

            SendPacket();
        }
示例#2
0
        void GameData_Response_Handler(BinaryReader br)
        {
            GameDataArgs args = new GameDataArgs();

            args.TowerFloors = new int[6];
            for (int i = 0; i < args.TowerFloors.Length; i++)
            {
                args.TowerFloors[i] = br.ReadInt32();
            }

            args.Level    = br.ReadInt32();
            args.Exp      = br.ReadInt32();
            args.Tutorial = br.ReadUInt64();

            OnGameDataResponse(this, args);
        }
示例#3
0
        void LoadGameData(BinaryReader br, int version)
        {
            _gameData = new GameDataArgs();

            int floorCount = br.ReadInt32();

            if (floorCount > 0)
            {
                _gameData.TowerFloors = new int[floorCount];
                for (int i = 0; i < floorCount; i++)
                {
                    _gameData.TowerFloors[i] = br.ReadInt32();
                }
            }
            _gameData.Level    = br.ReadInt32();
            _gameData.Exp      = br.ReadInt32();
            _gameData.Tutorial = br.ReadUInt64();
        }
示例#4
0
 private void M_Client_OnGameDataResponse(object sender, GameDataArgs e)
 {
     m_GameData = e;
 }
示例#5
0
        public void LoadStaticData()
        {
            GameDataArgs gd = new GameDataArgs();
            gd.TowerFloors = new int[6];

            // Load game data if it exists
            if (File.Exists(s_GameDataFile))
            {
                FileStream fs = File.OpenRead(s_GameDataFile);
                BinaryReader br = new BinaryReader(fs);

                int version = br.ReadInt32();
                int towers = version == 1 ? 4 : gd.TowerFloors.Length;
                for (int i = 0; i < towers; i++)
                    gd.TowerFloors[i] = br.ReadInt32();
                gd.Level = br.ReadInt32();
                gd.Exp = br.ReadInt32();
                gd.Tutorial = br.ReadUInt32();
                m_Client.HardCurrency = br.ReadInt32();

                br.Close();
            }
            else
            {
                gd.TowerFloors[0] = 1;
                gd.TowerFloors[1] = 0;
                gd.TowerFloors[2] = 0;
                gd.TowerFloors[3] = 0;
                gd.TowerFloors[4] = 0;
                gd.TowerFloors[5] = 0;
                gd.Level = 1;
                gd.Exp = 0;
                gd.Tutorial = 0;
                m_Client.HardCurrency = 1000;
            }

            m_GameData = gd;

            if (m_VipData == null)
            {
                m_VipData = new VipDataArgs();
                m_VipData.Level = 1;
                m_VipData.Progress = 0;
                m_VipData.Hints = 5;
                m_VipData.MegaHints = 2;
                m_VipData.UndoSize = 5;
            }
        }
示例#6
0
        void GameData_Response_Handler(BinaryReader br)
        {
            GameDataArgs args = new GameDataArgs();
            args.TowerFloors = new int[6];
            for (int i = 0; i < args.TowerFloors.Length; i++)
                args.TowerFloors[i] = br.ReadInt32();

            args.Level = br.ReadInt32();
            args.Exp = br.ReadInt32();
            args.Tutorial = br.ReadUInt64();

            OnGameDataResponse(this, args);
        }
示例#7
0
        public void SendGameData(GameDataArgs gameData)
        {
            BeginPacket(HPacketType.GameData_Response);
            for (int i = 0; i < gameData.TowerFloors.Length; i++)
                _outgoingBW.Write(gameData.TowerFloors[i]);

            _outgoingBW.Write(gameData.Level);
            _outgoingBW.Write(gameData.Exp);
            _outgoingBW.Write(gameData.Tutorial);

            SendPacket();
        }
示例#8
0
        GameDataArgs ReadGameData(DBQuery query)
        {
            GameDataArgs gameData = new GameDataArgs();

            object[] row = query.Rows[0];
            gameData.TowerFloors = new int[6];
            for (int i = 0; i < gameData.TowerFloors.Length; i++)
                gameData.TowerFloors[i] = (int)row[i + 1];

            gameData.Level = (int)row[7];
            gameData.Exp = (int)row[8];
            gameData.Tutorial = (ulong)row[9];

            return gameData;
        }