Upgraded clientprefs to use the client serial API (bug 3616)
authorMatt Woodrow <pred@alliedmods.net>
Thu Feb 19 19:28:50 2009 +1300 (2009-02-19)
changeset 2592e69a1297edbc
parent 2591 15213de19689
child 2593 4e9044aedf9a
Upgraded clientprefs to use the client serial API (bug 3616)
extensions/clientprefs/cookie.cpp
extensions/clientprefs/cookie.h
extensions/clientprefs/query.cpp
extensions/clientprefs/query.h
     1.1 --- a/extensions/clientprefs/cookie.cpp	Thu Feb 19 19:19:44 2009 +1300
     1.2 +++ b/extensions/clientprefs/cookie.cpp	Thu Feb 19 19:28:50 2009 +1300
     1.3 @@ -205,7 +205,7 @@
     1.4  
     1.5  	connected[client] = true;
     1.6  
     1.7 -	TQueryOp *op = new TQueryOp(Query_SelectData, player->GetUserId());
     1.8 +	TQueryOp *op = new TQueryOp(Query_SelectData, player->GetSerial());
     1.9  	strcpy(op->m_params.steamId, authstring);
    1.10  
    1.11  	g_ClientPrefs.AddQueryToQueue(op);
    1.12 @@ -268,13 +268,13 @@
    1.13  	}
    1.14  }
    1.15  
    1.16 -void CookieManager::ClientConnectCallback(int userid, IQuery *data)
    1.17 +void CookieManager::ClientConnectCallback(int serial, IQuery *data)
    1.18  {
    1.19  	int client;
    1.20  	IResultSet *results;
    1.21  
    1.22  	/* Check validity of client */
    1.23 -	if ((client = playerhelpers->GetClientOfUserId(userid)) == 0)
    1.24 +	if ((client = playerhelpers->GetClientFromSerial(serial)) == 0)
    1.25  	{
    1.26  		return;
    1.27  	}
     2.1 --- a/extensions/clientprefs/cookie.h	Thu Feb 19 19:19:44 2009 +1300
     2.2 +++ b/extensions/clientprefs/cookie.h	Thu Feb 19 19:28:50 2009 +1300
     2.3 @@ -121,7 +121,7 @@
     2.4  
     2.5  	void Unload();
     2.6  
     2.7 -	void ClientConnectCallback(int userid, IQuery *data);
     2.8 +	void ClientConnectCallback(int serial, IQuery *data);
     2.9  	void InsertCookieCallback(Cookie *pCookie, int dbId);
    2.10  	void SelectIdCallback(Cookie *pCookie, IQuery *data);
    2.11  
     3.1 --- a/extensions/clientprefs/query.cpp	Thu Feb 19 19:19:44 2009 +1300
     3.2 +++ b/extensions/clientprefs/query.cpp	Thu Feb 19 19:28:50 2009 +1300
     3.3 @@ -51,7 +51,7 @@
     3.4  
     3.5  		case Query_SelectData:
     3.6  		{
     3.7 -			g_CookieManager.ClientConnectCallback(m_userid, m_pResult);
     3.8 +			g_CookieManager.ClientConnectCallback(m_serial, m_pResult);
     3.9  			break;
    3.10  		}
    3.11  
    3.12 @@ -84,10 +84,10 @@
    3.13  		if (!BindParamsAndRun())
    3.14  		{
    3.15  			g_pSM->LogError(myself, 
    3.16 -							"Failed SQL Query, Error: \"%s\" (Query id %i - userid %i)", 
    3.17 +							"Failed SQL Query, Error: \"%s\" (Query id %i - serial %i)", 
    3.18  							m_database->GetError(),
    3.19  							m_type, 
    3.20 -							m_userid);
    3.21 +							m_serial);
    3.22  		}
    3.23  
    3.24  		m_database->UnlockFromFullAtomicOperation();
    3.25 @@ -115,10 +115,10 @@
    3.26  	delete this;
    3.27  }
    3.28  
    3.29 -TQueryOp::TQueryOp(enum querytype type, int userid)
    3.30 +TQueryOp::TQueryOp(enum querytype type, int serial)
    3.31  {
    3.32  	m_type = type;
    3.33 -	m_userid = userid;
    3.34 +	m_serial = serial;
    3.35  	m_database = NULL;
    3.36  	m_insertId = -1;
    3.37  	m_pResult = NULL;
     4.1 --- a/extensions/clientprefs/query.h	Thu Feb 19 19:19:44 2009 +1300
     4.2 +++ b/extensions/clientprefs/query.h	Thu Feb 19 19:28:50 2009 +1300
     4.3 @@ -68,7 +68,7 @@
     4.4  class TQueryOp : public IDBThreadOperation
     4.5  {
     4.6  public:
     4.7 -	TQueryOp(enum querytype type, int userid);
     4.8 +	TQueryOp(enum querytype type, int serial);
     4.9  	TQueryOp(enum querytype type, Cookie *cookie);
    4.10  	~TQueryOp() {}
    4.11  
    4.12 @@ -102,7 +102,7 @@
    4.13  	enum querytype m_type;
    4.14  
    4.15  	/* Data to be passed to the callback */
    4.16 -	int m_userid;
    4.17 +	int m_serial;
    4.18  	int m_insertId;
    4.19  	Cookie *m_pCookie;
    4.20  };