|
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:3 u! _1 }8 k! I, i: N
Code:6 ~* Q' b+ N0 v6 K1 \4 K
$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");
/ M, f3 @" _# ~6 R7 X9 ? W/ wecho 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 [% s5 q& F% z2 A; `; }, I" {Code:' |5 Q: B+ O9 {9 c+ ~
$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");+ O& k# a. k8 u5 C4 W" d8 [7 }
echo mssql_num_rows($mssql);9 Q; P' \- n. _1 Z0 c8 N
6 e2 i c3 N$ N3 v0 s
|
|