mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-10 14:34:32 +02:00
EXP and levels now get saved and loaded from database, changed battlecommand id dictionary to hold lists to account for archer and DoH/DoLs getting multiple abilities at certain levels. Level 1 abilities are now added to the hotbar on character creation.
This commit is contained in:
parent
ab98f3662f
commit
5dfbc0f249
5 changed files with 254 additions and 34 deletions
|
@ -231,15 +231,51 @@ namespace FFXIVClassic_Lobby_Server
|
|||
catch (MySqlException e)
|
||||
{
|
||||
Program.Log.Error(e.ToString());
|
||||
|
||||
conn.Dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
//Create Hotbar
|
||||
try
|
||||
{
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
cmd.Connection = conn;
|
||||
cmd.CommandText = "SELECT id FROM server_battle_commands WHERE classJob = @classjob AND lvl = 1 ORDER BY id DESC";
|
||||
cmd.Prepare();
|
||||
|
||||
cmd.Parameters.AddWithValue("@classJob", charaInfo.currentClass);
|
||||
List<uint> defaultActions = new List<uint>();
|
||||
using (var reader = cmd.ExecuteReader())
|
||||
{
|
||||
while(reader.Read())
|
||||
{
|
||||
defaultActions.Add(reader.GetUInt32("id"));
|
||||
}
|
||||
}
|
||||
MySqlCommand cmd2 = new MySqlCommand();
|
||||
cmd2.Connection = conn;
|
||||
cmd2.CommandText = "INSERT INTO characters_hotbar (characterId, classId, hotbarSlot, commandId, recastTime) VALUES (@characterId, @classId, @hotbarSlot, @commandId, 0)";
|
||||
cmd2.Prepare();
|
||||
cmd2.Parameters.AddWithValue("@characterId", cid);
|
||||
cmd2.Parameters.AddWithValue("@classId", charaInfo.currentClass);
|
||||
cmd2.Parameters.Add("@hotbarSlot", MySqlDbType.Int16);
|
||||
cmd2.Parameters.Add("@commandId", MySqlDbType.Int16);
|
||||
|
||||
for(int i = 0; i < defaultActions.Count; i++)
|
||||
{
|
||||
cmd2.Parameters["@hotbarSlot"].Value = i;
|
||||
cmd2.Parameters["@commandId"].Value = defaultActions[i];
|
||||
cmd2.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch(MySqlException e)
|
||||
{
|
||||
Program.Log.Error(e.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Dispose();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Program.Log.Debug("[SQL] CID={0} state updated to active(2).", cid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue