Split update hotbar function into seperate command and recast functions, fixed recast packet spam, recast timers now reset when commands are added to the hotbar and when changing classes, and are now saved in the databse correctly and sent on login. Merged demo's changes.

This commit is contained in:
yogurt 2017-08-22 14:50:53 -05:00
parent 86bf0eec81
commit 35f9251056
2 changed files with 83 additions and 43 deletions

View file

@ -1286,7 +1286,7 @@ namespace FFXIVClassic_Map_Server
cmd = new MySqlCommand(query, conn);
cmd.Parameters.AddWithValue("@charId", player.actorId);
cmd.Parameters.AddWithValue("@classId", player.charaWork.parameterSave.state_mainSkill[0]);
cmd.Parameters.AddWithValue("@hotbarSlot", hotbarSlot - 1);
cmd.Parameters.AddWithValue("@hotbarSlot", hotbarSlot);
cmd.ExecuteNonQuery();
}
catch (MySqlException e)
@ -1336,9 +1336,16 @@ namespace FFXIVClassic_Map_Server
while (reader.Read())
{
int index = reader.GetUInt16(0);
player.charaWork.command[index] = reader.GetUInt32(1);
uint trueCommandId = reader.GetUInt32(1);
player.charaWork.command[index] = trueCommandId;
player.charaWork.commandCategory[index] = 1;
player.charaWork.parameterSave.commandSlot_recastTime[index - player.charaWork.commandBorder] = reader.GetUInt32(2);
//Recast timer
Ability ability = Server.GetWorldManager().GetAbility((ushort)(trueCommandId ^ 2700083200));
player.charaWork.parameterTemp.maxCommandRecastTime[index - player.charaWork.commandBorder] = (ushort) (ability != null ? ability.recastTimeSeconds : 1);
//Previous recast timer
player.charaWork.parameterSave.commandSlot_recastTime[index - player.charaWork.commandBorder] = reader.GetUInt32(2);
}
}
}