8 ms·
In Soviet Minecraft, server op you
- isaacdl 12y agoI want a dad like you.
- _jomo 12y agoThis is a really interesting hack. I have done a similar thing by runnig minecraft in tmux, tail -f | grep for something in the log file and then sending commands back to tmux. However, all these problems in the article can be solved with a few essential bukkit Plugins. Bukkit has been DMCA'd by one oft their own developers, probably because it became clear that Mojang (the company developing Minecraft) owns the rights over Bukkit. A popular fork of Bukkit, "Spigot" [0] has continued development and published patches until they stripped all of the contributions of the DMCA issuer. They published Spigot for Minecraft 1.8 on Friday. [0] http://www.spigotmc.org/ http://www.spigotmc.org/ Edit: typos
- hyp0 12y agotail -f log | grep keyword | while read line; do tmux send-keys -t 1:1.0 "$line"; done Really cool idea! But grep awaits EOF to pipe its result... (though it outputs line-by-line if result is not piped onward) How are you getting it to work? I found a --line-buffered option for GNU grep, but I'm using busybox grep... EDIT OK, in case anyone else wants to know, found I could solve it by putting the grep inside the while loop instead (line=`echo $line | grep keyword`), but I'd still like to hear how you did it... BTW: entering "-" causes send-keys interprets it as an option.. I pr need some data cleansing...
- sp332 12y agoMaybe you can fix your '-' problem by putting '--' (like a blank option) in front of it. This tells send-keys not to interpret anything after the -- as an option.
- hyp0 12y agoGood idea, thanks, I know that idiom but didn't think of it. Interestingly, it's not in the tmux manpage, but I just tried it and it works. Cool!
- _jomo 12y agoCan't remember exactly how I did it. However I found something similar that waits for a command to complete sed instead of grep. sed exists after the first match: send_to_mc "/wb SomeWorld trim 100 15 C-m" sleep 1 send_to_mc "/wb trim confirm" tail -n 0 -F "logs/latest.log" | sed "/trimmed so far (100.0% done)/q" send_to_mc "/broadcast Chunk deletion done" send_to_mc is simply sending $1 + return to tmux: tmux send -t "$tmux_session" "$1" C-m /wb is a command from the WorldBorder [0] command that is (in this case) used to delete all chunks (which were generated for some reason) beyond the border. using while read line is probably the best option if you want to continuously check the logs You could also use awk isntead of grep: awk "/pattern/{print $0}" 0: https://github.com/Brettflan/WorldBorder https://github.com/Brettflan/WorldBorder EDIT: Completely misunderstood your problem. I thought grep wouldn't output to stdout until EOF. Seems like a loop is the only option
- nightpool 12y agoYep along with Spigot, as mentioned by _jomo, there's also a new project called Sponge that is replacing CraftBukkit from the ground up, building on top of Minecraft Forge (a modloader) rather then as a standalone mod like CraftBukkit/Spigot. Its still in pre-alpha though, and there are a LOT of things unimplemented, compared to Spigot which is a fork of Bukkit. Another popular option is Glowstone, which is an open source implementation of the entire minecraft server, rather then a mod. Glowstone already supports plugins written for the Bukkit API (separate from the CraftBukkit implementation that got DMCA'd) and there are plans to support the Sponge API when its more mature. I can't speak to its stability/completeness though. It looks like there isn't any redstone or physics yet? That shouldn't be a huge deal for most creative servers, but YMMV.
- jimmaswell 12y ago>There's no command to get a player's location You can see it on the debug overlay. One of the F keys. Also, I'd recommend running the server inside screen so you can get back to it from ssh
- 0942v8653 12y agoIt's F3, but that wouldn't have worked, because he needed a message to be logged (otherwise they'd have to type the coordinates in).
- Kequc 12y agoI'm certain this is an unpopular opinion I see Minecraft as an incredibly buggy mess. Not for it being unfun, because it is, a lot of fun but for years this game has been plagued with a litany of problems. [Edit: Maybe it isn't an incredibly unpopular opinion I'm just used to people who play games try to cut you when you critique.] Shortly before horses were added I thought something was going to be done to help the finer OCD-minded fans in the community like me. After horses were added I realised that was not going to happen. For example a bug cropped up that would lose a 'tick' of redstone power once per transfer down a circuit. Only if the pulse was shorter than three 'ticks' long. Making anything requiring use of a precision circuit impossible. That as far as I know was never actually fixed. Microsoft own the property I'd like to see them have a go at remaking it. I'm absolutely positive there will always be holdouts over the original. But Minecraft by itself doesn't seem like it would be all that complicated a game to remake. I'd play it.
- ivraatiems 12y agoFrom what I have seen, that is not at all an unpopular opinion. Minecraft is widely considered, even by its own player base, to be a resource-hogging, poorly-built mess. It is really fun, though.
- joezydeco 12y ago"Son, have you been playing Minecraft on my iMac again?" "No way, Dad" <feels white-hot top of unit> "Go to your room." (This is an actual transcript from last week)
- lostlogin 12y agoI can use the same technique with MS Word on the Macs in our house. They feel broken if someone has used Word recently. Restart required. 2013 MacBook Airs.
- ivraatiems 12y agoApple laptops have, and have had for some time, absolutely terrible heat dispersion. I had a 2007 silver Macbook Pro that overheated constantly under any kind of load. It was a huge pain.
- pjungwir 12y agoLine-oriented text-based interfaces strike again! I haven't used Perl in years, but I'd like to know why the POE approach is groty. I'd prefer writing the thing in Perl than Expect. As a dad waiting eagerly for his son to be old enough to play Minecraft, I'd much rather run an unmodded server, so this approach is very appealing to me. I've been disappointed that almost every pre-release for 1.8 had nothing but server commands, but if it means I can drive a Minecraft server without mods I see more value to that effort. I'm curious if the Dominus mentioned in the article is mjd. I saw him speak once on how git was a greater accomplishment for Linus than Linux. At 37 years old, I'm trying to find a path forward in my career that lets me keep growing as a programmer. It's encouraging to see these hackers who have stayed with their craft all these years and are still churning out cool solutions.
- rjbs 12y agoPOE is (in my opinion) a bit grottier than some other solutions might have been, but certainly not on the "shrieking horror" level of Expect. ;) There are many different sugar layers built atop POE, but I'm now using MooseX::POE, which is nice. It's not a disgusting pile of hacks, unless you think that everything in Perl is that, in which case... y'know. For example, IO::Async lets you do your work with futures, which are a very nice abstraction that people from many other languages are used to. You can do that in POE, but it's not the default way. POE also has, sometimes, weird choices of jargon for stuff. I know POE better, though, and my goal was to get it done, rather than learn a new framework or build something to last the ages. I mean, the kid might stop being interested in Minecraft at any second, right? And yes, it was mjd.
- kordless 12y agoI've been noodling around with Minecraft servers because it was the original idea behind what I'm now working on at StackMonkey. Messing around with the deployment for these servers[1] has helped me refine the business models a bit to make them more manageable. As a result, we'll have self-hosted managed-software-as-a-service deployments within a month or so. The demo server for Minecraft on the site[2] launches a server with ScriptCraft installed, which allows you to run JavaScript executables that execute actions in game. For example, you can build a sphere of TNT boxes with a very short JS comman. The intent behind this is to be able to bring the Bitcoin payment addresses for the server(s) in game where they can be managed by others. I'm working on getting qrcode.js running in game so I can build payment codes out of blocks. I'll also need to figure out a way to show the time left on the server. Now that I've read the post, I'm wondering how valuable adding the ability to op someone based on Bitcoin payments would be? It seems there needs to be a decent auth mechanism for this that can be quickly hooked up to the server. If the author's daughter wanted to 'op' herself, she simply sends in a very small amount of Bitcoin to the server. If the daughter's friend wanted to do it and was on with others, then they'd need to send in more to prove they weren't a bad actor. Maybe 10 cents or so. This is all related to enabling managing you software remotely on someone's cloud as if it were a public cloud. Enabling permissions for lower level users for high level functionality will surely be something we have to tackle. [1] https://gist.github.com/kordless/beba0a6fa8edcda3b15a https://gist.github.com/kordless/beba0a6fa8edcda3b15a [2] https://www.stackmonkey.com/demo/minecraft/ https://www.stackmonkey.com/demo/minecraft/
- deleted 12y ago[deleted]
- tete 12y agoSlightly OT: That code makes me miss Perl. Working, nice looking, easily understandable, object oriented, async code. https://github.com/rjbs/Soviet-Minecraft/blob/master/lib/Soviet/Minecraft.pm https://github.com/rjbs/Soviet-Minecraft/blob/master/lib/Sov...
- dola 12y agoI used to work on a Minecraft Server Tunnel which extended the idea of only using the console by also tunneling all network traffic. By inspecting packets it knew about things like player positions or block interactions which were used to allow players to have their own private chests or protected areas. It is fairly outdated now but was a very interesting project. https://github.com/SimpleServer/SimpleServer/ https://github.com/SimpleServer/SimpleServer/
- GICodeWarrior 12y agoI was hoping someone would post this. Too bad it hasn't been updated recently, but it had a good run.
- themoogle 12y agoThere is a much simpler reliable way to do this... Run a bungeecord proxy server http://www.spigotmc.org/threads/1-7-2-1-8-bungeecord.392/ http://www.spigotmc.org/threads/1-7-2-1-8-bungeecord.392/ Then you can link the servers together with signs and customizable nether portals. I have been running servers like this for a while now. And Craftbukkit isn't dead, http://www.spigotmc.org/threads/bukkit-craftbukkit-spigot-1-8.36598/ http://www.spigotmc.org/threads/bukkit-craftbukkit-spigot-1-... You can get the latest code from the devs at spigot without the DMCAed code, everything was rewritten, patched for 1.8 and is now has a legal way to distribute the files. (You compile them yourself)
- Orangeair 12y ago+1 for this. I actually just set up similar myself yesterday. Once you look at a few tutorials and figure out how to muck around with all the yaml config files, it's really pretty easy to configure bungeecord. The isolation you get from being in completely separate worlds is definitely an added bonus. You can do cool things like create worlds that are entirely devoted to a minigame, for instance, if you want to have that. It also makes it really easy to just create one hub world that players can teleport from, and return to easily. I used a really simple plugin called FancyPortals[0] to achieve that. There are a couple potential problems you may face, the biggest one being memory requirements (since you would actually be running n servers instead of just one). If that's the case, you could also check out MultiVerse[1], which is a bit easier on memory I believe. If nothing else, you should at least consider switching over to Spigot[2] (A high performance fork of Bukkit). They've had some DMCA problems, so you have to compile the .jar yourself, but there's a script which automates the entire process, so that's really no big deal. Plus they just updated to 1.8 yesterday! Once you have Spigot, you can use any Bukkit plugin. Plugins exist that do everything you're trying to do, and more, but with the added bonus of actually being integrated into the game. The big one to check out would be Essentials[3], which contains dozen of simple commands for doing lots of common, neat things. [0] http://dev.bukkit.org/bukkit-plugins/fancyportals/ http://dev.bukkit.org/bukkit-plugins/fancyportals/ [1] http://dev.bukkit.org/bukkit-plugins/multiverse-core/ http://dev.bukkit.org/bukkit-plugins/multiverse-core/ [2] http://www.spigotmc.org/threads/bukkit-craftbukkit-spigot-1-8.36598/ http://www.spigotmc.org/threads/bukkit-craftbukkit-spigot-1-... [3] http://dev.bukkit.org/bukkit-plugins/essentials/ http://dev.bukkit.org/bukkit-plugins/essentials/
- mholt 12y agoThe things you do for your kids.
- lifthrasiir 12y agoThe bot part sounds quite similar to what I've done with my server: https://github.com/lifthrasiir/mcbot https://github.com/lifthrasiir/mcbot . It opens two 0MQ sockets corresponding to the stdin and stdout of the java process and operates an IRC bot using them. 0MQ did have an advantage of not having to stop the server to update the bot.
- comrh 12y agoBeing a Minecraft admin is super fun, like a D&D dungeon master.
- adrusi 12y agoHuh, I used a similar approach several years ago running a Minecraft server for some friends on an old laptop as a child process of a nodejs monitor that had commands for changing time, getting certain items for free, etc. Eventually just migrated to craftbukkit because of demand for specific plugins. It turned out that the monitor process worked a lot better.