1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Client Verification

Discussion in 'Script Support' started by Aschnyder26, Sep 13, 2018.

  1. Aschnyder26
    Offline

    Aschnyder26 Member

    Joined:
    Jul 6, 2016
    Messages:
    253
    Likes Received:
    16
    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.
     
  2. Hammerhand
    Offline

    Hammerhand Active Member

    Joined:
    Mar 26, 2013
    Messages:
    857
    Likes Received:
    87
    Take a look at the Client.cfg file
     
  3. Aschnyder26
    Offline

    Aschnyder26 Member

    Joined:
    Jul 6, 2016
    Messages:
    253
    Likes Received:
    16
    This config file?

    Code (C#):
    1. # This flag controls if a shard owner wants to allow certain clients
    2. AllowRegular=true
    3. AllowUOTD=true
    4. AllowGod=true
    5. AllowEC=true
    6.  
    7. # this delay is when the players is booted from the server
    8. KickDelay=20
     
  4. PyrO
    Offline

    PyrO Well-Known Member

    Joined:
    Jan 27, 2015
    Messages:
    1,014
    Likes Received:
    53
    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
     
  5. Aschnyder26
    Offline

    Aschnyder26 Member

    Joined:
    Jul 6, 2016
    Messages:
    253
    Likes Received:
    16
    Here is where I set the Version
    Code (C#):
    1. public static void Initialize()
    2.         {
    3.             EventSink.ClientVersionReceived += new ClientVersionReceivedHandler( EventSink_ClientVersionReceived );
    4.  
    5.             if( m_DetectClientRequirement )
    6.             {
    7.                 string path = Core.FindDataFile( "client.exe" );
    8.  
    9.                 if( File.Exists( path ) )
    10.                 {
    11.                     FileVersionInfo info = FileVersionInfo.GetVersionInfo( path );
    12.  
    13.                     if ( info.FileMajorPart != 0 || info.FileMinorPart != 0 || info.FileBuildPart != 0 || info.FilePrivatePart != 0 )
    14.                     {
    15.                         Required = new ClientVersion( info.FileMajorPart, info.FileMinorPart, info.FileBuildPart, info.FilePrivatePart );
    16.                     }
    17.                 }
    18.             }
    19.  
    20.             Required = new ClientVersion("4.0.6a");
    21.  
    22.             if( Required != null )
    23.             {
    24.                 Utility.PushColor( ConsoleColor.White );
    25.                 Console.WriteLine( "Restricting client version to {0}. Action to be taken: {1}", Required, m_OldClientResponse );
    26.                 Utility.PopColor();
    27.             }
    28.         }
    Is this already not saying version 4.0.6a is required?

    Code (C#):
    1. Required = new ClientVersion("4.0.6a");
     
  6. PyrO
    Offline

    PyrO Well-Known Member

    Joined:
    Jan 27, 2015
    Messages:
    1,014
    Likes Received:
    53
    Code (C#):
    1. private static void EventSink_ClientVersionReceived(ClientVersionReceivedArgs e)
    2.         {
    3.             string kickMessage = null;
    4.             NetState state = e.State;
    5.             ClientVersion version = e.Version;
    6.  
    7.             if (state.Mobile.IsStaff())
    8.                 return;
    9.  
    10.             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)))
    11.             {
    12.                 kickMessage = String.Format("This server requires your client version be at least {0}.", Required);
    13.             }
    14. .......
     
  7. Aschnyder26
    Offline

    Aschnyder26 Member

    Joined:
    Jul 6, 2016
    Messages:
    253
    Likes Received:
    16
    Thanks! I was able to change
    Code (C#):
    1. version < Required
    to
    Code (C#):
    1. version != Required
    and that works great!
     
Similar Threads: Client Verification
Forum Title Date
Script Support [Fixed] Restrict client (ClientVerification.cs) Runuo 2.2 Mar 22, 2018
Script Support Disable Client Verification? Oct 20, 2017
General Discussion Infos about current client customizations Yesterday at 9:36 AM
General Discussion Adding Newer Client Artwork to older client Monday at 12:58 PM
General Discussion Most Optimal Client for ServUO Feb 10, 2019
General Discussion Old patchlog inside your client directory. Jan 28, 2019
General Discussion UO Client 3.0.8s/3.0.8z-4.0.3b (Borg_Server.DLL) Jan 27, 2019