Go Back   RunUO - Ultima Online Emulation > RunUO > Core Modifications > Subsystems

Subsystems This forum is for modifications to the various subystem code of RunUO

Reply
 
Thread Tools Display Modes
Old 04-17-2005, 07:14 AM   #1 (permalink)
Forum Novice
 
Join Date: Mar 2004
Location: Germany
Age: 23
Posts: 301
Default ClientVersion fix

As of the new UO client update, the version string now contains more than just one digit as revision. This means, that the current ClientVersion constructor parses the version string (4.0.10) and just reads this as "4.0.1".
I wrote a fix for this. This is the new constructor for the ClientVersion object (found in ClientVersion.cs)

Code:
		public ClientVersion( string fmt )
 		{
 			m_SourceString = fmt;
 
 			try
 			{
 				fmt = fmt.ToLower();
 
 				string[] version = fmt.Split( new char[] {'.'}, 3 );
 
 				m_Patch = 0;
 				for ( int i = 0; i < version[2].Length; i++ )
 				{
 		    		if ( Char.IsLetter( version[2][i] ) )
 					{
 		    			m_Patch = ( version[2][i] - 'a' ) + 1;
 		    			version[2] = version[2].Remove( i, version[2].Length - i );
 						break;
 					}
 				}
 
 				m_Major = int.Parse( version[0] );
 				m_Minor = int.Parse( version[1] );
 				m_Revision = int.Parse( version[2] );
 
 		    	if ( fmt.IndexOf( "god" ) >= 0 || fmt.IndexOf( "gq" ) >= 0 )
 					m_Type = ClientType.God;
 		    	else if ( fmt.IndexOf( "third dawn" ) >= 0 || fmt.IndexOf( "uo:td" ) >= 0 || fmt.IndexOf( "uotd" ) >= 0 || fmt.IndexOf( "uo3d" ) >= 0 || fmt.IndexOf( "uo:3d" ) >= 0 )
 					m_Type = ClientType.UOTD;
 				else
 					m_Type = ClientType.Regular;
 			}
 			catch
 			{
 				m_Major = 0;
 				m_Minor = 0;
 				m_Revision = 0;
 				m_Patch = 0;
 				m_Type = ClientType.Regular;
 			}
 		}
floppydisc is offline   Reply With Quote
Old 04-18-2005, 07:05 AM   #2 (permalink)
Forum Expert
 
Join Date: Feb 2003
Age: 30
Posts: 515
Default

No such script as ClientVersion.cs

Is this whats causing people not to beable to move when they die?
habitat85 is offline   Reply With Quote
Old 04-18-2005, 07:16 AM   #3 (permalink)
 
Join Date: Mar 2004
Location: Treasure Island, FL
Age: 38
Posts: 548
Send a message via ICQ to Talrol Send a message via MSN to Talrol
Default

This is a core code modification, not part of the regular distribution....I wouldn't recommend making changes such as this unless you know what you're doing and of course have a good compiler.

I'm not sure why you're having problems with characters not being able to move when they die, I have no such problems on my shard at all. Perhaps you could ask in Server Support or Script Support?
Talrol is offline   Reply With Quote
Old 04-18-2005, 07:40 AM   #4 (permalink)
Forum Expert
 
Tannis's Avatar
 
Join Date: Feb 2004
Age: 27
Posts: 2,047
Default

It's not only habitat, it's everyone on 2 shards I work on, and those people are the only ones with the new patch. They've died in custom map areas, Ilshenar areas, and it's all the same. As soon as you try to move as a ghost it will spawn up your screen that you're frozen and can't do that.
Tannis is offline   Reply With Quote
Old 04-18-2005, 04:15 PM   #5 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

Are you sure thats because of this script and not because of the client update itself? I haven't taken a look at the script yet, so don't bash me if I am wrong... just food for thought.
XxSP1DERxX is offline   Reply With Quote
Old 04-18-2005, 06:02 PM   #6 (permalink)
Forum Expert
 
Tannis's Avatar
 
Join Date: Feb 2004
Age: 27
Posts: 2,047
Default

I don't think the script would fix it either, now that I know it's a custom map problem. I figured since people were dying in Ilshenar, and that the area was still as OSI has it, it wouldn't matter what kind of map it is, but I guess it only happens on customs.
Tannis is offline   Reply With Quote
Old 04-18-2005, 11:02 PM   #7 (permalink)
Forum Expert
 
Join Date: Feb 2003
Age: 30
Posts: 515
Default

Im guessing its having the 0kb .diff files for custom map to remove the chunks of land from OSI but OSI hasnt patched any map files if you look in the patchlog file only thing they changed with 4.0.10a is the gump files, art files, and clioc files. Im stumped why its doing this but its super annoying babysitting people so they can get ressed.
habitat85 is offline   Reply With Quote
Old 04-24-2005, 02:59 PM   #8 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

This is my version of the Client Fix... I believe my code is faster and more effecient

Code:
		public ClientVersion( string fmt )
		{
			m_SourceString = fmt;

			try
			{
				//Format: Major.Minor.Revision[Patch] [Type]
				//Exmple: 4.0.10a UO3D
				fmt = fmt.ToLower();

				string[] fmts = fmt.Split( new char[] {'.'}, 3 );
				string patch = fmts[2];

				int letter_index;
				for( letter_index = 0; letter_index < patch.Length; letter_index++ )
					if ( !Char.IsNumber( patch[letter_index] ) )
						break;

				m_Major = int.Parse( fmts[0] );
				m_Minor = int.Parse( fmts[1] );
				m_Revision = int.Parse( patch.Substring( 0, letter_index ) );

				if ( Char.IsLetter( patch[letter_index] ) )
					m_Patch = (patch[letter_index] - 'a') + 1;
				else
					m_Patch = 0;

				if ( patch.IndexOf( "god" ) >= 0 || patch.IndexOf( "gq" ) >= 0 )
					m_Type = ClientType.God;
				else if ( patch.IndexOf( "third dawn" ) >= 0 || patch.IndexOf( "uo:td" ) >= 0 || patch.IndexOf( "uotd" ) >= 0 || patch.IndexOf( "uo3d" ) >= 0 || patch.IndexOf( "uo:3d" ) >= 0 )
					m_Type = ClientType.UOTD;
				else
					m_Type = ClientType.Regular;
			}
			catch
			{
				m_Major = 0;
				m_Minor = 0;
				m_Revision = 0;
				m_Patch = 0;
				m_Type = ClientType.Regular;
			}
		}
XxSP1DERxX is offline   Reply With Quote
Old 04-24-2005, 04:57 PM   #9 (permalink)
 
Join Date: Jan 2005
Age: 45
Posts: 176
Default

would this fix the client errors that kick people off the server?
Gator81 is offline   Reply With Quote
Old 04-25-2005, 03:27 AM   #10 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

I don't believe so... because thats a client thing, not a server thing....

Basically what happens is you take
4.0.9q for example, and it changes it to
Major = 4
Minor = 0
Revision = 9
Patch = q

with the fix, for example, it changes 4.0.10a to
Major = 4
Minor = 0
Revision = 10
Patch = a

as apposed to
Major = 4
Minor = 0
Revision = 1
Patch = (garbage)
XxSP1DERxX is offline   Reply With Quote
Old 04-25-2005, 07:43 PM   #11 (permalink)
Forum Expert
 
jaynigs's Avatar
 
Join Date: Mar 2003
Location: England
Age: 35
Posts: 986
Default

version is not defined in that code XxSP1DERxX
jaynigs is offline   Reply With Quote
Old 04-26-2005, 12:17 PM   #12 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

I fixed it, sorry.
XxSP1DERxX is offline   Reply With Quote
Old 04-26-2005, 12:42 PM   #13 (permalink)
Forum Expert
 
jaynigs's Avatar
 
Join Date: Mar 2003
Location: England
Age: 35
Posts: 986
Default

Hehe, no probs, good work and thanks for sharing.
jaynigs is offline   Reply With Quote
Old 05-22-2005, 05:00 PM   #14 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

There was a problem with my code which I forgot to put up.... Please refer to my post above which now as the correct code.
XxSP1DERxX is offline   Reply With Quote
Old 05-22-2005, 05:01 PM   #15 (permalink)
Forum Expert
 
jaynigs's Avatar
 
Join Date: Mar 2003
Location: England
Age: 35
Posts: 986
Default

Quote:
Originally Posted by XxSP1DERxX
There was a problem with my code which I forgot to put up.... Please refer to my post above which now as the correct code.
Would that be relating to the client version showing as 0.0.0?
jaynigs is offline   Reply With Quote
Old 05-22-2005, 05:02 PM   #16 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

Yes it would.. I had already fixed it, but I realized that I didn't fix it on the forum
XxSP1DERxX is offline   Reply With Quote
Old 07-01-2005, 06:05 PM   #17 (permalink)
 
Join Date: Dec 2004
Location: USA michigan
Age: 30
Posts: 171
Send a message via Yahoo to cuy782002
Default

ok so how do i attact this.............................

using System;
using Server;

namespace Server.Misc
{
public class ClientVerification
{
public static void Initialize()
{
ClientVersion.Required = null;
//ClientVersion.Required = new ClientVersion( "1.0.8q" );

ClientVersion.AllowGod = false;
ClientVersion.AllowUOTD = true;
ClientVersion.AllowRegular = true;

ClientVersion.KickDelay = TimeSpan.FromSeconds( 1.0 );
}
}
}



with yours............................................. ..



public ClientVersion( string fmt )
{
m_SourceString = fmt;

try
{
//Format: Major.Minor.Revision[Patch] [Type]
//Exmple: 4.0.10a UO3D
fmt = fmt.ToLower();

string[] fmts = fmt.Split( new char[] {'.'}, 3 );
string patch = fmts[2];

int letter_index;
for( letter_index = 0; letter_index < patch.Length; letter_index++ )
if ( !Char.IsNumber( patch[letter_index] ) )
break;

m_Major = int.Parse( fmts[0] );
m_Minor = int.Parse( fmts[1] );
m_Revision = int.Parse( patch.Substring( 0, letter_index ) );

if ( Char.IsLetter( patch[letter_index] ) )
m_Patch = (patch[letter_index] - 'a') + 1;
else
m_Patch = 0;

if ( patch.IndexOf( "god" ) >= 0 || patch.IndexOf( "gq" ) >= 0 )
m_Type = ClientType.God;
else if ( patch.IndexOf( "third dawn" ) >= 0 || patch.IndexOf( "uo:td" ) >= 0 || patch.IndexOf( "uotd" ) >= 0 || patch.IndexOf( "uo3d" ) >= 0 || patch.IndexOf( "uo:3d" ) >= 0 )
m_Type = ClientType.UOTD;
else
m_Type = ClientType.Regular;
}
catch
{
m_Major = 0;
m_Minor = 0;
m_Revision = 0;
m_Patch = 0;
m_Type = ClientType.Regular;
}
}
--------------------------------------------------------------------------------
cuy782002 is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5