|
|
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 q) f/ J# lCode:
3 Y, g; S5 Z2 K1 {% n$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");4 A- R o) E! 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:- H9 e6 I* J$ t, B6 r, y6 G8 j
Code:
* a. M# u% W% i4 P, G7 n) e$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");, s1 ^" ~3 s9 W! ]: T
echo mssql_num_rows($mssql);
8 u$ Z" ?: ~/ K" ~, `
/ n" \5 y+ S) y& N% R" h2 d( w |
|