Ejemplo n.º 1
0
        private void OnSteamLogin(object sender, SteamAPISession.SteamEvent e)
        {
            checkMark.SetOn(pictureSteamBot);

            //Get Steam Admin ID
            if (settings.SteamAdminId.Length <= 0)
            {
                List<SteamAPISession.Friend> friends = steamBot.GetFriends();
                foreach (SteamAPISession.Friend f in friends)
                {
                    SteamAPISession.User user = steamBot.GetUserInfo(f.steamid);
                    if (user.nickname == settings.SteamAdmin)
                    {
                        steamAdmin = user;
                        settings.SteamAdminId = steamAdmin.steamid;
                        settings.Save();
                        break;
                    }
                }
            }
            else
            {
                steamAdmin = steamBot.GetUserInfo(settings.SteamAdminId);
            }


            if (steamAdmin != null)
            {
                SteamAPISession.User ui = steamBot.GetUserInfo(steamAdmin.steamid);
                if (ui.status != SteamAPISession.UserStatus.Offline)
                {
                    checkMark.SetOn(pictureSteamAdmin);
                    steamAdmin.status = SteamAPISession.UserStatus.Online;
                }

            }
            else
                SendMessage(new Message(String.Format("Can't find {0} in your friends! Check settings or add that account into friend list for bot!", 
                    settings.SteamAdmin), EndPoint.Steam, EndPoint.Console));

            bWorkerSteamPoll.RunWorkerAsync();

        }
Ejemplo n.º 2
0
        private void OnSteamLogin(object sender, SteamAPISession.SteamEvent e)
        {
            chatStatusSteamBot.On = true;

            //Get Steam Admin ID
            if (String.IsNullOrEmpty(settings.SteamAdminId))
            {
                List<SteamAPISession.Friend> friends = steamBot.GetFriends();
                foreach (SteamAPISession.Friend f in friends)
                {
                    SteamAPISession.User user = steamBot.GetUserInfo(f.steamid);
                    if (user.nickname == settings.SteamAdmin)
                    {
                        steamAdmin = user;
                        settings.SteamAdminId = steamAdmin.steamid;
                        settings.Save();
                        break;
                    }
                }
            }
            else
            {
                steamAdmin = steamBot.GetUserInfo(settings.SteamAdminId);
            }


            if (steamAdmin != null)
            {
                SteamAPISession.User ui = steamBot.GetUserInfo(steamAdmin.steamid);
                if (ui.status != SteamAPISession.UserStatus.Offline)
                {
                    chatStatusSteamAdmin.On = true;
                    steamAdmin.status = SteamAPISession.UserStatus.Online;
                }

            }
            else
                SendMessage(new UbiMessage(String.Format("Can't find {0} in your friends! Check settings or add that account into friend list for bot!",
                    settings.SteamAdmin), EndPoint.Steam, EndPoint.Error));

            if( !bWorkerSteamPoll.IsBusy )
                bWorkerSteamPoll.RunWorkerAsync();

        }