mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-02 19:42:05 -04:00
Removed old db stuff.
This commit is contained in:
parent
625ee299f7
commit
bea796ec85
@ -1,5 +1,4 @@
|
|||||||
using FFXIVClassic_Lobby_Server.dataobjects;
|
using MySql.Data.MySqlClient;
|
||||||
using MySql.Data.MySqlClient;
|
|
||||||
using Dapper;
|
using Dapper;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
@ -8,12 +7,12 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using FFXIVClassic_Lobby_Server.common;
|
using FFXIVClassic_Lobby_Server.common;
|
||||||
using FFXIVClassic_Map_Server.dataobjects.database;
|
|
||||||
using FFXIVClassic_Map_Server.dataobjects.chara.npc;
|
using FFXIVClassic_Map_Server.dataobjects.chara.npc;
|
||||||
using FFXIVClassic_Map_Server.dataobjects.chara;
|
using FFXIVClassic_Map_Server.dataobjects.chara;
|
||||||
using FFXIVClassic_Map_Server.utils;
|
using FFXIVClassic_Map_Server.utils;
|
||||||
using FFXIVClassic_Lobby_Server.packets;
|
using FFXIVClassic_Lobby_Server.packets;
|
||||||
using FFXIVClassic_Map_Server.packets.send.player;
|
using FFXIVClassic_Map_Server.packets.send.player;
|
||||||
|
using FFXIVClassic_Lobby_Server.dataobjects;
|
||||||
|
|
||||||
namespace FFXIVClassic_Lobby_Server
|
namespace FFXIVClassic_Lobby_Server
|
||||||
{
|
{
|
||||||
@ -70,76 +69,6 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DBCharacter getCharacter(uint charId)
|
|
||||||
{
|
|
||||||
using (var conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
|
|
||||||
{
|
|
||||||
DBCharacter chara = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
conn.Open();
|
|
||||||
chara = conn.Query<DBCharacter>("SELECT * FROM characters WHERE id=@CharaId", new { CharaId = charId }).SingleOrDefault();
|
|
||||||
}
|
|
||||||
catch (MySqlException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
conn.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
return chara;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static DBAppearance getAppearance(bool loadFromPlayerTable, uint charaId)
|
|
||||||
{
|
|
||||||
using (var conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
|
|
||||||
{
|
|
||||||
DBAppearance appearance = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
conn.Open();
|
|
||||||
|
|
||||||
if (loadFromPlayerTable)
|
|
||||||
appearance = conn.Query<DBAppearance>("SELECT * FROM characters_appearance WHERE characterId=@CharaId", new { CharaId = charaId }).SingleOrDefault();
|
|
||||||
else
|
|
||||||
appearance = conn.Query<DBAppearance>("SELECT * FROM npc_appearance WHERE npcId=@CharaId", new { CharaId = charaId }).SingleOrDefault();
|
|
||||||
}
|
|
||||||
catch (MySqlException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
conn.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
return appearance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static DBStats getCharacterStats(uint charaId)
|
|
||||||
{
|
|
||||||
using (var conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
|
|
||||||
{
|
|
||||||
DBStats stats = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
conn.Open();
|
|
||||||
stats = conn.Query<DBStats>("SELECT * FROM characters_stats WHERE characterId=@CharaId", new { CharaId = charaId }).SingleOrDefault();
|
|
||||||
}
|
|
||||||
catch (MySqlException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
conn.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
return stats;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<Npc> getNpcList()
|
public static List<Npc> getNpcList()
|
||||||
{
|
{
|
||||||
using (var conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
|
using (var conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
|
||||||
|
@ -85,17 +85,10 @@
|
|||||||
<Compile Include="actors\chara\ParameterTemp.cs" />
|
<Compile Include="actors\chara\ParameterTemp.cs" />
|
||||||
<Compile Include="actors\chara\player\Player.cs" />
|
<Compile Include="actors\chara\player\Player.cs" />
|
||||||
<Compile Include="actors\command\Command.cs" />
|
<Compile Include="actors\command\Command.cs" />
|
||||||
<Compile Include="dataobjects\CharaInfo.cs" />
|
|
||||||
<Compile Include="actors\chara\CharaWork.cs" />
|
<Compile Include="actors\chara\CharaWork.cs" />
|
||||||
<Compile Include="actors\chara\ParameterSave.cs" />
|
<Compile Include="actors\chara\ParameterSave.cs" />
|
||||||
<Compile Include="actors\chara\player\PlayerWork.cs" />
|
<Compile Include="actors\chara\player\PlayerWork.cs" />
|
||||||
<Compile Include="dataobjects\database\DBAppearance.cs" />
|
<Compile Include="dataobjects\DBWorld.cs" />
|
||||||
<Compile Include="dataobjects\database\DBCharacter.cs" />
|
|
||||||
<Compile Include="dataobjects\database\DBCommands.cs" />
|
|
||||||
<Compile Include="dataobjects\database\DBJournal.cs" />
|
|
||||||
<Compile Include="dataobjects\database\DBPlayerData.cs" />
|
|
||||||
<Compile Include="dataobjects\database\DBStats.cs" />
|
|
||||||
<Compile Include="dataobjects\database\DBWorld.cs" />
|
|
||||||
<Compile Include="dataobjects\Item.cs" />
|
<Compile Include="dataobjects\Item.cs" />
|
||||||
<Compile Include="dataobjects\ConnectedPlayer.cs" />
|
<Compile Include="dataobjects\ConnectedPlayer.cs" />
|
||||||
<Compile Include="dataobjects\RecruitmentDetails.cs" />
|
<Compile Include="dataobjects\RecruitmentDetails.cs" />
|
||||||
@ -210,6 +203,7 @@
|
|||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="lua\LuaUtils.cs" />
|
<Compile Include="lua\LuaUtils.cs" />
|
||||||
<Compile Include="Server.cs" />
|
<Compile Include="Server.cs" />
|
||||||
|
<Compile Include="utils\ActorPropertyPacketUtil.cs" />
|
||||||
<Compile Include="utils\CharacterUtils.cs" />
|
<Compile Include="utils\CharacterUtils.cs" />
|
||||||
<Compile Include="Zone.cs" />
|
<Compile Include="Zone.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -6,8 +6,8 @@ using FFXIVClassic_Lobby_Server.common;
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using MySql.Data.MySqlClient;
|
using MySql.Data.MySqlClient;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using FFXIVClassic_Lobby_Server.dataobjects;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using FFXIVClassic_Lobby_Server.dataobjects;
|
||||||
|
|
||||||
namespace FFXIVClassic_Lobby_Server
|
namespace FFXIVClassic_Lobby_Server
|
||||||
{
|
{
|
||||||
|
@ -226,7 +226,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
|
|
||||||
public void testCodePacket(uint id, uint value, string target)
|
public void testCodePacket(uint id, uint value, string target)
|
||||||
{
|
{
|
||||||
SetActorPropetyPacket changeProperty = new SetActorPropetyPacket();
|
SetActorPropetyPacket changeProperty = new SetActorPropetyPacket(target);
|
||||||
changeProperty.addInt(id, value);
|
changeProperty.addInt(id, value);
|
||||||
changeProperty.setTarget(target);
|
changeProperty.setTarget(target);
|
||||||
|
|
||||||
@ -250,7 +250,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
{
|
{
|
||||||
foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList)
|
foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList)
|
||||||
{
|
{
|
||||||
SetActorPropetyPacket changeProperty = new SetActorPropetyPacket();
|
SetActorPropetyPacket changeProperty = new SetActorPropetyPacket(target);
|
||||||
changeProperty.addProperty(entry.Value.getActor(), name);
|
changeProperty.addProperty(entry.Value.getActor(), name);
|
||||||
changeProperty.addProperty(entry.Value.getActor(), "charaWork.parameterSave.hpMax[0]");
|
changeProperty.addProperty(entry.Value.getActor(), "charaWork.parameterSave.hpMax[0]");
|
||||||
changeProperty.setTarget(target);
|
changeProperty.setTarget(target);
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
using FFXIVClassic_Lobby_Server;
|
using FFXIVClassic_Lobby_Server;
|
||||||
using FFXIVClassic_Lobby_Server.common;
|
using FFXIVClassic_Lobby_Server.common;
|
||||||
using FFXIVClassic_Lobby_Server.dataobjects;
|
|
||||||
using FFXIVClassic_Lobby_Server.packets;
|
using FFXIVClassic_Lobby_Server.packets;
|
||||||
using FFXIVClassic_Map_Server.dataobjects.chara;
|
using FFXIVClassic_Map_Server.dataobjects.chara;
|
||||||
using FFXIVClassic_Map_Server.lua;
|
using FFXIVClassic_Map_Server.lua;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
using FFXIVClassic_Lobby_Server;
|
using FFXIVClassic_Lobby_Server;
|
||||||
using FFXIVClassic_Lobby_Server.common;
|
using FFXIVClassic_Lobby_Server.common;
|
||||||
using FFXIVClassic_Lobby_Server.dataobjects;
|
|
||||||
using FFXIVClassic_Lobby_Server.packets;
|
using FFXIVClassic_Lobby_Server.packets;
|
||||||
using FFXIVClassic_Map_Server.lua;
|
using FFXIVClassic_Map_Server.lua;
|
||||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||||
@ -29,36 +28,7 @@ namespace FFXIVClassic_Map_Server.dataobjects.chara.npc
|
|||||||
|
|
||||||
if (initParams.Length != 0)
|
if (initParams.Length != 0)
|
||||||
this.classParams = LuaUtils.readLuaParams(initParams);
|
this.classParams = LuaUtils.readLuaParams(initParams);
|
||||||
|
|
||||||
setPlayerAppearance();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPlayerAppearance()
|
|
||||||
{
|
|
||||||
DBAppearance appearance = Database.getAppearance(false, actorId);
|
|
||||||
|
|
||||||
if (appearance == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
modelID = DBAppearance.getTribeModel(appearance.tribe);
|
|
||||||
appearanceIDs[SIZE] = appearance.size;
|
|
||||||
appearanceIDs[COLORINFO] = (uint)(appearance.skinColor | (appearance.hairColor << 10) | (appearance.eyeColor << 20));
|
|
||||||
appearanceIDs[FACEINFO] = PrimitiveConversion.ToUInt32(appearance.getFaceInfo());
|
|
||||||
appearanceIDs[HIGHLIGHT_HAIR] = (uint)(appearance.hairHighlightColor | appearance.hairStyle << 10);
|
|
||||||
appearanceIDs[VOICE] = appearance.voice;
|
|
||||||
appearanceIDs[WEAPON1] = appearance.mainHand;
|
|
||||||
appearanceIDs[WEAPON2] = appearance.offHand;
|
|
||||||
appearanceIDs[HEADGEAR] = appearance.head;
|
|
||||||
appearanceIDs[BODYGEAR] = appearance.body;
|
|
||||||
appearanceIDs[LEGSGEAR] = appearance.legs;
|
|
||||||
appearanceIDs[HANDSGEAR] = appearance.hands;
|
|
||||||
appearanceIDs[FEETGEAR] = appearance.feet;
|
|
||||||
appearanceIDs[WAISTGEAR] = appearance.waist;
|
|
||||||
appearanceIDs[R_EAR] = appearance.rightEar;
|
|
||||||
appearanceIDs[L_EAR] = appearance.leftEar;
|
|
||||||
appearanceIDs[R_FINGER] = appearance.rightFinger;
|
|
||||||
appearanceIDs[L_FINGER] = appearance.leftFinger;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override SubPacket createScriptBindPacket(uint playerActorId)
|
public override SubPacket createScriptBindPacket(uint playerActorId)
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
using FFXIVClassic_Lobby_Server;
|
using FFXIVClassic_Lobby_Server;
|
||||||
using FFXIVClassic_Lobby_Server.common;
|
using FFXIVClassic_Lobby_Server.common;
|
||||||
using FFXIVClassic_Lobby_Server.dataobjects;
|
|
||||||
using FFXIVClassic_Lobby_Server.packets;
|
using FFXIVClassic_Lobby_Server.packets;
|
||||||
using FFXIVClassic_Map_Server.dataobjects.database;
|
|
||||||
using FFXIVClassic_Map_Server.lua;
|
using FFXIVClassic_Map_Server.lua;
|
||||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||||
using FFXIVClassic_Map_Server.utils;
|
using FFXIVClassic_Map_Server.utils;
|
||||||
|
@ -1,314 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using FFXIVClassic_Lobby_Server.common;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace FFXIVClassic_Lobby_Server.dataobjects
|
|
||||||
{
|
|
||||||
class CharaInfo
|
|
||||||
{
|
|
||||||
public uint tribe = 0;
|
|
||||||
public uint size = 0;
|
|
||||||
public uint voice = 0;
|
|
||||||
public ushort skinColor = 0;
|
|
||||||
|
|
||||||
public ushort hairStyle = 0;
|
|
||||||
public ushort hairColor = 0;
|
|
||||||
public ushort hairHighlightColor = 0;
|
|
||||||
public ushort eyeColor = 0;
|
|
||||||
public ushort characteristicsColor = 0;
|
|
||||||
|
|
||||||
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 faceType = 0;
|
|
||||||
public uint faceEyebrows = 0;
|
|
||||||
public uint faceEyeShape = 0;
|
|
||||||
public uint faceIrisSize = 0;
|
|
||||||
public uint faceNose = 0;
|
|
||||||
public uint faceMouth = 0;
|
|
||||||
public uint faceFeatures = 0;
|
|
||||||
public uint characteristics = 0;
|
|
||||||
public uint ears = 0;
|
|
||||||
|
|
||||||
public uint guardian = 0;
|
|
||||||
public uint birthMonth = 0;
|
|
||||||
public uint birthDay = 0;
|
|
||||||
public uint currentClass = 0;
|
|
||||||
public uint currentJob = 0;
|
|
||||||
public uint allegiance = 0;
|
|
||||||
|
|
||||||
public uint mainHand = 0;
|
|
||||||
public uint offHand = 0;
|
|
||||||
|
|
||||||
public uint headGear = 0;
|
|
||||||
public uint bodyGear = 0;
|
|
||||||
public uint legsGear = 0;
|
|
||||||
public uint handsGear = 0;
|
|
||||||
public uint feetGear = 0;
|
|
||||||
public uint waistGear = 0;
|
|
||||||
public uint rightEarGear = 0;
|
|
||||||
public uint leftEarGear = 0;
|
|
||||||
public uint rightFingerGear = 0;
|
|
||||||
public uint leftFingerGear = 0;
|
|
||||||
|
|
||||||
public uint currentLevel = 1;
|
|
||||||
|
|
||||||
public static CharaInfo getFromNewCharRequest(String encoded)
|
|
||||||
{
|
|
||||||
byte[] data = Convert.FromBase64String(encoded.Replace('-', '+').Replace('_', '/'));
|
|
||||||
CharaInfo info = new CharaInfo();
|
|
||||||
|
|
||||||
using (MemoryStream stream = new MemoryStream(data))
|
|
||||||
{
|
|
||||||
using (BinaryReader reader = new BinaryReader(stream))
|
|
||||||
{
|
|
||||||
uint version = reader.ReadUInt32();
|
|
||||||
uint unknown1 = reader.ReadUInt32();
|
|
||||||
info.tribe = reader.ReadByte();
|
|
||||||
info.size = reader.ReadByte();
|
|
||||||
info.hairStyle = reader.ReadUInt16();
|
|
||||||
info.hairHighlightColor = reader.ReadUInt16();
|
|
||||||
info.faceType = reader.ReadByte();
|
|
||||||
info.characteristics = reader.ReadByte();
|
|
||||||
info.characteristicsColor = reader.ReadByte();
|
|
||||||
|
|
||||||
reader.ReadUInt32();
|
|
||||||
|
|
||||||
info.faceEyebrows = reader.ReadByte();
|
|
||||||
info.faceIrisSize = reader.ReadByte();
|
|
||||||
info.faceEyeShape = reader.ReadByte();
|
|
||||||
info.faceNose = reader.ReadByte();
|
|
||||||
info.faceFeatures = reader.ReadByte();
|
|
||||||
info.faceMouth = reader.ReadByte();
|
|
||||||
info.ears = reader.ReadByte();
|
|
||||||
info.hairColor = reader.ReadUInt16();
|
|
||||||
|
|
||||||
reader.ReadUInt32();
|
|
||||||
|
|
||||||
info.skinColor = reader.ReadUInt16();
|
|
||||||
info.eyeColor = reader.ReadUInt16();
|
|
||||||
|
|
||||||
info.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.allegiance = reader.ReadByte();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String buildForCharaList(DBCharacter chara)
|
|
||||||
{
|
|
||||||
byte[] data;
|
|
||||||
|
|
||||||
mainHand = 79707136;
|
|
||||||
offHand = 32509954;
|
|
||||||
headGear = 43008;
|
|
||||||
bodyGear = 43008;
|
|
||||||
legsGear = 43008;
|
|
||||||
handsGear = 43008;
|
|
||||||
feetGear = 43008;
|
|
||||||
|
|
||||||
using (MemoryStream stream = new MemoryStream())
|
|
||||||
{
|
|
||||||
using (BinaryWriter writer = new BinaryWriter(stream))
|
|
||||||
{
|
|
||||||
//Build faceinfo for later
|
|
||||||
FaceInfo faceInfo = new FaceInfo();
|
|
||||||
faceInfo.characteristics = characteristics;
|
|
||||||
faceInfo.characteristicsColor = characteristicsColor;
|
|
||||||
faceInfo.type = faceType;
|
|
||||||
faceInfo.ears = ears;
|
|
||||||
faceInfo.features = faceFeatures;
|
|
||||||
faceInfo.eyebrows = faceEyebrows;
|
|
||||||
faceInfo.eyeShape = faceEyeShape;
|
|
||||||
faceInfo.irisSize = faceIrisSize;
|
|
||||||
faceInfo.mouth = faceMouth;
|
|
||||||
faceInfo.nose = 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());
|
|
||||||
writer.Write((UInt32)size);
|
|
||||||
uint colorVal = skinColor | (uint)(hairColor << 10) | (uint)(eyeColor << 20);
|
|
||||||
writer.Write((UInt32)colorVal);
|
|
||||||
|
|
||||||
var bitfield = PrimitiveConversion.ToUInt32(faceInfo);
|
|
||||||
|
|
||||||
writer.Write((UInt32)bitfield); //FACE, Figure this out!
|
|
||||||
uint hairVal = hairHighlightColor | (uint)(hairStyle << 10) | (uint)(characteristicsColor << 20);
|
|
||||||
writer.Write((UInt32)hairVal);
|
|
||||||
writer.Write((UInt32)voice);
|
|
||||||
writer.Write((UInt32)mainHand);
|
|
||||||
writer.Write((UInt32)offHand);
|
|
||||||
|
|
||||||
writer.Write((UInt32)0);
|
|
||||||
writer.Write((UInt32)0);
|
|
||||||
writer.Write((UInt32)0);
|
|
||||||
writer.Write((UInt32)0);
|
|
||||||
writer.Write((UInt32)0);
|
|
||||||
|
|
||||||
writer.Write((UInt32)headGear);
|
|
||||||
writer.Write((UInt32)bodyGear);
|
|
||||||
writer.Write((UInt32)legsGear);
|
|
||||||
writer.Write((UInt32)handsGear);
|
|
||||||
writer.Write((UInt32)feetGear);
|
|
||||||
writer.Write((UInt32)waistGear);
|
|
||||||
|
|
||||||
writer.Write((UInt32)0);
|
|
||||||
|
|
||||||
writer.Write((UInt32)rightEarGear);
|
|
||||||
writer.Write((UInt32)leftEarGear);
|
|
||||||
|
|
||||||
writer.Write((UInt32)0);
|
|
||||||
writer.Write((UInt32)0);
|
|
||||||
|
|
||||||
writer.Write((UInt32)rightFingerGear);
|
|
||||||
writer.Write((UInt32)leftFingerGear);
|
|
||||||
|
|
||||||
for (int i = 0; i < 0x8; i++)
|
|
||||||
writer.Write((byte)0);
|
|
||||||
|
|
||||||
writer.Write((UInt32)1);
|
|
||||||
writer.Write((UInt32)1);
|
|
||||||
|
|
||||||
writer.Write((byte)currentClass);
|
|
||||||
writer.Write((UInt16)currentLevel);
|
|
||||||
writer.Write((byte)currentJob);
|
|
||||||
writer.Write((UInt16)1);
|
|
||||||
writer.Write((byte)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)guardian);
|
|
||||||
writer.Write((byte)birthMonth);
|
|
||||||
writer.Write((byte)birthDay);
|
|
||||||
|
|
||||||
writer.Write((UInt16)0x17);
|
|
||||||
writer.Write((UInt32)4);
|
|
||||||
writer.Write((UInt32)4);
|
|
||||||
|
|
||||||
writer.BaseStream.Seek(0x10, SeekOrigin.Current);
|
|
||||||
|
|
||||||
writer.Write((UInt32)allegiance);
|
|
||||||
writer.Write((UInt32)allegiance);
|
|
||||||
}
|
|
||||||
|
|
||||||
data = stream.GetBuffer();
|
|
||||||
}
|
|
||||||
|
|
||||||
return Convert.ToBase64String(data).Replace('+', '-').Replace('/', '_');
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String debug()
|
|
||||||
{
|
|
||||||
byte[] bytes = File.ReadAllBytes("./packets/charaInfo.bin");
|
|
||||||
|
|
||||||
Console.WriteLine(Utils.ByteArrayToHex(bytes));
|
|
||||||
|
|
||||||
return Convert.ToBase64String(bytes).Replace('+', '-').Replace('/', '_');
|
|
||||||
}
|
|
||||||
|
|
||||||
public UInt32 getTribeModel()
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +1,4 @@
|
|||||||
using FFXIVClassic_Lobby_Server;
|
using FFXIVClassic_Lobby_Server;
|
||||||
using FFXIVClassic_Lobby_Server.dataobjects;
|
|
||||||
using FFXIVClassic_Lobby_Server.packets;
|
using FFXIVClassic_Lobby_Server.packets;
|
||||||
using FFXIVClassic_Map_Server.dataobjects.chara;
|
using FFXIVClassic_Map_Server.dataobjects.chara;
|
||||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||||
@ -102,8 +101,7 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||||||
|
|
||||||
public void sendMotd()
|
public void sendMotd()
|
||||||
{
|
{
|
||||||
DBWorld world = Database.getServer(ConfigConstants.DATABASE_WORLDID);
|
|
||||||
//sendChat(world.motd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendChat(ConnectedPlayer sender, string message, int mode)
|
public void sendChat(ConnectedPlayer sender, string message, int mode)
|
||||||
|
20
FFXIVClassic Map Server/dataobjects/DBWorld.cs
Normal file
20
FFXIVClassic Map Server/dataobjects/DBWorld.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FFXIVClassic_Lobby_Server.dataobjects
|
||||||
|
{
|
||||||
|
class DBWorld
|
||||||
|
{
|
||||||
|
public ushort id;
|
||||||
|
public string address;
|
||||||
|
public ushort port;
|
||||||
|
public ushort listPosition;
|
||||||
|
public ushort population;
|
||||||
|
public string name;
|
||||||
|
public bool isActive;
|
||||||
|
public string motd;
|
||||||
|
}
|
||||||
|
}
|
@ -1,143 +0,0 @@
|
|||||||
using FFXIVClassic_Lobby_Server.common;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace FFXIVClassic_Lobby_Server.dataobjects
|
|
||||||
{
|
|
||||||
class DBAppearance
|
|
||||||
{
|
|
||||||
////////////
|
|
||||||
//Chara Info
|
|
||||||
public byte tribe = 0;
|
|
||||||
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 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
|
|
||||||
////////////
|
|
||||||
|
|
||||||
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 FaceInfo getFaceInfo()
|
|
||||||
{
|
|
||||||
FaceInfo faceInfo = new FaceInfo();
|
|
||||||
faceInfo.characteristics = characteristics;
|
|
||||||
faceInfo.characteristicsColor = characteristicsColor;
|
|
||||||
faceInfo.type = faceType;
|
|
||||||
faceInfo.ears = ears;
|
|
||||||
faceInfo.features = faceFeatures;
|
|
||||||
faceInfo.eyebrows = faceEyebrows;
|
|
||||||
faceInfo.eyeShape = faceEyeShape;
|
|
||||||
faceInfo.irisSize = faceIrisSize;
|
|
||||||
faceInfo.mouth = faceMouth;
|
|
||||||
faceInfo.nose = faceNose;
|
|
||||||
return faceInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using FFXIVClassic_Lobby_Server.common;
|
|
||||||
using FFXIVClassic_Lobby_Server.dataobjects;
|
|
||||||
|
|
||||||
namespace FFXIVClassic_Lobby_Server
|
|
||||||
{
|
|
||||||
class DBCharacter
|
|
||||||
{
|
|
||||||
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 static CharaInfo EncodedToCharacter(String charaInfo)
|
|
||||||
{
|
|
||||||
charaInfo.Replace("+", "-");
|
|
||||||
charaInfo.Replace("/", "_");
|
|
||||||
byte[] data = System.Convert.FromBase64String(charaInfo);
|
|
||||||
|
|
||||||
Console.WriteLine("------------Base64 printout------------------");
|
|
||||||
Console.WriteLine(Utils.ByteArrayToHex(data));
|
|
||||||
Console.WriteLine("------------Base64 printout------------------");
|
|
||||||
|
|
||||||
CharaInfo chara = new CharaInfo();
|
|
||||||
|
|
||||||
return chara;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace FFXIVClassic_Map_Server.dataobjects.database
|
|
||||||
{
|
|
||||||
class DBCommands
|
|
||||||
{
|
|
||||||
public uint classId;
|
|
||||||
public uint index;
|
|
||||||
public uint commandId;
|
|
||||||
public uint recastTime;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace FFXIVClassic_Map_Server.dataobjects.database
|
|
||||||
{
|
|
||||||
class DBJournal
|
|
||||||
{
|
|
||||||
public uint id;
|
|
||||||
public uint characterId;
|
|
||||||
public uint index;
|
|
||||||
public uint questId;
|
|
||||||
public uint type;
|
|
||||||
public bool abandoned;
|
|
||||||
public bool completed;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace FFXIVClassic_Map_Server.dataobjects.database
|
|
||||||
{
|
|
||||||
class DBPlayerData
|
|
||||||
{
|
|
||||||
public int tribe;
|
|
||||||
public int guardian;
|
|
||||||
public int birthdayMonth;
|
|
||||||
public int birthdayDay;
|
|
||||||
public int initialTown;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace FFXIVClassic_Map_Server.dataobjects.database
|
|
||||||
{
|
|
||||||
class DBStats
|
|
||||||
{
|
|
||||||
public int hp;
|
|
||||||
public int hpMax;
|
|
||||||
public int mp;
|
|
||||||
public int mpMax;
|
|
||||||
public ushort[] state_mainSkill;
|
|
||||||
public int state_mainSkillLevel;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user