public Steam() { api = new SteamAPI(); }
void api_NewMessage(object sender, SteamAPI.SteamEvent e) { if (OnMessage != null) OnMessage(this, e); }
void api_Logon(object sender, SteamAPI.SteamEvent e) { if (OnLogon != null) OnLogon(this, e); LoginFailed = false; Connecting = false; }
void api_Typing(object sender, SteamAPI.SteamEvent e) { if (OnTyping != null) OnTyping(this, e); }
void api_FriendStateChange(object sender, SteamAPI.SteamEvent e) { if (OnFriendStateChange != null) OnFriendStateChange(this, e); }
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; } }
void _steam_OnLogon(object sender, SteamAPI.SteamEvent e) { _steam.Start(); }
void _steam_OnMessage(object sender, SteamAPI.SteamEvent e) { }