- // This function will free our clientID
- void CWorldServer::ClearClientID( unsigned int id )
- {
- if(id<0||id>0xffffff)
- {
- return;
- }
- #ifdef STATICID
- //Log(MSG_INFO,"In clear CID %i",id);
- //LMA: if the thread is already blocked, it should return EBUSY
- //else 0
- UINT res_blockP=pthread_mutex_trylock(&GServer->PlayerMutex);
- UINT res_blockM=pthread_mutex_trylock(&GServer->MapMutex);
- #endif
- if(ClientIDList[id]>1)
- {
- Log(MSG_INFO,"CID %i has already been cleared?",id);
- }
- else
- {
- ClientIDList[id] = (unsigned)time(NULL);
- }
- //Log(MSG_INFO,"XCID, clearing CID %u",id);
- #ifdef STATICID
- if (res_blockP==0)
- {
- pthread_mutex_unlock( &GServer->PlayerMutex );
- }
- if(res_blockM==0)
- {
- pthread_mutex_unlock( &GServer->MapMutex );
- }
- //Log(MSG_INFO,"Out clear CID %i",id);
- #endif
- return;
- }
this message is the smoking gun
Sun May 12 08:06:00 2013 - [INFO]: - CID 15785 has already been cleared?
That should never happen unless there's something terribly wrong.
I checked through the code to see where this is being output and found it in function ClearClientID in ExtraFunctions.cpp
I'm not at all sure why it is spitting out that message. It seems that this clientid has already been cleared somewhere else.
Do you get that message a lot?
Right now the code doesn't actually tell us what the clientid list value is though. id is just the index value which is 15785 in this case.
The value in the clientidlist should be 0 when an id is in use and a value set to equal time(NULL) at the time where it is cleared.
Seems like a weird way to do it but it has always worked.