Сообщений: 322
Тем: 6
Зарегистрирован: Nov 2015
Репутация:
505
zOne62 Написал:Спс бро получилось
как открыть два клиента в одной системе
0x40888D (nop) 0x90\0x90
Сообщений: 75
Тем: 11
Зарегистрирован: Feb 2016
Репутация:
0
Awiion Написал:Код: Write<byte>(player.Skill_1);
Write<byte>(player.Skill_2);
Write<byte>(player.Skill_3);
}
}
it's effect title?
Сообщений: 6,450
Тем: 262
Зарегистрирован: Nov 2007
Репутация:
44,165
Сообщений: 39
Тем: 1
Зарегистрирован: Apr 2016
Репутация:
0
Programmator > Help me : myProblem : End battle, always Draw
i use a Java Server
Where is the mistake?
Код: @Override
public void writeImpl() {
// TODO переделать
LevelUpInfo levelUpInfo = LevelUpDaoService.getInstance().getLevelInfoForRank((byte) (player.getRank() + 1));
RoomSlot slotByPlayer = room.getRoomSlotByPlayer(player);
player.setExp(player.getExp() + slotByPlayer.getAllExp());
player.setGp(player.getGp() + slotByPlayer.getAllGp());
if(player.getRank() <= 52) {
if(levelUpInfo.getAllExp() < player.getExp()) {
player.setRank((short) (player.getRank() + 1));
player.setGp(player.getGp() + levelUpInfo.getRewardGp());
}
}
//
[B][COLOR="Red"] if (room.getType() == 1)
{
if (room.getBlueKills() > room.getRedKills()){writeC(1);}
if (room.getRedKills() > room.getBlueKills()){writeC(0);}
if (room.getRedKills() == room.getBlueKills()){writeC(2);}
}
if (room.getType() == 2)
{
if (room.getBlueWinRounds() > room.getRedWinRounds()){writeC(1);}
if (room.getRedWinRounds() > room.getBlueWinRounds()){writeC(0);}
if (room.getRedWinRounds() == room.getBlueWinRounds()){writeC(2);}
}
if (room.getType() == 4)
{
if (room.getBlueWinRounds() > room.getRedWinRounds()){writeC(1);}
if (room.getRedWinRounds() > room.getBlueWinRounds()){writeC(0);}
if (room.getRedWinRounds() == room.getBlueWinRounds()){writeC(2);}
}
writeH(383); // что это???
writeH(266); // что это???[/COLOR]
[/B]
// Опыт
for(int i = 0; i < 16; i++) {
RoomSlot slot = room.getRoomSlot(i);
writeH(slot.getAllExp());
}
// Очки
for(int i = 0; i < 16; i++) {
RoomSlot slot = room.getRoomSlot(i);
writeH(slot.getAllGp());
}
// Очки за ботов
for(int i = 0; i < 16; i++) {
if(room.getSpecial() == 6) {
RoomSlot slot = room.getRoomSlot(i);
int score = slot.getBotScore();
writeH(score);
} else
writeH(0);
}
writeB(new byte[] {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//
0x00, 0x00,//
// и тут ХЗ
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//
0x00, 0x00, 0x00, 0x00
//
});
writeS(player.getName(), Player.MAX_NAME_SIZE); // Имя перса
writeD(player.getExp()); // опыт
writeD(player.getRank()); // ранк (0-54)
writeD(player.getRank()); // Пока не понятно за чего отвечают пустые байты...
writeD(player.getGp()); // ГП
writeD(con.getAccount().getMoney()); // Рублики
writeD(0); // ClanID
writeD(0); // ClanNameColor
writeD(0); // Unk
writeD(0); // Unk
writeH(player.getPcCafe());
writeC(player.getColor()); // 0-9 Color name
if(player.getClan() == null) {
writeS("", 16);
writeC(0);
writeH(0);
writeC(255);
writeC(255);
writeC(255);
writeC(255);
writeH(0);
} else {
writeS(player.getClan().getName(), 16);
writeC(0); // unk - Видимо разделитель
writeH(player.getClan().getRank());
writeC(player.getClan().getLogo1());
writeC(player.getClan().getLogo2());
writeC(player.getClan().getLogo3());
writeC(player.getClan().getLogo4());
writeH(player.getClan().getColor());
}
writeD(0); // Непонятно чо
writeB(new byte[9]);
writeD(player.getStats().getFights());
writeD(player.getStats().getWins());
writeD(player.getStats().getLosts());
writeD(0); // unk
writeD(player.getStats().getKills());
writeD(player.getStats().getSeriaWins());
writeD(player.getStats().getDeaths());
writeD(0); // unk
writeD(player.getStats().getKpd());
writeD(player.getStats().getEscapes());
writeD(player.getStats().getSeasonFights());
writeD(player.getStats().getSeasonWins());
writeD(player.getStats().getSeasonLosts());
writeD(0); // unk
writeD(player.getStats().getSeasonKills());
writeD(player.getStats().getSeasonSeriaWins());
writeD(player.getStats().getSeasonDeaths());
writeD(0); // unk
writeD(player.getStats().getSeasonKpd());
writeD(player.getStats().getSeasonEscapes());
[B][COLOR="Red"]writeH((short)room.getRedWinRounds());
writeH((short)room.getBlueWinRounds());[/COLOR][/B]
writeB(new byte[49]);
}
Сообщений: 6,450
Тем: 262
Зарегистрирован: Nov 2007
Репутация:
44,165
The Types 2 and 4 are the same. You see that the codes are the same.
Check in debugger which conditions are fulfilled and way.
Сообщений: 39
Тем: 1
Зарегистрирован: Apr 2016
Репутация:
0
PROGRAMMATOR Написал:The Types 2 and 4 are the same. You see that the codes are the same.
Check in debugger which conditions are fulfilled and way.
I replace with this code results are the blue team always wins
Код: writeC(room.getRedKills() > room.getBlueKills() ? 0 : 1);
writeH(383);
writeH(266);
Сообщений: 6,450
Тем: 262
Зарегистрирован: Nov 2007
Репутация:
44,165
[SRC="csharp"]enum WinningTeamType
{
Red,
Blue,
Draw
}
[/SRC]
0 - red, 1 - blue, 2 - draw
Сообщений: 39
Тем: 1
Зарегистрирован: Apr 2016
Репутация:
0
PROGRAMMATOR Написал:[SRC="csharp"]enum WinningTeamType
{
Red,
Blue,
Draw
}
[/SRC]
0 - red, 1 - blue, 2 - draw
sorry, if you do not mind please answer the direct result ....... do not answer with a formula or code.
I could not think anymore to solve this problem
:mol:
Thanks before
Сообщений: 75
Тем: 11
Зарегистрирован: Feb 2016
Репутация:
0
05-21-2016, 08:21 PM
(Сообщение последний раз редактировалось: 05-21-2016, 09:52 PM zOne62.)
PROGRAMMATOR Написал:zOne62, yes.
PROGRAMMATOR and Awwion please help. items 0 hours problem.
https://www.youtube.com/watch?v=jbpz7cIaLH8
SM_INVENTORY_ITEM_EQUIP
Код: public class SM_INVENTORY_ITEM_EQUIP : SendBaseGamePacket
{
private int _objId;
private int item_id;
private int _type;
private Account _p;
public SM_INVENTORY_ITEM_EQUIP(int id, int type, Account player)
{
makeme();
_objId = id;
_type = type;
_p = player;
}
protected internal override void write()
{
DateTime now;
writeH(535);
if (_type != 2)
{
writeD(1);
now = DateTime.Now;
string s = now.ToString("yyMMddHHmm");
writeD(Convert.ToInt32(now.ToString("yyMMddHHmm")));
writeD(1);
writeD(0);
writeD(0);
writeC(1);
writeD(0);
}
else
{
if (DAOM.getInstance().getItem(_objId) == null)
{
item_id = 0;
}
else
{
item_id = DAOM.getInstance().getItem(_objId).id;
}
writeD(1);
now = DateTime.Now;
writeD(Convert.ToInt32(now.ToString("yyMMddHHmm")));
writeQ(_objId);
if ((item_id >= 1301510000 ? true : item_id <= 1300002000))
{
writeD(item_id);
writeC(2);
int count = 86400;
if (DAOM.getInstance().getItem(_objId) != null)
{
count = DAOM.getInstance().getItem(_objId).count;
}
int days = count / 86400;
DateTime data = new DateTime();
data.AddDays(days);
int tFinal = Convert.ToInt32(data.ToString("yyMMddHHmm"));
writeD(tFinal);
}
else
{
writeD(item_id);
writeC(1);
writeD(1);
}
}
}
}
}
CM_INVENTORY_ITEM_EQUIP
Код: public class CM_INVENTORY_ITEM_EQUIP : ReceiveBaseGamePacket
{
private int obj_id;
public CM_INVENTORY_ITEM_EQUIP(GameClient Client, byte[] data)
{
makeme(Client, data);
}
protected internal override void read()
{
readH();
obj_id = readD();
}
protected internal override void run()
{
if (getClient() != null)
{
try
{
Account player = getClient().getPlayer();
AccountManager.getInstance().updateStatusItem(obj_id);
foreach (ItemsModel items in player.getInventory().getItemsAll())
{
if (items.object_id == obj_id)
{
items.equip_type = 2;
}
}
if (DAOM.getInstance().getItem(obj_id) != null)
{
DAOM.getInstance().getItem(obj_id).equip_type = 2;
}
player.sendPacket(new SM_INVENTORY_ITEM_EQUIP(obj_id, 2, player));
}
catch (Exception exception)
{
CLogger.getInstance().info(exception.ToString());
}
}
}
}
}
OPCODE PACKET
Код: [CM]received data size: 14
[CM]received size: 10
[CM]received key: 128
[CM]received opcode: 534
00000000 16 02 1B 26 CA C2 5D 01 00 00 00 00 ···&&amp;amp;amp;#202;Â]·····
[SM]received data size: 29
[SM]received size: 25
[SM]received opcode: 535
00000000 19 00 17 02 01 00 00 00 3B 6D AD 5F CA C2 5D 01 ········;m-_ÊÂ]·
00000010 00 00 00 00 17 90 D2 23 02 4C 94 AD 5F ·····Ò#·L”-_
Останавливаем! Network adapter 'Realtek PCIe GBE Family Controller' on local host
Сообщений: 43
Тем: 18
Зарегистрирован: Mar 2016
Репутация:
-11
Please Code DAOM getItem
|