using System; using Holo.Managers; using Holo.Virtual.Users; using Ion.Storage; namespace Holo.Virtual.Users.Messenger { class virtualBuddy { internal int userID; internal bool Online; private bool inRoom; internal virtualBuddy(int userID) { this.userID = userID; bool b = Updated; // Update } internal bool Updated { get { bool _Online = userManager.containsUser(userID); bool _inRoom = false; if (_Online) _inRoom = (userManager.getUser(userID).roomUser != null); if (_inRoom != inRoom || _Online != Online) { Online = _Online; inRoom = _inRoom; return true; } else return false; } } internal string ToString(bool includeUsername, bool isOffline) { string OUT = Encoding.encodeVL64(userID); if (includeUsername) { string Username = ""; if (Online) Username = userManager.getUser(userID)._Username; else { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { Username = dbClient.getString("SELECT name FROM users WHERE id = '" + userID + "'"); } } #region buildlist friends OUT += Username + Convert.ToChar(2); #endregion } if (Online) { OUT += "II"; if (inRoom) OUT += "I"; else OUT += "H"; OUT += userManager.getUser(userID)._Figure; } else OUT += "IHH"; return OUT + Convert.ToChar(2) + "H"; } } }