mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-27 04:48:16 +02:00
Error and server list packets added. Reserve will send error to client if a character name is take for a server. Code to send out server list on GetCharacters added.
This commit is contained in:
parent
c982493d66
commit
091166b41a
8 changed files with 216 additions and 223 deletions
|
@ -142,7 +142,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
|||
}
|
||||
|
||||
#region Utility Functions
|
||||
public BasePacket createPacket(List<SubPacket> subpackets, bool isAuthed, bool isEncrypted)
|
||||
public static BasePacket createPacket(List<SubPacket> subpackets, bool isAuthed, bool isEncrypted)
|
||||
{
|
||||
//Create Header
|
||||
BasePacketHeader header = new BasePacketHeader();
|
||||
|
@ -174,6 +174,32 @@ namespace FFXIVClassic_Lobby_Server.packets
|
|||
return packet;
|
||||
}
|
||||
|
||||
public static BasePacket createPacket(SubPacket subpacket, bool isAuthed, bool isEncrypted)
|
||||
{
|
||||
//Create Header
|
||||
BasePacketHeader header = new BasePacketHeader();
|
||||
byte[] data = null;
|
||||
|
||||
header.isAuthenticated = isAuthed ? (byte)1 : (byte)0;
|
||||
header.isEncrypted = isEncrypted ? (byte)1 : (byte)0;
|
||||
header.numSubpackets = (ushort)1;
|
||||
header.packetSize = BASEPACKET_SIZE;
|
||||
|
||||
//Get packet size
|
||||
header.packetSize += subpacket.header.subpacketSize;
|
||||
|
||||
data = new byte[header.packetSize - 0x10];
|
||||
|
||||
//Add Subpackets
|
||||
byte[] subpacketData = subpacket.getBytes();
|
||||
Array.Copy(subpacketData, 0, data, 0, subpacketData.Length);
|
||||
|
||||
Debug.Assert(data != null);
|
||||
|
||||
BasePacket packet = new BasePacket(header, data);
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static unsafe void encryptPacket(Blowfish blowfish, BasePacket packet)
|
||||
{
|
||||
byte[] data = packet.data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue