Simple version limit
#1
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!
Reply
Thanks given by:
#2
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: 176)
Reply
Thanks given by:
#3
Thanks!! This is exactly what i need. You should maybe put it in Plugin Releases so everyone can find it there.
Reply
Thanks given by:
#4
Maybe later. I should go back to my homework now Wink
Reply
Thanks given by:
#5
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()?
Reply
Thanks given by:
#6
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


Attached Files
.zip   ProtLimit.zip (Size: 1.16 KB / Downloads: 295)
Reply
Thanks given by:
#7
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!
Reply
Thanks given by:
#8
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
Reply
Thanks given by:
#9
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).
Reply
Thanks given by:
#10
Hm, well, we could just get xoft to cut away all of the old protocols, he promised to do it sometime Wink
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)