|
|
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:
9 q2 c6 k% A6 i% t) t$ o+ H1 t7 ECode:5 g* i' v# I5 u* s) h
$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");
& o& e# l+ |- m+ L0 I' P. m8 O" Zecho 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:7 {' W( k# W8 [4 F. B
Code:1 c3 S9 P, M3 O# ^# _
$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");) O9 m8 _# R( e
echo mssql_num_rows($mssql);
; M4 h$ b$ B% p3 b4 g
' u5 @: j0 p" X# k |
|