Beispiel #1
0
 public Steam()
 {
     api = new SteamAPI();
 }
Beispiel #2
0
 void  api_NewMessage(object sender, SteamAPI.SteamEvent e)
 {
     if (OnMessage != null)
         OnMessage(this, e);
 }
Beispiel #3
0
 void  api_Logon(object sender, SteamAPI.SteamEvent e)
 {
     if (OnLogon != null)
         OnLogon(this, e);
     LoginFailed = false;
     Connecting = false;
 }
Beispiel #4
0
 void  api_Typing(object sender, SteamAPI.SteamEvent e)
 {
     if (OnTyping != null)
         OnTyping(this, e);
 }
Beispiel #5
0
 void  api_FriendStateChange(object sender, SteamAPI.SteamEvent e)
 {
     if (OnFriendStateChange != null)
         OnFriendStateChange(this, e);
 }
Beispiel #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;
            }

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