|
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:
. Q( _" \% |3 G9 YCode:
$ t1 K3 _& D; Y, D1 U$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");
8 ~; Z7 f S4 U4 v! \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:8 a) j# R' ^2 U. e
Code:. @5 A1 H% y4 {) z
$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");
r( z6 h5 S6 ^4 o) X3 T- wecho mssql_num_rows($mssql);
1 f5 p8 k6 E' S; Y/ m- Z% c+ v8 z" T/ V7 z" P
|
|