void SteamChat_NewMessage(object sender, SteamAPISession.SteamEvent e) { //TODO: implement send to current chat if (MessageReceived != null && e.update != null && e.update.origin != null) { AddFriendToCache(e.update.origin); var nickname = friends[e.update.origin].nickname; if (!String.IsNullOrWhiteSpace(nickname)) { MessageReceived(this, new ChatServiceEventArgs() { Message = new ChatMessage() { Channel = "#" + nickname, ChatIconURL = this.IconURL, ChatName = this.ChatName, FromUserName = nickname, HighlyImportant = false, IsSentByMe = true, Text = e.update.message, } }); } } }
void SteamChat_FriendStateChange(object sender, SteamAPISession.SteamEvent e) { AddFriendToCache(e.update.origin); friends[e.update.origin].status = e.update.status; Log.WriteInfo("Steam user status changed {0}", e.update.nick); }
void SteamChat_Logon(object sender, SteamAPISession.SteamEvent e) { Log.WriteInfo("Steam logged in"); var friendList = GetFriends(); foreach (var friend in friendList) { AddFriendToCache(friend.steamid); } Status.IsLoggedIn = true; }
void SteamChat_SteamGuard(object sender, SteamAPISession.SteamEvent e) { for (int i = 0; i < 10; i++) { if (RequestData != null) { break; } Thread.Sleep(1000); } RequestData("SteamGuardCode"); SteamGuardKey = (string)Config.GetParameterValue("AuthToken"); }
void SteamChat_Typing(object sender, SteamAPISession.SteamEvent e) { Log.WriteInfo("Steam user typing"); }