AMREG
18-08-2009, 04:38
I use a test server (home-based, v2.0.20.1), and a "production" server (rented, v2.0.23.19).
Both run under Linux so I post here, but as it deals with the TCPQuery interface the following may apply as well to Windows TS2 servers (I simply have no way to check the Windows case).
I am preparing scripts to automate some users database updates, according to various criteria. So I'm focusing on what can be done using the TCPQuery interface.
1) Banning.
On both servers, my "ordinary" TS2 account has SA privileges (in other words, it is equivalent to the "admin" account, not to the "superadmin" one).
When I log in through a TS2 client with this account, I can ban or un-ban users from the server. OK, fine.
When I log in through the TCPQuery interface using the same account, I get "ERROR, invalid permissions" for exactly the same operations. Why ? (Yes, I first selected the correct server and logged in, prior to try to ban/unban... but no way).
To be able to (un)ban someone from the TCPQuery interface, I need to log in as superadmin, and only then it works. But what required SSA privileges via TCPQuery can always be undone via a simple SA-level login via the client. Seems inconsistent...
2) DBUserID.
Deleting a user from the database via the TCPQuery interface requires to provide his/her DBUserID. Normal so far.
What seems less normal is that the deletion itself only requires a SA-level login, but finding out the relevant DBUserID requires SSA-level login.
In other words, the "dbuserdel nnn" command needs only a SA-level login, but the "dbuserid" needed to get the "nnn" itself requires a SSA-level login (trying to issue a dbuserid with a simple SA-level login yields the same error as above - invalid permissions). Why ?
Note : Conversely, the related command "dbuserlist" only requires SA-level privileges, as could be expected. It produces the above DBUserID information (among a huge bunch of other information), so it seems definitely inconsistent to require the highest level login to be able to get the DBUserID only with "dbuserid", while it is available (with many other things) via a lower level login and "dbuserlist"...
So why do I not simply use the "dbuserlist" ? Just remember that all that stuff will eventually be done programatically. The "dbuserid" yields exactly what is needed (no more, no less), while extracting the same data from the output of "dbuserlist" both yields unneeded network traffic (especially on crowded servers) and requires developing additional software, simply to cope with what seems basically a unappropriate privilege management on the server's TCPQuery interface.
3) Other similar symptoms.
The same principle as above (SSA-level login abusively mandatory) applies to other commands on the interface, such as the "fp" command to find out the PlayerID of a connected player for subsequent actions.
For instance, the "kick p_id" (for kicking a connected user) only requires SA-level login, but finding out the necessary "p_id" using the "fp" command requires a SSA-level login (same old song...).
Similarly, the same "p_id" info can yet be obtained among many other things from a more general command ("pl"), here again with a simple SA-level login...
Sorry, I didn't test each and every command available with this interface, I tested only the ones I plan to use in the near future. But I ends with a general feeling of a systematically inconsistent privileges management...:(
Both run under Linux so I post here, but as it deals with the TCPQuery interface the following may apply as well to Windows TS2 servers (I simply have no way to check the Windows case).
I am preparing scripts to automate some users database updates, according to various criteria. So I'm focusing on what can be done using the TCPQuery interface.
1) Banning.
On both servers, my "ordinary" TS2 account has SA privileges (in other words, it is equivalent to the "admin" account, not to the "superadmin" one).
When I log in through a TS2 client with this account, I can ban or un-ban users from the server. OK, fine.
When I log in through the TCPQuery interface using the same account, I get "ERROR, invalid permissions" for exactly the same operations. Why ? (Yes, I first selected the correct server and logged in, prior to try to ban/unban... but no way).
To be able to (un)ban someone from the TCPQuery interface, I need to log in as superadmin, and only then it works. But what required SSA privileges via TCPQuery can always be undone via a simple SA-level login via the client. Seems inconsistent...
2) DBUserID.
Deleting a user from the database via the TCPQuery interface requires to provide his/her DBUserID. Normal so far.
What seems less normal is that the deletion itself only requires a SA-level login, but finding out the relevant DBUserID requires SSA-level login.
In other words, the "dbuserdel nnn" command needs only a SA-level login, but the "dbuserid" needed to get the "nnn" itself requires a SSA-level login (trying to issue a dbuserid with a simple SA-level login yields the same error as above - invalid permissions). Why ?
Note : Conversely, the related command "dbuserlist" only requires SA-level privileges, as could be expected. It produces the above DBUserID information (among a huge bunch of other information), so it seems definitely inconsistent to require the highest level login to be able to get the DBUserID only with "dbuserid", while it is available (with many other things) via a lower level login and "dbuserlist"...
So why do I not simply use the "dbuserlist" ? Just remember that all that stuff will eventually be done programatically. The "dbuserid" yields exactly what is needed (no more, no less), while extracting the same data from the output of "dbuserlist" both yields unneeded network traffic (especially on crowded servers) and requires developing additional software, simply to cope with what seems basically a unappropriate privilege management on the server's TCPQuery interface.
3) Other similar symptoms.
The same principle as above (SSA-level login abusively mandatory) applies to other commands on the interface, such as the "fp" command to find out the PlayerID of a connected player for subsequent actions.
For instance, the "kick p_id" (for kicking a connected user) only requires SA-level login, but finding out the necessary "p_id" using the "fp" command requires a SSA-level login (same old song...).
Similarly, the same "p_id" info can yet be obtained among many other things from a more general command ("pl"), here again with a simple SA-level login...
Sorry, I didn't test each and every command available with this interface, I tested only the ones I plan to use in the near future. But I ends with a general feeling of a systematically inconsistent privileges management...:(