|
|
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:
9 R. F9 L) ]% E0 sCode:
7 ]" N; e$ i/ k% |% _" h, Z. e$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");, m7 { E' O+ U& H
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:
( B% w& B1 x5 G ?& I; ?' ECode:
0 ^! t7 W$ \3 Q) \4 {' a$ N O/ L2 Q$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");7 s% p, \. V4 |' t
echo mssql_num_rows($mssql);0 H; V- }/ Z+ A3 M$ ~( b# D
' ?2 `1 k* A7 b$ j7 ^ |
|