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 :
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!
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: