|
|
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:; D+ c" m. A; \9 b
Code:1 |' d7 n2 p' _" E8 a% }5 o6 D4 \
$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");" n* O1 C& t8 O2 A2 S
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:
3 `4 e. }3 J/ }+ v0 z* ICode:, A2 b: w' {" m h
$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");4 L- T$ W7 L$ z* ~" u) y
echo mssql_num_rows($mssql);. A' W4 x: r/ A* P6 T. R9 w. J S0 d
( B3 b/ g/ H* w$ U1 o |
|