Hello,

is there somebody working on Kingdom Reborn client support? I'm trying to make it work with old RunUO 1.0 and willing to share some info.

Currently i have got it partially working. I can connect and move, lot of information about connection mechanism can be found here: https://github.com/LeonG-ZA/JustUO-KR.

The huge problem is Gump support, it is described here: http://ruosi.org/publ/1-1-0-2 I have an idea how tu use current gump system from RunUO without rewriting it. I think, there can be a way with encapsulating gump strings into gump label and then parse it from LUA scripts in client. UOKR uses LuaPlus (http://wwhiz.com/LuaPlus/LuaPlus.html) engine, all scripts are packed in Interface.uop and can be replaced with Mythic Package Editor (http://www.runuo.com/community/threads/editing-uop-files-for-the-enhanced-client.103469/). I have succesfully sent gumps strings to client, now i'm trying to wirte a parser:Untitled.png

Anyway, if there is somebody with some new info about getting gumps work, i would be glad to read it. Thanks :)
 
I've diddle'd around with KR a bit, and I didn't notice anything out of the ordinary with the gumps. The exception to that is the fact that you cannot put elements on top of a button.
 
Was it truly KR? Beacuse there is difference between KR client and Enhanced client. Enhanced client uses classical UO gump structure, so there is no need to change anything.
 
From what i know Enhanced client uses old CC graphic, but KR client uses it's own high resolution textures. This is why i think that KR is better and can bring new players. New players won't start playing a game with outdated graphics. You can run KR on Windows 10 with 4k resolution and it still looks good.
 
I've decided to start from the beginning... so here is the first part:

How to connect with UOKR (2.58.0.6) client
First, we have to somehow change the IP of server. There is no login.cfg. We can find out what address the client is trying to connect:
ip.png
Now we can look into client.exe and try to find this IP:
login.png
As we can see, there is a routine which load the IP address and port. We can change it in HEX editor:
login-hex.png
For example localhost, ip: 127.0.0.1 => 7F 00 00 01, port: 2593 => 0A21. Now we can connect.

How to login with UOKR (2.58.0.6) client
If you try to login to RunUO or ServUO you will get error, because the connection is encrypted. Login mechanism should be like this:
  1. Client -> 0xEF: Login Server Seed
  2. Client -> 0x80: Account Login
  3. Server -> 0xA8: Account Login Ack
  4. Client -> 0xD9: Hardware Info
  5. Client -> 0xA0: Play Server
  6. Server -> 0x8C: Play Server Ack
But, you can only get first packet:
seed.png

There are some useful info in this packet, you can see:
  • seed: C0 A8 11 01 => 192.168.17.1 (client LAN address)
  • major version: 42
  • minor version: 37
  • patch version: 34
  • build version: 0
The encryption is based on seed, it uses following keys:
Code:
key0 = ( ( ( ~seed ) ^ 0x00001357 ) << 16 ) | ( ( seed ^ 0xffffaaaa ) & 0x0000ffff );
key1 = ( ( seed ^ 0x43210000 ) >> 16 ) | ( ( ( ~seed ) ^ 0xabcdffff ) & 0xffff0000 );

If we look into client, we can find the encryption routine, which is using these keys in [esi+4] and [esi+8]:
keys.png

There are also client keys, which are constants here, but they can be calculated from client version. With the knowledge of client keys, we can simplify this routine to:
Code:
public void Decrypt( ref byte[] buffer int length )
{
  for( int i = 0; i < length; i++ )
  {
    buffer[i] = (byte)( key0 ^ buffer[i] );
    uint oldKey0 = key0;
    uint oldKey1 = key1;
    key0 = ( ( oldKey0 >> 1 ) | ( oldKey1 << 31 ) ) ^ clientKey1;
    key1 = ( ( ( ( ( oldKey1 >> 1 ) | ( oldKey0 << 31 ) ) ^ clientKey0 ) >> 1 ) | ( oldKey0 << 31 ) ) ^ clientKey0;
  }
}

Now we can decrypt packets and complete the login process. Next time I will focus to game encryption.
 
Getting UOKR to work is my dream for years.

I can't believe we can't put high rez textures back in EC client. It's so much more beautiful.

I tried to make KR work with Sphere (Sphere is all I know...) without success.

I found RunUO and JustUO with basic KR support.

Indeed, you have to rework all the gumps to match lua to runuo.
I can't code RunUO so I could not make any progress.

I wish I had more time to help and learn how to make these gumps work one after the other...
[doublepost=1505414180][/doublepost]Sorry for double posting, couldn't edit.

RunUO Russian Edition (Wyatt) managed to get KR fully working : http://www.infinitetravel.ru/shard/features/

Couldn't find it anywhere.
[doublepost=1505414500][/doublepost]Lots of talks about KR at uodev.de too

https://uodev.de/viewforum.php?f=66&sid=2553275d5948744f4899574206107119
 
After sometime, I'm back working on game encryption. I have followed instructions from https://www.uodev.de/viewtopic.php?f=66&t=5330&sid=88cdbfcb5ad4c57eb495435fe1765342 and result is strange. Like if I try client 10 times, it successfully decrypt at least one time, but it's totally random.

I have coded the decryption in C# with BouncyCastle. And also tried the Java decryption example from site above. But they all have the same strange problem. At least they give same result.

If there is anybody interesting in getting decryption work. I will put here my source code for testing.
[doublepost=1542544934][/doublepost]Here is the source code.
 

Attachments

  • UOKR.Server.zip
    47 KB · Views: 25
Hey guys! I am sorry because my question is a little bit offtopic. Is it possible to bring back KR graphics in to EC client?

There are two packed files in a folder named: "Texture.uop" and "LegacyTexture.uop".
Just for test i drag&drop "Texture.uop" out of game folder, and start the game... Turns out that all terrain tiles became pinky in colour. But buildings and trees were ok.
Then i bring that file back and did the same with "LegacyTexture.uop". It turns opposite. Terrrain were ok, buildings and other things became pink.

Using Mythic Package Editor i unpacked those two files in a different folders, and it turns out that "Texture.uop" still has all sprites from original KR client! ( i thought that i need to download KR client to get them...) And those files are named exactly like classic client sprites in "LegacyTexture.uop"!

In other 2D game Copy-Paste way of thinking could solve the problem. But i guess not in UO. I tried to replace files in a package using same Mythic Package Editor, but fail.

I was thinking, maybe there is a file of loading files somewhere in a client, which can be tweaked, to upload KR tiles and spites from "Texture.uop" entirely?

And i want to apologise for my poor english, and complete lack of understanding in scripting.
 
Hmm, the ids itself cant be changed unless I guess you would change them all in the map files? Not sure

What definitly should work is when you copy the KR client graphics to the ids of the EC version
 
I'm sorry to necro this topic, but I was trying to at least run a server and login to see one more time the high resolution graphics of KR client.

Took me some time to figure it out, all info is pretty outdated.

I'm sharing links that are still online to download and make it run:

This client ver. 2.53.0.2:

This server: (found it at first post here, thanks!)

This launcher, can remove encryption for login and game, also correctly patches IP. (I got it from a guy that kept it from the past):

I were able to login, create character and do some stuff inside, not much luck with gumps, it seems to be the "impossible part". But you can still "see" all items, textures, effects, etc.

Edit: Initially I was trying to find a shard that allows to play with UOKR, I only found this one: http://www.infinitetravel.ru/shard/features/ but I were not able to login, it's probably dead by now.
 
Last edited:
GumpAttempt.PNG
Apologies for reviving an old thread, but has anyone attempted anything further with the gumps? During the weekend I had an idea to modify nogumpfound.lua in the interface.uop file and change the code to dynamically add elements to a Window. I must say that it isn't really nice to work with Lua compared to C#
I had to also modify the server code a bit to pack element info into textentry fields since the x,y co-ordinates gets lost. This only gets sent if a KR client is detected.
There are still lots of different types of gump elements to implement and I'll see how far I'll get.
 
That's great man!

I've been working to support login without breaking standard client on a ModernUO PR it started to tow too much and was not merged in the end. I was going to start working with gumps but I had to quit working on the project.

I've something that may help, I got in contact with the owner of an old shard that supported KR, he pushed his files and shared me a link GitHub - KonssnoK/UO-runsa at RunSA_v3.0.0 it's not clean since it's merged with RunUO but still.

Let us know how it goes! gl
 
Last edited:
Thanks, I will check those out.
The main issue that I'm experiencing now is that it seems that the only Gump art Ids available to use is located in the managedtextures.xml file. Item Ids seem to work well as seen in the [add menu
addMenu.PNG
Props.PNG
toolbar.PNG
The problematic ones:
house.PNG
QuestLog.PNG

Some areas are overlapping each other, but I haven't implemented all gump element types yet so that might be why.
 
Wow, it seems you've managed a way to create gumps dynamically on the client side.
Good work! Please keep us informed. I'm really excited to this.
 
If you want to test it out I've pushed initial changes to the 'custom-gumps' branch: GitHub - LeonG-ZA/JustUO-KR at custom-gumps
Instructions:
You need to patch your 'interface.uop' file: (The files required for the modification are located in 'ClientMods/interface.uop')
- Get hold of this tool: GitHub - pincoide/Mythic-Package-Editor-EC-: UOP editor compatible with EC client of Ultilma Online
- The tool is a bit unpredictable, because sometimes it randomly crashes. if you try the same operation again it works. So I suggest doing one operation at a time and save. Exit. Open up the tool again. etc.
- Run the tool and open your 'interface.uop' file.
- Delete 'nogumpfound.xml' and 'nogumpfound.lua'. You will have to go through each block to find the files.
- Save a new copy of the 'interface.uop' file somewhere else.
- Run the tool and open the modified 'interface.uop' file.
- Add 'nogumpfound.xml' and select 'data/interface/default/source/generic/' as the 'Relative folder'. Leave it on 'Zlib' Compression.
- Add 'nogumpfound.lua' and select 'data/interface/default/source/generic/' as the 'Relative folder'. Leave it on 'Zlib' Compression.
- Save a new copy of the 'interface.uop' file somewhere else.
- Replace your 'interface.uop' file in your KR game folder with the new modified file.
- If the tool crashes at any time then just try again

I haven't tested these changes on any other version of KR except for KR 2.58.0.6
The code is very messy at the moment, but I also feel like JustUO isn't the correct project for these changes. I plan to make more clean changes on RunUO 2.0 Final. I've tried other later RunUO versions, but they all have minor issues such as boats not working and unnecessary content. The duplicate and unused code in the Lua script can also be cleaned up.

On a side note, while I was creating the custom gump code in Lua, I realized that it wont be too difficult to map the current RunUO gumps to the static gumps in the Lua code. It will just take a lot of time, but I can maybe explain how the Lua scripts reads the incoming gump data.
 
This might be a longshot, but does anyone know where I can get hold of packet logs that were captured during the KR era?
I've been trying to figure out how to get equipped Candles/Torches/Lanterns working, but everything I try isn't working. It's displaying correctly on the paperdoll window, but it isn't showing on the actual player and no light is being produced.
It must be some packet that we are missing or some incorrect flag in an existing packet.
Things I've tried:
- Used different layers
- Used different Items Ids
- Edited wearables.xml <- not completely sure how this file works
- Ran the latest EC client on OSI, captured packets and tried to look for any overlooked differences that might of been inherited from KR.
Any other suggestions would be appreciated.
 
This might be a longshot, but does anyone know where I can get hold of packet logs that were captured during the KR era?
I've been trying to figure out how to get equipped Candles/Torches/Lanterns working, but everything I try isn't working. It's displaying correctly on the paperdoll window, but it isn't showing on the actual player and no light is being produced.
It must be some packet that we are missing or some incorrect flag in an existing packet.
Things I've tried:
- Used different layers
- Used different Items Ids
- Edited wearables.xml <- not completely sure how this file works
- Ran the latest EC client on OSI, captured packets and tried to look for any overlooked differences that might of been inherited from KR.
Any other suggestions would be appreciated.
Couldn't it be a bug in the KR client? I don't think we can get a packet log. Disassembly is probably the only way to find out (but I'm not that skilled).
 
I think you might be right, but what is mind boggling is that it has been broken since the earliest versions of KR and nobody noticed?
I tried doing a bit of disassembly, but gave up rather quickly since there is so much stuff going on (and I don't know much about assembly :D)
Yesterday I modified the .bin file for a buckler in the tileart.uop file to point it's animation to a torch's animation and it also didn't work, but later today I'm going to try and copy over the torch's animation files over the buckler's animation files and see what happens. Just trying to pinpoint where the issue is.
My initial though was that maybe some incorrect flag values were used for the torch item in tileart.uop for the animation not to get displayed.
 
Last edited:
That did seem to work however....there are some issues. The animations are shown in the wrong hand. The lantern and torch occupy the same hand as any weapon so the animations overlap each other. There also doesn't seem to be any files related to the candle animation.
 
I think you might be right, but what is mind boggling is that it has been broken since the earliest versions of KR and nobody noticed?
I think that bugs were the main reason why KR was abandoned, and enhanced client uses old graphics. So, I wouldn't be surprised.

That did seem to work however....there are some issues. The animations are shown in the wrong hand.
Fidling with the bin data could be the way. Useful info about KR data structure can be found here: https://www.uodev.de/viewforum.php?f=66
 
If you want to test it out I've pushed initial changes to the 'custom-gumps' branch: GitHub - LeonG-ZA/JustUO-KR at custom-gumps
Instructions:
You need to patch your 'interface.uop' file: (The files required for the modification are located in 'ClientMods/interface.uop')
- Get hold of this tool: GitHub - pincoide/Mythic-Package-Editor-EC-: UOP editor compatible with EC client of Ultilma Online
- The tool is a bit unpredictable, because sometimes it randomly crashes. if you try the same operation again it works. So I suggest doing one operation at a time and save. Exit. Open up the tool again. etc.
- Run the tool and open your 'interface.uop' file.
- Delete 'nogumpfound.xml' and 'nogumpfound.lua'. You will have to go through each block to find the files.
- Save a new copy of the 'interface.uop' file somewhere else.
- Run the tool and open the modified 'interface.uop' file.
- Add 'nogumpfound.xml' and select 'data/interface/default/source/generic/' as the 'Relative folder'. Leave it on 'Zlib' Compression.
- Add 'nogumpfound.lua' and select 'data/interface/default/source/generic/' as the 'Relative folder'. Leave it on 'Zlib' Compression.
- Save a new copy of the 'interface.uop' file somewhere else.
- Replace your 'interface.uop' file in your KR game folder with the new modified file.
- If the tool crashes at any time then just try again

I haven't tested these changes on any other version of KR except for KR 2.58.0.6
The code is very messy at the moment, but I also feel like JustUO isn't the correct project for these changes. I plan to make more clean changes on RunUO 2.0 Final. I've tried other later RunUO versions, but they all have minor issues such as boats not working and unnecessary content. The duplicate and unused code in the Lua script can also be cleaned up.

On a side note, while I was creating the custom gump code in Lua, I realized that it wont be too difficult to map the current RunUO gumps to the static gumps in the Lua code. It will just take a lot of time, but I can maybe explain how the Lua scripts reads the incoming gump data.

I just tested this and it works pretty well !! gumps looks weird but hey! they are working, I still need to understand what you did ;) but it's a huge step :D congratz on the achievement.

I guess ModernUO should be a good base to work on, despite it's name is focused on no so new UO expansions, the modern part is under the hood. It's currently under development. I added support to KR but had to stop working on it at some point, client detection/version and login were working for CC, KR and EC.
 
Back