Some good changes in this latest version, I'm going to have to update and see how it goes!
Just one note though, it appears that in the latest MC version the "tell" command no longer works, which breaks a few things. Not sure if it is a permanent removal or a bug.
One feature request - add /tp to the intercepted commands to allow users to tp?
I apologize to everyone for the belated replies. I haven't been very active in the MC community for some time, but I noticed all of your activity and decided to make some updates to the script.
I cleaned up this patch and added it to the script. This is a much more elegant backup solution than I had, and much better than your original patch that I had promised to take a closer look at and never got around to.
Thanks!
I added in support for Pigmap. It doesn't have the feature set of c10t, but it is pretty slick non-the-less. If you have a mapping program that you feel should be added in, let me know and I'll try to spend some time adding it to the script.
Glad to see you're back and thanks for including my patch!
I use overviewer -http://overviewer.org for mapping myself and I have already modified this script to use it.
I can provide the edits and overviewer config files if you would like.
@sandain : Many thanks for the update! Everything seems to be running well on my Slackware setup. However, I'm not so sure this mcsuperserver thing is doing much good, in fact it's having an adverse effect and taking my users up to 20 seconds to login from hitting the connect button. Most hit the cancel button before they actually get to the game world. With the older version of your script logging in was pratically instant with no hanging around at all. Pigmap is just BRILLIANT and I love it - thank you!
Please consider making this mcsuperserver function optional and not mandatory in your next update. Like MrPhobik, I run CraftBukkit and although I'm not seeing any errors your previous script ran much better for me without it.
This is one of the hazards on loading Minecraft on-demand, especially on Bukkit if it has a bunch of mods. I run Tekkit for one server and it takes almost a minute to start so this would be a bad thing for me to use.
Edit 2: Ok, problem NOT solved. It's updating the server and everything alright, but now the servers won't start. It appears to be a problem with mcsuperserver.py; If I try to run it on my own, it creates a .properties file of some sort, and just goes idle.
Edit 3: So the servers DO run, but they tell the client that they're using version 1.3, or sometimes say the server's not reachable, or sometimes tell the client garbled data that makes the client put '???' everywhere. Can we get off MCSuperServer, or fix it, or something? It seems to just be causing problems, unfortunately
Just make sure you ONLY have JDK installed and not JRE as well. If you have both installed, minecraft will not run. This is my experience.
If you have both installed, uninstall them both and reinstall JDK only.
The JDK is the development environment (Java Development Kit). JDK is only needed when you want to write and compile Java applications.
The JRE is the runtime environment; the actual program that runs the Java applications.
Basically, you got it backwards; he needs the JRE installed, not the JDK. However, they shouldn't conflict with each other, so I doubt that is the problem.
I found with McSuperServer it was taking me between 20-30 seconds to log in to the game world and if I was the only player online it could take up to a minute to log in. It gets there eventually, but eventually is the key word here (i.e. if you don't think your internet has frozen, or the servers crashed/hanging, like most of my players did!) lol
The answer would be if Sandain made this mcsuperserver function an option, rather than forcing people to use it. Because it just doesn't seem to be working well for some people. So, for those individuals I would turn it off.
This is because MCSuperServer actually does not run the server at all until there is at least one player on the server. MCSuperServer wraps the protocol for telling the client how many people are on, the MOTD, and other information... But as soon as one player does join, it starts MC up and lets it take over those things as well.
For me it takes about 10 seconds, joining as the first player (I timed it just now). This is, however, on a dedicated Linux server at a friend's house running Debian Stable with no GUI - not on some Windows desktop running an unknown number of useless processes with Minecraft running minimized. Though it is worth noting that my friend lives in Washington, while I live in Arizona.
However, given the instability of the script, I have to completely agree. I don't want to be forced to use this, I want this to be optional. I'm disappointed that it isn't.
I have just uploaded a new version of the script that removes the support for mcsuperserver.py. While an interesting idea, it doesn't seem to work optimally for everyone and seems to be broken with the latest Minecraft update (1.4). I thought about making this feature optional instead of killing it with fire, but due to its current non-functional state, I went with fire. I apologize for not making this optional to begin with.
Actually, on my Slackware64 13.37 it's the other way around. If I have JRE installed Minecraft simple refuses to boot. I've also had friends running Ubuntu with exactly the same issue(s)... once JRE was removed everything worked perfectly. My apologies for assuming.
That's rather odd. I have both installed here on Ubuntu, but I always assumed that JDK relied on JRE; not the other way around. I'll have to use a VM to mess with this.
That's not a bad idea
I just looked through my patches to add an additional server and realized I have quite a bit more changes in the script. It might take a bit to make a .patch file.
Basically all I did was add an additional column to the worlds.conf file, server type.
Then based on which server type is set (mojang,bukkit,ftb,tekkit), it will run that jar from a sub-directory in the servers directory.
Having a jar detection in the world folder was something that I did not consider.
Create subfolders in /home/minecraft/minecraft_server/
bukkit/
ftb/
mojang/
tekkit/
FTB and Tekkit do not auto install or update, there is some code to do this but it is broken and commented out.
With this in mind, you will need to extract the server code to the FTb and Tekkit subfolders.
Starting a ftb or Tekkit server will copy ALL of the server code to the world folder, this is required.
Mojang and bukkit should install and auto update normally.
checkForLogout() {
local LOGOUT BAN PLAYER_NAME
LOGOUT=$(echo "$2" | $PERL -ne 'if ($_ =~ /(\w+) lost connection\: (.+)/) { print "$1\t$2"; }')
BAN=$(echo "$2" | $PERL -ne 'if ($_ =~ /Disconnecting (\w+)\s*\[\/([0-9\.]+)\:\d+\]\: You are banned/) { print "$1\t$2"; }')
if [ -n "$LOGOUT" ]; then
PLAYER_NAME=$(printf "$LOGOUT" | cut -f1)
# Remove the user from the world.users file.
execute "$PERL -i -ne 'print unless /^$PLAYER_NAME\t[0-9\.]+\t\d+\d+/;' $WORLDS_LOCATION/$1.users" $USER_NAME
# Announce the user logging out via lib-notify.
if [ $USE_LIBNOTIFY ]; then
libNotify "Minecraft - $1" "$PLAYER_NAME has logged out of world."
fi
elif [ -n "$BAN" ]; then
PLAYER_NAME=$(printf "$BAN" | cut -f1)
# Remove the user from the world.users file.
execute "$PERL -i -ne 'print unless /^$PLAYER_NAME\t[0-9\.]+\t\d+\d+/;' $WORLDS_LOCATION/$1.users" $USER_NAME
# Announce the user ban via lib-notify.
if [ $USE_LIBNOTIFY ]; then
libNotify "Minecraft - $1" "$PLAYER_NAME has been banned from the world."
fi
fi
}
checkForLogout() {
local LOGOUT BAN PLAYER_NAME
LOGOUT=$(echo "$2" | $PERL -ne 'if ($_ =~ /(\w+) lost connection\: (.+)/) { print "$1\t$2"; }')
BAN=$(echo "$2" | $PERL -ne 'if ($_ =~ /Disconnecting (\w+)\s*\[\/([0-9\.]+)\:\d+\]\: You are banned/) { print "$1\t$2"; }')
if [ -n "$LOGOUT" ]; then
PLAYER_NAME=$(printf "$LOGOUT" | cut -f1)
# Remove the user from the world.users file.
execute "$PERL -i -ne 'print unless /^$PLAYER_NAME\t[0-9\.]+\t\d+\d+/;' $WORLDS_LOCATION/$1.users" $USER_NAME
# Announce the user logging out via lib-notify.
if [ $USE_LIBNOTIFY ]; then
libNotify "Minecraft - $1" "$PLAYER_NAME has logged out of world."
fi
elif [ -n "$BAN" ]; then
PLAYER_NAME=$(printf "$BAN" | cut -f1)
# Remove the user from the world.users file.
execute "$PERL -i -ne 'print unless /^$PLAYER_NAME\t[0-9\.]+\t\d+\d+/;' $WORLDS_LOCATION/$1.users" $USER_NAME
# Announce the user ban via lib-notify.
if [ $USE_LIBNOTIFY ]; then
libNotify "Minecraft - $1" "$PLAYER_NAME has been banned from the world."
fi
fi
}
This patch looks good to me. Added.
I'll give some thought to the other one that adds server type selection to worlds.conf
I'll give some thought to the other one that adds server type selection to worlds.conf
Yeah, much thought is needed. The way I have it now is sloppy and could be done better.
I was thinking of using another config file for server types. Let me know if you have ideas on how to do this.
Just a quick question for sandain. WIll you be eventually settling for one particular mapping software or are you planning on changing your script to use a different one for every version you release? First c10t, then pigmap (which wasn't so bad), and now some overviewer thing which I don't even want to install on my system. lol
Sorry for the churn there. I would have preferred to stick with c10t, but it is no longer being updated and no longer functions with the current version of Minecraft. Pigmap wasn't bad, but it had no options to generate other views like c10t did, so I switched over to Overviewer which does. I'm happy with Overviewer and don't plan to switch again. As a nice bonus, they provide a Debian repository for automatic updates, meaning I don't need to deal with maintaining update code in the script.
The update to add overviewer is great.
I was about to provide a patch to add it but you seem to have beat me to it.
I do have a bit more functionality that I think will be useful.
This patch is for the Dec 3 2012 update
This patch adds the ability to have an overviewer-settings.py file in each world folder for more configuration.
If no config file is found, then a standard render will be made.
This also separates the Minecraft client update into it's own function and can be updated with
As for the overviewer-settings.py file, I have a default for you.
This will generate 6 maps types (normal, day, night, cave, nether, end), POI for all Signs, Player Spawn locations, and Player Last Seen locations.
These are removable by editing the settings file. http://pastebin.com/u7T16WCJ
A note about why the MC client needs an update routine added.
Overviewer uses the MC client for the textures.
If you render your map with a newer server build (ex 1.4.5) than the client build (ex. 1.3.1) then Overviewer will not render any new block types correctly and your maps will look bad.
Just one note though, it appears that in the latest MC version the "tell" command no longer works, which breaks a few things. Not sure if it is a permanent removal or a bug.
One feature request - add /tp to the intercepted commands to allow users to tp?
Swallowtail23.
It doesn't fully load.. any suggestions?
Glad to see you're back and thanks for including my patch!
I use overviewer -http://overviewer.org for mapping myself and I have already modified this script to use it.
I can provide the edits and overviewer config files if you would like.
This is one of the hazards on loading Minecraft on-demand, especially on Bukkit if it has a bunch of mods. I run Tekkit for one server and it takes almost a minute to start so this would be a bad thing for me to use.
So I updated to the newest version of the script. However, I still get the same error.
Edit 1: Nevermind, I found out the problem. For the newest release, they changed the download location for the .jar file. It is now:
https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar
Please update your script to reflect this.
Edit 2: Ok, problem NOT solved. It's updating the server and everything alright, but now the servers won't start. It appears to be a problem with mcsuperserver.py; If I try to run it on my own, it creates a .properties file of some sort, and just goes idle.
Edit 3: So the servers DO run, but they tell the client that they're using version 1.3, or sometimes say the server's not reachable, or sometimes tell the client garbled data that makes the client put '???' everywhere. Can we get off MCSuperServer, or fix it, or something? It seems to just be causing problems, unfortunately
The JDK is the development environment (Java Development Kit). JDK is only needed when you want to write and compile Java applications.
The JRE is the runtime environment; the actual program that runs the Java applications.
Basically, you got it backwards; he needs the JRE installed, not the JDK. However, they shouldn't conflict with each other, so I doubt that is the problem.
This is because MCSuperServer actually does not run the server at all until there is at least one player on the server. MCSuperServer wraps the protocol for telling the client how many people are on, the MOTD, and other information... But as soon as one player does join, it starts MC up and lets it take over those things as well.
For me it takes about 10 seconds, joining as the first player (I timed it just now). This is, however, on a dedicated Linux server at a friend's house running Debian Stable with no GUI - not on some Windows desktop running an unknown number of useless processes with Minecraft running minimized. Though it is worth noting that my friend lives in Washington, while I live in Arizona.
However, given the instability of the script, I have to completely agree. I don't want to be forced to use this, I want this to be optional. I'm disappointed that it isn't.
I have just uploaded a new version of the script that removes the support for mcsuperserver.py. While an interesting idea, it doesn't seem to work optimally for everyone and seems to be broken with the latest Minecraft update (1.4). I thought about making this feature optional instead of killing it with fire, but due to its current non-functional state, I went with fire. I apologize for not making this optional to begin with.
That's rather odd. I have both installed here on Ubuntu, but I always assumed that JDK relied on JRE; not the other way around. I'll have to use a VM to mess with this.
Later today I can provide a patch.
I just looked through my patches to add an additional server and realized I have quite a bit more changes in the script. It might take a bit to make a .patch file.
Basically all I did was add an additional column to the worlds.conf file, server type.
Then based on which server type is set (mojang,bukkit,ftb,tekkit), it will run that jar from a sub-directory in the servers directory.
Having a jar detection in the world folder was something that I did not consider.
To use:
A new server type column is added to the worlds.conf file
Create subfolders in /home/minecraft/minecraft_server/
bukkit/
ftb/
mojang/
tekkit/
FTB and Tekkit do not auto install or update, there is some code to do this but it is broken and commented out.
With this in mind, you will need to extract the server code to the FTb and Tekkit subfolders.
Starting a ftb or Tekkit server will copy ALL of the server code to the world folder, this is required.
Mojang and bukkit should install and auto update normally.
http://pastebin.com/REFrEvhP
http://pastebin.com/kUrDWQFF
Just noticed a goof
Change
To
To anyone else, please don't use this. It's ugly, hacked code that should be cleaned up.
I want to re-work this to be a bit more clean.
The server URL is wrong
Should be
You can still use the minecraft.net URL for the server, you just need to change the WGET command in the update section of the script to be:
This needs to be updated if the notification has changed in that version of bukkit
Can you paste the line from the server.log when a user logs out?
Hmm, is this a line for when the user is kicked or baned, or if they just quit/exit?
Replace the checkForLogout() function with this
This patch looks good to me. Added.
I'll give some thought to the other one that adds server type selection to worlds.conf
Yeah, much thought is needed. The way I have it now is sloppy and could be done better.
I was thinking of using another config file for server types. Let me know if you have ideas on how to do this.
Sorry for the churn there. I would have preferred to stick with c10t, but it is no longer being updated and no longer functions with the current version of Minecraft. Pigmap wasn't bad, but it had no options to generate other views like c10t did, so I switched over to Overviewer which does. I'm happy with Overviewer and don't plan to switch again. As a nice bonus, they provide a Debian repository for automatic updates, meaning I don't need to deal with maintaining update code in the script.
I was about to provide a patch to add it but you seem to have beat me to it.
I do have a bit more functionality that I think will be useful.
This patch is for the Dec 3 2012 update
This patch adds the ability to have an overviewer-settings.py file in each world folder for more configuration.
If no config file is found, then a standard render will be made.
This also separates the Minecraft client update into it's own function and can be updated with
Here is the patch
http://pastebin.com/R7AtdwSP
As for the overviewer-settings.py file, I have a default for you.
This will generate 6 maps types (normal, day, night, cave, nether, end), POI for all Signs, Player Spawn locations, and Player Last Seen locations.
These are removable by editing the settings file.
http://pastebin.com/u7T16WCJ
A note about why the MC client needs an update routine added.
Overviewer uses the MC client for the textures.
If you render your map with a newer server build (ex 1.4.5) than the client build (ex. 1.3.1) then Overviewer will not render any new block types correctly and your maps will look bad.