I don't understand "action id's" in chat.admin.php

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

Post Reply
amgreborn
pedestrian
pedestrian
Posts: 14
Joined: 05 Jun 2018 15:38
Owned TM-games: TMU

I don't understand "action id's" in chat.admin.php

Post by amgreborn » 13 Sep 2019 17:25

I just started looking into manialinks, maniacodes and such. I opened chat.admin.php to have a look there, and I saw a bunch of ID ranges for different commands... example

Code: Select all

// handles action id's "2201"-"2400" for /admin warn
later in the code this appears...

Code: Select all

target = $player->playerlist[$answer[2]-2201]['login'];
Now... I am on my server with 2 accounts. When I click the warn button on one of 2 players, and log out $answer[2] in console, I get 2201. When I click the other player, I get 2202. These numbers are subtracted by 2201 and will essentially just give me the login of the player who I want to warn... But here's what I don't get: Why is the range 2201 - 2400? That's 199.... But TM server allow up to 255 players????? If $answer[2] just increase for every player, after 200 players (or 199 whatever) it should be at 2400... What happens to the other 55 player? The warn command doesn't work for them??

:ftw: :ftw: :ftw: :ftw:

User avatar
L3cKy
smooth traffic navigator
smooth traffic navigator
Posts: 193
Joined: 05 Sep 2007 13:55
Owned TM-games: TMUF
Location: Berlin
Contact:

Re: I don't understand "action id's" in chat.admin.php

Post by L3cKy » 14 Sep 2019 03:58


Xymph
Pit Crew
Pit Crew
Posts: 5706
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: I don't understand "action id's" in chat.admin.php

Post by Xymph » 14 Sep 2019 05:49

Manialink action ids need to be unique for each action anywhere on the screen by any plugin. See includes/manialinks.inc.php for the entire list. 200 players was just a practical choice for the admin panels, commands to any specific player outside that list can always be sent by login via the chat.
Array reset() has nothing to do with it.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

amgreborn
pedestrian
pedestrian
Posts: 14
Joined: 05 Jun 2018 15:38
Owned TM-games: TMU

Re: I don't understand "action id's" in chat.admin.php

Post by amgreborn » 14 Sep 2019 13:14

@l3cky :roflol:

thanks for the response xymph

Post Reply