|
|
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:
U% o p" |* J6 o' x. DCode:* v$ f7 K. y6 ^8 j! V+ w
$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'"); u; u9 s A/ n: 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:& ^' ^+ i9 t) ]+ b& J
Code:
1 g5 K$ C" n5 u9 D0 j. a' C1 y9 r$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");6 Y, q% x, ?% c# k
echo mssql_num_rows($mssql);
3 n$ }6 p1 s* n1 B7 @- {7 t$ R
* C8 r2 J2 l/ I9 ~8 z* H1 } |
|