Periodic sv_say Messages?

StukaJU87cStukaJU87c Join Date: 2012-11-04 Member: 166988Members
Is there anyway (without mods) to have an sv_say message periodically displayed..with info such as forums etc..?

Comments

  • SynergiSynergi Join Date: 2012-11-07 Member: 167921Members
    edited November 2012
    u can set up a script which pushes RCON direct to ur server.

    we did the same
  • StukaJU87cStukaJU87c Join Date: 2012-11-04 Member: 166988Members
    Could you post an example of what you are using?
  • TechnIckSTechnIckS Join Date: 2007-01-14 Member: 59616Members
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    <!--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-->

    Now that. Is creative. :)
  • CoTTonCoTTon Join Date: 2005-02-28 Member: 42773Members
    edited November 2012
    I totally want this.

    Synergi - you wanna explain how? :)
  • SynergiSynergi Join Date: 2012-11-07 Member: 167921Members
    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]"

    That easy nothing else.
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    edited November 2012
    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

    <!--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.
  • ScyllaScylla Join Date: 2003-08-05 Member: 18942Members
    <!--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

    <!--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.
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    Wow, perfect! Might be a good idea to set a short timeout for the execution if its on the same machine as your server too.

    --connect-timeout and --max-time
  • ZaggyZaggy NullPointerException The Netherlands Join Date: 2003-12-10 Member: 24214Forum Moderators, NS2 Playtester, Reinforced - Onos, Subnautica Playtester
    edited November 2012
    Sticky for great justice!


    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.
  • GamigonGamigon Join Date: 2003-07-25 Member: 18418Members
    I setup the command as follows because I host NS2 on same server as curl.

    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?
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    edited November 2012
    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.
  • xLithxLith Join Date: 2012-11-02 Member: 165969Members
    Thanks for all of this information guys. I would have never figured this out on my own. Works great!
  • HeatSurgeHeatSurge Some Guy Join Date: 2012-09-15 Member: 159438Members, Reinforced - Supporter
    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.
  • TechnIckSTechnIckS Join Date: 2007-01-14 Member: 59616Members
    I answered a question about this using DAK Admin Mod and wrote a detailed post a bout it.

    <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.
Sign In or Register to comment.