Example #1
0
        public override void write()
        {
            this.writeH((short)2566);
            this.writeD(this._erro);
            if (this._erro != 0U)
            {
                return;
            }
            ServerConfig    config       = LoginManager.Config;
            EventVisitModel runningEvent = EventVisitSyncer.getRunningEvent();

            this.writeC((byte)0);
            this.writeS(this.c.player_name, 33);
            this.writeD(this.c._exp);
            this.writeD(this.c._rank);
            this.writeD(this.c._rank);
            this.writeD(this.c._gp);
            this.writeD(this.c._money);
            this.writeD(this.clan._id);
            this.writeD(this.c.clanAccess);
            this.writeQ(0L);
            this.writeC((byte)this.c.pc_cafe);
            this.writeC((byte)this.c.tourneyLevel);
            this.writeC((byte)this.c.name_color);
            this.writeS(this.clan._name, 17);
            this.writeC((byte)this.clan._rank);
            this.writeC((byte)this.clan.getClanUnit());
            this.writeD(this.clan._logo);
            this.writeC((byte)this.clan._name_color);
            this.writeD(10000);
            this.writeC((byte)0);
            this.writeD(0);
            this.writeD(this.c.LastRankUpDate);
            this.writeD(this.c._statistic.fights);
            this.writeD(this.c._statistic.fights_win);
            this.writeD(this.c._statistic.fights_lost);
            this.writeD(this.c._statistic.fights_draw);
            this.writeD(this.c._statistic.kills_count);
            this.writeD(this.c._statistic.headshots_count);
            this.writeD(this.c._statistic.deaths_count);
            this.writeD(this.c._statistic.totalfights_count);
            this.writeD(this.c._statistic.totalkills_count);
            this.writeD(this.c._statistic.escapes);
            this.writeD(this.c._statistic.fights);
            this.writeD(this.c._statistic.fights_win);
            this.writeD(this.c._statistic.fights_lost);
            this.writeD(this.c._statistic.fights_draw);
            this.writeD(this.c._statistic.kills_count);
            this.writeD(this.c._statistic.headshots_count);
            this.writeD(this.c._statistic.deaths_count);
            this.writeD(this.c._statistic.totalfights_count);
            this.writeD(this.c._statistic.totalkills_count);
            this.writeD(this.c._statistic.escapes);
            this.writeD(this.c._equip._red);
            this.writeD(this.c._equip._blue);
            this.writeD(this.c._equip._helmet);
            this.writeD(this.c._equip._beret);
            this.writeD(this.c._equip._dino);
            this.writeD(this.c._equip._primary);
            this.writeD(this.c._equip._secondary);
            this.writeD(this.c._equip._melee);
            this.writeD(this.c._equip._grenade);
            this.writeD(this.c._equip._special);
            this.writeH((short)0);
            this.writeD(this.c._bonus.fakeRank);
            this.writeD(this.c._bonus.fakeRank);
            this.writeS(this.c._bonus.fakeNick, 33);
            this.writeH((short)this.c._bonus.sightColor);
            this.writeC((byte)31);
            this.CheckGameEvents(runningEvent);
            if (config.ClientVersion == "1.15.37")
            {
                this.writeC((byte)1);
                this.writeD(this.charas.Count);
                this.writeD(this.weapons.Count);
                this.writeD(this.cupons.Count);
                this.writeD(0);
                for (int index = 0; index < this.charas.Count; ++index)
                {
                    ItemsModel chara = this.charas[index];
                    this.writeQ(chara._objId);
                    this.writeD(chara._id);
                    this.writeC((byte)chara._equip);
                    this.writeD(chara._count);
                }
                for (int index = 0; index < this.weapons.Count; ++index)
                {
                    ItemsModel weapon = this.weapons[index];
                    this.writeQ(weapon._objId);
                    this.writeD(weapon._id);
                    this.writeC((byte)weapon._equip);
                    this.writeD(weapon._count);
                }
                for (int index = 0; index < this.cupons.Count; ++index)
                {
                    ItemsModel cupon = this.cupons[index];
                    this.writeQ(cupon._objId);
                    this.writeD(cupon._id);
                    this.writeC((byte)cupon._equip);
                    this.writeD(cupon._count);
                }
            }
            this.writeC(ConfigGA.Outpost);
            this.writeD(this.c.brooch);
            this.writeD(this.c.insignia);
            this.writeD(this.c.medal);
            this.writeD(this.c.blue_order);
            this.writeC((byte)this.c._mission.actualMission);
            this.writeC((byte)this.c._mission.card1);
            this.writeC((byte)this.c._mission.card2);
            this.writeC((byte)this.c._mission.card3);
            this.writeC((byte)this.c._mission.card4);
            this.writeB(ComDiv.getCardFlags(this.c._mission.mission1, this.c._mission.list1));
            this.writeB(ComDiv.getCardFlags(this.c._mission.mission2, this.c._mission.list2));
            this.writeB(ComDiv.getCardFlags(this.c._mission.mission3, this.c._mission.list3));
            this.writeB(ComDiv.getCardFlags(this.c._mission.mission4, this.c._mission.list4));
            this.writeC((byte)this.c._mission.mission1);
            this.writeC((byte)this.c._mission.mission2);
            this.writeC((byte)this.c._mission.mission3);
            this.writeC((byte)this.c._mission.mission4);
            this.writeB(this.c._mission.list1);
            this.writeB(this.c._mission.list2);
            this.writeB(this.c._mission.list3);
            this.writeB(this.c._mission.list4);
            this.writeQ(this.c._titles.Flags);
            this.writeC((byte)this.c._titles.Equiped1);
            this.writeC((byte)this.c._titles.Equiped2);
            this.writeC((byte)this.c._titles.Equiped3);
            this.writeD(this.c._titles.Slots);
            this.writeD(ConfigMaps.Tutorial);
            this.writeD(ConfigMaps.Deathmatch);
            this.writeD(ConfigMaps.Destruction);
            this.writeD(ConfigMaps.Sabotage);
            this.writeD(ConfigMaps.Supression);
            this.writeD(ConfigMaps.Defense);
            this.writeD(ConfigMaps.Challenge);
            this.writeD(ConfigMaps.Dinosaur);
            this.writeD(ConfigMaps.Sniper);
            this.writeD(ConfigMaps.Shotgun);
            this.writeD(ConfigMaps.HeadHunter);
            this.writeD(ConfigMaps.Knuckle);
            this.writeD(ConfigMaps.CrossCounter);
            this.writeD(ConfigMaps.Chaos);
            if (config.ClientVersion == "1.15.38" || config.ClientVersion == "1.15.39" || (config.ClientVersion == "1.15.41" || config.ClientVersion == "1.15.42"))
            {
                this.writeD(0);
            }
            this.writeC((byte)MapsXML.ModeList.Count);
            this.writeC((byte)4);
            this.writeD(MapsXML.maps1);
            this.writeD(MapsXML.maps2);
            this.writeD(MapsXML.maps3);
            this.writeD(MapsXML.maps4);
            foreach (ushort mode in MapsXML.ModeList)
            {
                this.writeH(mode);
            }
            this.writeB(MapsXML.TagList.ToArray());
            this.writeC(config.missions);
            this.writeD(MissionsXML._missionPage1);
            this.writeD(50);
            this.writeD(75);
            this.writeC((byte)1);
            this.writeH((short)20);
            this.writeB(new byte[20]
            {
                (byte)112,
                (byte)12,
                (byte)148,
                (byte)45,
                (byte)72,
                (byte)8,
                (byte)221,
                (byte)30,
                (byte)176,
                (byte)171,
                (byte)26,
                (byte)0,
                (byte)153,
                (byte)123,
                (byte)66,
                (byte)0,
                (byte)112,
                (byte)12,
                (byte)148,
                (byte)45
            });
            this.writeD(this.c.IsGM());
            this.writeD(this._xmas);
            this.writeC((byte)1);
            this.WriteVisitEvent(runningEvent);
            if (config.ClientVersion == "1.15.39" || config.ClientVersion == "1.15.41" || config.ClientVersion == "1.15.42")
            {
                this.writeB(new byte[9]);
            }
            this.writeD(uint.Parse(DateTime.Now.ToString("yyMMddHHmm")));
            this.writeS("10.120.1.44", 256);
            this.writeD(8085);
            this.writeC(config.GiftSystem);
            this.writeH((short)0);
            this.writeC((byte)1);
            this.writeC((byte)0);
            this.writeC((byte)1);
            this.writeC((byte)6);
            this.writeC((byte)4);
            this.writeC((byte)0);
            this.writeC((byte)1);
            this.writeC((byte)2);
            this.writeC((byte)5);
            this.writeC((byte)3);
        }
        public override void write()
        {
            writeH(2566);
            writeD(_erro);
            if (_erro != 0)
            {
                return;
            }
            EventVisitModel evVisit = EventVisitSyncer.getRunningEvent();

            writeC(0);
            writeS(c.player_name, 33);
            writeD(c._exp);
            writeD(c._rank);
            writeD(c._rank);
            writeD(c._gp);
            writeD(c._money);
            writeD(clan._id);
            writeD(c.clanAccess);
            writeQ(0);
            writeC((byte)c.pc_cafe);
            writeC((byte)c.tourneyLevel);
            writeC((byte)c.name_color); // 0-9
            writeS(clan._name, 17);
            writeC((byte)clan._rank);
            writeC((byte)clan.getClanUnit());
            writeD(clan._logo);
            writeC((byte)clan._name_color);

            writeD(10000);
            writeC(0);
            writeD(0);
            writeD(0); // Subistitudo do LastRankUpDate

            writeD(c._statistic.fights);
            writeD(c._statistic.fights_win);
            writeD(c._statistic.fights_lost);
            writeD(c._statistic.fights_draw);
            writeD(c._statistic.kills_count);
            writeD(c._statistic.headshots_count);
            writeD(c._statistic.deaths_count);
            writeD(c._statistic.totalfights_count);
            writeD(c._statistic.totalkills_count);
            writeD(c._statistic.escapes);
            writeD(c._statistic.fights);
            writeD(c._statistic.fights_win);
            writeD(c._statistic.fights_lost);
            writeD(c._statistic.fights_draw);
            writeD(c._statistic.kills_count);
            writeD(c._statistic.headshots_count);
            writeD(c._statistic.deaths_count);
            writeD(c._statistic.totalfights_count);
            writeD(c._statistic.totalkills_count);
            writeD(c._statistic.escapes);
            writeD(c._equip._red);
            writeD(c._equip._blue);
            writeD(c._equip._helmet);
            writeD(c._equip._beret);
            writeD(c._equip._dino);
            writeD(c._equip._primary);
            writeD(c._equip._secondary);
            writeD(c._equip._melee);
            writeD(c._equip._grenade);
            writeD(c._equip._special);
            writeH(0);
            writeD(c._bonus.fakeRank);
            writeD(c._bonus.fakeRank);
            writeS(c._bonus.fakeNick, 33);
            writeH((short)c._bonus.sightColor); // crosshair
            writeC(31);                         //pais?
            CheckGameEvents(evVisit);
            if (ServerConfig.ClientVersion == "1.15.37")
            {
                writeC(1); //inventário?
                writeD(charas.Count);
                writeD(weapons.Count);
                writeD(cupons.Count);
                writeD(0);
                for (int i = 0; i < charas.Count; i++)
                {
                    ItemsModel item = charas[i];
                    writeQ(item._objId);
                    writeD(item._id);
                    writeC((byte)item._equip);
                    writeD(item._count);
                }
                for (int i = 0; i < weapons.Count; i++)
                {
                    ItemsModel item = weapons[i];
                    writeQ(item._objId);
                    writeD(item._id);
                    writeC((byte)item._equip);
                    writeD(item._count);
                }
                for (int i = 0; i < cupons.Count; i++)
                {
                    ItemsModel item = cupons[i];
                    writeQ(item._objId);
                    writeD(item._id);
                    writeC((byte)item._equip);
                    writeD(item._count);
                }
            }
            writeC(ConfigGA.Outpost);
            writeD(c.brooch);
            writeD(c.insignia);
            writeD(c.medal);
            writeD(c.blue_order);
            writeC((byte)c._mission.actualMission);
            writeC((byte)c._mission.card1);
            writeC((byte)c._mission.card2);
            writeC((byte)c._mission.card3);
            writeC((byte)c._mission.card4);
            writeB(ComDiv.getCardFlags(c._mission.mission1, c._mission.list1));
            writeB(ComDiv.getCardFlags(c._mission.mission2, c._mission.list2));
            writeB(ComDiv.getCardFlags(c._mission.mission3, c._mission.list3));
            writeB(ComDiv.getCardFlags(c._mission.mission4, c._mission.list4));
            writeC((byte)c._mission.mission1);
            writeC((byte)c._mission.mission2);
            writeC((byte)c._mission.mission3);
            writeC((byte)c._mission.mission4);
            writeB(c._mission.list1);
            writeB(c._mission.list2);
            writeB(c._mission.list3);
            writeB(c._mission.list4);
            writeQ(c._titles.Flags);
            writeC((byte)c._titles.Equiped1);
            writeC((byte)c._titles.Equiped2);
            writeC((byte)c._titles.Equiped3);
            writeD(c._titles.Slots);
            writeD(ConfigMaps.Tutorial);
            writeD(ConfigMaps.Deathmatch);
            writeD(ConfigMaps.Destruction);
            writeD(ConfigMaps.Sabotage);
            writeD(ConfigMaps.Supression);
            writeD(ConfigMaps.Defense);
            writeD(ConfigMaps.Challenge);
            writeD(ConfigMaps.Dinosaur);
            writeD(ConfigMaps.Sniper);
            writeD(ConfigMaps.Shotgun);
            writeD(ConfigMaps.HeadHunter);
            writeD(ConfigMaps.Knuckle);
            writeD(ConfigMaps.CrossCounter);
            writeD(ConfigMaps.Chaos);
            if (ServerConfig.ClientVersion == "1.15.38" || ServerConfig.ClientVersion == "1.15.39" || ServerConfig.ClientVersion == "1.15.41" || ServerConfig.ClientVersion == "1.15.42")
            {
                writeD(ConfigMaps.TheifMode);
            }

            writeC((byte)MapsXML.ModeList.Count); //124 maps ver 42

            writeC(4);                            //(Flag pages | 4 bytes)
            writeD(MapsXML.maps1);
            writeD(MapsXML.maps2);
            writeD(MapsXML.maps3);
            writeD(MapsXML.maps4);
            foreach (ushort mode in MapsXML.ModeList)
            {
                writeH(mode);// 2 byts por cartão
            }
            writeB(MapsXML.TagList.ToArray());

            writeC(ServerConfig.missions); //Pages Count
            writeD(MissionsXML._missionPage1);
            writeD(0);                     //Multiplicado por 100?
            writeD(0);                     //Multiplicado por 100?
            writeC(0);
            writeH(20);                    //length de algo.
            writeB(new byte[20] {
                0x70, 0x0C, 0x94, 0x2D, 0x48, 0x08, 0xDD, 0x1E, 0xB0, 0xAB, 0x1A, 0x00, 0x99, 0x7B, 0x42, 0x00, 0x70, 0x0C, 0x94, 0x2D
            });
            writeD(c.IsGM() || c.HaveAcessLevel());
            writeD(_xmas);
            writeC(1); //Repair?

            WriteVisitEvent(evVisit);

            if (ServerConfig.ClientVersion == "1.15.39" || ServerConfig.ClientVersion == "1.15.41" || ServerConfig.ClientVersion == "1.15.42")
            {
                writeB(new byte[9]);
            }

            writeD(uint.Parse(DateTime.Now.ToString("yyMMddHHmm"))); //DataNow By Server
            //writeB(new byte[256]);
            writeS("10.120.1.44", 256);                              //?
            writeD(8085);                                            //0
            writeC(ServerConfig.GiftSystem);                         //Ativar presentes (0 = Não | 1 = Sim)

            writeH(1);                                               //Lê algo se for positivo, Quantidade sequêncial (1byte)
            writeC(0);
            writeC(1);                                               //1

            writeC(7);                                               //7

            writeC(4);                                               //4 víp 1//Length dos write abaixo
            writeC(1);                                               // vip2 Relevancia da itens tag VIP - 0 - Por Goods | 1 - Topo da lista | 2 - Fim da Lista | 3 - VIP Topo, New Good
            writeC(1);                                               //1 new
            writeC(2);                                               //2 hot
            writeC(5);                                               //5 sale
            writeC(3);                                               //3 event
            writeC(6);                                               //6*/
        }