|
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:, p9 Q m% U# C8 W& m3 Y: f
Code:
U5 y" ?5 T4 q$ ~$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");' u8 Q$ n& q( _9 E/ A, h9 `
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 A7 k; r' b2 N5 n2 ^6 yCode:9 b% f8 `% C* |! N
$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");
) f- Y$ x1 _! q* Y* }+ cecho mssql_num_rows($mssql);
: c% n+ T, c5 A4 J8 d n+ C. F6 `& |1 }* S$ j2 ^
|
|