private void GetBankPacketBytes(ref List <byte> oBytes) { if (_mapPlayer.BankUpdated) { _mapPlayer.BankUpdated = false; oBytes.AddRange(BitConverter.GetBytes((int)PacketType.BankPacket)); byte[] bytes = _mapPlayer.GetBankData().GetBytes(); oBytes.AddRange(BitConverter.GetBytes(bytes.Length)); oBytes.AddRange(bytes); } }
public bool UpdatePlayerQuery(MapPlayer mapPlayer) { bool updated = false; PlayerPacket packet = mapPlayer.GetPlayerPacket(); BankData bankData = mapPlayer.GetBankData(); try { string updateQuery = "UPDATE Players SET " + "MapID=" + packet.MapID + "," + "SpriteID=" + packet.SpriteID + "," + "Direction=" + (int)packet.Direction + "," + "MapX=" + packet.PositionX + "," + "MapY=" + packet.PositionY + "," + "OnBridge=" + (packet.OnBridge ? 1 : 0) + "," + "Level=" + packet.Data.Level + "," + "Experience=" + packet.Data.Experience + "," + "ClassID=" + packet.Data.GetClassID() + "," + "HP=" + packet.Data.HP + "," + "MP=" + packet.Data.MP + "," + "Stamina=" + packet.Data.Stamina + "," + "Gold=" + packet.Data.Gold + "," + "Inventory='" + packet.Data.GetInventoryString() + "'," + "Equipment='" + packet.Data.GetEquipmentString() + "'," + "Bank='" + bankData.GetBankString() + "'," + "Quests='" + packet.Data.GetQuestsString() + "'," + "InvestmentPoints=" + packet.Data.InvestmentPoints + "," + "VitalityPoints=" + packet.Data.InvestedStats.Vitality + "," + "InteligencePoints=" + packet.Data.InvestedStats.Inteligence + "," + "StrengthPoints=" + packet.Data.InvestedStats.Strength + "," + "AgilityPoints=" + packet.Data.InvestedStats.Agility + "," + "MeleeDefencePoints=" + packet.Data.InvestedStats.MeleeDefence + "," + "RangeDefencePoints=" + packet.Data.InvestedStats.RangeDefence + "," + "MagicDefencePoints=" + packet.Data.InvestedStats.MagicDefence + " " + "WHERE Username='******'"; Insert(updateQuery); updated = true; } catch { } return(updated); }