namespace Holo.Virtual.Users { using Holo; using Holo.Managers; using Holo.Virtual.Rooms; using System; using System.Collections; using System.Runtime.CompilerServices; using System.Threading; public class virtualRoomUserStatusManager { private Hashtable _Statuses; private int roomID; private int userID; public virtualRoomUserStatusManager(int userID, int roomID) { this.userID = userID; this.roomID = roomID; this._Statuses = new Hashtable(); } internal void addStatus(string Key, string Value) { if (this._Statuses.ContainsKey(Key)) { this._Statuses.Remove(Key); } this._Statuses.Add(Key, Value); } internal void carryItem(int Item) { this.User.statusID = "Gb"; this.User.statusCount = Item; this.Room.sendData(this.roomUser.User.statusID + Encoding.encodeVL64(this.roomUser.roomUID) + Encoding.encodeVL64(this.User.statusCount)); } internal void carryItem(string item) { throw new NotImplementedException(); } internal void Clear() { try { this._Statuses.Clear(); this._Statuses = null; } catch { } } internal bool containsStatus(string Key) { return this._Statuses.ContainsKey(Key); } internal void dropCarrydItem() { this.User.statusID = "Gb"; this.User.statusCount = 0; this.Room.sendData(this.roomUser.User.statusID + Encoding.encodeVL64(this.roomUser.roomUID) + Encoding.encodeVL64(0)); } internal void handleStatus(string Key, string Value, int Length) { if (this._Statuses.ContainsKey(Key)) { this._Statuses.Remove(Key); } new statusVoid(this.HANDLESTATUS).BeginInvoke(Key, Value, Length, null, null); } private void HANDLESTATUS(string Key, string Value, int Length) { try { this._Statuses.Add(Key, Value); this.roomUser.Refresh(); Thread.Sleep(Length); this._Statuses.Remove(Key); this.roomUser.Refresh(); } catch { } } internal void Refresh() { this.roomUser.Refresh(); } internal void removeStatus(string Key) { try { if (this._Statuses.ContainsKey(Key)) { this._Statuses.Remove(Key); } } catch { } } public override string ToString() { string str = ""; Hashtable hashtable = (Hashtable) this._Statuses.Clone(); try { foreach (string str2 in hashtable.Keys) { str = str + str2; string str3 = (string) this._Statuses[str2]; if (str3 != "") { str = str + " " + str3; } str = str + "/"; } return str; } catch { } return str; } private virtualRoom Room { get { return roomManager.getRoom(this.roomID); } } private virtualRoomUser roomUser { get { return userManager.getUser(this.userID).roomUser; } } private virtualUser User { get { return userManager.getUser(this.userID); } } private delegate void statusVoid(string Key, string Value, int Length); } }