|
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:/ H- Q1 h/ R' k/ @$ h2 R
Code:+ E2 D. k! J" h. p' T
$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");8 P8 u5 |+ |$ ^7 J
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:" i2 D' q, P+ @4 S" N! h
Code:" O7 U8 k7 P% G8 h, P
$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");0 e: G5 o. [+ Z- i4 U
echo mssql_num_rows($mssql);
: A4 B. d, L/ M2 t }2 e; R; Q4 O( Q5 U! {. `8 q7 R
|
|