|
||
|
|||||||
| Network Modifications This forum is for modifications to the networking code of RunUO |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Master of the Internet
Join Date: Aug 2003
Posts: 5,688
|
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;
}
}
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.
__________________
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. |
|
|
|
|
|
#3 (permalink) |
|
Forum Newbie
|
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 |
|
|
|
|
|
#5 (permalink) |
|
Forum Expert
Join Date: Jul 2004
Location: IL, USA
Posts: 579
|
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. |
|
|
|
|
|
#6 (permalink) |
|
Master of the Internet
Join Date: Aug 2003
Posts: 5,688
|
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 |
|
|
|
|
|
#8 (permalink) |
|
Master of the Internet
Join Date: Aug 2003
Posts: 5,688
|
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 |
|
|
|
|
|
#9 (permalink) | |
|
Newbie
Join Date: Dec 2005
Posts: 16
|
Quote:
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. |
|
|
|
|
|
|
#10 (permalink) |
|
Master of the Internet
Join Date: Aug 2003
Posts: 5,688
|
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 |
|
|
|
|
|
#11 (permalink) |
|
Forum Expert
Join Date: Sep 2005
Location: UK
Age: 29
Posts: 781
|
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 +* |
|
|
|
|
|
#15 (permalink) | |
|
Master of the Internet
Join Date: Aug 2003
Posts: 5,688
|
Quote:
__________________
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 |
|
|
|
|
|
|
#17 (permalink) | |
|
Master of the Internet
Join Date: Aug 2003
Posts: 5,688
|
Quote:
__________________
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 |
|
|
|
|
|
|
#23 (permalink) |
|
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 |
|
|
|
|
|
|
#24 (permalink) |
|
Account Terminated
|
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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|