|
|
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; j' p* l2 H. O/ Y3 p
Code:" w# ~, B6 ^0 Z; o% P( u* ~
$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");3 `$ H- T6 H6 g. z. R+ E
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:
& z0 R9 D7 s1 X: M( SCode:* \' H2 d" X0 h6 \& }7 w. I% z
$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");' y* r& v% H1 M/ E
echo mssql_num_rows($mssql);+ Q$ ?+ a& m; T+ p1 R1 y
; Z u( P m) |9 K' k1 v |
|