On my server I have client verification enabled. I noticed it really only detects if the client version is older than what version is required in the script. Is there a way to make the script only allow a certain version, regardless if it is older or newer, instead of just checking if the client version is older than what you are requiring? For example if I want players to use only version 5.x.x.x the client verification should warn them if they are using 4.x.x OR something higher like 7.x.x.x.
 
Take a look at the Client.cfg file

This config file?

Code:
# This flag controls if a shard owner wants to allow certain clients
AllowRegular=true
AllowUOTD=true
AllowGod=true
AllowEC=true

# this delay is when the players is booted from the server
KickDelay=20
 
Well go into the script for the verfication and instead of checking if it is lower check if it is not equal to the required version
 
Here is where I set the Version
Code:
public static void Initialize()
        {
            EventSink.ClientVersionReceived += new ClientVersionReceivedHandler( EventSink_ClientVersionReceived );

            if( m_DetectClientRequirement )
            {
                string path = Core.FindDataFile( "client.exe" );

                if( File.Exists( path ) )
                {
                    FileVersionInfo info = FileVersionInfo.GetVersionInfo( path );

                    if ( info.FileMajorPart != 0 || info.FileMinorPart != 0 || info.FileBuildPart != 0 || info.FilePrivatePart != 0 )
                    {
                        Required = new ClientVersion( info.FileMajorPart, info.FileMinorPart, info.FileBuildPart, info.FilePrivatePart );
                    }
                }
            }

            Required = new ClientVersion("4.0.6a");

            if( Required != null )
            {
                Utility.PushColor( ConsoleColor.White );
                Console.WriteLine( "Restricting client version to {0}. Action to be taken: {1}", Required, m_OldClientResponse );
                Utility.PopColor();
            }
        }

Is this already not saying version 4.0.6a is required?

Code:
Required = new ClientVersion("4.0.6a");
 
Code:
private static void EventSink_ClientVersionReceived(ClientVersionReceivedArgs e)
        {
            string kickMessage = null;
            NetState state = e.State;
            ClientVersion version = e.Version;

            if (state.Mobile.IsStaff())
                return;

            if (Required != null && version < Required && (m_OldClientResponse == OldClientResponse.Kick || (m_OldClientResponse == OldClientResponse.LenientKick && (DateTime.UtcNow - state.Mobile.CreationTime) > m_AgeLeniency && state.Mobile is PlayerMobile && ((PlayerMobile)state.Mobile).GameTime > m_GameTimeLeniency)))
            {
                kickMessage = String.Format("This server requires your client version be at least {0}.", Required);
            }
.......
 
Thanks! I was able to change
Code:
version < Required
to
Code:
version != Required
and that works great!
 
Back