|
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:& T; s. M: B. m9 \9 W
Code:
; A- r( G& w8 n& T, e: R6 c2 q k H$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");
4 |2 H2 I' v1 ~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:
, g4 \ D; D/ y& F A kCode:
, f4 n+ o3 h9 f+ F$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");* P( @1 b/ s1 b) s/ ]
echo mssql_num_rows($mssql);* P, L3 E7 a! R C; s5 T8 \
, ^. ?) }8 X1 U0 y; b7 S4 y |
|