|
|
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:, |! m* v3 {! ?- e
Code:5 a3 Q4 [* b+ u2 A7 ]% f p, S
$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");
, t% q, e2 r- k. r% P0 L- Jecho 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:$ b9 [' d& Y+ T+ [( W! k1 T" z
Code:. v7 W/ a5 F( a. ]
$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");
0 a/ R) u t# f8 r7 q/ hecho mssql_num_rows($mssql);( A* k$ W7 \2 D+ ^7 T
2 k/ A n( |; A& k* u/ R |
|