|
|
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:, k, m7 y; G1 s- A6 R3 u& c
Code:
u) P, h p: b3 ]2 i/ L$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");
. e8 N% f; s. h, S( f; I% h& b/ Cecho 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:% m% }( ]7 ~& g* D+ C: o
Code:
& S# y& M/ |" p# n$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");. G8 I$ g. i! j( n
echo mssql_num_rows($mssql);
0 x( {/ o; x ^4 E8 u3 j! F: z" a
0 Y4 b: {) x0 l, B) K |
|