02-06-2018, 02:23 PM
Hello everybody. I have a problem with MyInfo Structure. 2 first medals not work, always 0. i tried every method but not work. 2 last one works. i think this problem comes from inventory codes which i marked with bold. but inventory works. i stuck at here. please someone help me about this.
@PROGRAMMATOR @Awiion
@PROGRAMMATOR @Awiion
Код:
public class BASE_GET_MYINFO_ACK
extends AuthPacketACK {
public Player pS;
public Clan cS;
public EventVerification ev;
public ServerSettings srv;
public int error;
public List<PlayerInventory> weapon;
public List<PlayerInventory> chara;
public List<PlayerInventory> coupon;
public List<PlayerInventory> new_item;
public BASE_GET_MYINFO_ACK(Player pS, int error) {
super(2566);
this.pS = pS;
this.error = error;
this.srv = SettingsProperty.gI().st;
if (pS != null) {
if (this.srv.christmas && pS.event.christmas == 0) {
pS.event.christmas = 1;
this.db.updateChristmas(pS, 1);
}
this.checkInventory();
this.cS = this.db.readCSlan(pS.clan_id);
this.weapon = pS.getItemByType(1);
this.chara = pS.getItemByType(2);
this.coupon = pS.getItemByType(3);
this.new_item = pS.getItemByType(4);
EventVerification clone = EventXML.gI().VERIFICATION_NOW();
if (clone != null && this.srv.verification_active && clone != null && clone.checks > pS.event.checks && this.date.getHourTime(0) != pS.event.check_day) {
this.ev = EventXML.gI().VERIFICATION_NOW();
}
}
}
@Override
public void writeImpl() {
this.WriteD(this.error);
if (this.error == 0 && this.pS != null) {
int i;
PlayerInventory item;
this.WriteC(this.pS.client_version);
this.WriteS(this.pS.name, 33);
this.WriteD(this.pS.exp);
this.WriteD(this.pS.rank);
this.WriteD(this.pS.rank);
this.WriteD(this.pS.gold);
this.WriteD(this.pS.cash);
this.WriteD(this.pS.clan_id);
this.WriteD(this.pS.role);
this.WriteQ(this.pS.status());
this.WriteC(this.pS.pc_cafe);
this.WriteC(this.pS.tourney_level); //not work
this.WriteC(this.pS.color);
this.WriteS(this.cS.name, 17);
this.WriteC(this.cS.rank);
this.WriteC(this.cS.total_players);
this.WriteD(this.cS.logo);
this.WriteC(this.cS.color);
this.WriteC(0); //unk
this.WriteD(0); //unk
this.WriteD(0); //unk
this.WriteD(0); //unk
this.WriteD(this.pS.stats.partidas);
this.WriteD(this.pS.stats.ganhou);
this.WriteD(this.pS.stats.perdeu);
this.WriteD(this.pS.stats.empatou);
this.WriteD(this.pS.stats.matou);
this.WriteD(this.pS.stats.headshots);
this.WriteD(this.pS.stats.morreu);
this.WriteD(this.pS.stats.partidas);
this.WriteD(this.pS.stats.matou);
this.WriteD(this.pS.stats.kitou);
this.WriteD(this.pS.stats.partidas);
this.WriteD(this.pS.stats.ganhou);
this.WriteD(this.pS.stats.perdeu);
this.WriteD(this.pS.stats.empatou);
this.WriteD(this.pS.stats.matou);
this.WriteD(this.pS.stats.headshots);
this.WriteD(this.pS.stats.morreu);
this.WriteD(this.pS.stats.partidas);
this.WriteD(this.pS.stats.matou);
this.WriteD(this.pS.stats.kitou);
this.WriteD(this.pS.equipment.char_red);
this.WriteD(this.pS.equipment.char_blue);
this.WriteD(this.pS.equipment.char_head);
this.WriteD(this.pS.equipment.char_beret);
this.WriteD(this.pS.equipment.char_dino);
this.WriteD(this.pS.equipment.weapon_primary);
this.WriteD(this.pS.equipment.weapon_secundary);
this.WriteD(this.pS.equipment.weapon_melee);
this.WriteD(this.pS.equipment.weapon_grenade);
this.WriteD(this.pS.equipment.weapon_special);
this.WriteH(0);
this.WriteD(55);
this.WriteD(55);
this.WriteS(this.pS.coupon.false_nick, 33);
this.WriteH(0);
this.WriteC(0x1F);
this.WriteC(1); //inventory enable/disable
//inventory work but medals not
[B]this.WriteD(this.chara.size());
this.WriteD(this.weapon.size());
this.WriteD(this.coupon.size());
this.WriteD(this.new_item.size());
for (i = 0; i < this.chara.size(); i++) {
item = this.chara.get(i);
this.WriteQ(item.equip != 3 ? item.object : 0);
this.WriteD(item.item_id);
this.WriteC(item.equip);
this.WriteD(item.count);
}
for (i = 0; i < this.weapon.size(); i++) {
item = this.weapon.get(i);
this.WriteQ(item.equip != 3 ? item.object : 0);
this.WriteD(item.item_id);
this.WriteC(item.equip);
this.WriteD(item.count);
}
for (i = 0; i < this.coupon.size(); i++) {
item = this.coupon.get(i);
this.WriteQ(item.equip != 3 ? item.object : 0);
this.WriteD(item.item_id);
this.WriteC(item.equip);
this.WriteD(item.count);
}
for (i = 0; i < this.new_item.size(); i++) {
item = this.new_item.get(i);
this.WriteQ(item.equip != 3 ? item.object : 0);
this.WriteD(item.item_id);
this.WriteC(item.equip);
this.WriteD(item.count);
}[/B]
this.WriteC(0); //outpost enable/disable
this.WriteD(30); // medal always 0
this.WriteD(31); //medal always 0
this.WriteD(32); //work
this.WriteD(33); //work