Updated Map Server namespace. Moved all other data folders (www and sql) to data folder. Renamed boot name to Project Meteor.

This commit is contained in:
Filip Maj
2019-06-19 01:10:15 -04:00
parent 18ef69f3d1
commit 91549bff7a
1823 changed files with 102704 additions and 901 deletions

View File

@@ -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.IO;
using System.Text;
using Meteor.Common;
namespace Meteor.Map.packets.send.social
{
class BlacklistAddedPacket
{
public const ushort OPCODE = 0x01C9;
public const uint PACKET_SIZE = 0x048;
public static SubPacket BuildPacket(uint sourceActorId, bool isSuccess, string nameToAdd)
{
byte[] data = new byte[PACKET_SIZE - 0x20];
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryWriter binWriter = new BinaryWriter(mem))
{
binWriter.Write((byte)(isSuccess ? 1 : 0));
binWriter.Write(Encoding.ASCII.GetBytes(nameToAdd), 0, Encoding.ASCII.GetByteCount(nameToAdd) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(nameToAdd));
}
}
return new SubPacket(OPCODE, sourceActorId, data);
}
}
}

View File

@@ -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.IO;
using System.Text;
using Meteor.Common;
namespace Meteor.Map.packets.send.social
{
class BlacklistRemovedPacket
{
public const ushort OPCODE = 0x01CA;
public const uint PACKET_SIZE = 0x048;
public static SubPacket BuildPacket(uint sourceActorId, bool isSuccess, string nameToRemove)
{
byte[] data = new byte[PACKET_SIZE - 0x20];
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryWriter binWriter = new BinaryWriter(mem))
{
binWriter.Write((byte)(isSuccess ? 1 : 0));
binWriter.Write(Encoding.ASCII.GetBytes(nameToRemove), 0, Encoding.ASCII.GetByteCount(nameToRemove) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(nameToRemove));
}
}
return new SubPacket(OPCODE, sourceActorId, data);
}
}
}

View File

@@ -0,0 +1,69 @@
/*
===========================================================================
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.Map.packets.send.social
{
class FriendStatusPacket
{
public const ushort OPCODE = 0x01CF;
public const uint PACKET_SIZE = 0x686;
public static SubPacket BuildPacket(uint sourceActorId, Tuple<long, bool>[] friendStatus)
{
byte[] data = new byte[PACKET_SIZE - 0x20];
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryWriter binWriter = new BinaryWriter(mem))
{
binWriter.Write((UInt32)0);
int max;
if (friendStatus != null)
{
if (friendStatus.Length <= 200)
max = friendStatus.Length;
else
max = 200;
}
else
max = 0;
binWriter.Write((UInt32)max);
for (int i = 0; i < max; i++)
{
binWriter.Write((UInt64)friendStatus[i].Item1);
binWriter.Write((UInt64)(friendStatus[i].Item2 ? 1 : 0));
}
}
}
return new SubPacket(OPCODE, sourceActorId, data);
}
}
}

View 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 System.Text;
using Meteor.Common;
namespace Meteor.Map.packets.send.social
{
class FriendlistAddedPacket
{
public const ushort OPCODE = 0x01CC;
public const uint PACKET_SIZE = 0x067;
public static SubPacket BuildPacket(uint sourceActorId, bool isSuccess, long id, bool isOnline, string nameToAdd)
{
byte[] data = new byte[PACKET_SIZE - 0x20];
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryWriter binWriter = new BinaryWriter(mem))
{
binWriter.Write((UInt64)id);
binWriter.Write((byte)(isOnline ? 1 : 0));
binWriter.Write((byte)(isSuccess ? 1 : 0));
binWriter.Write(Encoding.ASCII.GetBytes(nameToAdd), 0, Encoding.ASCII.GetByteCount(nameToAdd) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(nameToAdd));
}
}
return new SubPacket(OPCODE, sourceActorId, data);
}
}
}

View File

@@ -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.IO;
using System.Text;
using Meteor.Common;
namespace Meteor.Map.packets.send.social
{
class FriendlistRemovedPacket
{
public const ushort OPCODE = 0x01CD;
public const uint PACKET_SIZE = 0x057;
public static SubPacket BuildPacket(uint sourceActorId, bool isSuccess, string nameToRemove)
{
byte[] data = new byte[PACKET_SIZE - 0x20];
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryWriter binWriter = new BinaryWriter(mem))
{
binWriter.Write((byte)(isSuccess ? 1 : 0));
binWriter.Write(Encoding.ASCII.GetBytes(nameToRemove), 0, Encoding.ASCII.GetByteCount(nameToRemove) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(nameToRemove));
}
}
return new SubPacket(OPCODE, sourceActorId, data);
}
}
}

View 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;
using Meteor.Common;
namespace Meteor.Map.packets.send.social
{
class SendBlacklistPacket
{
public const ushort OPCODE = 0x01CB;
public const uint PACKET_SIZE = 0x686;
public static SubPacket BuildPacket(uint sourceActorId, string[] blacklistedNames, ref int offset)
{
byte[] data = new byte[PACKET_SIZE - 0x20];
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryWriter binWriter = new BinaryWriter(mem))
{
binWriter.Write((UInt32)0);
int max;
if (blacklistedNames.Length - offset <= 0x32)
max = blacklistedNames.Length - offset;
else
max = 0x32;
binWriter.Write((UInt32)max);
for (int i = 0; i < max; i++ )
binWriter.Write(Encoding.ASCII.GetBytes(blacklistedNames[i]), 0, Encoding.ASCII.GetByteCount(blacklistedNames[i]) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(blacklistedNames[i]));
offset += max;
}
}
return new SubPacket(OPCODE, sourceActorId, data);
}
}
}

View File

@@ -0,0 +1,66 @@
/*
===========================================================================
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.Map.packets.send.social
{
class SendFriendlistPacket
{
public const ushort OPCODE = 0x01CE;
public const uint PACKET_SIZE = 0x686;
public static SubPacket BuildPacket(uint sourceActorId, Tuple<long, string>[] friends, ref int offset)
{
byte[] data = new byte[PACKET_SIZE - 0x20];
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryWriter binWriter = new BinaryWriter(mem))
{
binWriter.Write((UInt32)0);
int max;
if (friends.Length - offset <= 0x32)
max = friends.Length - offset;
else
max = 0x32;
binWriter.Write((UInt32)max);
for (int i = 0; i < max; i++)
{
binWriter.Write(Encoding.ASCII.GetBytes(friends[i].Item2), 0, Encoding.ASCII.GetByteCount(friends[i].Item2) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(friends[i].Item2));
binWriter.Write((UInt64)friends[i].Item1);
}
offset += max;
}
}
return new SubPacket(OPCODE, sourceActorId, data);
}
}
}