Added all the inventory packets, and implemented add and get inventory from the db to the server. Inventory at login is now connected to the db!

This commit is contained in:
Filip Maj 2016-02-11 22:14:40 -05:00
parent c4dea467e3
commit df2ac1fb32
23 changed files with 1227 additions and 160 deletions

View file

@ -406,6 +406,23 @@ namespace FFXIVClassic_Lobby_Server
}
}
private void giveItem(ConnectedPlayer client, uint itemId)
{
if (client != null)
{
Player p = client.getActor();
p.addItem(itemId, 0, 1, 1);
}
else
{
foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList)
{
Player p = entry.Value.getActor();
p.addItem(itemId, 0, 1, 1);
}
}
}
internal void doCommand(string input, ConnectedPlayer client)
{
input.Trim();
@ -451,6 +468,17 @@ namespace FFXIVClassic_Lobby_Server
Log.error("Could not load packet: " + e);
}
}
else if (split[0].Equals("giveitem"))
{
try
{
giveItem(client, UInt32.Parse(split[1]));
}
catch (Exception e)
{
Log.error("Could not give item.");
}
}
else if (split[0].Equals("music"))
{
try