mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-05-20 08:26:59 -04:00
mass replaced all methods to pascal case
This commit is contained in:
@@ -103,7 +103,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public List<SubPacket> getSubpackets()
|
||||
public List<SubPacket> GetSubpackets()
|
||||
{
|
||||
List<SubPacket> subpackets = new List<SubPacket>(header.numSubpackets);
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
return subpackets;
|
||||
}
|
||||
|
||||
public unsafe static BasePacketHeader getHeader(byte[] bytes)
|
||||
public unsafe static BasePacketHeader GetHeader(byte[] bytes)
|
||||
{
|
||||
BasePacketHeader header;
|
||||
if (bytes.Length < BASEPACKET_SIZE)
|
||||
@@ -129,7 +129,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
return header;
|
||||
}
|
||||
|
||||
public byte[] getHeaderBytes()
|
||||
public byte[] GetHeaderBytes()
|
||||
{
|
||||
int size = Marshal.SizeOf(header);
|
||||
byte[] arr = new byte[size];
|
||||
@@ -141,16 +141,16 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
return arr;
|
||||
}
|
||||
|
||||
public byte[] getPacketBytes()
|
||||
public byte[] GetPacketBytes()
|
||||
{
|
||||
byte[] outBytes = new byte[header.packetSize];
|
||||
Array.Copy(getHeaderBytes(), 0, outBytes, 0, BASEPACKET_SIZE);
|
||||
Array.Copy(GetHeaderBytes(), 0, outBytes, 0, BASEPACKET_SIZE);
|
||||
Array.Copy(data, 0, outBytes, BASEPACKET_SIZE, data.Length);
|
||||
return outBytes;
|
||||
}
|
||||
|
||||
//Replaces all instances of the sniffed actorID with the given one
|
||||
public void replaceActorID(uint actorID)
|
||||
public void ReplaceActorID(uint actorID)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
@@ -173,7 +173,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
}
|
||||
|
||||
//Replaces all instances of the sniffed actorID with the given one
|
||||
public void replaceActorID(uint fromActorID, uint actorID)
|
||||
public void ReplaceActorID(uint fromActorID, uint actorID)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
@@ -196,7 +196,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
}
|
||||
|
||||
#region Utility Functions
|
||||
public static 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();
|
||||
@@ -218,7 +218,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
int offset = 0;
|
||||
foreach (SubPacket subpacket in subpackets)
|
||||
{
|
||||
byte[] subpacketData = subpacket.getBytes();
|
||||
byte[] subpacketData = subpacket.GetBytes();
|
||||
Array.Copy(subpacketData, 0, data, offset, subpacketData.Length);
|
||||
offset += (ushort)subpacketData.Length;
|
||||
}
|
||||
@@ -229,7 +229,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static BasePacket createPacket(SubPacket subpacket, bool isAuthed, bool isEncrypted)
|
||||
public static BasePacket CreatePacket(SubPacket subpacket, bool isAuthed, bool isEncrypted)
|
||||
{
|
||||
//Create Header
|
||||
BasePacketHeader header = new BasePacketHeader();
|
||||
@@ -247,7 +247,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
data = new byte[header.packetSize - 0x10];
|
||||
|
||||
//Add Subpackets
|
||||
byte[] subpacketData = subpacket.getBytes();
|
||||
byte[] subpacketData = subpacket.GetBytes();
|
||||
Array.Copy(subpacketData, 0, data, 0, subpacketData.Length);
|
||||
|
||||
Debug.Assert(data != null);
|
||||
@@ -256,7 +256,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static BasePacket createPacket(byte[] data, bool isAuthed, bool isEncrypted)
|
||||
public static BasePacket CreatePacket(byte[] data, bool isAuthed, bool isEncrypted)
|
||||
{
|
||||
|
||||
Debug.Assert(data != null);
|
||||
@@ -277,7 +277,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static unsafe void encryptPacket(Blowfish blowfish, BasePacket packet)
|
||||
public static unsafe void EncryptPacket(Blowfish blowfish, BasePacket packet)
|
||||
{
|
||||
byte[] data = packet.data;
|
||||
int size = packet.header.packetSize;
|
||||
@@ -304,7 +304,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
|
||||
}
|
||||
|
||||
public static unsafe void decryptPacket(Blowfish blowfish, ref BasePacket packet)
|
||||
public static unsafe void DecryptPacket(Blowfish blowfish, ref BasePacket packet)
|
||||
{
|
||||
byte[] data = packet.data;
|
||||
int size = packet.header.packetSize;
|
||||
@@ -331,16 +331,16 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void debugPrintPacket()
|
||||
public void DebugPrintPacket()
|
||||
{
|
||||
#if DEBUG
|
||||
Console.BackgroundColor = ConsoleColor.DarkYellow;
|
||||
|
||||
Program.Log.Debug("IsAuth: {0} Size: 0x{1:X}, NumSubpackets: {2}{3}{4}", header.isAuthenticated, header.packetSize, header.numSubpackets, Environment.NewLine, Utils.ByteArrayToHex(getHeaderBytes()));
|
||||
Program.Log.Debug("IsAuth: {0} Size: 0x{1:X}, NumSubpackets: {2}{3}{4}", header.isAuthenticated, header.packetSize, header.numSubpackets, Environment.NewLine, Utils.ByteArrayToHex(GetHeaderBytes()));
|
||||
|
||||
foreach (SubPacket sub in getSubpackets())
|
||||
foreach (SubPacket sub in GetSubpackets())
|
||||
{
|
||||
sub.debugPrintSubPacket();
|
||||
sub.DebugPrintSubPacket();
|
||||
}
|
||||
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
|
@@ -101,7 +101,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
data = original.data;
|
||||
}
|
||||
|
||||
public byte[] getHeaderBytes()
|
||||
public byte[] GetHeaderBytes()
|
||||
{
|
||||
int size = Marshal.SizeOf(header);
|
||||
byte[] arr = new byte[size];
|
||||
@@ -113,7 +113,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
return arr;
|
||||
}
|
||||
|
||||
public byte[] getGameMessageBytes()
|
||||
public byte[] GetGameMessageBytes()
|
||||
{
|
||||
int size = Marshal.SizeOf(gameMessage);
|
||||
byte[] arr = new byte[size];
|
||||
@@ -125,26 +125,26 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
return arr;
|
||||
}
|
||||
|
||||
public byte[] getBytes()
|
||||
public byte[] GetBytes()
|
||||
{
|
||||
byte[] outBytes = new byte[header.subpacketSize];
|
||||
Array.Copy(getHeaderBytes(), 0, outBytes, 0, SUBPACKET_SIZE);
|
||||
Array.Copy(GetHeaderBytes(), 0, outBytes, 0, SUBPACKET_SIZE);
|
||||
|
||||
if (header.type == 0x3)
|
||||
Array.Copy(getGameMessageBytes(), 0, outBytes, SUBPACKET_SIZE, GAMEMESSAGE_SIZE);
|
||||
Array.Copy(GetGameMessageBytes(), 0, outBytes, SUBPACKET_SIZE, GAMEMESSAGE_SIZE);
|
||||
|
||||
Array.Copy(data, 0, outBytes, SUBPACKET_SIZE + (header.type == 0x3 ? GAMEMESSAGE_SIZE : 0), data.Length);
|
||||
return outBytes;
|
||||
}
|
||||
|
||||
public void debugPrintSubPacket()
|
||||
public void DebugPrintSubPacket()
|
||||
{
|
||||
#if DEBUG
|
||||
Program.Log.Debug("Size: 0x{0:X}{1}{2}", header.subpacketSize, Environment.NewLine, Utils.ByteArrayToHex(getHeaderBytes()));
|
||||
Program.Log.Debug("Size: 0x{0:X}{1}{2}", header.subpacketSize, Environment.NewLine, Utils.ByteArrayToHex(GetHeaderBytes()));
|
||||
|
||||
if (header.type == 0x03)
|
||||
{
|
||||
Program.Log.Debug("Opcode: 0x{0:X}{1}{2}", gameMessage.opcode, Environment.NewLine, Utils.ByteArrayToHex(getGameMessageBytes(), SUBPACKET_SIZE));
|
||||
Program.Log.Debug("Opcode: 0x{0:X}{1}{2}", gameMessage.opcode, Environment.NewLine, Utils.ByteArrayToHex(GetGameMessageBytes(), SUBPACKET_SIZE));
|
||||
}
|
||||
|
||||
Program.Log.Debug("Data: {0}{1}", Environment.NewLine, Utils.ByteArrayToHex(data, SUBPACKET_SIZE + GAMEMESSAGE_SIZE));
|
||||
|
@@ -20,7 +20,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
this.accountList = accountList;
|
||||
}
|
||||
|
||||
public List<SubPacket> buildPackets()
|
||||
public List<SubPacket> BuildPackets()
|
||||
{
|
||||
List<SubPacket> subPackets = new List<SubPacket>();
|
||||
|
||||
|
@@ -36,7 +36,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
this.worldName = worldName;
|
||||
}
|
||||
|
||||
public SubPacket buildPacket()
|
||||
public SubPacket BuildPacket()
|
||||
{
|
||||
MemoryStream memStream = new MemoryStream(0x1F0);
|
||||
BinaryWriter binWriter = new BinaryWriter(memStream);
|
||||
|
@@ -20,7 +20,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
this.characterList = characterList;
|
||||
}
|
||||
|
||||
public List<SubPacket> buildPackets()
|
||||
public List<SubPacket> BuildPackets()
|
||||
{
|
||||
List<SubPacket> subPackets = new List<SubPacket>();
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
|
||||
foreach (Character chara in characterList)
|
||||
{
|
||||
Appearance appearance = Database.getAppearance(chara.id);
|
||||
Appearance appearance = Database.GetAppearance(chara.id);
|
||||
|
||||
if (totalCount == 0 || characterCount % MAXPERPACKET == 0)
|
||||
{
|
||||
@@ -53,7 +53,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
binWriter.Seek(0x10 + (0x1D0 * characterCount), SeekOrigin.Begin);
|
||||
|
||||
//Write Entries
|
||||
World world = Database.getServer(chara.serverId);
|
||||
World world = Database.GetServer(chara.serverId);
|
||||
string worldname = world == null ? "Unknown" : world.name;
|
||||
|
||||
binWriter.Write((uint)0); //???
|
||||
@@ -74,8 +74,8 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(chara.name.PadRight(0x20, '\0'))); //Name
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(worldname.PadRight(0xE, '\0'))); //World Name
|
||||
|
||||
binWriter.Write(CharaInfo.buildForCharaList(chara, appearance)); //Appearance Data
|
||||
//binWriter.Write(CharaInfo.debug()); //Appearance Data
|
||||
binWriter.Write(CharaInfo.BuildForCharaList(chara, appearance)); //Appearance Data
|
||||
//binWriter.Write(CharaInfo.Debug()); //Appearance Data
|
||||
|
||||
characterCount++;
|
||||
totalCount++;
|
||||
|
@@ -23,7 +23,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public SubPacket buildPacket()
|
||||
public SubPacket BuildPacket()
|
||||
{
|
||||
MemoryStream memStream = new MemoryStream(0x210);
|
||||
BinaryWriter binWriter = new BinaryWriter(memStream);
|
||||
|
@@ -19,7 +19,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
this.namesList = names;
|
||||
}
|
||||
|
||||
public List<SubPacket> buildPackets()
|
||||
public List<SubPacket> BuildPackets()
|
||||
{
|
||||
List<SubPacket> subPackets = new List<SubPacket>();
|
||||
|
||||
|
@@ -19,7 +19,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
this.retainerList = retainerList;
|
||||
}
|
||||
|
||||
public List<SubPacket> buildPackets()
|
||||
public List<SubPacket> BuildPackets()
|
||||
{
|
||||
List<SubPacket> subPackets = new List<SubPacket>();
|
||||
|
||||
|
@@ -26,7 +26,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
this.selectCharTicket = selectCharTicket;
|
||||
}
|
||||
|
||||
public List<SubPacket> buildPackets()
|
||||
public List<SubPacket> BuildPackets()
|
||||
{
|
||||
List<SubPacket> subPackets = new List<SubPacket>();
|
||||
|
||||
|
@@ -20,7 +20,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
||||
this.worldList = serverList;
|
||||
}
|
||||
|
||||
public List<SubPacket> buildPackets()
|
||||
public List<SubPacket> BuildPackets()
|
||||
{
|
||||
List<SubPacket> subPackets = new List<SubPacket>();
|
||||
|
||||
|
Reference in New Issue
Block a user