Cuberite Forum
Simple version limit - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Requests (https://forum.cuberite.org/forum-3.html)
+--- Thread: Simple version limit (/thread-1333.html)

Pages: 1 2


Simple version limit - Antonio - 01-27-2014

I will need a plugin that can limit the server to specific client version. For example to only allow 1.7.4 clients to join and every other version that tries to join gets kicked with custom configurable message (so it can be translated).

I have been told be xoft that this is easy to code but i'm not really good at this programming. I hope someone can do this in their free time.
Thanks!


RE: Simple version limit - NiLSPACE - 01-27-2014

I'll do this. Give me a minute Smile

Here you go, My first version.: See Edit

In the Config.ini you can set what protocols are allowed. By default only 1.7 is allowed. In the config this is '4'. You can find the protocol versions when you start Cuberite.
Code:
[16:05:36] Compatible clients: 1.8.x, 1.9.x, 1.10.x, 1.11.x, 1.12.x
[16:05:36] Compatible protocol versions 47, 107, 108, 109, 110, 210, 315, 316, 335, 338, 340

Now gonna do the custom message.

Xoft there is a cRoot:GetProtocolVersionTextFromInt function, but is there a function that does the opposite?

Done: See Edit

EDIT:
Download here: 
.zip   ProtLimit.zip (Size: 1.16 KB / Downloads: 214)


RE: Simple version limit - Antonio - 01-27-2014

Thanks!! This is exactly what i need. You should maybe put it in Plugin Releases so everyone can find it there.


RE: Simple version limit - NiLSPACE - 01-27-2014

Maybe later. I should go back to my homework now Wink


RE: Simple version limit - xoft - 01-27-2014

STR, sorry, we don't have such a function. Of course you could write it if you want, but it's one more place to update when a new protocol is added, and those places tend to get forgotten.

Why does the plugin use the OnTick() function? Can't it just kick the player (or schedule the kick) directly in the OnLogin()?


RE: Simple version limit - NiLSPACE - 01-27-2014

Schedule.. good call.

I tried the OnLogin, OnPlayerJoined and OnPlayerSpawned hook, but when I kicked the player you woudn't get the kick message but an error so I used the OnTick hook.

Update. Now it's using a schedule task. It should be a little bit better performance wise: See first comment


RE: Simple version limit - seanhi2 - 02-01-2014

Why would you want to do that Sad - All the big servers are making custom jars for their servers to allow more clients. More clients = more players = more people eating pie!


RE: Simple version limit - tigerw - 02-01-2014

Are there really enough people still on <1.7 clients for limiting client versions to make a difference?

If so, this is like the Windows 8 situation, except worse, because updates are free! Rolleyes


RE: Simple version limit - Antonio - 02-01-2014

Actually all the members of my community have either 1.7.2 or 1.7.4 clients already installed. I don't want them to connect with clients with missing features or worst crash the server with bad packets of some old client due to the networking layer of MCS (I don't know if the deadlock was fully fixed).


RE: Simple version limit - tigerw - 02-03-2014

Hm, well, we could just get xoft to cut away all of the old protocols, he promised to do it sometime Wink