2016-08-22 10:43:04 -04:00
|
|
|
|
using FFXIVClassic.Common;
|
|
|
|
|
using System;
|
2015-09-07 23:43:23 -04:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace FFXIVClassic_Lobby_Server.packets
|
|
|
|
|
{
|
|
|
|
|
class CharaCreatorPacket
|
|
|
|
|
{
|
|
|
|
|
public const ushort OPCODE = 0x0E;
|
|
|
|
|
|
|
|
|
|
public const ushort RESERVE = 0x01;
|
|
|
|
|
public const ushort MAKE = 0x02;
|
|
|
|
|
public const ushort RENAME = 0x03;
|
|
|
|
|
public const ushort DELETE = 0x04;
|
|
|
|
|
public const ushort RENAME_RETAINER = 0x06;
|
|
|
|
|
|
|
|
|
|
private UInt64 sequence;
|
|
|
|
|
|
|
|
|
|
private ushort command;
|
|
|
|
|
private uint pid;
|
|
|
|
|
private uint cid;
|
|
|
|
|
private uint type;
|
|
|
|
|
private uint ticket;
|
|
|
|
|
private string charaName;
|
|
|
|
|
private string worldName;
|
|
|
|
|
|
|
|
|
|
public CharaCreatorPacket(UInt64 sequence, ushort command, uint pid, uint cid, uint ticket, string charaName, string worldName)
|
|
|
|
|
{
|
|
|
|
|
this.sequence = sequence;
|
|
|
|
|
this.command = command;
|
|
|
|
|
this.pid = pid;
|
|
|
|
|
this.cid = cid;
|
2015-09-09 00:08:46 -04:00
|
|
|
|
this.type = 0x400017;
|
2015-09-07 23:43:23 -04:00
|
|
|
|
this.ticket = ticket;
|
|
|
|
|
this.charaName = charaName;
|
|
|
|
|
this.worldName = worldName;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-14 21:29:10 +01:00
|
|
|
|
public SubPacket BuildPacket()
|
2015-09-07 23:43:23 -04:00
|
|
|
|
{
|
|
|
|
|
MemoryStream memStream = new MemoryStream(0x1F0);
|
|
|
|
|
BinaryWriter binWriter = new BinaryWriter(memStream);
|
|
|
|
|
|
|
|
|
|
binWriter.Write((UInt64)sequence);
|
|
|
|
|
binWriter.Write((byte)1);
|
|
|
|
|
binWriter.Write((byte)1);
|
|
|
|
|
binWriter.Write((UInt16)command);
|
|
|
|
|
binWriter.Write((UInt32)0);
|
|
|
|
|
|
|
|
|
|
binWriter.Write((UInt32)pid); //PID
|
|
|
|
|
binWriter.Write((UInt32)cid); //CID
|
|
|
|
|
binWriter.Write((UInt32)type); //Type?
|
|
|
|
|
binWriter.Write((UInt32)ticket); //Ticket
|
|
|
|
|
binWriter.Write(Encoding.ASCII.GetBytes(charaName.PadRight(0x20, '\0'))); //Name
|
|
|
|
|
binWriter.Write(Encoding.ASCII.GetBytes(worldName.PadRight(0x20, '\0'))); //World Name
|
|
|
|
|
|
|
|
|
|
byte[] data = memStream.GetBuffer();
|
|
|
|
|
binWriter.Dispose();
|
|
|
|
|
memStream.Dispose();
|
|
|
|
|
|
2017-06-29 11:38:28 -04:00
|
|
|
|
return new SubPacket(OPCODE, 0xe0006868, data);
|
2015-09-07 23:43:23 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|