|
|
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:+ P6 p; M0 d; N9 M2 y
Code:
2 }% t6 n& U. X, N. ?$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");1 h7 Z$ I$ a, G% F9 e9 R
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:) R6 H, h. B/ @7 q5 e6 _& e
Code:# B; E) e& Q2 d0 q7 {
$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");
3 n3 L5 w5 K, D7 R- y, hecho mssql_num_rows($mssql);
- Z4 t' M* }; z/ m" Z" s
$ c/ B- |% H) i |
|