Programming a Lua MUD server, trying to accept keyboard input
#1 Members - Reputation: 126
Posted 21 August 2012 - 12:17 PM
#2 Moderators - Reputation: 7663
Posted 21 August 2012 - 04:57 PM
[Work - ArenaNet] [Epoch Language] [Scribblings] [Journal - peek into my shattered mind]
#4 Moderators - Reputation: 7663
Posted 21 August 2012 - 06:18 PM
[Work - ArenaNet] [Epoch Language] [Scribblings] [Journal - peek into my shattered mind]
#5 Members - Reputation: 126
Posted 21 August 2012 - 06:19 PM
Its the Lua for Windows package, if that's what you're asking.(Sorry, I'm new at this thing... all my Lua experience has been scripting in Mudlet, which auto compiles/runs the scripts for you. Over there, you just type the code out and save it.)
Edited by WackyWormer, 21 August 2012 - 06:25 PM.
#6 Moderators - Reputation: 7663
Posted 21 August 2012 - 06:51 PM
[Work - ArenaNet] [Epoch Language] [Scribblings] [Journal - peek into my shattered mind]
#7 Members - Reputation: 101
Posted 22 August 2012 - 06:00 AM
For a Lua MUD server, check out MudCore, which is build on pretty good stuff. I can't vouch for how well it would perform, I've only fiddled with it a bit, but the tech behind it is pretty solid.
It's cross-platform as well so you wouldn't be getting tied down to finding a Windows server for your hosting.
Edited by Vadi, 22 August 2012 - 06:03 AM.
#8 Moderators - Reputation: 3293
Posted 23 August 2012 - 12:16 PM
It does look like the CUI library has a "nodelay" option to allow polled input.
However, if I were to do this personally, I would add an attribute to users for whether they are allowed admin options or not, and just do it using regular logins.
If this scales up to a bigger system, you'd want to replace "is_admin" with a list of specific granted privileges, and test different privileges for different management functions. This would allow certain users to be "wizards" without being "admins."
#9 Members - Reputation: 126
Posted 23 August 2012 - 06:37 PM
#10 Moderators - Reputation: 7663
Posted 23 August 2012 - 06:40 PM
[Work - ArenaNet] [Epoch Language] [Scribblings] [Journal - peek into my shattered mind]
#11 Members - Reputation: 126
Posted 23 August 2012 - 10:19 PM
#12 Moderators - Reputation: 7663
Posted 23 August 2012 - 11:25 PM
[Work - ArenaNet] [Epoch Language] [Scribblings] [Journal - peek into my shattered mind]
#13 Moderators - Reputation: 3293
Posted 24 August 2012 - 10:29 AM
Yep, a shutdown command is the typical way to handle that.
If your game is designed to require a "clean" shutdown, then the first "hard" crash you get will destroy your game.
Design your game to survive any "hard" failure. If you need to shut down the server, just kill the process. (You may want to tell users a few minutes before, of course ;-)
Netflix takes this one step further: Because systems will fail, and all systems should be written to survive failure, they have a "chaos monkey" that will randomly kill servers/services. You have to design your code so that you survive this. It's a different way of thinking.
#14 Moderators - Reputation: 7663
Posted 24 August 2012 - 10:49 AM
However, especially during development clean shutdowns can be extremely useful as you can use them to spot-check for leaks, things that don't clean up properly, and so on. In my experience making sure things can shutdown cleanly is a good first step to making sure they are also recoverable in the worst-case scenario.
[Work - ArenaNet] [Epoch Language] [Scribblings] [Journal - peek into my shattered mind]






