|
In the past I've seen various ways of checking the current number of online players, but all that I've seen have a fatal flaw. Depending on how the server was turned off (or more specifically, if it crashes) the player count gets messed up. Here's the one I'm talking about:
. _7 I# I6 ]3 {5 BCode:
" K4 C- O& ] S9 p X# ^$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");; J1 I f0 a0 }+ @& _2 V; ~
echo mssql_num_rows($mssql);Here's a more proper code, which will automatically reset the current online count whenever the world server program is opened:
2 ?$ O' m% z* `6 f ]Code:
! n% ?0 z/ I9 f, a; {( s$ i, S$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");1 p9 X7 _8 m1 `
echo mssql_num_rows($mssql);' ]7 ~" W6 W$ @. T
% s9 |$ [; F w4 ]5 E$ _ |
|