Page 1 of 1

[Idea] Reject players between certain hours [opening_hours]

PostPosted: Wed Feb 15, 2017 13:19
by texmex
For servers, I want to be able to schedule hours and weekdays where the server accepts player joins and hours where it rejects them.

For more flexible use, the mod would accept configuration from both "inclusive" and "exclusive" approaches. That is, the user would either
• specify opening hours of the server (the rest of the time it rejects players) or
• specify closing hours (the rest of the time it accepts players). Perhaps those could be combined, even.

The mod could be made to optionally
• broadcast messages when approacing closing hours
• kick players when closing hours comes in effect

For join rejection code there's already the Whitelist mod to look to.

Thoughts?

Re: [Idea] Reject players between certain hours [opening_hou

PostPosted: Thu Feb 16, 2017 05:59
by helpless
Cool idea. But you need to remember, if it's 0300 were you live, it may be 1500 were somebody else lives, and this is an international game.

Re: [Idea] Reject players between certain hours [opening_hou

PostPosted: Thu Feb 16, 2017 09:08
by texmex
helpless wrote:Cool idea. But you need to remember, if it's 0300 were you live, it may be 1500 were somebody else lives, and this is an international game.

True that! Informing players of that will be key. But for maintenance and other tasks, admins may still need to shut players out at some point. This would also be useful for private servers for people's kids, limiting access.

WHY?

PostPosted: Thu Feb 16, 2017 18:12
by Wuzzy
WHY?

Re: WHY?

PostPosted: Thu Feb 16, 2017 19:04
by texmex
Wuzzy wrote:WHY?

But for maintenance and other tasks, admins may still need to shut players out at some point. This would also be useful for private servers for people's kids, limiting access.

Re: [Idea] Reject players between certain hours [opening_hou

PostPosted: Fri Feb 17, 2017 13:27
by Nathan.S
Couldn't you just shut down the server and accomplish the same thing?

Re: [Idea] Reject players between certain hours [opening_hou

PostPosted: Fri Feb 17, 2017 14:41
by texmex
I can, that is what I do now using cron. But I notice that certain mechanisms in-world such as furnaces and hoppers needs to be manually restarted after each server start. Also I'd like to be able to have certain areas always loaded in the future.

Perhaps there's an entirely different approach to this. If anyone has it I'd like to hear it. =)

Re: [Idea] Reject players between certain hours [opening_hou

PostPosted: Mon Feb 20, 2017 19:54
by GreenDimond
The removal of players is easy. Just kick them all.
You have already found a way of keeping players out it seems.
As for timing....is there not a RTC or something in digilines? Having a realtime clock that is set to your time could activate command blocks to do stuff at certain times. I dunno.

Re: [Idea] Reject players between certain hours [opening_hou

PostPosted: Tue Feb 21, 2017 10:18
by texmex
GreenDimond wrote:The removal of players is easy. Just kick them all.
You have already found a way of keeping players out it seems.
As for timing....is there not a RTC or something in digilines? Having a realtime clock that is set to your time could activate command blocks to do stuff at certain times. I dunno.

But I don't use digilines, I use basic hoppers and furnaces. I'd like to be able to have chunks loaded for visual reasons also. If I could autoload chunks on server launch or increase the number of chunks around a player that is loaded, that would solve half the problem.

Re: [Idea] Reject players between certain hours [opening_hou

PostPosted: Tue Feb 21, 2017 22:10
by sofar
This shouldn't be too hard to implement:

- os.time() is available in lua and gets you the real clock time
- you can easily capture joining players (minetest.register_on_joinplayer()
- kicking players can be done: minetest.kick_player()

so all you'd have to do is run a function once in a while (every minute or so would suffice) that would remove all normal players and leave admins (by for instance checking for certain privs)

Then I'd add a nice announcement message 15, 10, 5 and 1 minute before the closing time so players know that they're going to get kicked.

When in closing time, just kick the players immediately after login.

Re: [Idea] Reject players between certain hours [opening_hou

PostPosted: Wed Feb 22, 2017 07:12
by texmex
Thank you sofar, perhaps I may be able to dabble something together.