Client Verification

Aschnyder26

Well-Known Member
Jul 6, 2016
257
18
Atlanta, GA
www.kalvasflam.org
Shard Name
Kal Vas Flam
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.
 

PyrO

Well-Known Member
Jan 27, 2015
1,118
83
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
 

Aschnyder26

Well-Known Member
Jul 6, 2016
257
18
Atlanta, GA
www.kalvasflam.org
Shard Name
Kal Vas Flam
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");
 

PyrO

Well-Known Member
Jan 27, 2015
1,118
83
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);
            }
.......