mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-24 03:20:30 +02:00
Cleaned up namespaces (still have to do Map Project) and removed references to FFXIV Classic from the code. Removed the Launcher Editor project as it is no longer needed (host file editing is cleaner).
This commit is contained in:
parent
7587a6e142
commit
0f61c4c0e1
544 changed files with 54548 additions and 55498 deletions
54
World Server/Packets/Receive/HelloPacket.cs
Normal file
54
World Server/Packets/Receive/HelloPacket.cs
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Meteor.World.Packets.Receive
|
||||
{
|
||||
class HelloPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public uint sessionId;
|
||||
|
||||
public HelloPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] readIn = new byte[12];
|
||||
binReader.BaseStream.Seek(0x14, SeekOrigin.Begin);
|
||||
binReader.Read(readIn, 0, 12);
|
||||
sessionId = UInt32.Parse(Encoding.ASCII.GetString(readIn));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
63
World Server/Packets/Receive/Subpackets/ChatMessagePacket.cs
Normal file
63
World Server/Packets/Receive/Subpackets/ChatMessagePacket.cs
Normal file
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Meteor.World.Packets.Receive.Subpackets
|
||||
{
|
||||
class ChatMessagePacket
|
||||
{
|
||||
public float posX;
|
||||
public float posY;
|
||||
public float posZ;
|
||||
public float posRot;
|
||||
|
||||
public uint logType;
|
||||
|
||||
public string message;
|
||||
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public ChatMessagePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
binReader.ReadUInt64();
|
||||
posX = binReader.ReadSingle();
|
||||
posY = binReader.ReadSingle();
|
||||
posZ = binReader.ReadSingle();
|
||||
posRot = binReader.ReadSingle();
|
||||
logType = binReader.ReadUInt32();
|
||||
message = Encoding.ASCII.GetString(binReader.ReadBytes(0x200)).Trim(new [] { '\0' });
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Meteor.World.Packets.Receive.Subpackets
|
||||
{
|
||||
class GroupCreatedPacket
|
||||
{
|
||||
public ulong groupId;
|
||||
public string workString;
|
||||
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public GroupCreatedPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
groupId = binReader.ReadUInt64();
|
||||
workString = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Meteor.World.Packets.Receive.Subpackets
|
||||
{
|
||||
class PartyChatMessagePacket
|
||||
{
|
||||
public uint actorId;
|
||||
public string message;
|
||||
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public PartyChatMessagePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
actorId = binReader.ReadUInt32();
|
||||
message = Encoding.ASCII.GetString(binReader.ReadBytes(0x200)).Trim(new [] { '\0' });
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
371
World Server/Packets/Send/Subpackets/GameMessagePacket.cs
Normal file
371
World Server/Packets/Send/Subpackets/GameMessagePacket.cs
Normal file
|
@ -0,0 +1,371 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
using Meteor.World.DataObjects;
|
||||
|
||||
namespace Meteor.World.Packets.Send.Subpackets
|
||||
{
|
||||
class GameMessagePacket
|
||||
{
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITH_ACTOR1 = 0x157;
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITH_ACTOR2 = 0x158;
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITH_ACTOR3 = 0x159;
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITH_ACTOR4 = 0x15a;
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITH_ACTOR5 = 0x15b;
|
||||
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITH_CUSTOM_SENDER1 = 0x15c;
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITH_CUSTOM_SENDER2 = 0x15d;
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITH_CUSTOM_SENDER3 = 0x15e;
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITH_CUSTOM_SENDER4 = 0x15f;
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITH_CUSTOM_SENDER5 = 0x160;
|
||||
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITH_DISPID_SENDER1 = 0x161;
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITH_DISPID_SENDER2 = 0x162;
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITH_DISPID_SENDER3 = 0x163;
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITH_DISPID_SENDER4 = 0x164;
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITH_DISPID_SENDER5 = 0x165;
|
||||
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITHOUT_ACTOR1 = 0x166;
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITHOUT_ACTOR2 = 0x167;
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITHOUT_ACTOR3 = 0x168;
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITHOUT_ACTOR4 = 0x169;
|
||||
private const ushort OPCODE_GAMEMESSAGE_WITHOUT_ACTOR5 = 0x16a;
|
||||
|
||||
private const ushort SIZE_GAMEMESSAGE_WITH_ACTOR1 = 0x30;
|
||||
private const ushort SIZE_GAMEMESSAGE_WITH_ACTOR2 = 0x38;
|
||||
private const ushort SIZE_GAMEMESSAGE_WITH_ACTOR3 = 0x40;
|
||||
private const ushort SIZE_GAMEMESSAGE_WITH_ACTOR4 = 0x50;
|
||||
private const ushort SIZE_GAMEMESSAGE_WITH_ACTOR5 = 0x70;
|
||||
|
||||
private const ushort SIZE_GAMEMESSAGE_WITH_CUSTOM_SENDER1 = 0x48;
|
||||
private const ushort SIZE_GAMEMESSAGE_WITH_CUSTOM_SENDER2 = 0x58;
|
||||
private const ushort SIZE_GAMEMESSAGE_WITH_CUSTOM_SENDER3 = 0x68;
|
||||
private const ushort SIZE_GAMEMESSAGE_WITH_CUSTOM_SENDER4 = 0x78;
|
||||
private const ushort SIZE_GAMEMESSAGE_WITH_CUSTOM_SENDER5 = 0x98;
|
||||
|
||||
private const ushort SIZE_GAMEMESSAGE_WITH_DISPID_SENDER1 = 0x30;
|
||||
private const ushort SIZE_GAMEMESSAGE_WITH_DISPID_SENDER2 = 0x38;
|
||||
private const ushort SIZE_GAMEMESSAGE_WITH_DISPID_SENDER3 = 0x40;
|
||||
private const ushort SIZE_GAMEMESSAGE_WITH_DISPID_SENDER4 = 0x50;
|
||||
private const ushort SIZE_GAMEMESSAGE_WITH_DISPID_SENDER5 = 0x60;
|
||||
|
||||
private const ushort SIZE_GAMEMESSAGE_WITHOUT_ACTOR1 = 0x28;
|
||||
private const ushort SIZE_GAMEMESSAGE_WITHOUT_ACTOR2 = 0x38;
|
||||
private const ushort SIZE_GAMEMESSAGE_WITHOUT_ACTOR3 = 0x38;
|
||||
private const ushort SIZE_GAMEMESSAGE_WITHOUT_ACTOR4 = 0x48;
|
||||
private const ushort SIZE_GAMEMESSAGE_WITHOUT_ACTOR5 = 0x68;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceId, uint actorId, uint textOwnerActorId, ushort textId, byte log)
|
||||
{
|
||||
byte[] data = new byte[SIZE_GAMEMESSAGE_WITH_ACTOR1 - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)actorId);
|
||||
binWriter.Write((UInt32)textOwnerActorId);
|
||||
binWriter.Write((UInt16)textId);
|
||||
binWriter.Write((UInt16)log);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE_GAMEMESSAGE_WITH_ACTOR1, sourceId, data);
|
||||
}
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceId, uint actorId, uint textOwnerActorId, ushort textId, byte log, List<LuaParam> lParams)
|
||||
{
|
||||
int lParamsSize = findSizeOfParams(lParams);
|
||||
byte[] data;
|
||||
ushort opcode;
|
||||
|
||||
if (lParamsSize <= 0x8)
|
||||
{
|
||||
data = new byte[SIZE_GAMEMESSAGE_WITH_ACTOR2 - 0x20];
|
||||
opcode = OPCODE_GAMEMESSAGE_WITH_ACTOR2;
|
||||
}
|
||||
else if (lParamsSize <= 0x10)
|
||||
{
|
||||
data = new byte[SIZE_GAMEMESSAGE_WITH_ACTOR3 - 0x20];
|
||||
opcode = OPCODE_GAMEMESSAGE_WITH_ACTOR3;
|
||||
}
|
||||
else if (lParamsSize <= 0x20)
|
||||
{
|
||||
data = new byte[SIZE_GAMEMESSAGE_WITH_ACTOR4 - 0x20];
|
||||
opcode = OPCODE_GAMEMESSAGE_WITH_ACTOR4;
|
||||
}
|
||||
else
|
||||
{
|
||||
data = new byte[SIZE_GAMEMESSAGE_WITH_ACTOR5 - 0x20];
|
||||
opcode = OPCODE_GAMEMESSAGE_WITH_ACTOR5;
|
||||
}
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)actorId);
|
||||
binWriter.Write((UInt32)textOwnerActorId);
|
||||
binWriter.Write((UInt16)textId);
|
||||
binWriter.Write((UInt16)log);
|
||||
LuaUtils.WriteLuaParams(binWriter, lParams);
|
||||
|
||||
if (lParamsSize <= 0x14-12)
|
||||
{
|
||||
binWriter.Seek(0x14, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(opcode, sourceId, data);
|
||||
}
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceId, uint textOwnerActorId, ushort textId, string sender, byte log)
|
||||
{
|
||||
byte[] data = new byte[SIZE_GAMEMESSAGE_WITH_CUSTOM_SENDER1 - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)textOwnerActorId);
|
||||
binWriter.Write((UInt16)textId);
|
||||
binWriter.Write((UInt16)log);
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(sender), 0, Encoding.ASCII.GetByteCount(sender) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(sender));
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE_GAMEMESSAGE_WITH_CUSTOM_SENDER1, sourceId, data);
|
||||
}
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceId, uint textOwnerActorId, ushort textId, string sender, byte log, List<LuaParam> lParams)
|
||||
{
|
||||
int lParamsSize = findSizeOfParams(lParams);
|
||||
byte[] data;
|
||||
ushort opcode;
|
||||
|
||||
if (lParamsSize <= 0x8)
|
||||
{
|
||||
data = new byte[SIZE_GAMEMESSAGE_WITH_CUSTOM_SENDER2 - 0x20];
|
||||
opcode = OPCODE_GAMEMESSAGE_WITH_CUSTOM_SENDER2;
|
||||
}
|
||||
else if (lParamsSize <= 0x10)
|
||||
{
|
||||
data = new byte[SIZE_GAMEMESSAGE_WITH_CUSTOM_SENDER3 - 0x20];
|
||||
opcode = OPCODE_GAMEMESSAGE_WITH_CUSTOM_SENDER3;
|
||||
}
|
||||
else if (lParamsSize <= 0x20)
|
||||
{
|
||||
data = new byte[SIZE_GAMEMESSAGE_WITH_CUSTOM_SENDER4 - 0x20];
|
||||
opcode = OPCODE_GAMEMESSAGE_WITH_CUSTOM_SENDER4;
|
||||
}
|
||||
else
|
||||
{
|
||||
data = new byte[SIZE_GAMEMESSAGE_WITH_CUSTOM_SENDER5 - 0x20];
|
||||
opcode = OPCODE_GAMEMESSAGE_WITH_CUSTOM_SENDER5;
|
||||
}
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)textOwnerActorId);
|
||||
binWriter.Write((UInt16)textId);
|
||||
binWriter.Write((UInt16)log);
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(sender), 0, Encoding.ASCII.GetByteCount(sender) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(sender));
|
||||
LuaUtils.WriteLuaParams(binWriter, lParams);
|
||||
|
||||
if (lParamsSize <= 0x14 - 12)
|
||||
{
|
||||
binWriter.Seek(0x30, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(opcode, sourceId, data);
|
||||
}
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceId, uint textOwnerActorId, ushort textId, uint senderDisplayNameId, byte log)
|
||||
{
|
||||
byte[] data = new byte[SIZE_GAMEMESSAGE_WITH_DISPID_SENDER1 - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)senderDisplayNameId);
|
||||
binWriter.Write((UInt32)textOwnerActorId);
|
||||
binWriter.Write((UInt16)textId);
|
||||
binWriter.Write((UInt16)log);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE_GAMEMESSAGE_WITH_DISPID_SENDER1, sourceId, data);
|
||||
}
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceId, uint textOwnerActorId, ushort textId, uint senderDisplayNameId, byte log, List<LuaParam> lParams)
|
||||
{
|
||||
int lParamsSize = findSizeOfParams(lParams);
|
||||
byte[] data;
|
||||
ushort opcode;
|
||||
|
||||
if (lParamsSize <= 0x8)
|
||||
{
|
||||
data = new byte[SIZE_GAMEMESSAGE_WITH_DISPID_SENDER2 - 0x20];
|
||||
opcode = OPCODE_GAMEMESSAGE_WITH_DISPID_SENDER2;
|
||||
}
|
||||
else if (lParamsSize <= 0x10)
|
||||
{
|
||||
data = new byte[SIZE_GAMEMESSAGE_WITH_DISPID_SENDER3 - 0x20];
|
||||
opcode = OPCODE_GAMEMESSAGE_WITH_DISPID_SENDER3;
|
||||
}
|
||||
else if (lParamsSize <= 0x20)
|
||||
{
|
||||
data = new byte[SIZE_GAMEMESSAGE_WITH_DISPID_SENDER4 - 0x20];
|
||||
opcode = OPCODE_GAMEMESSAGE_WITH_DISPID_SENDER4;
|
||||
}
|
||||
else
|
||||
{
|
||||
data = new byte[SIZE_GAMEMESSAGE_WITH_DISPID_SENDER5 - 0x20];
|
||||
opcode = OPCODE_GAMEMESSAGE_WITH_DISPID_SENDER5;
|
||||
}
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)senderDisplayNameId);
|
||||
binWriter.Write((UInt32)textOwnerActorId);
|
||||
binWriter.Write((UInt16)textId);
|
||||
binWriter.Write((UInt16)log);
|
||||
LuaUtils.WriteLuaParams(binWriter, lParams);
|
||||
|
||||
if (lParamsSize <= 0x14 - 12)
|
||||
{
|
||||
binWriter.Seek(0x14, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(opcode, sourceId, data);
|
||||
}
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceId, uint textOwnerActorId, ushort textId, byte log)
|
||||
{
|
||||
byte[] data = new byte[SIZE_GAMEMESSAGE_WITHOUT_ACTOR1 - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)textOwnerActorId);
|
||||
binWriter.Write((UInt16)textId);
|
||||
binWriter.Write((UInt16)log);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE_GAMEMESSAGE_WITHOUT_ACTOR1, sourceId, data);
|
||||
}
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceId, uint textOwnerActorId, ushort textId, byte log, List<LuaParam> lParams)
|
||||
{
|
||||
int lParamsSize = findSizeOfParams(lParams);
|
||||
byte[] data;
|
||||
ushort opcode;
|
||||
|
||||
if (lParamsSize <= 0x8)
|
||||
{
|
||||
data = new byte[SIZE_GAMEMESSAGE_WITHOUT_ACTOR2 - 0x20];
|
||||
opcode = OPCODE_GAMEMESSAGE_WITHOUT_ACTOR2;
|
||||
}
|
||||
else if (lParamsSize <= 0x10)
|
||||
{
|
||||
data = new byte[SIZE_GAMEMESSAGE_WITHOUT_ACTOR3 - 0x20];
|
||||
opcode = OPCODE_GAMEMESSAGE_WITHOUT_ACTOR3;
|
||||
}
|
||||
else if (lParamsSize <= 0x20)
|
||||
{
|
||||
data = new byte[SIZE_GAMEMESSAGE_WITHOUT_ACTOR4 - 0x20];
|
||||
opcode = OPCODE_GAMEMESSAGE_WITHOUT_ACTOR4;
|
||||
}
|
||||
else
|
||||
{
|
||||
data = new byte[SIZE_GAMEMESSAGE_WITHOUT_ACTOR5 - 0x20];
|
||||
opcode = OPCODE_GAMEMESSAGE_WITHOUT_ACTOR5;
|
||||
}
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)textOwnerActorId);
|
||||
binWriter.Write((UInt16)textId);
|
||||
binWriter.Write((UInt16)log);
|
||||
LuaUtils.WriteLuaParams(binWriter, lParams);
|
||||
|
||||
if (lParamsSize <= 0x8)
|
||||
{
|
||||
binWriter.Seek(0x10, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(opcode, sourceId, data);
|
||||
}
|
||||
|
||||
private static int findSizeOfParams(List<LuaParam> lParams)
|
||||
{
|
||||
int total = 0;
|
||||
foreach (LuaParam l in lParams)
|
||||
{
|
||||
switch (l.typeID)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
total += 5;
|
||||
break;
|
||||
case 2:
|
||||
total += 1 + 0x20;
|
||||
break;
|
||||
case 6:
|
||||
total += 5;
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
total += 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return total + 1;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
using Meteor.World.DataObjects.Group;
|
||||
|
||||
namespace Meteor.World.Packets.Send.Subpackets.Groups
|
||||
{
|
||||
class CreateNamedGroup
|
||||
{
|
||||
public const ushort OPCODE = 0x0188;
|
||||
public const uint PACKET_SIZE = 0x60;
|
||||
|
||||
public static SubPacket buildPacket(uint sessionId, Group group)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt64)group.groupIndex);
|
||||
binWriter.Write((UInt32)group.GetTypeId());
|
||||
binWriter.Write((Int32)group.GetGroupLocalizedName());
|
||||
|
||||
binWriter.Write((UInt16)0x121C);
|
||||
|
||||
binWriter.Seek(0x20, SeekOrigin.Begin);
|
||||
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(group.GetGroupName()), 0, Encoding.ASCII.GetByteCount(group.GetGroupName()) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(group.GetGroupName()));
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sessionId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
using Meteor.World.DataObjects.Group;
|
||||
|
||||
namespace Meteor.World.Packets.Send.Subpackets.Groups
|
||||
{
|
||||
class CreateNamedGroupMultiple
|
||||
{
|
||||
public const ushort OPCODE = 0x0189;
|
||||
public const uint PACKET_SIZE = 0x228;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, Group[] groups, ref int offset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
int max = 8;
|
||||
if (groups.Length - offset <= 8)
|
||||
max = groups.Length - offset;
|
||||
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Seek(i * 0x40, SeekOrigin.Begin);
|
||||
|
||||
Group group = groups[offset+i];
|
||||
|
||||
binWriter.Write((UInt64)group.groupIndex);
|
||||
binWriter.Write((UInt32)group.GetTypeId());
|
||||
binWriter.Write((Int32)group.GetGroupLocalizedName());
|
||||
|
||||
binWriter.Write((UInt16)0x121C);
|
||||
|
||||
binWriter.Seek(0x20, SeekOrigin.Begin);
|
||||
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(group.GetGroupName()), 0, Encoding.ASCII.GetByteCount(group.GetGroupName()) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(group.GetGroupName()));
|
||||
}
|
||||
|
||||
binWriter.Seek(0x200, SeekOrigin.Begin);
|
||||
binWriter.Write((Byte)max);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
using Meteor.World.DataObjects.Group;
|
||||
|
||||
namespace Meteor.World.Packets.Send.Subpackets.Groups
|
||||
{
|
||||
class DeleteGroupPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x0143;
|
||||
public const uint PACKET_SIZE = 0x40;
|
||||
|
||||
public static SubPacket buildPacket(uint sessionId, Group group)
|
||||
{
|
||||
return buildPacket(sessionId, group.groupIndex);
|
||||
}
|
||||
|
||||
public static SubPacket buildPacket(uint sessionId, ulong groupId)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
//Write control num ????
|
||||
binWriter.Write((UInt64)3);
|
||||
|
||||
//Write Ids
|
||||
binWriter.Write((UInt64)groupId);
|
||||
binWriter.Write((UInt64)0);
|
||||
binWriter.Write((UInt64)groupId);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sessionId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
using Meteor.World.DataObjects.Group;
|
||||
|
||||
namespace Meteor.World.Packets.Send.Subpackets.Groups
|
||||
{
|
||||
class GroupHeaderPacket
|
||||
{
|
||||
public const uint TYPEID_RETAINER = 0x13881;
|
||||
public const uint TYPEID_PARTY = 0x2711;
|
||||
public const uint TYPEID_LINKSHELL = 0x4E22;
|
||||
|
||||
public const ushort OPCODE = 0x017C;
|
||||
public const uint PACKET_SIZE = 0x98;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, uint locationCode, ulong sequenceId, Group group)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
//Write list header
|
||||
binWriter.Write((UInt64)locationCode);
|
||||
binWriter.Write((UInt64)sequenceId);
|
||||
|
||||
//Write list id
|
||||
binWriter.Write((UInt64)3);
|
||||
binWriter.Write((UInt64)group.groupIndex);
|
||||
binWriter.Write((UInt64)0);
|
||||
binWriter.Write((UInt64)group.groupIndex);
|
||||
|
||||
//This seems to change depending on what the list is for
|
||||
binWriter.Write((UInt32)group.GetTypeId());
|
||||
binWriter.Seek(0x40, SeekOrigin.Begin);
|
||||
|
||||
//This is for Linkshell
|
||||
binWriter.Write((UInt32)group.GetGroupLocalizedName());
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(group.GetGroupName()), 0, Encoding.ASCII.GetByteCount(group.GetGroupName()) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(group.GetGroupName()));
|
||||
|
||||
binWriter.Seek(0x64, SeekOrigin.Begin);
|
||||
|
||||
//Does this change chat????
|
||||
binWriter.Write((UInt32)0x6D);
|
||||
binWriter.Write((UInt32)0x6D);
|
||||
binWriter.Write((UInt32)0x6D);
|
||||
binWriter.Write((UInt32)0x6D);
|
||||
|
||||
binWriter.Write((UInt32)group.GetMemberCount());
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
43
World Server/Packets/Send/Subpackets/Groups/GroupMember.cs
Normal file
43
World Server/Packets/Send/Subpackets/Groups/GroupMember.cs
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
namespace Meteor.World.Packets.Send.Subpackets.Groups
|
||||
{
|
||||
class GroupMember
|
||||
{
|
||||
public uint actorId;
|
||||
public int localizedName;
|
||||
public uint unknown2;
|
||||
public bool flag1;
|
||||
public bool isOnline;
|
||||
public string name;
|
||||
|
||||
public GroupMember(uint actorId, int localizedName, uint unknown2, bool flag1, bool isOnline, string name)
|
||||
{
|
||||
this.actorId = actorId;
|
||||
this.localizedName = localizedName;
|
||||
this.unknown2 = unknown2;
|
||||
this.flag1 = flag1;
|
||||
this.isOnline = isOnline;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
using Meteor.World.DataObjects.Group;
|
||||
|
||||
namespace Meteor.World.Packets.Send.Subpackets.Groups
|
||||
{
|
||||
class GroupMembersBeginPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x017D;
|
||||
public const uint PACKET_SIZE = 0x40;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, uint locationCode, ulong sequenceId, Group group)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
//Write List Header
|
||||
binWriter.Write((UInt64)locationCode);
|
||||
binWriter.Write((UInt64)sequenceId);
|
||||
//Write List Info
|
||||
binWriter.Write((UInt64)group.groupIndex);
|
||||
binWriter.Write((UInt32)group.GetMemberCount());
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
using Meteor.World.DataObjects.Group;
|
||||
|
||||
namespace Meteor.World.Packets.Send.Subpackets.Groups
|
||||
{
|
||||
class GroupMembersEndPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x017E;
|
||||
public const uint PACKET_SIZE = 0x38;
|
||||
|
||||
public static SubPacket buildPacket(uint sessionId, uint locationCode, ulong sequenceId, Group group)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
//Write List Header
|
||||
binWriter.Write((UInt64)locationCode);
|
||||
binWriter.Write((UInt64)sequenceId);
|
||||
//Write List Info
|
||||
binWriter.Write((UInt64)group.groupIndex);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sessionId, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace Meteor.World.Packets.Send.Subpackets.Groups
|
||||
{
|
||||
class GroupMembersX08Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x017F;
|
||||
public const uint PACKET_SIZE = 0x1B8;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, uint locationCode, ulong sequenceId, List<GroupMember> entries, ref int offset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
//Write List Header
|
||||
binWriter.Write((UInt64)locationCode);
|
||||
binWriter.Write((UInt64)sequenceId);
|
||||
//Write Entries
|
||||
int max = 8;
|
||||
if (entries.Count-offset < 8)
|
||||
max = entries.Count - offset;
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Seek(0x10 + (0x30 * i), SeekOrigin.Begin);
|
||||
|
||||
GroupMember entry = entries[i];
|
||||
binWriter.Write((UInt32)entry.actorId);
|
||||
binWriter.Write((Int32)entry.localizedName);
|
||||
binWriter.Write((UInt32)entry.unknown2);
|
||||
binWriter.Write((Byte)(entry.flag1? 1 : 0));
|
||||
binWriter.Write((Byte)(entry.isOnline? 1 : 0));
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(entry.name), 0, Encoding.ASCII.GetByteCount(entry.name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(entry.name));
|
||||
|
||||
offset++;
|
||||
}
|
||||
//Write Count
|
||||
binWriter.Seek(0x10 + (0x30 * 8), SeekOrigin.Begin);
|
||||
binWriter.Write(max);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace Meteor.World.Packets.Send.Subpackets.Groups
|
||||
{
|
||||
class GroupMembersX16Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x0180;
|
||||
public const uint PACKET_SIZE = 0x330;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, uint locationCode, ulong sequenceId, List<GroupMember> entries, ref int offset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
//Write List Header
|
||||
binWriter.Write((UInt64)locationCode);
|
||||
binWriter.Write((UInt64)sequenceId);
|
||||
//Write Entries
|
||||
int max = 16;
|
||||
if (entries.Count-offset < 16)
|
||||
max = entries.Count - offset;
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Seek(0x10 + (0x30 * i), SeekOrigin.Begin);
|
||||
|
||||
GroupMember entry = entries[i];
|
||||
binWriter.Write((UInt32)entry.actorId);
|
||||
binWriter.Write((Int32)entry.localizedName);
|
||||
binWriter.Write((UInt32)entry.unknown2);
|
||||
binWriter.Write((Byte)(entry.flag1? 1 : 0));
|
||||
binWriter.Write((Byte)(entry.isOnline? 1 : 0));
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(entry.name), 0, Encoding.ASCII.GetByteCount(entry.name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(entry.name));
|
||||
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace Meteor.World.Packets.Send.Subpackets.Groups
|
||||
{
|
||||
class GroupMembersX32Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x0181;
|
||||
public const uint PACKET_SIZE = 0x630;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, uint locationCode, ulong sequenceId, List<GroupMember> entries, ref int offset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
//Write List Header
|
||||
binWriter.Write((UInt64)locationCode);
|
||||
binWriter.Write((UInt64)sequenceId);
|
||||
//Write Entries
|
||||
int max = 32;
|
||||
if (entries.Count-offset < 32)
|
||||
max = entries.Count - offset;
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Seek(0x10 + (0x30 * i), SeekOrigin.Begin);
|
||||
|
||||
GroupMember entry = entries[i];
|
||||
binWriter.Write((UInt32)entry.actorId);
|
||||
binWriter.Write((Int32)entry.localizedName);
|
||||
binWriter.Write((UInt32)entry.unknown2);
|
||||
binWriter.Write((Byte)(entry.flag1? 1 : 0));
|
||||
binWriter.Write((Byte)(entry.isOnline? 1 : 0));
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(entry.name), 0, Encoding.ASCII.GetByteCount(entry.name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(entry.name));
|
||||
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace Meteor.World.Packets.Send.Subpackets.Groups
|
||||
{
|
||||
class GroupMembersX64Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x0182;
|
||||
public const uint PACKET_SIZE = 0xC30;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, uint locationCode, ulong sequenceId, List<GroupMember> entries, ref int offset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
//Write List Header
|
||||
binWriter.Write((UInt64)locationCode);
|
||||
binWriter.Write((UInt64)sequenceId);
|
||||
//Write Entries
|
||||
int max = 64;
|
||||
if (entries.Count - offset < 64)
|
||||
max = entries.Count - offset;
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Seek(0x10 + (0x30 * i), SeekOrigin.Begin);
|
||||
|
||||
GroupMember entry = entries[i];
|
||||
binWriter.Write((UInt32)entry.actorId);
|
||||
binWriter.Write((Int32)entry.localizedName);
|
||||
binWriter.Write((UInt32)entry.unknown2);
|
||||
binWriter.Write((Byte)(entry.flag1? 1 : 0));
|
||||
binWriter.Write((Byte)(entry.isOnline? 1 : 0));
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(entry.name), 0, Encoding.ASCII.GetByteCount(entry.name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(entry.name));
|
||||
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
using Meteor.World.DataObjects.Group;
|
||||
|
||||
namespace Meteor.World.Packets.Send.Subpackets.Groups
|
||||
{
|
||||
class SetActiveLinkshellPacket
|
||||
{
|
||||
|
||||
public const ushort OPCODE = 0x018A;
|
||||
public const uint PACKET_SIZE = 0x98;
|
||||
|
||||
public static SubPacket BuildPacket(uint sessionId, ulong groupId)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
//Write the LS groupId
|
||||
binWriter.Write((UInt64)groupId);
|
||||
|
||||
//Write the LS group type
|
||||
binWriter.Seek(0x40, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)Group.CompanyGroup);
|
||||
|
||||
//Seems to be a index but can only set one active so /shrug
|
||||
binWriter.Seek(0x60, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)(groupId == 0 ? 0 : 1));
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sessionId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,230 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
using Meteor.World.DataObjects.Group;
|
||||
|
||||
namespace Meteor.World.Packets.Send.Subpackets.Groups
|
||||
{
|
||||
class SynchGroupWorkValuesPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x017A;
|
||||
public const uint PACKET_SIZE = 0xB0;
|
||||
|
||||
private const ushort MAXBYTES = 0x98;
|
||||
|
||||
private ushort runningByteTotal = 0;
|
||||
private byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
private bool isMore = false;
|
||||
|
||||
private MemoryStream mem;
|
||||
private BinaryWriter binWriter;
|
||||
|
||||
public SynchGroupWorkValuesPacket(ulong listId)
|
||||
{
|
||||
mem = new MemoryStream(data);
|
||||
binWriter = new BinaryWriter(mem);
|
||||
binWriter.Write((UInt64)listId);
|
||||
binWriter.Seek(1, SeekOrigin.Current);
|
||||
}
|
||||
|
||||
public void closeStreams()
|
||||
{
|
||||
binWriter.Dispose();
|
||||
mem.Dispose();
|
||||
}
|
||||
|
||||
public bool addByte(uint id, byte value)
|
||||
{
|
||||
if (runningByteTotal + 6 > MAXBYTES)
|
||||
return false;
|
||||
|
||||
binWriter.Write((byte)1);
|
||||
binWriter.Write((UInt32)id);
|
||||
binWriter.Write((byte)value);
|
||||
runningByteTotal += 6;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool addShort(uint id, ushort value)
|
||||
{
|
||||
if (runningByteTotal + 7 > MAXBYTES)
|
||||
return false;
|
||||
|
||||
binWriter.Write((byte)2);
|
||||
binWriter.Write((UInt32)id);
|
||||
binWriter.Write((UInt16)value);
|
||||
runningByteTotal += 7;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool addInt(uint id, uint value)
|
||||
{
|
||||
if (runningByteTotal + 9 > MAXBYTES)
|
||||
return false;
|
||||
|
||||
binWriter.Write((byte)4);
|
||||
binWriter.Write((UInt32)id);
|
||||
binWriter.Write((UInt32)value);
|
||||
runningByteTotal += 9;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool addLong(uint id, ulong value)
|
||||
{
|
||||
if (runningByteTotal + 13 > MAXBYTES)
|
||||
return false;
|
||||
|
||||
binWriter.Write((byte)8);
|
||||
binWriter.Write((UInt32)id);
|
||||
binWriter.Write((UInt64)value);
|
||||
runningByteTotal += 13;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool addBuffer(uint id, byte[] buffer)
|
||||
{
|
||||
if (runningByteTotal + 5 + buffer.Length > MAXBYTES)
|
||||
return false;
|
||||
|
||||
binWriter.Write((byte)buffer.Length);
|
||||
binWriter.Write((UInt32)id);
|
||||
binWriter.Write(buffer);
|
||||
runningByteTotal += (ushort)(5 + buffer.Length);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void addProperty(Group group, string name)
|
||||
{
|
||||
string[] split = name.Split('.');
|
||||
int arrayIndex = 0;
|
||||
|
||||
if (!(split[0].Equals("work") || split[0].Equals("partyGroupWork")))
|
||||
return;
|
||||
|
||||
Object curObj = group;
|
||||
for (int i = 0; i < split.Length; i++)
|
||||
{
|
||||
//For arrays
|
||||
if (split[i].Contains('['))
|
||||
{
|
||||
if (split[i].LastIndexOf(']') - split[i].IndexOf('[') <= 0)
|
||||
return;
|
||||
|
||||
arrayIndex = Convert.ToInt32(split[i].Substring(split[i].IndexOf('[') + 1, split[i].Length - split[i].LastIndexOf(']')));
|
||||
|
||||
split[i] = split[i].Substring(0, split[i].IndexOf('['));
|
||||
|
||||
if (i != split.Length - 1)
|
||||
{
|
||||
curObj = curObj.GetType().GetField(split[i]).GetValue(curObj);
|
||||
curObj = ((Array)curObj).GetValue(arrayIndex);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
FieldInfo field = curObj.GetType().GetField(split[i]);
|
||||
if (field == null)
|
||||
return;
|
||||
|
||||
curObj = field.GetValue(curObj);
|
||||
if (curObj == null)
|
||||
return;
|
||||
}
|
||||
|
||||
if (curObj == null)
|
||||
return;
|
||||
else
|
||||
{
|
||||
//Array, we actually care whats inside
|
||||
if (curObj.GetType().IsArray)
|
||||
{
|
||||
if (((Array)curObj).Length <= arrayIndex)
|
||||
return;
|
||||
curObj = ((Array)curObj).GetValue(arrayIndex);
|
||||
}
|
||||
|
||||
if (curObj == null)
|
||||
return;
|
||||
|
||||
//Cast to the proper object and add to packet
|
||||
uint id = Utils.MurmurHash2(name, 0);
|
||||
if (curObj is bool)
|
||||
addByte(id, (byte)(((bool)curObj) ? 1 : 0));
|
||||
else if (curObj is byte)
|
||||
addByte(id, (byte)curObj);
|
||||
else if (curObj is ushort)
|
||||
addShort(id, (ushort)curObj);
|
||||
else if (curObj is short)
|
||||
addShort(id, (ushort)(short)curObj);
|
||||
else if (curObj is uint)
|
||||
addInt(id, (uint)curObj);
|
||||
else if (curObj is int)
|
||||
addInt(id, (uint)(int)curObj);
|
||||
else if (curObj is long)
|
||||
addLong(id, (ulong)(long)curObj);
|
||||
else if (curObj is ulong)
|
||||
addLong(id, (ulong)curObj);
|
||||
else if (curObj is float)
|
||||
addBuffer(id, BitConverter.GetBytes((float)curObj));
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void setIsMore(bool flag)
|
||||
{
|
||||
isMore = flag;
|
||||
}
|
||||
|
||||
public void setTarget(string target)
|
||||
{
|
||||
binWriter.Write((byte)(isMore ? 0x62 + target.Length : 0x82 + target.Length));
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(target));
|
||||
runningByteTotal += (ushort)(1 + Encoding.ASCII.GetByteCount(target));
|
||||
|
||||
}
|
||||
|
||||
public SubPacket buildPacket(uint playerActorID)
|
||||
{
|
||||
binWriter.Seek(0x8, SeekOrigin.Begin);
|
||||
binWriter.Write((byte)runningByteTotal);
|
||||
|
||||
closeStreams();
|
||||
|
||||
SubPacket packet = new SubPacket(OPCODE, playerActorID, data);
|
||||
return packet;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
79
World Server/Packets/Send/Subpackets/SendMessagePacket.cs
Normal file
79
World Server/Packets/Send/Subpackets/SendMessagePacket.cs
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
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.World.Packets.Send.Subpackets
|
||||
{
|
||||
class SendMessagePacket
|
||||
{
|
||||
public const int MESSAGE_TYPE_NONE = 0;
|
||||
public const int MESSAGE_TYPE_SAY = 1;
|
||||
public const int MESSAGE_TYPE_SHOUT = 2;
|
||||
public const int MESSAGE_TYPE_TELL = 3;
|
||||
public const int MESSAGE_TYPE_PARTY = 4;
|
||||
public const int MESSAGE_TYPE_LINKSHELL1 = 5;
|
||||
public const int MESSAGE_TYPE_LINKSHELL2 = 6;
|
||||
public const int MESSAGE_TYPE_LINKSHELL3 = 7;
|
||||
public const int MESSAGE_TYPE_LINKSHELL4 = 8;
|
||||
public const int MESSAGE_TYPE_LINKSHELL5 = 9;
|
||||
public const int MESSAGE_TYPE_LINKSHELL6 = 10;
|
||||
public const int MESSAGE_TYPE_LINKSHELL7 = 11;
|
||||
public const int MESSAGE_TYPE_LINKSHELL8 = 12;
|
||||
|
||||
public const int MESSAGE_TYPE_SAY_SPAM = 22;
|
||||
public const int MESSAGE_TYPE_SHOUT_SPAM = 23;
|
||||
public const int MESSAGE_TYPE_TELL_SPAM = 24;
|
||||
public const int MESSAGE_TYPE_CUSTOM_EMOTE = 25;
|
||||
public const int MESSAGE_TYPE_EMOTE_SPAM = 26;
|
||||
public const int MESSAGE_TYPE_STANDARD_EMOTE = 27;
|
||||
public const int MESSAGE_TYPE_URGENT_MESSAGE = 28;
|
||||
public const int MESSAGE_TYPE_GENERAL_INFO = 29;
|
||||
public const int MESSAGE_TYPE_SYSTEM = 32;
|
||||
public const int MESSAGE_TYPE_SYSTEM_ERROR = 33;
|
||||
|
||||
public const ushort OPCODE = 0x0003;
|
||||
public const uint PACKET_SIZE = 0x248;
|
||||
|
||||
public static SubPacket BuildPacket(uint playerActorID, uint targetID, uint messageType, string sender, string message)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(sender), 0, Encoding.ASCII.GetByteCount(sender) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(sender));
|
||||
binWriter.BaseStream.Seek(0x20, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)messageType);
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(message), 0, Encoding.ASCII.GetByteCount(message) >= 0x200 ? 0x200 : Encoding.ASCII.GetByteCount(message));
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
65
World Server/Packets/Send/_0x2Packet.cs
Normal file
65
World Server/Packets/Send/_0x2Packet.cs
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace Meteor.World.Packets.Send
|
||||
{
|
||||
class _0x2Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x0002;
|
||||
public const uint PACKET_SIZE = 0x38;
|
||||
|
||||
public static SubPacket BuildPacket(uint actorID)
|
||||
{
|
||||
byte[] data = {
|
||||
0x6c, 0x00, 0x00, 0x00, 0xC8, 0xD6, 0xAF, 0x2B, 0x38, 0x2B, 0x5F, 0x26, 0xB8, 0x8D, 0xF0, 0x2B,
|
||||
0xC8, 0xFD, 0x85, 0xFE, 0xA8, 0x7C, 0x5B, 0x09, 0x38, 0x2B, 0x5F, 0x26, 0xC8, 0xD6, 0xAF, 0x2B,
|
||||
0xB8, 0x8D, 0xF0, 0x2B, 0x88, 0xAF, 0x5E, 0x26
|
||||
};
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
binWriter.Seek(0, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)actorID);
|
||||
}
|
||||
catch (Exception)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
0x6c, 0x00, 0x00, 0x00, 0xC8, 0xD6, 0xAF, 0x2B, 0x38, 0x2B, 0x5F, 0x26, 0xB8, 0x8D, 0xF0, 0x2B,
|
||||
0xC8, 0xFD, 0x85, 0xFE, 0xA8, 0x7C, 0x5B, 0x09, 0x38, 0x2B, 0x5F, 0x26, 0xC8, 0xD6, 0xAF, 0x2B,
|
||||
0xB8, 0x8D, 0xF0, 0x2B, 0x88, 0xAF, 0x5E, 0x26
|
||||
*/
|
||||
|
||||
return new SubPacket(false, OPCODE, 0, data);
|
||||
}
|
||||
}
|
||||
}
|
55
World Server/Packets/Send/_0x7Packet.cs
Normal file
55
World Server/Packets/Send/_0x7Packet.cs
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace Meteor.World.Packets.Send
|
||||
{
|
||||
class _0x7Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x0007;
|
||||
public const uint PACKET_SIZE = 0x18;
|
||||
|
||||
public static SubPacket BuildPacket(uint actorID)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
binWriter.Write((UInt32)actorID);
|
||||
binWriter.Write((UInt32)Utils.UnixTimeStampUTC());
|
||||
}
|
||||
catch (Exception)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(false, OPCODE, 0, data);
|
||||
}
|
||||
}
|
||||
}
|
55
World Server/Packets/Send/_0x8PingPacket.cs
Normal file
55
World Server/Packets/Send/_0x8PingPacket.cs
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace Meteor.World.Packets.Send.Login
|
||||
{
|
||||
class _0x8PingPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x0008;
|
||||
public const uint PACKET_SIZE = 0x18;
|
||||
|
||||
public static SubPacket BuildPacket(uint actorID)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
binWriter.Write((UInt32)actorID);
|
||||
binWriter.Write((UInt32)Utils.UnixTimeStampUTC());
|
||||
}
|
||||
catch (Exception)
|
||||
{}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(false, OPCODE, 0, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class CreateLinkshellPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public string name;
|
||||
public ushort crestid;
|
||||
public uint master;
|
||||
|
||||
public CreateLinkshellPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
name = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
|
||||
crestid = binReader.ReadUInt16();
|
||||
master = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class CreateRelationPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public uint host;
|
||||
public uint guest;
|
||||
public uint command;
|
||||
|
||||
public CreateRelationPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
host = binReader.ReadUInt32();
|
||||
guest = binReader.ReadUInt32();
|
||||
command = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class DeleteLinkshellPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public string name;
|
||||
|
||||
public DeleteLinkshellPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
name = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class GetGroupPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public ulong groupId;
|
||||
|
||||
public GetGroupPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
groupId = binReader.ReadUInt64();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class GroupInviteResultPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public uint groupType;
|
||||
public uint result;
|
||||
|
||||
public GroupInviteResultPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
groupType = binReader.ReadUInt32();
|
||||
result = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class LinkshellChangePacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public string lsName;
|
||||
|
||||
public LinkshellChangePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
lsName = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class LinkshellInviteCancelPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public string lsName;
|
||||
public uint actorId;
|
||||
|
||||
public LinkshellInviteCancelPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class LinkshellInvitePacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public string lsName;
|
||||
public uint actorId;
|
||||
|
||||
public LinkshellInvitePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
actorId = binReader.ReadUInt32();
|
||||
lsName = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class LinkshellLeavePacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public bool isKicked;
|
||||
public string lsName;
|
||||
public string kickedName;
|
||||
|
||||
public LinkshellLeavePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
isKicked = binReader.ReadUInt16() == 1;
|
||||
kickedName = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
|
||||
lsName = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class LinkshellRankChangePacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public string name;
|
||||
public string lsName;
|
||||
public byte rank;
|
||||
|
||||
public LinkshellRankChangePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
name = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
|
||||
lsName = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
|
||||
rank = binReader.ReadByte();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class ModifyLinkshellPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public string currentName;
|
||||
public ushort argCode;
|
||||
public string name;
|
||||
public ushort crestid;
|
||||
public uint master;
|
||||
|
||||
public ModifyLinkshellPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
currentName = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
|
||||
argCode = binReader.ReadUInt16();
|
||||
|
||||
switch (argCode)
|
||||
{
|
||||
case 0:
|
||||
name = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
|
||||
break;
|
||||
case 1:
|
||||
crestid = binReader.ReadUInt16();
|
||||
break;
|
||||
case 2:
|
||||
master = binReader.ReadUInt32();
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class PartyInvitePacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public ushort command;
|
||||
public string name;
|
||||
public uint actorId;
|
||||
|
||||
public PartyInvitePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
command = binReader.ReadUInt16();
|
||||
|
||||
if (command == 1)
|
||||
actorId = binReader.ReadUInt32();
|
||||
else
|
||||
name = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class PartyLeavePacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public bool isDisband;
|
||||
|
||||
public PartyLeavePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
isDisband = binReader.ReadByte() == 1;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive.Group
|
||||
{
|
||||
class PartyModifyPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public const ushort MODIFY_LEADER = 0;
|
||||
public const ushort MODIFY_KICKPLAYER = 1;
|
||||
|
||||
public ushort command;
|
||||
public string name;
|
||||
public uint actorId;
|
||||
|
||||
public PartyModifyPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
command = binReader.ReadUInt16();
|
||||
|
||||
if (command >= 2)
|
||||
actorId = binReader.ReadUInt32();
|
||||
else
|
||||
name = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive
|
||||
{
|
||||
class SessionBeginConfirmPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public uint sessionId;
|
||||
public ushort errorCode;
|
||||
|
||||
public SessionBeginConfirmPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
sessionId = binReader.ReadUInt32();
|
||||
errorCode = binReader.ReadUInt16();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive
|
||||
{
|
||||
class SessionEndConfirmPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public uint sessionId;
|
||||
public ushort errorCode;
|
||||
public uint destinationZone;
|
||||
|
||||
public SessionEndConfirmPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
sessionId = binReader.ReadUInt32();
|
||||
errorCode = binReader.ReadUInt16();
|
||||
destinationZone = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Receive
|
||||
{
|
||||
class WorldRequestZoneChangePacket
|
||||
{
|
||||
public uint sessionId;
|
||||
public uint destinationZoneId;
|
||||
public byte destinationSpawnType;
|
||||
public float destinationX;
|
||||
public float destinationY;
|
||||
public float destinationZ;
|
||||
public float destinationRot;
|
||||
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public WorldRequestZoneChangePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
sessionId = binReader.ReadUInt32();
|
||||
destinationZoneId = binReader.ReadUInt32();
|
||||
destinationSpawnType = (byte)binReader.ReadUInt16();
|
||||
destinationX = binReader.ReadSingle();
|
||||
destinationY = binReader.ReadSingle();
|
||||
destinationZ = binReader.ReadSingle();
|
||||
destinationRot = binReader.ReadSingle();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
55
World Server/Packets/WorldPackets/Send/ErrorPacket.cs
Normal file
55
World Server/Packets/WorldPackets/Send/ErrorPacket.cs
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
using Meteor.World.DataObjects;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Send
|
||||
{
|
||||
class ErrorPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x100A;
|
||||
public const uint PACKET_SIZE = 0x24;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, uint errorCode)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
binWriter.Write((UInt32)errorCode);
|
||||
}
|
||||
catch (Exception)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(true, OPCODE, session.sessionId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
using Meteor.World.DataObjects;
|
||||
using Meteor.World.DataObjects.Group;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Send.Group
|
||||
{
|
||||
class PartySyncPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1020;
|
||||
public const uint PACKET_SIZE = 0x60;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, Party party)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt64)party.groupIndex);
|
||||
binWriter.Write((UInt32)party.GetLeader());
|
||||
binWriter.Write((UInt32)party.members.Count);
|
||||
for (int i = 0; i < party.members.Count; i++)
|
||||
binWriter.Write((UInt32)party.members[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(true, OPCODE, session.sessionId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
using Meteor.World.DataObjects;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Send
|
||||
{
|
||||
class LinkshellResultPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1025;
|
||||
public const uint PACKET_SIZE = 0x24;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, int result)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((Int32)result);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(true, OPCODE, session.sessionId, data);
|
||||
}
|
||||
}
|
||||
}
|
53
World Server/Packets/WorldPackets/Send/SessionBeginPacket.cs
Normal file
53
World Server/Packets/WorldPackets/Send/SessionBeginPacket.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
using Meteor.World.DataObjects;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Send
|
||||
{
|
||||
class SessionBeginPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1000;
|
||||
public const uint PACKET_SIZE = 0x24;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, bool isLogin)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
if (isLogin)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((Byte)1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(true, OPCODE, session.sessionId, data);
|
||||
}
|
||||
}
|
||||
}
|
81
World Server/Packets/WorldPackets/Send/SessionEndPacket.cs
Normal file
81
World Server/Packets/WorldPackets/Send/SessionEndPacket.cs
Normal file
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
using Meteor.World.DataObjects;
|
||||
|
||||
namespace Meteor.World.Packets.WorldPackets.Send
|
||||
{
|
||||
class SessionEndPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1001;
|
||||
public const uint PACKET_SIZE = 0x38;
|
||||
|
||||
public static SubPacket BuildPacket(Session session)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
binWriter.Write((UInt32)0);
|
||||
}
|
||||
catch (Exception)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(true, OPCODE, session.sessionId, data);
|
||||
}
|
||||
|
||||
public static SubPacket BuildPacket(Session session, uint destinationZoneId, string destinationPrivateArea, byte spawnType, float spawnX, float spawnY, float spawnZ, float spawnRotation)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
binWriter.Write((UInt32)destinationZoneId);
|
||||
binWriter.Write((UInt16)spawnType);
|
||||
binWriter.Write((Single)spawnX);
|
||||
binWriter.Write((Single)spawnY);
|
||||
binWriter.Write((Single)spawnZ);
|
||||
binWriter.Write((Single)spawnRotation);
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(true, OPCODE, session.sessionId, data);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue