Cuberite Forum
Reserved player slots - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: Reserved player slots (/thread-555.html)



Reserved player slots - Taugeshtu - 09-05-2012

That's probably a feature request, but I'm not sure right now.
Idea is:
You set slots ammount in settings.ini
You set reserved slots ammount in settings.ini
You write player names in some .ini - those players would be allowed to use reserved slots.

What for:
For example, you want your players to see that server has 10 slots. You also want to be able to log in any time you want, even if server is full. Kicking somebody via webadmin isn't really a "nice guy" optionBig Grin
You might also want to let VIPs to log in at any time. But you don't want to dissapoint ordinary players with "20 players / 30 slots" promt and then not allowing them to log in via plugin.

This could be done with current API, but we need a way to make server say that it has less slots than it actually has.


RE: Reserved slots - xoft - 09-05-2012

Something like this crossed my mind several times in the past, didn't think much about the details, just thought "it would be nice for a server admin to be able to log in even when the server is otherwise full".

Could you perhaps change the thread title to "Reserved player slots"? Because at first I was thinking about chest / inventory slots Wink


RE: Reserved player slots - FakeTruth - 09-05-2012

Sounds like a perfect job for the handshake hook which still isn't implemented yet! XD

The cProtocol::ParseHandshake() kicks the player when the server is full, but it should also call a hook.

Then you can create a plugin for this.
Return true when you want to override default behaviour. Returning true will not kick the player and allow the player to join.
If you want to override default behaviour and still kick the player (for whatever reason you have, banned player perhaps) you should manually kick the player in the plugin.

Return false for default behaviour, which means let the player join when there's enough room, and otherwise kick the player


RE: Reserved player slots - Taugeshtu - 09-05-2012

Quote:Returning true will not kick the player and allow the player to join.
Will it allow me to let player join even when all slots, defined in settings.ini, are full?

Probably, this will be nice, to have such a functionality in the Core plugin. I can write it, among with ban function (both via command and webAdmin), and commit to SVN. Would you appretiate it? Smile


RE: Reserved player slots - FakeTruth - 09-05-2012

Yes all that is possible, I already tested it.
I want to commit my changes but SVN won't let me, wtf.. Sad

I think Core already has ban functionality, not sure though


Yep you can already ban people, there's no web interface for it though


RE: Reserved player slots - Taugeshtu - 09-05-2012

> Core already has ban functionality
I think it could use a bit more... love. Ban reasoning and duration would be nice touch.


RE: Reserved player slots - FakeTruth - 09-05-2012

Feel free to add such things or if it's outside the scope of the Core plugin, create a dedicated ban plugin


RE: Reserved player slots - FakeTruth - 09-06-2012

Finally.. I managed to commit the changes