|
|
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:
+ C( }: M5 Q7 @* zCode:
; M8 d1 R) O) g r% `. z$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");
3 b0 o& p( a0 p8 X( L( ?# Yecho 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:
L2 w: n1 _% }1 J: d' G- F: yCode:3 n3 q* J4 _, p, ~ q( ?
$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");
0 R6 G: D3 F# \3 |2 Mecho mssql_num_rows($mssql);
- Z7 Z) W1 g+ j1 H1 g, C; f/ s; J q
S* ^9 B% o5 _8 N1 E* A% G |
|