mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-09 05:54:50 +02:00
Packet refactoring.
This commit is contained in:
parent
96641865bc
commit
0ec9c5576c
22 changed files with 115 additions and 109 deletions
|
@ -265,6 +265,15 @@ namespace Meteor.Common
|
|||
return secondDigit + firstDigit;
|
||||
}
|
||||
|
||||
public static string ReadNullTermString(BinaryReader reader, int maxSize = 0x20)
|
||||
{
|
||||
return Encoding.ASCII.GetString(reader.ReadBytes(maxSize)).Trim(new[] { '\0' });
|
||||
}
|
||||
|
||||
public static void WriteNullTermString(BinaryWriter writer, string value, int maxSize = 0x20)
|
||||
{
|
||||
writer.Write(Encoding.ASCII.GetBytes(value), 0, Encoding.ASCII.GetByteCount(value) >= maxSize ? maxSize : Encoding.ASCII.GetByteCount(value));
|
||||
}
|
||||
|
||||
public static string FFXIVLoginStringDecodeBinary(string path)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue