Got most of the properties getting set. Commands and General Parameters broken.

This commit is contained in:
Filip Maj 2016-01-10 13:36:36 -05:00
parent d42dac543f
commit 5b5b99bb4b
6 changed files with 79 additions and 23 deletions

View File

@ -158,6 +158,51 @@ namespace FFXIVClassic_Lobby_Server
}
}
player.charaWork.parameterSave.state_mainSkillLevel = 1;
/*
//Get level of our classjob
//Load appearance
query = @"
SELECT
baseId
FROM characters_appearance WHERE characterId = @charId";
cmd = new MySqlCommand(query, conn);
cmd.Parameters.AddWithValue("@charId", player.actorId);
using (MySqlDataReader reader = cmd.ExecuteReader())
{
if (reader.Read())
{
}
}
*/
//Get level of our classjob
//Load appearance
query = @"
SELECT
hp,
hpMax,
mp,
mpMax
FROM characters_parametersave WHERE characterId = @charId";
cmd = new MySqlCommand(query, conn);
cmd.Parameters.AddWithValue("@charId", player.actorId);
using (MySqlDataReader reader = cmd.ExecuteReader())
{
if (reader.Read())
{
player.charaWork.parameterSave.hp[0] = reader.GetInt16(0);
player.charaWork.parameterSave.hpMax[0] = reader.GetInt16(1);
player.charaWork.parameterSave.mp = reader.GetInt16(2);
player.charaWork.parameterSave.mpMax = reader.GetInt16(3);
}
}
//Load appearance
query = @"
SELECT

View File

@ -214,7 +214,7 @@ namespace FFXIVClassic_Lobby_Server
client.queuePacket(SetMusicPacket.buildPacket(player.actorID, 0x3D, 0x01), true, false);
client.queuePacket(SetWeatherPacket.buildPacket(player.actorID, SetWeatherPacket.WEATHER_CLEAR), true, false);
BasePacket actorPacket = player.getActor().getInitPackets(player.actorID);
BasePacket actorPacket = player.getActor().getSpawnPackets(player.actorID);
client.queuePacket(actorPacket);
//Retainers
@ -344,7 +344,7 @@ namespace FFXIVClassic_Lobby_Server
//return;
inn.addActorToZone(player.getActor());
client.queuePacket(reply7);
//client.queuePacket(reply7);
client.queuePacket(reply8);
client.queuePacket(reply9);
client.queuePacket(reply10);

View File

@ -52,6 +52,9 @@ namespace FFXIVClassic_Map_Server.dataobjects.chara
public Character(uint actorID) : base(actorID)
{
//Init timer array to "notimer"
for (int i = 0; i < charaWork.statusShownTime.Length; i++)
charaWork.statusShownTime[i] = 0xFFFFFFFF;
}
public SubPacket createAppearancePacket(uint playerActorId)

View File

@ -8,17 +8,17 @@ namespace FFXIVClassic_Map_Server.dataobjects.chara
{
class ParameterSave
{
public int[] hp = new int[1];
public int[] hpMax = new int[1];
public int mp;
public int mpMax;
public short[] hp = new short[1];
public short[] hpMax = new short[1];
public short mp;
public short mpMax;
public int[] state_mainSkill = new int[4];
public int state_mainSkillLevel;
public byte[] state_mainSkill = new byte[4];
public ushort state_mainSkillLevel;
public int[] state_boostPointForSkill;
public uint[] commandSlot_compatibility = new uint[40];
public bool[] commandSlot_compatibility = new bool[40];
public uint[] commandSlot_recastTime = new uint[40];
public int[] giftCommandSlot_commandId;

View File

@ -8,7 +8,7 @@ namespace FFXIVClassic_Map_Server.dataobjects.chara
{
class ParameterTemp
{
public int tp = 0;
public short tp = 0;
public int targetInformation = 0;

View File

@ -84,9 +84,12 @@ namespace FFXIVClassic_Map_Server.dataobjects.chara
charaWork.command[14] = 0xA0F00000 | 29497;
charaWork.command[15] = 0xA0F00000 | 22015;
charaWork.command[32] = 0xA0F00000 | 27150;
for (int i = 0; i < 16; i++)
charaWork.commandCategory[i] = 1;
charaWork.commandCategory[32] = 1;
charaWork.commandBorder = 32;
Database.loadPlayerCharacter(this);
@ -155,35 +158,39 @@ namespace FFXIVClassic_Map_Server.dataobjects.chara
propPacketUtil.addProperty("charaWork.parameterSave.hpMax[0]");
propPacketUtil.addProperty("charaWork.parameterSave.mp");
propPacketUtil.addProperty("charaWork.parameterSave.mpMax");
propPacketUtil.addProperty("charaWork.parameterSave.mpMax");
propPacketUtil.addProperty("charaWork.parameterTemp.tp");
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[0]");
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkillLevel");
//Status Times
for (int i = 0; i < charaWork.statusShownTime.Length; i++)
{
if (charaWork.statusShownTime[i] != 0)
if (charaWork.statusShownTime[i] != 0xFFFFFFFF)
propPacketUtil.addProperty(String.Format("charaWork.statusShownTime[{0}]", i));
}
//General Parameters
for (int i = 0; i < 36; i++)
for (int i = 0; i < charaWork.battleTemp.generalParameter.Length; i++)
{
if (charaWork.battleTemp.generalParameter[i] != 0)
propPacketUtil.addProperty(String.Format("charaWork.battleTemp.generalParameter[{0}]", i));
}
propPacketUtil.addProperty("charaWork.battleTemp.castGauge_speed[0]");
propPacketUtil.addProperty("charaWork.battleTemp.castGauge_speed[1]");
//Battle Save Skillpoint
//Commands
for (int i = 0; i < charaWork.command.Length; i++)
{
if (charaWork.command[i] != 0)
propPacketUtil.addProperty(String.Format("charaWork.command[{0}]", i));
}
for (int i = 0; i < charaWork.commandCategory.Length; i++)
{
if (charaWork.commandCategory[i] != 0)
@ -194,9 +201,10 @@ namespace FFXIVClassic_Map_Server.dataobjects.chara
for (int i = 0; i < charaWork.parameterSave.commandSlot_compatibility.Length; i++)
{
if (charaWork.parameterSave.commandSlot_compatibility[i] != 0)
if (charaWork.parameterSave.commandSlot_compatibility[i])
propPacketUtil.addProperty(String.Format("charaWork.parameterSave.commandSlot_compatibility[{0}]", i));
}
for (int i = 0; i < charaWork.parameterSave.commandSlot_recastTime.Length; i++)
{
if (charaWork.parameterSave.commandSlot_recastTime[i] != 0)