mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-20 09:35:56 +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
31
Lobby Server/DataObjects/Account.cs
Normal file
31
Lobby Server/DataObjects/Account.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
===========================================================================
|
||||
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;
|
||||
|
||||
namespace Meteor.Lobby.DataObjects
|
||||
{
|
||||
class Account
|
||||
{
|
||||
public UInt32 id;
|
||||
public string name;
|
||||
}
|
||||
}
|
65
Lobby Server/DataObjects/Appearance.cs
Normal file
65
Lobby Server/DataObjects/Appearance.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/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
namespace Meteor.Lobby.DataObjects
|
||||
{
|
||||
class Appearance
|
||||
{
|
||||
////////////
|
||||
//Chara Info
|
||||
public byte size = 0;
|
||||
public byte voice = 0;
|
||||
public ushort skinColor = 0;
|
||||
|
||||
public ushort hairStyle = 0;
|
||||
public ushort hairColor = 0;
|
||||
public ushort hairHighlightColor = 0;
|
||||
public ushort hairVariation = 0;
|
||||
public ushort eyeColor = 0;
|
||||
public byte characteristicsColor = 0;
|
||||
|
||||
public byte faceType = 0;
|
||||
public byte faceEyebrows = 0;
|
||||
public byte faceEyeShape = 0;
|
||||
public byte faceIrisSize = 0;
|
||||
public byte faceNose = 0;
|
||||
public byte faceMouth = 0;
|
||||
public byte faceFeatures = 0;
|
||||
public byte characteristics = 0;
|
||||
public byte ears = 0;
|
||||
|
||||
public uint mainHand = 0;
|
||||
public uint offHand = 0;
|
||||
|
||||
public uint head = 0;
|
||||
public uint body = 0;
|
||||
public uint legs = 0;
|
||||
public uint hands = 0;
|
||||
public uint feet = 0;
|
||||
public uint waist = 0;
|
||||
public uint rightEar = 0;
|
||||
public uint leftEar = 0;
|
||||
public uint rightFinger = 0;
|
||||
public uint leftFinger = 0;
|
||||
//Chara Info
|
||||
////////////
|
||||
}
|
||||
}
|
305
Lobby Server/DataObjects/CharaInfo.cs
Normal file
305
Lobby Server/DataObjects/CharaInfo.cs
Normal file
|
@ -0,0 +1,305 @@
|
|||
/*
|
||||
===========================================================================
|
||||
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.Lobby.DataObjects
|
||||
{
|
||||
class CharaInfo
|
||||
{
|
||||
public Appearance appearance;
|
||||
|
||||
public struct FaceInfo
|
||||
{
|
||||
[BitfieldLength(5)]
|
||||
public uint characteristics;
|
||||
[BitfieldLength(3)]
|
||||
public uint characteristicsColor;
|
||||
[BitfieldLength(6)]
|
||||
public uint type;
|
||||
[BitfieldLength(2)]
|
||||
public uint ears;
|
||||
[BitfieldLength(2)]
|
||||
public uint mouth;
|
||||
[BitfieldLength(2)]
|
||||
public uint features;
|
||||
[BitfieldLength(3)]
|
||||
public uint nose;
|
||||
[BitfieldLength(3)]
|
||||
public uint eyeShape;
|
||||
[BitfieldLength(1)]
|
||||
public uint irisSize;
|
||||
[BitfieldLength(3)]
|
||||
public uint eyebrows;
|
||||
[BitfieldLength(2)]
|
||||
public uint unknown;
|
||||
}
|
||||
|
||||
public uint guardian = 0;
|
||||
public uint birthMonth = 0;
|
||||
public uint birthDay = 0;
|
||||
public uint currentClass = 0;
|
||||
public uint currentJob = 0;
|
||||
public uint initialTown = 0;
|
||||
public uint tribe = 0;
|
||||
|
||||
public ushort zoneId;
|
||||
public float x, y, z, rot;
|
||||
|
||||
public uint currentLevel = 1;
|
||||
|
||||
public uint weapon1;
|
||||
public uint weapon2;
|
||||
public uint head;
|
||||
public uint body;
|
||||
public uint hands;
|
||||
public uint legs;
|
||||
public uint feet;
|
||||
public uint belt;
|
||||
|
||||
public static CharaInfo GetFromNewCharRequest(String encoded)
|
||||
{
|
||||
byte[] data = Convert.FromBase64String(encoded.Replace('-', '+').Replace('_', '/'));
|
||||
|
||||
CharaInfo info = new CharaInfo();
|
||||
Appearance appearance = new Appearance();
|
||||
|
||||
using (MemoryStream stream = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader reader = new BinaryReader(stream))
|
||||
{
|
||||
uint version = reader.ReadUInt32();
|
||||
uint unknown1 = reader.ReadUInt32();
|
||||
info.tribe = reader.ReadByte();
|
||||
appearance.size = reader.ReadByte();
|
||||
appearance.hairStyle = reader.ReadUInt16();
|
||||
appearance.hairHighlightColor = reader.ReadByte();
|
||||
appearance.hairVariation = reader.ReadByte();
|
||||
appearance.faceType = reader.ReadByte();
|
||||
appearance.characteristics = reader.ReadByte();
|
||||
appearance.characteristicsColor = reader.ReadByte();
|
||||
|
||||
reader.ReadUInt32();
|
||||
|
||||
appearance.faceEyebrows = reader.ReadByte();
|
||||
appearance.faceIrisSize = reader.ReadByte();
|
||||
appearance.faceEyeShape = reader.ReadByte();
|
||||
appearance.faceNose = reader.ReadByte();
|
||||
appearance.faceFeatures = reader.ReadByte();
|
||||
appearance.faceMouth = reader.ReadByte();
|
||||
appearance.ears = reader.ReadByte();
|
||||
appearance.hairColor = reader.ReadUInt16();
|
||||
|
||||
reader.ReadUInt32();
|
||||
|
||||
appearance.skinColor = reader.ReadUInt16();
|
||||
appearance.eyeColor = reader.ReadUInt16();
|
||||
|
||||
appearance.voice = reader.ReadByte();
|
||||
info.guardian = reader.ReadByte();
|
||||
info.birthMonth = reader.ReadByte();
|
||||
info.birthDay = reader.ReadByte();
|
||||
info.currentClass = reader.ReadUInt16();
|
||||
|
||||
reader.ReadUInt32();
|
||||
reader.ReadUInt32();
|
||||
reader.ReadUInt32();
|
||||
|
||||
reader.BaseStream.Seek(0x10, SeekOrigin.Current);
|
||||
|
||||
info.initialTown = reader.ReadByte();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
info.appearance = appearance;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
public static String BuildForCharaList(Character chara, Appearance appearance)
|
||||
{
|
||||
byte[] data;
|
||||
|
||||
using (MemoryStream stream = new MemoryStream())
|
||||
{
|
||||
using (BinaryWriter writer = new BinaryWriter(stream))
|
||||
{
|
||||
//Build faceinfo for later
|
||||
FaceInfo faceInfo = new FaceInfo();
|
||||
faceInfo.characteristics = appearance.characteristics;
|
||||
faceInfo.characteristicsColor = appearance.characteristicsColor;
|
||||
faceInfo.type = appearance.faceType;
|
||||
faceInfo.ears = appearance.ears;
|
||||
faceInfo.features = appearance.faceFeatures;
|
||||
faceInfo.eyebrows = appearance.faceEyebrows;
|
||||
faceInfo.eyeShape = appearance.faceEyeShape;
|
||||
faceInfo.irisSize = appearance.faceIrisSize;
|
||||
faceInfo.mouth = appearance.faceMouth;
|
||||
faceInfo.nose = appearance.faceNose;
|
||||
|
||||
string location1 = "prv0Inn01\0";
|
||||
string location2 = "defaultTerritory\0";
|
||||
|
||||
writer.Write((UInt32)0x000004c0);
|
||||
writer.Write((UInt32)0x232327ea);
|
||||
writer.Write((UInt32)System.Text.Encoding.UTF8.GetBytes(chara.name + '\0').Length);
|
||||
writer.Write(System.Text.Encoding.UTF8.GetBytes(chara.name + '\0'));
|
||||
writer.Write((UInt32)0x1c);
|
||||
writer.Write((UInt32)0x04);
|
||||
writer.Write((UInt32)GetTribeModel(chara.tribe));
|
||||
writer.Write((UInt32)appearance.size);
|
||||
uint colorVal = appearance.skinColor | (uint)(appearance.hairColor << 10) | (uint)(appearance.eyeColor << 20);
|
||||
writer.Write((UInt32)colorVal);
|
||||
|
||||
var bitfield = PrimitiveConversion.ToUInt32(faceInfo);
|
||||
|
||||
writer.Write((UInt32)bitfield); //FACE, Figure this out!
|
||||
uint hairVal = appearance.hairHighlightColor | (uint)(appearance.hairStyle << 10) | (uint)(appearance.characteristicsColor << 20);
|
||||
writer.Write((UInt32)hairVal);
|
||||
writer.Write((UInt32)appearance.voice);
|
||||
writer.Write((UInt32)appearance.mainHand);
|
||||
writer.Write((UInt32)appearance.offHand);
|
||||
|
||||
writer.Write((UInt32)0);
|
||||
writer.Write((UInt32)0);
|
||||
writer.Write((UInt32)0);
|
||||
writer.Write((UInt32)0);
|
||||
writer.Write((UInt32)0);
|
||||
|
||||
writer.Write((UInt32)appearance.head);
|
||||
writer.Write((UInt32)appearance.body);
|
||||
writer.Write((UInt32)appearance.legs);
|
||||
writer.Write((UInt32)appearance.hands);
|
||||
writer.Write((UInt32)appearance.feet);
|
||||
writer.Write((UInt32)appearance.waist);
|
||||
|
||||
writer.Write((UInt32)0);
|
||||
|
||||
writer.Write((UInt32)appearance.rightEar);
|
||||
writer.Write((UInt32)appearance.leftEar);
|
||||
|
||||
writer.Write((UInt32)0);
|
||||
writer.Write((UInt32)0);
|
||||
|
||||
writer.Write((UInt32)appearance.rightFinger);
|
||||
writer.Write((UInt32)appearance.leftFinger);
|
||||
|
||||
for (int i = 0; i < 0x8; i++)
|
||||
writer.Write((byte)0);
|
||||
|
||||
writer.Write((UInt32)1);
|
||||
writer.Write((UInt32)1);
|
||||
|
||||
writer.Write((byte)chara.currentClass);
|
||||
writer.Write((UInt16)chara.currentLevel);
|
||||
writer.Write((byte)chara.currentJob);
|
||||
writer.Write((UInt16)1);
|
||||
writer.Write((byte)chara.tribe);
|
||||
|
||||
writer.Write((UInt32)0xe22222aa);
|
||||
|
||||
writer.Write((UInt32)System.Text.Encoding.UTF8.GetBytes(location1).Length);
|
||||
writer.Write(System.Text.Encoding.UTF8.GetBytes(location1));
|
||||
writer.Write((UInt32)System.Text.Encoding.UTF8.GetBytes(location2).Length);
|
||||
writer.Write(System.Text.Encoding.UTF8.GetBytes(location2));
|
||||
|
||||
writer.Write((byte)chara.guardian);
|
||||
writer.Write((byte)chara.birthMonth);
|
||||
writer.Write((byte)chara.birthDay);
|
||||
|
||||
writer.Write((UInt16)0x17);
|
||||
writer.Write((UInt32)4);
|
||||
writer.Write((UInt32)4);
|
||||
|
||||
writer.BaseStream.Seek(0x10, SeekOrigin.Current);
|
||||
|
||||
writer.Write((UInt32)chara.initialTown);
|
||||
writer.Write((UInt32)chara.initialTown);
|
||||
}
|
||||
|
||||
data = stream.GetBuffer();
|
||||
}
|
||||
|
||||
return Convert.ToBase64String(data).Replace('+', '-').Replace('/', '_');
|
||||
}
|
||||
|
||||
public static String Debug()
|
||||
{
|
||||
byte[] bytes = File.ReadAllBytes("./packets/charaappearance.bin");
|
||||
|
||||
Program.Log.Debug(Common.Utils.ByteArrayToHex(bytes));
|
||||
|
||||
return Convert.ToBase64String(bytes).Replace('+', '-').Replace('/', '_');
|
||||
}
|
||||
|
||||
public static UInt32 GetTribeModel(byte tribe)
|
||||
{
|
||||
switch (tribe)
|
||||
{
|
||||
//Hyur Midlander Male
|
||||
case 1:
|
||||
default:
|
||||
return 1;
|
||||
|
||||
//Hyur Midlander Female
|
||||
case 2:
|
||||
return 2;
|
||||
|
||||
//Elezen Male
|
||||
case 4:
|
||||
case 6:
|
||||
return 3;
|
||||
|
||||
//Elezen Female
|
||||
case 5:
|
||||
case 7:
|
||||
return 4;
|
||||
|
||||
//Lalafell Male
|
||||
case 8:
|
||||
case 10:
|
||||
return 5;
|
||||
|
||||
//Lalafell Female
|
||||
case 9:
|
||||
case 11:
|
||||
return 6;
|
||||
|
||||
//Miqo'te Female
|
||||
case 12:
|
||||
case 13:
|
||||
return 8;
|
||||
|
||||
//Roegadyn Male
|
||||
case 14:
|
||||
case 15:
|
||||
return 7;
|
||||
|
||||
//Hyur Highlander Male
|
||||
case 3:
|
||||
return 9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
64
Lobby Server/DataObjects/Character.cs
Normal file
64
Lobby Server/DataObjects/Character.cs
Normal file
|
@ -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;
|
||||
|
||||
namespace Meteor.Lobby.DataObjects
|
||||
{
|
||||
class Character
|
||||
{
|
||||
public uint id;
|
||||
public ushort slot;
|
||||
public ushort serverId;
|
||||
public string name;
|
||||
public ushort state;
|
||||
public string charaInfo;
|
||||
public bool isLegacy;
|
||||
public bool doRename;
|
||||
public uint currentZoneId;
|
||||
|
||||
public byte guardian;
|
||||
public byte birthMonth;
|
||||
public byte birthDay;
|
||||
|
||||
public uint currentClass = 3;
|
||||
public uint currentJob = 0;
|
||||
public int currentLevel = 1;
|
||||
|
||||
public byte initialTown;
|
||||
public byte tribe;
|
||||
|
||||
public static CharaInfo EncodedToCharacter(String charaInfo)
|
||||
{
|
||||
charaInfo.Replace("+", "-");
|
||||
charaInfo.Replace("/", "_");
|
||||
byte[] data = System.Convert.FromBase64String(charaInfo);
|
||||
|
||||
Program.Log.Debug("------------Base64 printout------------------");
|
||||
Program.Log.Debug(Common.Utils.ByteArrayToHex(data));
|
||||
Program.Log.Debug("------------Base64 printout------------------");
|
||||
|
||||
CharaInfo chara = new CharaInfo();
|
||||
|
||||
return chara;
|
||||
}
|
||||
}
|
||||
}
|
39
Lobby Server/DataObjects/Retainer.cs
Normal file
39
Lobby Server/DataObjects/Retainer.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
===========================================================================
|
||||
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.Lobby.DataObjects
|
||||
{
|
||||
class Retainer
|
||||
{
|
||||
public readonly uint id;
|
||||
public readonly uint characterId;
|
||||
public readonly string name;
|
||||
public readonly bool doRename;
|
||||
|
||||
public Retainer(uint characterId, uint retainerId, string name, bool doRename)
|
||||
{
|
||||
this.id = retainerId;
|
||||
this.characterId = characterId;
|
||||
this.name = name;
|
||||
this.doRename = doRename;
|
||||
}
|
||||
}
|
||||
}
|
52
Lobby Server/DataObjects/World.cs
Normal file
52
Lobby Server/DataObjects/World.cs
Normal file
|
@ -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/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
namespace Meteor.Lobby.DataObjects
|
||||
{
|
||||
class World
|
||||
{
|
||||
public readonly ushort id;
|
||||
public readonly string address;
|
||||
public readonly ushort port;
|
||||
public readonly ushort listPosition;
|
||||
public readonly ushort population;
|
||||
public readonly string name;
|
||||
public readonly bool isActive;
|
||||
|
||||
public World(
|
||||
ushort id,
|
||||
string address,
|
||||
ushort port,
|
||||
ushort listPosition,
|
||||
ushort population,
|
||||
string name,
|
||||
bool isActive)
|
||||
{
|
||||
this.id = id;
|
||||
this.address = address;
|
||||
this.port = port;
|
||||
this.listPosition = listPosition;
|
||||
this.population = population;
|
||||
this.name = name;
|
||||
this.isActive = isActive;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue