Crome969

Member
Dear community,
I´m writing this letter of encouragement to all those of you, who not use ServUO as core and having issues to get your code merged to ServUO.

After 8 days, reviewing almost 7000 files, making my Core ( with almost 1500 handwritten files and 800 Core Mods) compatible to ServUO repo & resolving save-compability issues i got the feeling, that i might should share some experience about and encourage all of you, who want to move forward and have fear to merge all those files.

Documentation

I know its a painful thing, the documentation of own code. In my first year of owning RebirthUO i not cared much about. Once you plan to migrate new stuff or have multiple developers working on your source, you have to documentate it properly or you will suffer about. I used the concept, whenever adding a code block standalone i marked it in a region. If i replaced code i commented the old code out and added new code and then surround it by a region as well.

Sample :

Code:
#region RebirthUO - Pure - 11.02.2016 - Adding Arrow to my Arrow Bag
this.AddItem(new Arrow(100));
#endregion

Code:
#region RebirthUO - Pure - 11.02.2016 - Adding Nullcheck
//if(m.Bankbox.Items.Count = 0)
if ((m.Bankbox == null) ||(m.Bankbox.Items.Count = 0))
   return false;
#endregion

If you not documentate your code properly, you will loose your progress and struggle hard because you will be unable to decide, what is your code, what is from your core what is from servuo. If you not started yet, you may should do this beforehand else you will struggle on the whole process.

The Process

- Get your Source to a structure equal as ServUO
- Create a new Repo using the GIT-Service you prefer (i did on sourceforge).
- Add a Remote to ServUO Repo (for fetching commits from servuo).
- Download latest version of your source.
- Merge Source (Multiple SubCommits used)
- Commit your source to your Repo
- Fetch and Rebase your code from the latest changes from ServUO via Remote. Then double check what was marked by GIT as changed. There should be only your wanted changes.

First Steps

I tried to finish this process 2 times. The first time i just exchanged the servuo folder with mine and looked how many changes are marked, the problem is, when you have almost 4000 changes marked you will loose yourself within the progress.The second run i exchanged small folders at once. I copied the ServUO to a second location and then removed small folders of mine, replace them with the proper servuo folder and check on GIT (i used Sourcetree to see differences together with Winmerge) what has been changed. I only checked for my documentated changes and used the ServUO base and added my documentated changes.
One note about the merging : Forget to try to get it always compiled. Many stuff is cross referencing. You change 1 wrong file and will get 1 million issues over the whole project. Merge as best you can and correct compiler issues at end.

Insanity

The first 100 or 1000 files you will do quiete fast, then you will start getting slowly insane.. If you meet that point dont be like me, take a rest! Once you feel comfortable again work further on. Also in case of security do multiple local commits so you have small steps to move forward or backward in any case.

Compability

Once you are done with all Files, you should try to compile your files for a first time. Don´t use any Save yet, try to compile it and if you notice issues, try to fix them. They will happen, we are all humans only ;)
Once you can Compile and boot your new Core with your saves you should try to make an account, do some actions, save and reboot and check that you also serialize and deserialize correctly.

Now take a huge air breathing, the real efforts starting now :

You start load your previous most up 2 date save file and when you boot them pray for your prefered god (or food) that it compiles and boot. If you have issues here, you will have to start decide for yourself, do you want to remove those objects or update? I personally decided only to keep data in stream that is owned by player.
We had as sample those ratman clan mobiles named clanblablatinkerer. ServUO had the exact same creatures but the name was ClanRT. Instead of using both i decided to take the ServUO variant and remove the old from stream. This should only be an option if player not loose anything by it. Else you need to check and compare the datastream with an IDE and -debug as parameter and then check what causes the issue.

Sometimes it looks absolutly impossible to get an object deserialized, because the structure is different.
We had this issue with GargishNecklace and GargishEarrings. We had them integrated inheriting from BaseJewel, ServUO inherits from BaseArmor. So what to do? I used here a hackish way :
First i tooked a copy of my old GargishNecklace and renamed class to GargishNecklaceOLD. Then on deserialize instead of calling the base.Deserialize in new GargishNecklace i created a GargishNecklaceOLD object and called Deserialize of that object. On Serialize of GargishNecklaceOLD i generate a gargishnecklace and full required data by hand to that object with informations and then serialize that object.
Next time you reboot, you remove the mapper from GargishNecklace to GargishNecklaceOLD and you will be done with mapping.

Freedom

After you are done with all your issues and you made your save compatible you will be free *phew* but what comes now? Real Testing!!

Testing

Choosen (or all) player now should try to test that new core with all efforts. A lot of things will be changed, some not work as intended before so you not should hurry on releasing your new version to public and live.

Last Words

I hope i were able to share some experience and give some insight about the process. There is nothing to fear. What i can do you all can do as well.

~Pure - Owner of RebirthUO

PS : I also have to thank @Norman Lancaster who offered me some help about. I was not able to take the help, but i know you and the ServUO team cares about the plain shard owner just like me.
Don´t be shy if you have trouble, the people here are all really nice!
 
Last edited:
Dear community,
I´m writing this letter of encouragement to all those of you, who not use ServUO as core and having issues to get your code merged to ServUO.

After 8 days, reviewing almost 7000 files, making my Core ( with almost 1500 handwritten files and 800 Core Mods) compatible to ServUO repo & resolving save-compability issues i got the feeling, that i might should share some experience about and encourage all of you, who want to move forward and have fear to merge all those files.

Documentation

I know its a painful thing, the documentation of own code. In my first year of owning RebirthUO i not cared much about. Once you plan to migrate new stuff or have multiple developers working on your source, you have to documentate it properly or you will suffer about. I used the concept, whenever adding a code block standalone i marked it in a region. If i replaced code i commented the old code out and added new code and then surround it by a region as well.

Sample :

Code:
#region RebirthUO - Pure - 11.02.2016 - Adding Arrow to my Arrow Bag
this.AddItem(new Arrow(100));
#endregion

Code:
#region RebirthUO - Pure - 11.02.2016 - Adding Nullcheck
//if(m.Bankbox.Items.Count = 0)
if ((m.Bankbox == null) ||(m.Bankbox.Items.Count = 0))
   return false;
#endregion

If you not documentate your code properly, you will loose your progress and struggle hard because you will be unable to decide, what is your code, what is from your core what is from servuo. If you not started yet, you may should do this beforehand else you will struggle on the whole process.

The Process

- Get your Source to a structure equal as ServUO
- Create a new Repo using the GIT-Service you prefer (i did on sourceforge).
- Add a Remote to ServUO Repo (for fetching commits from servuo).
- Download latest version of your source.
- Merge Source (Multiple SubCommits used)
- Commit your source to your Repo
- Fetch and Rebase your code from the latest changes from ServUO via Remote. Then double check what was marked by GIT as changed. There should be only your wanted changes.

First Steps

I tried to finish this process 2 times. The first time i just exchanged the servuo folder with mine and looked how many changes are marked, the problem is, when you have almost 4000 changes marked you will loose yourself within the progress.The second run i exchanged small folders at once. I copied the ServUO to a second location and then removed small folders of mine, replace them with the proper servuo folder and check on GIT (i used Sourcetree to see differences together with Winmerge) what has been changed. I only checked for my documentated changes and used the ServUO base and added my documentated changes.
One note about the merging : Forget to try to get it always compiled. Many stuff is cross referencing. You change 1 wrong file and will get 1 million issues over the whole project. Merge as best you can and correct compiler issues at end.

Insanity

The first 100 or 1000 files you will do quiete fast, then you will start getting slowly insane.. If you meet that point dont be like me, take a rest! Once you feel comfortable again work further on. Also in case of security do multiple local commits so you have small steps to move forward or backward in any case.

Compability

Once you are done with all Files, you should try to compile your files for a first time. Don´t use any Save yet, try to compile it and if you notice issues, try to fix them. They will happen, we are all humans only ;)
Once you can Compile and boot your new Core with your saves you should try to make an account, do some actions, save and reboot and check that you also serialize and deserialize correctly.

Now take a huge air breathing, the real efforts starting now :

You start load your previous most up 2 date save file and when you boot them pray for your prefered god (or food) that it compiles and boot. If you have issues here, you will have to start decide for yourself, do you want to remove those objects or update? I personally decided only to keep data in stream that is owned by player.
We had as sample those ratman clan mobiles named clanblablatinkerer. ServUO had the exact same creatures but the name was ClanRT. Instead of using both i decided to take the ServUO variant and remove the old from stream. This should only be an option if player not loose anything by it. Else you need to check and compare the datastream with an IDE and -debug as parameter and then check what causes the issue.

Sometimes it looks absolutly impossible to get an object deserialized, because the structure is different.
We had this issue with GargishNecklace and GargishEarrings. We had them integrated inheriting from BaseJewel, ServUO inherits from BaseArmor. So what to do? I used here a hackish way :
First i tooked a copy of my old GargishNecklace and renamed class to GargishNecklaceOLD. Then on deserialize instead of calling the base.Deserialize in new GargishNecklace i created a GargishNecklaceOLD object and called Deserialize of that object. On Serialize of GargishNecklaceOLD i generate a gargishnecklace and full required data by hand to that object with informations and then serialize that object.
Next time you reboot, you remove the mapper from GargishNecklace to GargishNecklaceOLD and you will be done with mapping.

Freedom

After you are done with all your issues and you made your save compatible you will be free *phew* but what comes now? Real Testing!!

Testing

Choosen (or all) player now should try to test that new core with all efforts. A lot of things will be changed, some not work as intended before so you not should hurry on releasing your new version to public and live.

Last Words

I hope i were able to share some experience and give some insight about the process. There is nothing to fear. What i can do you all can do as well.

~Pure - Owner of RebirthUO

PS : I also have to thank @Norman Lancaster who offered me some help about. I was not able to take the help, but i know you and the ServUO team cares about the plain shard owner just like me.
Don´t be shy if you have trouble, the people here are all really nice!

Nice! :) That's a lot of work, even if you are documenting every change you make, in code or in your own notes. Over the years I've helped many individuals in the community merging scripts and cores from RunUO 1.0 to 2.1 and then RunUO 2.1 to Orb 3.0, and now to ServUO. It's not a cakewalk, sometimes you get lucky and things are simple, but usually, it's not. Serialize/Deserialize are usually the two most common sticking points. As Pure said above "Don't be shy if you have trouble, the people here are all really nice!"

Grats on finishing this project! Take a breath, grab a beer, smoke a bowl, you definitely earned it Lol
 
Hey Ladies and Gentleman,
thank you for your replies on this thread.
I`ve been out of uo scene for ~ 3 months because of personal issues and just returning and updating servuo code to my server again (i love it :rolleyes:). I hope many people finally got it working already and enjoy the awesome features servuo has to offer.
Keep going!:D:D
 
I wanted to add a bit of info I've run across as I'm doing pretty much the same thing Crome did, just not a full-merge as I have custom core changes. Anyway, depending on which repo you are using to run a shard, you will likely notice and run into a couple of situations:

1. When using a program like WinMerge to merge the new source with the old (always go New to Old, not Old to New), some files look completely "un-mergeable". I've noticed that one of the largest differences in my core and my base scripts was the organization of the code, i.e. in the old source, a method was towards the top of the page, but in the new source, it's in the middle. So of course, WinMerge doesn't realize this is the issue, so it's trying to match up similar code sections down the page. If you see a situation like this, take your old source and in the WinMerge window, just Cut/Paste it to match the new source. This will help immensely when merging code.

2. DateTime.Now had several significant changes happen, from my repo to ServUO's latest. The most notable change was DateTime.UtcNow. However, when I started changing the scripts from DateTime.Now to DateTime.UtcNow, I was still seeing errors popping up relating to those lines of code I thought I had just fixed. Mind you, I am not an expert programmer, but I know enough to get myself into trouble. I mentioned this in another thread and Ravenwolfe was good enough to reply and clarify this a bit for me:

The purpose of the change is have all times on the server consistent and to not have to adjust for daylight savings, etc. All times are now using UTC.

There are a few circumstances were we still want to use DateTime.Now. For example, in a gump, we might want to display the actual time to players and not the UTC time.

Core.Tickcount is used as a much more precise measure of short passages of time. Bascially, its the number of cpu "ticks" since server up. Think of the OnTick method you see in most timers. We can often use Core.Tickcount instead of setting a timer for some scripts.

For the most part, during a merge, you should be able to change all DateTime.Now to DateTime.UtcNow unless you want the actual time to display to someone.

The confusion comes in when the Core wants to use a TickCount instead of a DateTime due to a core change from RunUO to ServUO.

If you change all DateTime.Now to DateTime.UtcNow, that IS a step in the right direction, but you will likely still have to fix scripts that involve an OnThink or an OnTick method and the DateTime involves an operator (>=,<=,+,-) and change the DateTime.UtcNow to something similar to this:

Core.TickCount + TimeSpan.FromSeconds(1000)

As always, if you get stuck, just ask for a hand! ;)
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back