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:
    250
    Likes Received:
    13
    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:
    855
    Likes Received:
    87
    Take a look at the Client.cfg file
     
  3. Aschnyder26
    Offline

    Aschnyder26 Member

    Joined:
    Jul 6, 2016
    Messages:
    250
    Likes Received:
    13
    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 Active Member

    Joined:
    Jan 27, 2015
    Messages:
    960
    Likes Received:
    52
    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:
    250
    Likes Received:
    13
    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 Active Member

    Joined:
    Jan 27, 2015
    Messages:
    960
    Likes Received:
    52
    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:
    250
    Likes Received:
    13
    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
ServUO Discussion Client Question Saturday at 1:07 PM
General Discussion Client patch help (UOpatch) Nov 2, 2018
ServUO Discussion Newest Classic Client- tons of enhancements Oct 30, 2018
Archived Bug Reports First Aid Belt does not work with built in client macros Oct 30, 2018
General Discussion Client Help Oct 17, 2018