reserved slots

mike
Member
 
Posts: 45
Joined: Wed Sep 26, 2012 01:15

reserved slots

by mike » Sun Aug 31, 2014 11:51

As known from other Games, there should be a reserved slots feature.
People with the priv "reservedslot" should be able to connect, even if the playerlimit is reached.

This could be solved by a mod which kicks the latest joining players when maxplayers-2 is reached.
Engine support would be better.

So the admin (and his friends) can always connect.

Alternative:
Kick last 2 Players or 2 Random Players when a privileged player connects.
 

User avatar
Jordach
Member
 
Posts: 4412
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach

Re: reserved slots

by Jordach » Sun Aug 31, 2014 12:28

Nobody actually uses the max players in the conf file, so this is redundant as Minetest supports a near infinite players at once.

Provided you have a good network connection.

( ͡° ͜ʖ ͡°) ( ͡o ͜ʖ ͡o) [$ ( ͡° ͜ʖ ͡°) $] ( ͡$ ͜ʖ ͡$) ヽ༼ຈل͜ຈ༽ノ



My image and media server is back online and is functioning as normal.
 

mike
Member
 
Posts: 45
Joined: Wed Sep 26, 2012 01:15

Re: reserved slots

by mike » Sun Aug 31, 2014 13:43

i actually do and its necessary to keep the cpu load low enough, so it does not lag.
so you cant run more than i think 10-15 players on a p4.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: reserved slots

by rubenwardy » Sun Aug 31, 2014 14:34

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
MAX_PLAYERS = 6
minetest.register_privilege("reserved_slot")

minetest.register_on_prejoinplayer(function(name, ip)
    if #minetest.get_connected_players() >= MAX_PLAYERS - 2 and
            not minetest.check_player_privs(name, {reserved_slot = true}) then
        return "Too many users on this server"
    end
end)
 

mike
Member
 
Posts: 45
Joined: Wed Sep 26, 2012 01:15

Re: reserved slots

by mike » Sun Aug 31, 2014 17:08

Thanks! That was very quick and good!
 

User avatar
Minetestforfun
Member
 
Posts: 936
Joined: Tue Aug 05, 2014 14:09
GitHub: Darcidride
IRC: Darcidride + MinetestForFun
In-game: Darcidride + MinetestForFun

Re: reserved slots

by Minetestforfun » Sun Aug 31, 2014 17:57

It's a very good idea !
Reserved slots is activable for other games...

@rubenwardy
Can you make a quick guide step by step for implement your commands code ?
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: reserved slots

by rubenwardy » Sun Aug 31, 2014 18:19

  • Create a folder called "reserved" in your mod folder. (ie: ~/.minetest/mods)
  • Paste the code into a new file in that folder called init.lua. Modify MAX_PLAYERS to suit your needs
  • Enable the mod.
  • /grant player reserved_slot
 

User avatar
Minetestforfun
Member
 
Posts: 936
Joined: Tue Aug 05, 2014 14:09
GitHub: Darcidride
IRC: Darcidride + MinetestForFun
In-game: Darcidride + MinetestForFun

Re: reserved slots

by Minetestforfun » Sun Aug 31, 2014 18:38

Thank you rubenwardy
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 9 guests

cron