|
|
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:, j5 F1 _* P& l* U9 M
Code:' T) F- Y1 l0 p
$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");
: `' C* e U0 w$ U. s4 R* H1 F) gecho 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:
% O& S- D3 Y5 R5 BCode:0 L: h7 Q3 a2 J' @! F
$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");" G- ~3 i8 g: |+ H
echo mssql_num_rows($mssql);
9 E+ d2 I* B4 J) c; ^ _! K; g- r# O1 p' Q
|
|