public static byte[] ServerList_Ack(byte serverId, int[] loads) { PacketLittleEndianWriter plew = new PacketLittleEndianWriter(); plew.write((byte)SendOperationCode.Login.SERVERLIST_ACK); for (int i = 0; i < 13; i++) { plew.write(0xFF); } plew.writeInt(1); // 伺服器數量 plew.writeShort(serverId); // 伺服器順序 plew.writeInt((byte)loads.Length); // 頻道數量 int id = 0; for (byte i = 1; i <= 18; i++) { plew.writeShort((short)(id + 1)); plew.writeShort((short)(id + 1)); plew.writeGhostAsciiString("127.0.0.1"); plew.writeInt(14101 + id); plew.writeInt(1); // 玩家數量 plew.writeInt(400); // 頻道人數上限 plew.writeInt(12); // 標章類型 plew.writeInt(0); plew.write((byte) (loads[i - 1] != 0 ? 1 : 2)); plew.writeInt(14199); id++; } return plew.getPacket(); }
/* state * 28 = 此為有年齡限制的頻道,請使用其他頻道 * 04 = 此ID已連線,請稍後再試 * else = 網路狀態錯誤 */ public static byte[] Game_Ack(GhostClient c, int state) { PacketLittleEndianWriter plew = new PacketLittleEndianWriter(); plew.write((byte)SendOperationCode.Login.GAME_ACK); plew.write((byte)state); plew.writeGhostAsciiString("192.168.1.101"); plew.writeInt(14101 + c.CharSID); plew.writeInt(14199); return plew.getPacket(); }