<!--quoteo(post=2017097:date=Nov 10 2012, 12:20 AM:name=Synergi)--><div class='quotetop'>QUOTE (Synergi @ Nov 10 2012, 12:20 AM) <a href="index.php?act=findpost&pid=2017097"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->u can set up a script which pushes RCON direct to ur server.
we did the same<!--QuoteEnd--></div><!--QuoteEEnd-->
Sr CoTTon, but we of Exit1.at dont want to share our code. Its not because of privacy or sth else, but actually we are only using workarounds for everything to get good servers to run. We have a workaround for the htpasswd, we have a workaround for motd, we have a workaround to get all WebInterfaces together, and on and on and on.
Its not that we dont want to share our solution with u, so if u really want the solution u can contact us in our forums www.exit1.at.
But we really dont want that these workarounds get satteled in the community. It's up to Unknown Worlds to make it able or not.
But generally said, we have the following setup to get an motd without server blacklisted as modded:
1) A php script 2) A timer for the php script 3) the php script itselfs casts "sv_say [TEXT]"
Alternatively, you could run <a href="http://cronw.sourceforge.net/" target="_blank">Cron for Windows</a> and then install <a href="http://www.vordweb.co.uk/standards/download_lynx.htm" target="_blank">lynx</a> (console-based browser) and run the command
<!--quoteo(post=2022789:date=Nov 13 2012, 10:47 PM:name=Whosat)--><div class='quotetop'>QUOTE (Whosat @ Nov 13 2012, 10:47 PM) <a href="index.php?act=findpost&pid=2022789"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Alternatively, you could run <a href="http://cronw.sourceforge.net/" target="_blank">Cron for Windows</a> and then install <a href="http://www.vordweb.co.uk/standards/download_lynx.htm" target="_blank">lynx</a> (console-based browser) and run the command
You could also just run your standard cron and lynx on linux remotely.<!--QuoteEnd--></div><!--QuoteEEnd-->
Well i tried it but i had the problem Lynx wasn't able to respond with a correct digest authentification; i tried wget but digest authentification seems to be broken since some version. Last resort cUrl (http://curl.haxx.se/download.html) worked for me
Don't forget to give execute permission on motd.sh with chmod +x /home/username/ns2server/motd.sh
Explanation: every 10 minutes it will say: "Admin contact: zaggynl on #naturalselection at irc.gamesurge.net"
Use <a href="http://meyerweb.com/eric/tools/dencoder/" target="_blank">http://meyerweb.com/eric/tools/dencoder/</a> to encode the part after rv_say%20 to URL notation, otherwise the message will not display correctly.
Can you check on your server console if the RCON command got through? That is the standard response from the server of the JSON data with the server's information.
NINJA EDIT: I suspect you are trying to do this from a batch file? If so, you need to change all "%" to "%%" as the % is a special operator in Windows batch files. Placing two of those tells Windows to interpret the "%%" as a literal "%" character.
i.e. curl.exe --digest "http://localhost:27057/?request=json&command=Send&rcon=sv_say%%20TEST1"
Running this command from the Windows Task Scheduler will not have such an issue.
These hacky solutions are fine for now, but I'd really love to see things like MOTD and scrolling messages with configurable intervals, colors, etc. be eventually implemented officially.
Comments
we did the same
we did the same<!--QuoteEnd--></div><!--QuoteEEnd-->
Now that. Is creative. :)
Synergi - you wanna explain how? :)
Its not that we dont want to share our solution with u, so if u really want the solution u can contact us in our forums www.exit1.at.
But we really dont want that these workarounds get satteled in the community. It's up to Unknown Worlds to make it able or not.
But generally said, we have the following setup to get an motd without server blacklisted as modded:
1) A php script
2) A timer for the php script
3) the php script itselfs casts "sv_say [TEXT]"
That easy nothing else.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->lynx -auth=username:password www.somesite.com/?request=json&command=Send&rcon=sv_say%20Welcome%20to%20The%20Thirsty%20Thirsty<!--c2--></div><!--ec2-->
every x minutes.
You could also just run your standard cron and lynx on linux remotely.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->lynx -auth=username:password www.somesite.com/?request=json&command=Send&rcon=sv_say%20Welcome%20to%20The%20Thirsty%20Thirsty<!--c2--></div><!--ec2-->
every x minutes.
You could also just run your standard cron and lynx on linux remotely.<!--QuoteEnd--></div><!--QuoteEEnd-->
Well i tried it but i had the problem Lynx wasn't able to respond with a correct digest authentification; i tried wget but digest authentification seems to be broken since some version. Last resort cUrl (http://curl.haxx.se/download.html) worked for me
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->C:\path\to\curl.exe --digest "http://**USERNAME**:**PASSWORD**@**DOMAIN_OR_IP**:**PORT**/?request=json&command=Send&rcon=sv_say%20TEST"<!--c2--></div><!--ec2-->
Beside cron you could use the Windows Scheduler to execute this command.
--connect-timeout and --max-time
Edit:
How I set it up on my Ubuntu server:
crontab -e
*/10 * * * * /home/username/ns2server/motd.sh
File /home/username/ns2server/motd.sh with contents:
/usr/bin/curl --digest "http://username:password@hostname:port/?request=json&command=Send&rcon=sv_say%20Admin%20contact:%20zaggynl%20in%20%23naturalselection%20at%20irc.gamesurge.net" --max-time 3 --connect-timeout 3 -silent -o /dev/null
Don't forget to give execute permission on motd.sh with chmod +x /home/username/ns2server/motd.sh
Explanation: every 10 minutes it will say: "Admin contact: zaggynl on #naturalselection at irc.gamesurge.net"
Use <a href="http://meyerweb.com/eric/tools/dencoder/" target="_blank">http://meyerweb.com/eric/tools/dencoder/</a> to encode the part after rv_say%20 to URL notation, otherwise the message will not display correctly.
Edit: added chmod part.
curl.exe --digest "http://localhost:27057/?request=json&command=Send&rcon=sv_say%20TEST1"
However I only get this response back
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->"map": "ns2_veil", "cheats": "false", "marines": 0, "aliens": 0, "player_list"
: [ ], "frame_rate": 29.996246337891, "devmode": "false", "marine_res": 50, "up
time": 2245, "server_name": "myservernamet", "alien_res":
50, "webport": "27057", "players_online": 0, "webdomain": "localhost" }
C:\servers\Tools\curl><!--QuoteEnd--></div><!--QuoteEEnd-->
Which is the the output from the web-interface when not going to index.html. I am doing this though localhost so I dont need username or password.
what am i missing?
NINJA EDIT: I suspect you are trying to do this from a batch file? If so, you need to change all "%" to "%%" as the % is a special operator in Windows batch files. Placing two of those tells Windows to interpret the "%%" as a literal "%" character.
i.e. curl.exe --digest "http://localhost:27057/?request=json&command=Send&rcon=sv_say%%20TEST1"
Running this command from the Windows Task Scheduler will not have such an issue.
<a href="http://www.unknownworlds.com/ns2/forums/index.php?s=&showtopic=120542&view=findpost&p=2039048" target="_blank">http://www.unknownworlds.com/ns2/forums/in...t&p=2039048</a>
Hope it helps someone.