Форум администраторов игровых серверов

Форум администраторов игровых серверов (https://forum.zone-game.info/TT.php)
-   Point Blank (Piercing Blow) (https://forum.zone-game.info/forumdisplay.php?f=204)
-   -   Chat msg error (https://forum.zone-game.info/showthread.php?t=40040)

Exile03 03.02.2016 20:02

Chat msg error
 
someone can help how i can fix this bug chat
when i send msg to chat he send this bug

http://i.imgur.com/bTcgluW.png


Код:

public class SM_CHAT_LOBBY_MESSAGE extends ServerPacket {

        private Player player;
        private String message;

        public SM_CHAT_LOBBY_MESSAGE(Player player, String message) {
                super(0xC15);
                this.player = player;
                this.message = message;
        }

        @Override
        public void writeImpl() {
                writeD(player.getConnection().getId());
                int length = player.getName().length() > player.MAX_NAME_SIZE ? player.MAX_NAME_SIZE : player.getName().length();
                writeC(length);
                writeS(player.getName().length() > length ? player.getName().substring(0, length) : player.getName());
                writeC(player.getColor());
                writeH(message.length());
                writeS(message);
        }
}


Код:

public class SM_CHAT_TEAM_MESSAGE extends ServerPacket {

        private RoomSlot slot;
        private String message;
        private ChatType type;

        public SM_CHAT_TEAM_MESSAGE(RoomSlot slot, ChatType type, String message) {
                super(0xF0B);
                this.slot = slot;
                this.type = type;
                this.message = message;
        }

        @Override
        public void writeImpl() {
                writeH(type.getValue());
                writeD(slot.getId());
                writeD(message.length());
                writeS(message);
        }
}

:)

PROGRAMMATOR 04.02.2016 01:09

Re: [PointBlank] Chat msg error
 
In previous client encoding is written in binary file.


Текущее время: 18:43. Часовой пояс GMT +3.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot