diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-04-10 19:33:27 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-04-10 19:33:27 +0000 |
commit | ab05a30ab1f725e421287bf8158508c3ba3eddd3 (patch) | |
tree | ccbbd21993e21a9e8a6d358d0216e980b1818e65 /protocols/Steam/src/steam_account.cpp | |
parent | a1ef91459fb0a353c9919c1b8ff349efdf162b3c (diff) |
Steam: small fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@8938 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_account.cpp')
-rw-r--r-- | protocols/Steam/src/steam_account.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/protocols/Steam/src/steam_account.cpp b/protocols/Steam/src/steam_account.cpp index 17e47887ab..a1261291ea 100644 --- a/protocols/Steam/src/steam_account.cpp +++ b/protocols/Steam/src/steam_account.cpp @@ -16,7 +16,7 @@ bool CSteamProto::IsMe(const char *steamId) void CSteamProto::SetServerStatusThread(void *arg)
{
- WORD status = *((WORD*)arg);
+ WORD status = *((WORD*)&arg);
ptrA token(getStringA("TokenSecret"));
ptrA sessionId(getStringA("SessionID"));
@@ -24,19 +24,27 @@ void CSteamProto::SetServerStatusThread(void *arg) int state = CSteamProto::MirandaToSteamState(status);
// change status
- if (m_iStatus == state)
- return;
-
- int oldStatus = m_iStatus;
- m_iStatus = state;
+ WORD oldStatus = m_iStatus;
+ m_iDesiredStatus = status;
SteamWebApi::MessageApi::SendResult sendResult;
SteamWebApi::MessageApi::SendStatus(m_hNetlibUser, token, sessionId, state, &sendResult);
if (sendResult.IsSuccess())
+ {
+ m_iStatus = status;
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
+ }
else
- m_iStatus = oldStatus;
+ m_iDesiredStatus = m_iStatus;
+}
+
+void CSteamProto::SetServerStatus(WORD status)
+{
+ if (m_iStatus == status)
+ return;
+
+ ForkThread(&CSteamProto::SetServerStatusThread, (void*)status);
}
void CSteamProto::Authorize(SteamWebApi::AuthorizationApi::AuthResult *authResult)
@@ -163,8 +171,7 @@ void CSteamProto::LogInThread(void* param) setDword("MessageID", loginResult.GetMessageId());
// set selected status
- m_iStatus = m_iDesiredStatus;
- ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)ID_STATUS_CONNECTING, m_iDesiredStatus);
+ //CSteamProto::SetServerStatusThread((void*)m_iDesiredStatus);
// load contact list
LoadContactList();
|