// // HoN Login events // void _login_Login(object sender, HoNLoginInfoArgs e) { Hashtable accountInfo = (Hashtable)e.Data(); if (e.LoggedIn() == true) { this._username = accountInfo["nickname"].ToString(); this._userid = Convert.ToUInt32(accountInfo["account_id"]); this._cookie = accountInfo["cookie"].ToString(); if (onLogin != null) { onLogin(sender, new HoNLoginResultArgs(e.LoggedIn(), this._username)); } // We've raised the event, we ought to start connecting and stuff. this._host = accountInfo["chat_url"].ToString(); this._port = 11031; this._conn.Connect(this._host, this._port); } else { if (onLogin != null) { onLogin(sender, new HoNLoginResultArgs(e.LoggedIn(), accountInfo["auth"].ToString())); } } if (onHoNLoginInfo != null) { onHoNLoginInfo(sender, e); } }
void hon_onHoNLoginInfo(object sender, HoNLoginInfoArgs e) { Data = e.Data(); _userid = uint.Parse((string)Data["account_id"]); _cookie = (string)Data["cookie"]; if (Data["auth"] != null) { if ((string)Data["auth"] == "Invalid Nickname or Password.") { return; } } if (((Hashtable)Data["buddy_list"]) != null) //if ((((Hashtable)Data["buddy_list"])[int.Parse((string)Data["account_id"])]).GetType().Name == "ArrayList") { ArrayList _buddylist = new ArrayList(); _buddylist = (ArrayList)((Hashtable)Data["buddy_list"])[int.Parse((string)Data["account_id"])]; foreach (Hashtable buddy in _buddylist) { hemUsers.AddEntity((string)buddy["nickname"], uint.Parse((string)buddy["buddy_id"]), 0, new List<char> { }); } } if (((Hashtable)Data["clan_roster"])["error"] == null) { Hashtable _clanroster = new Hashtable(); _clanroster = (Hashtable)Data["clan_roster"]; foreach (Hashtable member in _clanroster.Values) { hemUsers.AddEntity((string)member["nickname"], uint.Parse((string)member["account_id"]), 0, new List<char> { }); } } }