[ADMIN] MCSignOnDoor 1.9 - So Your Server Can Say "Gone Fishin' Back in Five!"

Discussion in 'Bukkit Tools' started by tustin2121, Mar 16, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Specops343

    Sorry, Im guess im kind of a noob to java, but how exactly do i run it?
     
  2. Offline

    tustin2121

    There's an example in a spoiler in the original post. :)
     
  3. Offline

    Specops343

    *facepalm* Alright, one question answered, one to go: Any ideas on ways i could set this up so it runs automatically after my server stops running?
     
  4. Offline

    tustin2121

    Well, if you start your server via a batch file / shell script (which is likely, as it's easier to just double click that file instead of typing in all the command line arguments needed every time) you can edit the script file to include the command to run McSod after the Minecraft server stops. This way, when the server stops, it goes right into McSod. For example (pulling from the examples here, though the script file I run doesn't have the BINDIR thing):

    Batch:
    Code:
    @ECHO OFF
    SET BINDIR=%~dp0
    CD /D "%BINDIR%"
    "%ProgramFiles%\Java\jre6\bin\java.exe" -Xincgc -Xmx1G -jar craftbukkit-0.0.1-SNAPSHOT.jar
    "%ProgramFiles%\Java\jre6\bin\java.exe" -jar MCSignOnDoor.jar -m "Message Here"
    PAUSE
    
    Shell script:
    Code:
    #! /bin/sh
    BINDIR="$(dirname "$(readlink -fn "$0")")"
    cd "$BINDIR"
    java -Xincgc -Xmx1G -jar craftbukkit-0.0.1-SNAPSHOT.jar
    java -jar MCSignOnDoor.jar -m "Message Here"
    
    (This is assuming you keep MCSignOnDoor.jar in the same folder as your craftbukkit.jar)
    Just remember you have to stop McSod before you can start the Minecraft server again - they use the same port, and one can't run while the other is.
     
  5. Offline

    Specops343

  6. Offline

    h0us3cat

    My server has 3 ip's, how can i set it up so it uses the right ip?
     
  7. Offline

    tustin2121

    That's kind of a neat tool there. If you come up with something to work with that, feel free to just post it here. :)

    .....How? I mean, how do you have 3 IP's? McSod makes the assumption that the IP of the computer it is running on is the IP players will try and connect to.

    Do they all point to the same server? Because in that case just starting it on the same server as Minecraft is usually running on should suffice.

    EDIT: Depending on what you have going there, I may have to release a new version to add an IP command line switch.
     
  8. Offline

    Specops343

    Dumptruckman says he might add mcsod compatability in his GUI!
     
  9. Offline

    h0us3cat

    I am on a windows server 2008, that server has 3 different ip's. the default is x.139 but my minecraft server runs on x.177. So if i start this .jar it runs on x.139. I hope this explains it more :)
     
  10. Offline

    tustin2121

    That's awesome! :p Tell him he can contact me if he needs any help with it. :)

    From the sound of it, I'm gonna have to add another command line switch for IP address.

    Have you tried connecting to it as it is right now? Does McSod respond properly or at all? Does it get caught by another service, or refused connection? I ask because the JavaDocs seem to suggest that setting up a ServerSocket without an IP address specified means that it listens on all IP addresses, whereas specifying one sets it up to only listen on that IP. (I find it odd that it says "local address", btw.)
     
  11. Offline

    h0us3cat

    If i run it the minecraft server just continue running.
    And if i connect to the default ip x.139 it says the message i setup in -m .
    So a -ip <iphere> will work fine i think :).
    And thx for looking at it.
     
  12. Offline

    tustin2121

    See if this works for you: McSod 1.3 PreRelease (Link Broken)
    (PreRelease because I can't test if this works without your help to test the situation you have.)
    java -jar MCSignOnDoor.1.3_pre.jar -ip <ip>
    :)
     
  13. Offline

    h0us3cat

    works! :cool:
     
  14. Offline

    GmK

    You dont know how long I have waited for something like this.

    Thank you SO much for making this!
     
    tustin2121 likes this.
  15. Offline

    tustin2121

    Excellent! Releasing then. :p
     
  16. Offline

    RaCooN

    Superb plug-in! Keep up the good work! Absolutely brilliant!
     
    tustin2121 likes this.
  17. Offline

    woodzy

    LOVE IT!, Worked first try my message is
    Dont Blaim Me, The Creepers Did It!!
     
    tustin2121 likes this.
  18. Offline

    Kahl

    Will this work for the current minecraft?
     
  19. Offline

    woodzy

    yea man its not a server plugin its a fake server that displays a message to the client when thay try to connect
     
  20. Offline

    Crig000

    Mine doesn't create any new folders/files/config's?
     
  21. Offline

    ARasputin

    Probably a stupid question, but how do I stop it?

    Nvm, I read the rest of the thread. Excellent tool, thank you so much!
     
  22. Offline

    Lolmewn Retired Staff

    Whoo! Whats thiis :p This is nice xD
     
    tustin2121 likes this.
  23. Offline

    tustin2121

    Source is now uploaded to GitHub for your forking pleasure (that sounded slightly wrong). Please abide by the Creative Commons BY-NC-SA 3.0 license, however.

    https://github.com/tustin2121/MCSignOnDoor

    MCSignOnDoor is not a bukkit plugin (and hence not in the plugin list). It does not go into the plugin folder, but (well, anywhere, but usually) in the top level craftbukkit folder. It runs separately from craftbukkit - because it's supposed to run when craftbukkit is not. In fact, if it runs while craftbukkit is running, it will throw an error and exit (or if it doesn't, you set it up wrong).

    It will not create anything new (unless specifically told to create and use a log file with that command line switch).

    Version 1.4 is OUT!

    Changelog:
    - Added support for minecraft color codes (see here)

    Thanks to FrozenBrain and his MessageChanger plugin for giving me the idea... and stealing his code. ;) His plugin is a complement to this program in that you can change the default messages sent to the clients while the server is running! Go check it out!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 12, 2016
  24. Offline

    Crig000

    Im now confused and don't know how to install it?
     
  25. Offline

    tustin2121

    There is no installation, you only run it. Have you seen this post yet? Have you looked at the example spoiler in the original post?

    If none of those can help you, then I'll have to give you specific instruction. Before I can give specifc instructions, however, I need to know a couple things:
    • How do you run craftbukkit? Via the command line or via a script that you double click on?
    • Are you running craftbukkit on a Windows or Mac (or, I suppose, Linux, though I don't use Linux)?
     
  26. Offline

    Crig000

    I finally worked how to and this is awesome it is extremely helpful!
     
  27. Offline

    tustin2121

    Excellent. Glad you enjoy it. :)
     
  28. Offline

    elevatorguy

    This is *exactly* what I needed!! You are a godsend!!

    and a gift for future thread readers, the result of an hour's worth of reading on google

    my killsign.sh (kills the screen session named mcaway - what i use for this program)
    Code:
    #!/bin/bash
    procID=$( screen -list | grep mcaway | cut -f1 -d'.' | sed 's/\W//g')
    kill $procID;
    
    I run the killsign.sh script at the beginning of my script starting bukkit and I run your program at the end of my stop bukkit script
    here they are
    Show Spoiler
    my halt.sh -- used from the commandline for a quick server stop to fix a plugin or something
    Code:
    #!/bin/sh
    screen -S bukkit -p 0 -X stuff "`printf "save-all\r"`";
    screen -S bukkit -p 0 -X stuff "`printf "stop\r"`";
    sleep 2;
    screen -dmS mcaway java -jar /home/minecraft/mc-server/MCSignOnDoor.jar -l /home/minecraft/mc-server/away.log -m "Server down shortly, it will be up again soon :)"
    
    
    my stop.sh, ran from cron for the nightly c10t map processing (mapupdate.sh), then cron runs start.sh again an hour later
    Code:
    #!/bin/sh
    screen -S bukkit -p 0 -X stuff "`printf "say Going down in 5 minutes.\r"`";
    sleep 240;
    screen -S bukkit -p 0 -X stuff "`printf "say Going down in 60 seconds.\r"`";
    sleep 55;
    screen -S bukkit -p 0 -X stuff "`printf "say Going down in 5 seconds.\r"`";
    sleep 4;
    screen -S bukkit -p 0 -X stuff "`printf "save-all\r"`";
    screen -S bukkit -p 0 -X stuff "`printf "stop\r"`";
    sleep 2;
    screen -dmS mcaway java -jar /home/minecraft/mc-server/MCSignOnDoor.jar -l /home/minecraft/mc-server/away.log -m "Server down for nightly web map update";
    
    my start.sh for minecraft bukkit
    Code:
    #!/bin/sh
    /home/minecraft/killsign.sh
    sleep 2;
    cd /home/minecraft/mc-server
    screen -dmS bukkit java -Xincgc -Xmx1G -jar craftbukkit-0.0.1-SNAPSHOT.jar
    
     
    MaliciousMan and tustin2121 like this.
  29. Offline

    tustin2121

    How is MCSignOnDoor holding up for everyone struggling to transfer to the new update? Hopefully Notch hasn't again changed the login protocol again like he did a couple updates ago now. :p
     
  30. Offline

    NeatMonster

    Can't download it :(.
     
Thread Status:
Not open for further replies.

Share This Page