public void Update()
{
while (true)
{
CallbackMsg msg = client.WaitForCallback(true);
if (msg == null)
{
return;
}
client.FreeLastCallback();
if (msg.IsType<SteamClient.ConnectCallback>())
{
user.LogOn(new SteamUser.LogOnDetails()
{
Username = username,
Password = password,
AuthCode = authcode
});
}
if (msg.IsType<SteamClient.DisconnectCallback>())
{
loggedIn = false;
}
if (msg.IsType<SteamUser.LogOnCallback>())
{
SteamUser.LogOnCallback callback = (SteamUser.LogOnCallback)msg;
if (callback.Result == EResult.OK)
{
this.loggedIn = true;
this.authcode = null;
}
Friends.SetPersonaState(EPersonaState.Online);
}
Push(msg);
}
}