Packet refactoring.

This commit is contained in:
Filip Maj
2019-07-26 23:24:06 -04:00
parent 96641865bc
commit 0ec9c5576c
22 changed files with 115 additions and 109 deletions

View File

@@ -37,8 +37,7 @@ namespace Meteor.Map.packets.receive.recruitment
using (BinaryReader binReader = new BinaryReader(mem))
{
try{
recruitmentId = binReader.ReadUInt64();
recruitmentId = binReader.ReadUInt64();
}
catch (Exception){
invalidPacket = true;

View File

@@ -21,7 +21,8 @@ along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
using System;
using System.IO;
using System.Text;
using Meteor.Common;
namespace Meteor.Map.packets.receive.recruitment
{
@@ -54,8 +55,8 @@ namespace Meteor.Map.packets.receive.recruitment
unknown1 = binReader.ReadByte();
unknown2 = binReader.ReadByte();
text = Encoding.ASCII.GetString(binReader.ReadBytes(0x20));
text = Utils.ReadNullTermString(binReader);
}
catch (Exception){
invalidPacket = true;

View File

@@ -19,9 +19,9 @@ along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
===========================================================================
*/
using Meteor.Common;
using System;
using System.IO;
using System.Text;
namespace Meteor.Map.packets.receive.recruitment
{
@@ -62,7 +62,7 @@ namespace Meteor.Map.packets.receive.recruitment
binReader.ReadByte();
}
comment = Encoding.ASCII.GetString(binReader.ReadBytes(0x168));
comment = Utils.ReadNullTermString(binReader, 0x168);
}
catch (Exception){
invalidPacket = true;