|
|
|
@ -1393,73 +1393,6 @@ extern bool gDataServerLocal;
|
|
|
|
|
#include "plQuality.h" |
|
|
|
|
#include "plLoadMask.h" |
|
|
|
|
|
|
|
|
|
#if 0 |
|
|
|
|
class LoginNetClientCommCallback : public plNetClientComm::Callback |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
enum Op {kAuth, kCreatePlayer, kGetPlayerList, kLeave, kDeletePlayer}; |
|
|
|
|
|
|
|
|
|
LoginNetClientCommCallback() : plNetClientComm::Callback(), fNumCurrentOps(0) |
|
|
|
|
{} |
|
|
|
|
|
|
|
|
|
virtual void OperationStarted( uint32_t context ) |
|
|
|
|
{ |
|
|
|
|
fNumCurrentOps++; |
|
|
|
|
} |
|
|
|
|
virtual void OperationComplete( uint32_t context, int resultCode ) |
|
|
|
|
{ |
|
|
|
|
if (context == kAuth) |
|
|
|
|
{ |
|
|
|
|
if (hsSucceeded(resultCode)) |
|
|
|
|
{ |
|
|
|
|
plClient::GetInstance()->fAuthPassed = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (context == kGetPlayerList) |
|
|
|
|
{ |
|
|
|
|
if ( hsSucceeded( resultCode ) ) |
|
|
|
|
{ |
|
|
|
|
uint32_t numPlayers = fCbArgs.GetInt(0); |
|
|
|
|
uint32_t pId = -1; |
|
|
|
|
std::string pName; |
|
|
|
|
|
|
|
|
|
for (uint32_t i = 0; i < numPlayers; i++) |
|
|
|
|
{ |
|
|
|
|
pId = fCbArgs.GetInt((uint16_t)(i*3+1)); |
|
|
|
|
pName = fCbArgs.GetString((uint16_t)(i*3+2)); |
|
|
|
|
|
|
|
|
|
if (pName == plClient::GetInstance()->fUsername) |
|
|
|
|
{ |
|
|
|
|
plClient::GetInstance()->fPlayerID = pId; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (context == kCreatePlayer) |
|
|
|
|
{ |
|
|
|
|
if (hsSucceeded(resultCode)) |
|
|
|
|
plClient::GetInstance()->fPlayerID = fCbArgs.GetInt(0); |
|
|
|
|
} |
|
|
|
|
else if (context == kDeletePlayer) |
|
|
|
|
{ |
|
|
|
|
if (hsSucceeded(resultCode)) |
|
|
|
|
plClient::GetInstance()->fPlayerID = -1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fNumCurrentOps--; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool IsActive() |
|
|
|
|
{ |
|
|
|
|
return fNumCurrentOps > 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
int fNumCurrentOps; |
|
|
|
|
}; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
bool plClient::StartInit() |
|
|
|
|
{ |
|
|
|
|