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

Network Modifications This forum is for modifications to the networking code of RunUO

Reply
 
Thread Tools Display Modes
Old 04-27-2006, 12:12 PM   #1 (permalink)
Master of the Internet
 
Join Date: Aug 2003
Posts: 5,688
Default fix for ClientVersion errors

The following is a fix for ClientVersion that incorrectly parses some client version strings, such as the recent '5.0.2' version.

just replace the ClientVersion constructor around line 240 in ClientVersion.cs with the following

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 (letter_index < patch.Length && 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;
			}
		}
The above is a core modification and requires access to the RunUO-1.0.0 source files and the ability to recompile the server.

I have also attached a fix that can be used instead of making this core mod. Just drop the script into your custom script area. This is NOT a core modification and does not require access to the RunUO sources.

If you made the core mod, then you dont need the script. If you used the script then you dont need the core mod. If you did both, that's not a problem either.
Attached Files
File Type: cs clientversionfix.cs (4.5 KB, 555 views)
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. "

For questions, information, and support for XmlSpawner and its addons, visit the
XmlSpawner Support Forum

Last edited by ArteGordon; 05-01-2006 at 05:33 AM.
ArteGordon is offline   Reply With Quote
Old 04-27-2006, 12:46 PM   #2 (permalink)
Forum Expert
 
Manu's Avatar
 
Join Date: Jul 2005
Location: München/Deutschland (Munich/Germany)
Age: 27
Posts: 1,939
Send a message via ICQ to Manu Send a message via Skype™ to Manu
Default

Dude... you rock Pure and simple
__________________
http://www.gecko-entertainment.net/blog
Another pathetic weblog. Again. Get to know the real Manu, if you're really bored.
Manu is offline   Reply With Quote
Old 04-27-2006, 05:58 PM   #3 (permalink)
Forum Newbie
 
Join Date: Feb 2006
Location: Live in NW USA
Posts: 11
Send a message via ICQ to Solbehlas Send a message via AIM to Solbehlas Send a message via MSN to Solbehlas Send a message via Yahoo to Solbehlas Send a message via Skype™ to Solbehlas
Default

Thank you all so much for finding an immediate fix to this situation from OSI. You all are so talented to be on the ball so quickly. I still got a lot to learn still and I would have been lost trying to figure what to do. I learn so much from expeirenced scripters. I am glad the the community can thrive and be as one.

Thanks again!

Solbehlas,

Simplyuso
Solbehlas is offline   Reply With Quote
Old 04-27-2006, 11:42 PM   #4 (permalink)
Forum Expert
 
jaynigs's Avatar
 
Join Date: Mar 2003
Location: England
Age: 35
Posts: 986
Default

Thanks arte, your a legend
jaynigs is offline   Reply With Quote
Old 04-28-2006, 12:38 AM   #5 (permalink)
Forum Expert
 
Join Date: Jul 2004
Location: IL, USA
Posts: 579
Default

I feel extremely stupid now. I have searched and found nothing like this to change in the Core files. This is the closest thing I have found in the core ClientVersion.cs

m_Revision = int.Parse( fmt[4].ToString() );

if ( fmt.Length >= 6 && Char.IsWhiteSpace( fmt[5] ) )
m_Patch = 0;
else
m_Patch = (fmt[5] - 'a') + 1;

What am I doing wrong? I know it's me. I have never not found exactly what Arte Grodon tells us to do.
haazen is offline   Reply With Quote
Old 04-28-2006, 04:51 AM   #6 (permalink)
Master of the Internet
 
Join Date: Aug 2003
Posts: 5,688
Default

it looks like you already have a modified ClientVersion. The core patch that I posted isnt going to be much help for you since it is based on an unmodded core.

You could still use the drop-in script that replaces the default clientversion packet handler, but then whatever mods you have made to your current ClientVersion constructor will end up being ignored.
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. "

For questions, information, and support for XmlSpawner and its addons, visit the
XmlSpawner Support Forum
ArteGordon is offline   Reply With Quote
Old 04-28-2006, 03:12 PM   #7 (permalink)
Forum Expert
 
Join Date: Jul 2004
Location: IL, USA
Posts: 579
Default

Thanks Arte Gordon. The drop in script works great.


fyi I just downloaded the core zip file again and my script is the same as the download.
haazen is offline   Reply With Quote
Old 04-28-2006, 03:31 PM   #8 (permalink)
Master of the Internet
 
Join Date: Aug 2003
Posts: 5,688
Default

ah, I just checked and you are correct. The code I posted also reflects an earlier mod to deal with the problem with 2 digit revisions that came up a while back in 4.0.10a

I will modify the posted core mod to reflect that. Sorry.
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. "

For questions, information, and support for XmlSpawner and its addons, visit the
XmlSpawner Support Forum
ArteGordon is offline   Reply With Quote
Old 04-28-2006, 04:30 PM   #9 (permalink)
Newbie
 
Join Date: Dec 2005
Posts: 16
Default

Quote:
Originally Posted by ArteGordon
ah, I just checked and you are correct. The code I posted also reflects an earlier mod to deal with the problem with 2 digit revisions that came up a while back in 4.0.10a

I will modify the posted core mod to reflect that. Sorry.
Yes. Problem with numbers (not only for revision) exist.
Version string must be parsed dynamically.
Please see my solution for this problem.
Can be parsed below types of versions:
5 (Major=5; Minor=0; Revision=0; Patch = 0)
5a (Major=5; Minor=0; Revision=0; Patch = 1)
5.2a (Major=5; Minor=2; Revision=0; Patch = 1)
5.0.1j (Major=5; Minor=0; Revision=1; Patch = 10)
5.0.2 (Major=5; Minor=0; Revision=2; Patch = 0)
10.1.2 (Major=10; Minor=1; Revision=2; Patch = 0)
1234567.1234567.1234567z (Major=1234567; Minor=1234567; Revision=1234567; Patch = 26)

I used Finite State Machine methodology. Usually this technique used in systems programming (compilers, interpreters, regular expressions and others).

Last edited by Sender; 04-28-2006 at 04:38 PM.
Sender is offline   Reply With Quote
Old 04-28-2006, 04:34 PM   #10 (permalink)
Master of the Internet
 
Join Date: Aug 2003
Posts: 5,688
Default

these will all be temporary fixes anyway with RunUO 2.0 just around the corner.
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. "

For questions, information, and support for XmlSpawner and its addons, visit the
XmlSpawner Support Forum
ArteGordon is offline   Reply With Quote
Old 04-29-2006, 09:58 AM   #11 (permalink)
Forum Expert
 
Join Date: Sep 2005
Location: UK
Age: 29
Posts: 781
Default

hi there, i have tryout looking for ClientVersion.cs and ive used agent ransack, and nothing in my runuo folder. the closes ive got is ClientVerification

any help where this is. thanks.
__________________
*+ MW Admin Naturescorpse +*
WonderlandADnc is offline   Reply With Quote
Old 04-29-2006, 10:04 AM   #12 (permalink)
Forum Expert
 
Join Date: May 2005
Age: 29
Posts: 949
Default

This is the Core-Modification forum, so ClientVersion.cs is a part of the Core, not the scripts.
Irian is offline   Reply With Quote
Old 04-29-2006, 10:39 AM   #13 (permalink)
Forum Expert
 
Join Date: Sep 2005
Location: UK
Age: 29
Posts: 781
Default

so theres nothing i can do.!
__________________
*+ MW Admin Naturescorpse +*
WonderlandADnc is offline   Reply With Quote
Old 04-29-2006, 11:14 AM   #14 (permalink)
Forum Expert
 
Join Date: May 2005
Age: 29
Posts: 949
Default

You could download the sourcecode for the core, edit and recompile it.
Irian is offline   Reply With Quote
Old 04-29-2006, 11:24 AM   #15 (permalink)
Master of the Internet
 
Join Date: Aug 2003
Posts: 5,688
Default

Quote:
Originally Posted by WonderlandADnc
so theres nothing i can do.!
just download the attached script and drop it into your custom scripts area. That implements the fix without having to modify the core.
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. "

For questions, information, and support for XmlSpawner and its addons, visit the
XmlSpawner Support Forum
ArteGordon is offline   Reply With Quote
Old 04-29-2006, 02:12 PM   #16 (permalink)
Forum Expert
 
Join Date: Sep 2005
Location: UK
Age: 29
Posts: 781
Default

ok that sounds ok. but what if i want to have it back as it was.!
__________________
*+ MW Admin Naturescorpse +*
WonderlandADnc is offline   Reply With Quote
Old 04-29-2006, 03:27 PM   #17 (permalink)
Master of the Internet
 
Join Date: Aug 2003
Posts: 5,688
Default

Quote:
Originally Posted by WonderlandADnc
ok that sounds ok. but what if i want to have it back as it was.!
I dont know exactly what you mean but if you remove the script that I attached then it will be back to the way it was unless you changed something else.
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. "

For questions, information, and support for XmlSpawner and its addons, visit the
XmlSpawner Support Forum
ArteGordon is offline   Reply With Quote
Old 04-30-2006, 08:42 AM   #18 (permalink)
Forum Newbie
 
Join Date: Jun 2005
Location: http://www.shadow1980.com
Age: 24
Posts: 93
Default

Thanks so much for this fix Arte, you rule
__________________
Zyle - Prophecies Developer
Zyle is offline   Reply With Quote
Old 04-30-2006, 09:21 AM   #19 (permalink)
Forum Expert
 
Shadow1980's Avatar
 
Join Date: Mar 2005
Location: York, UK
Age: 27
Posts: 708
Default

Thanks Arte, very useful!
__________________
Shadow1980
Game Reviews, Jokes and Rants from real People
Shadow1980 is offline   Reply With Quote
Old 05-01-2006, 06:31 PM   #20 (permalink)
 
Join Date: Mar 2006
Posts: 1
Default

Thanks Arte This Helps Alot
BlazeJuz10 is offline   Reply With Quote
Old 05-03-2006, 07:23 PM   #21 (permalink)
Forum Expert
 
IHaveRegistered's Avatar
 
Join Date: Jun 2003
Location: Ontario
Age: 20
Posts: 4,519
Send a message via MSN to IHaveRegistered
Default

+ to karma for this baby! Woo
__________________
IHaveRegistered is offline   Reply With Quote
Old 05-06-2006, 05:14 PM   #22 (permalink)
Forum Newbie
 
Join Date: Dec 2005
Posts: 21
Send a message via ICQ to baddman
Default Thanks for the fix

was going a bit nuts when I found spell books had lost spells. Thank for the fix
baddman is offline   Reply With Quote
Old 05-09-2006, 12:22 AM   #23 (permalink)
 
Join Date: Jun 2005
Age: 45
Posts: 155
Send a message via MSN to Marlberg
Default

Definitely a winner Arte! Used the drop in version. Didnt feel like modding my core tonight but the drop in worked just as promised.

Got to love it when OSI posts client patches That we cant deal with until a true guru comes along and figures out the problem!

Kinda makes me wish there was a way to build a client that would be dynamic enough to absorb most patch changes like this without it violating the Terms Of Service from OSI

Ahh Well. It is what it is. Of course I guess we can all look at it as Job Security right?
__________________
"If you've nothing to say, say it any way you like. Stylistic innovations, contorted story lines or none, exotic or genderless pronouns, internal inconsistencies, the recipe for preparing your lover as a cannibal banquet: feel free. If what you have to say is important and/or difficult to follow, use the simplest language possible. If the reader doesn't get it then, let it not be your fault. " - Larry Niven. Nivens Laws for writers
Marlberg is offline   Reply With Quote
Old 05-09-2006, 11:00 PM   #24 (permalink)
Account Terminated
 
Join Date: May 2006
Age: 36
Posts: 11
Send a message via ICQ to Ramstien
Default

ArteGordon, would you mind uploading the scipt in a rar or zip, the cs file thats uploadit doesn't download, it opens into a page and all the coding is bunched up.


P.S. I notice this with all cs files directly uploadit to site, not sure if there's a problem with these boards and cs files or if its on my end, all other file formats work, just cs files, wierd.

Thanks in advance

Edit: I fixed the problem sorta, I right clicked the file and saved as target, then saved as a cs file and it worked. I still think it should be fixed as it use to download the script when you clicked the download link.

Last edited by Ramstien; 05-09-2006 at 11:05 PM.
Ramstien is offline   Reply With Quote
Old 05-10-2006, 12:18 AM   #25 (permalink)
Forum Novice
 
Join Date: Feb 2006
Location: Wisconsin USA
Posts: 206
Default Clientversrsion Fix

This is Arte Fix I jest made it in a rar format
Hope he dosnt mind
jest put it in customs foulder.
Works Great Arte
Attached Files
File Type: rar clientversionfix.rar (1.5 KB, 55 views)
Boulder 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