Hey all
I'm trying to make a server controller
Its my first ever try to write a php file
(actualy the first time i program xD)
Now i have a problem:
I can fully connect to the server and send message's and stuff , BUT
is there a list of call backs i can recieve from the server?
I've already looked inside the FOXcontrol file but i can't understand them
i'm looking for thing like:
TrackMania.PlayerConnect
Is there a list of all available call-backs ?
thanks in advance
Dedicated server callbacks?
Moderator: NADEO
Re: Dedicated server callbacks?
There you go: http://gamers.org/tm2/docs/ListCallbacks.html (TM2) or http://gamers.org/tmf/docs/ListCallbacks.html (TMF)
Good luck !
Good luck !
Global moderator | Dutch moderator | Laddermoderator | ManiaWiki moderator
Server Manager/webmaster of Smurfen.net, join us on Canyon, Valley and Royal!
ESL (Game) Staff Head for TrackMania (Stadium, Canyon and Valley).
Server Manager/webmaster of Smurfen.net, join us on Canyon, Valley and Royal!
ESL (Game) Staff Head for TrackMania (Stadium, Canyon and Valley).
Re: Dedicated server callbacks?
You have also a simple script in http://www.xaseco.org/downloads/rpc_utilities.zip : callbacks.php, which can help your first steps, showing easily all dedicated callbacks and so help to understand them.
Developer/maintainer of TM² Dedimania records system - TM² Fast4 server script (download , french topic)
Re: Dedicated server callbacks?
Thanks very much guys
Re: Dedicated server callbacks?
Hello!
I need a little help
i have this code:
and the only thing i get is this: http://imgur.com/WfWIJ
empty variables.
thanks in advance
I need a little help
i have this code:
Code: Select all
$connect->query('EnableCallbacks', true);
$connect->readCB(0);
$callbacks = $connect->getCBResponses();
foreach ($callbacks as $cb) {
if ($cb[0] == 'TrackMania.PlayerFinish') {
$cb[1] = $playerfinish['nickname'];
$cb[2] = $playerfinish['login'];
$cb[3] = $playerfinish['timee'];
$connect->query('ChatSendServerMessage', '$z$fffPlayer $f00'.$playerfinish['nickname'].'$fff('.$playerfinish['login'].'$fff) Drove this time: $f00'.$playerfinish['timee'].'$fff!');
}
}
empty variables.
thanks in advance
-
- Posts: 1041
- Joined: 15 Jun 2010, 15:46
Re: Dedicated server callbacks?
You've inverted assignments between $playerfinish array and $cb array. This should work:
Edit: well, even with this you won't have what you're expecting to have, because $cb[1] is an integer identifying the player, not his nickname. You have to query the server to get nicknames.
Code: Select all
$playerfinish['nickname'] = $cb[1];
$playerfinish['login'] = $cb[2];
$playerfinish['timee'] = $cb[3];
OS: Win 7 Pro x64
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
Re: Dedicated server callbacks?
Your assignments are in the wrong order. Use "var_dump()" to see the contents of a variable (or http://xdebug.org/docs/remote if you have acces to that).adder wrote:Code: Select all
foreach ($callbacks as $cb) { if ($cb[0] == 'TrackMania.PlayerFinish') { $playerfinish['nickname'] = $cb[1]; $playerfinish['login'] = $cb[2]; $playerfinish['timee'] = $cb[3]; $connect->query('ChatSendServerMessage', '$z$fffPlayer $f00'.$playerfinish['nickname'].'$fff('.$playerfinish['login'].'$fff) Drove this time: $f00'.$playerfinish['timee'].'$fff!'); } }
Re: Dedicated server callbacks?
Hello!
I've got a little question (its nothing really important)
I have this file "admins.list", and its a list off all admin logins. this is the list:
when i load this file into an array "$isadmin"
and perform an IN_ARRAY check like this:
it doesn't work. But with this: it does
why is this ?
I've got a little question (its nothing really important)
I have this file "admins.list", and its a list off all admin logins. this is the list:
Code: Select all
login
login2
adder
otherlogin
and perform an IN_ARRAY check like this:
Code: Select all
if (in_array($playerchat['login'], $isadmin)) {
Code: Select all
if (in_array($playerchat['login']."\r\n", $isadmin)) {
Re: Dedicated server callbacks?
You're working on Windows, on Linux you'd just need to append "\n".
But that's beside the point, you need to trim the lines that are read from the file before storing them in the array.
But that's beside the point, you need to trim the lines that are read from the file before storing them in the array.
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
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub
Re: Dedicated server callbacks?
It depends on how you load the admin list into your script.
ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!
Who is online
Users browsing this forum: No registered users and 3 guests