public CharacterCacheInfo GetCharInfoByInternalID(int pInternalID) { if (KnownCharlist.ContainsKey(pInternalID)) { return(KnownCharlist[pInternalID]); } return(null); }
public void LoadBaseData(string pName = null) { using (var result = MySQL_Connection.Instance.RunQuery("SELECT id, internal_id, userid, world_id, name FROM characters" + (pName != null ? " WHERE name = '" + MySql.Data.MySqlClient.MySqlHelper.EscapeString(pName) + "'" : "")) as MySql.Data.MySqlClient.MySqlDataReader) { while (result.Read()) { CharacterCacheInfo ch = new CharacterCacheInfo(); ch.Initialize(result); KnownCharlist.Add(ch.InternalID, ch); } } }
public bool DeleteCharacterInfo(int pCharacterID, byte pWorldID, int pAccountID, out int pInternalID) { pInternalID = -1; var info = GetCharInfoByIDAndWorldID(pCharacterID, pWorldID); if (info == null) { return(false); } if (info.AccountID != pAccountID) { return(false); } pInternalID = info.InternalID; return(KnownCharlist.Remove(info.InternalID)); }