|
|
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* o- H. {" X/ ~5 z pCode:
- f5 h7 C- x4 d' G) I1 m$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");) C# T5 g: ^+ j+ Z4 f/ Z0 v/ a0 Q
echo 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 {# W ~8 S5 d$ d9 I
Code:
, K6 V+ L6 W3 m0 W% d$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");
~$ Y9 O* V/ ]echo mssql_num_rows($mssql); [8 X5 S! I; f" Z3 _" P
9 B+ B7 H3 n, o' k) { |
|