|
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:
5 k/ T) i x: E- M9 H1 ECode:, Y6 Q0 D9 e0 b/ T
$mssql = mssql_query("SELECT * FROM [ACCOUNT_DBF].dbo.[ACCOUNT_TBL] WHERE isuse='J'");
/ Q# k: I1 R8 [: Z; l. B! Q4 Yecho 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:& p/ I8 N5 o3 Q
Code:
' }0 ]2 ~' c9 R4 t: u$ R' ?$mssql = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE MultiServer='1'");8 H+ D G9 e$ T6 F
echo mssql_num_rows($mssql);! D$ E0 L8 j# w6 ?* S8 d) E$ ]
4 s3 w6 P: X. M+ F- ]0 l! R
|
|