git-svn-id: http://mc-server.googlecode.com/svn/trunk@281 0a769ca7-a7f5-676a-18bf-c427514a06d6
parent
eefe71f593
commit
4a7883a5e3
|
@ -174,7 +174,7 @@ static int tolua_cWorld_ForEachPlayer(lua_State* tolua_S)
|
||||||
int TableRef;
|
int TableRef;
|
||||||
} Callback( tolua_S, FuncRef, TableRef );
|
} Callback( tolua_S, FuncRef, TableRef );
|
||||||
|
|
||||||
bool bRetVal = self->ForEachPlayer( &Callback );
|
bool bRetVal = self->ForEachPlayer( Callback );
|
||||||
|
|
||||||
// Unreference the values again, so the LUA_REGISTRYINDEX can make place for other references
|
// Unreference the values again, so the LUA_REGISTRYINDEX can make place for other references
|
||||||
luaL_unref( tolua_S, LUA_REGISTRYINDEX, TableRef );
|
luaL_unref( tolua_S, LUA_REGISTRYINDEX, TableRef );
|
||||||
|
|
|
@ -471,7 +471,7 @@ void cServer::ServerCommand( const char * a_Cmd )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} Logger;
|
} Logger;
|
||||||
cRoot::Get()->GetWorld()->ForEachPlayer(&Logger);
|
cRoot::Get()->GetWorld()->ForEachPlayer(Logger);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if( split[0].compare( "numchunks" ) == 0 )
|
if( split[0].compare( "numchunks" ) == 0 )
|
||||||
|
|
|
@ -214,7 +214,7 @@ void cWebAdmin::Request_Handler(webserver::http_request* r)
|
||||||
|
|
||||||
cPlayerAccum PlayerAccum;
|
cPlayerAccum PlayerAccum;
|
||||||
cWorld * World = cRoot::Get()->GetWorld(); // TODO - Create a list of worlds and players
|
cWorld * World = cRoot::Get()->GetWorld(); // TODO - Create a list of worlds and players
|
||||||
World->ForEachPlayer(&PlayerAccum);
|
World->ForEachPlayer(PlayerAccum);
|
||||||
Content.append(PlayerAccum.m_Contents);
|
Content.append(PlayerAccum.m_Contents);
|
||||||
Content += "</ul><br>";
|
Content += "</ul><br>";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1052,13 +1052,13 @@ void cWorld::RemovePlayer( cPlayer* a_Player )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool cWorld::ForEachPlayer(cPlayerListCallback * a_Callback)
|
bool cWorld::ForEachPlayer(cPlayerListCallback & a_Callback)
|
||||||
{
|
{
|
||||||
// Calls the callback for each player in the list
|
// Calls the callback for each player in the list
|
||||||
cCSLock Lock(m_CSPlayers);
|
cCSLock Lock(m_CSPlayers);
|
||||||
for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||||
{
|
{
|
||||||
if (a_Callback->Item(*itr))
|
if (a_Callback.Item(*itr))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,7 @@ public:
|
||||||
void RemovePlayer( cPlayer* a_Player );
|
void RemovePlayer( cPlayer* a_Player );
|
||||||
|
|
||||||
typedef struct lua_State lua_State;
|
typedef struct lua_State lua_State;
|
||||||
bool ForEachPlayer(cPlayerListCallback * a_Callback); // Calls the callback for each player in the list
|
bool ForEachPlayer(cPlayerListCallback & a_Callback); // Calls the callback for each player in the list
|
||||||
// >> EXPORTED IN MANUALBINDINGS <<
|
// >> EXPORTED IN MANUALBINDINGS <<
|
||||||
unsigned int GetNumPlayers(); //tolua_export
|
unsigned int GetNumPlayers(); //tolua_export
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue