Esempio n. 1
0
 public Steam()
 {
     api = new SteamAPI();
 }
Esempio n. 2
0
 void  api_NewMessage(object sender, SteamAPI.SteamEvent e)
 {
     if (OnMessage != null)
         OnMessage(this, e);
 }
Esempio n. 3
0
 void  api_Logon(object sender, SteamAPI.SteamEvent e)
 {
     if (OnLogon != null)
         OnLogon(this, e);
     LoginFailed = false;
     Connecting = false;
 }
Esempio n. 4
0
 void  api_Typing(object sender, SteamAPI.SteamEvent e)
 {
     if (OnTyping != null)
         OnTyping(this, e);
 }
Esempio n. 5
0
 void  api_FriendStateChange(object sender, SteamAPI.SteamEvent e)
 {
     if (OnFriendStateChange != null)
         OnFriendStateChange(this, e);
 }
Esempio n. 6
0
        public SteamAPI.LoginStatus Connect( string user, string password, string code, string token )
        {
            lock (lockConnect)
            {
                Connecting = true;
                api = new SteamAPI();
                SteamAPI.LoginStatus status = SteamAPI.LoginStatus.LoginFailed;

                api.Logon += new EventHandler<SteamAPI.SteamEvent>(api_Logon);
                api.NewMessage += new EventHandler<SteamAPI.SteamEvent>(api_NewMessage);
                api.FriendStateChange += new EventHandler<SteamAPI.SteamEvent>(api_FriendStateChange);
                api.Typing += new EventHandler<SteamAPI.SteamEvent>(api_Typing);

                if (!String.IsNullOrEmpty(token))
                {
                    status = api.Authenticate(token);
                }
                else if (!String.IsNullOrEmpty(code))
                {
                    status = api.Authenticate(user, password, code);
                }
                else if (!String.IsNullOrEmpty(user) && !String.IsNullOrEmpty(password))
                {
                    status = api.Authenticate(user, password);
                    if (status == SteamAPI.LoginStatus.SteamGuard)
                    {
                        if (OnGuardCode != null)
                            OnGuardCode(this, EventArgs.Empty);
                    }
                }

                if (status == SteamAPI.LoginStatus.LoginFailed)
                {
                    if (OnLoginError != null)
                        OnLoginError(this, EventArgs.Empty);
                    
                    LoginFailed = true;
                    Connecting = false;
                }

                return status;
            }

        }
Esempio n. 7
0
 void _steam_OnLogon(object sender, SteamAPI.SteamEvent e)
 {
     _steam.Start();
 }
Esempio n. 8
0
 void _steam_OnMessage(object sender, SteamAPI.SteamEvent e)
 {
 }