|
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:( n8 U' K; a" u5 e! U
Code:7 V$ E% O# z( E+ L4 H4 ~+ Q/ p4 I
$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");
7 S7 u/ O# v* n* ~' N. t/ becho 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:5 g- Y% S$ D3 C" H; a
Code:! z+ G1 o: d4 E6 A [ C; w- q
$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");
/ ~0 ?9 I0 L% R3 becho mssql_num_rows($mssql);5 T) W4 H- q: |, S( z0 K' \
7 U# r- ]8 b3 B6 n6 }1 E& z |
|