|
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: q: c& X# j5 ~1 S, [5 O" O2 ^' y
Code: N% ~' r; |* M) F
$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");
" e4 F; `, w8 oecho 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:- M6 T1 B$ R8 D5 Y. k1 ^
Code:5 y' }5 e$ c0 U& R" u6 B2 D/ [
$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");% D) g% y0 K& l: T3 H0 g
echo mssql_num_rows($mssql);
( j5 L3 \ J9 \- S
5 C+ W5 u- N1 p |
|