Aurastin

Member
I have noticed that the ServUO Repo seems to be updated fairly regularly, which indicates to me that it is in active development. However beyond just downloading the zip-file on the repo I have no real experience with GitHub.

So with that said, I have two questions.

What is the best way to keep my server up-to-date with new changes to ServUO without having to download a new zip-file and configure every time I want to update?

Can this be done without messing up any custom scripts and add-ons I may be using?

Thanks in advance. :)
 
I recommend looking at this video:

https://www.servuo.com/threads/servuo-for-beginners-git-github-and-you.1088/

Especially look at the explanation of the Git process. The author did not use GitHub, but the concepts translate.

He used this image:

upload_2016-2-13_6-11-57.png

He basically describes how you have:

1. Your working directory, which includes files that are not part of the Git source

2. Your staging area, which is all of the files you added to Git but have not committed to the repository

3. Your repository, which is files you have committed, so they are now available to share online, and

4. A remote repository, which is probably the original source of your cloned repository to start with.

You can see from the arrows how the relationships work between the different sections. Anyway, I do recommend watching the video, it's not that long. There are other online tutorials that explain how Git works, but since this one was specific to ServUO, I thought it was appropriate.
 
I am trying to finally figure out how to do this. I am using the EC (https://github.com/GenerationOfWorlds/ServUO) and they are making a lot of updates - so it is time for me to learn...

I want to make sure I can keep my local copy up to date and not accidentally upload anything to the repo.

I used GitGUI to clone it to my drive.

Ok. First problem. My Visual Studio 2010 will not open the sln file. Says I need a newer copy. Any suggestions on a version to download? I have always just downloaded the zip file, and made changes to each file directly. Never tried using the sln. Of course I have never kept up to date either...

Also, in the video he is using Source Tree. Should I get that or is there something else y'all recommend? Do the standard Git tools do it well enough?
 
If you do not have VS 2013, you can download the Express versions from Microsoft for free. They work pretty much the same as the Full versions.

Just search for Microsoft Visual Studio Express 2013, and download it directly from Microsoft.
 
Oh very cool... and good timing. At 6 Gb it will take all night... and it is almost bedtime ha ha


8 hours remaining... oh I miss having real internet :)


~Edit~
And I have Source Tree now. Turns out it is free to register.

~2nd Edit~
Ok, morning now, got VS Express 2013 installed. It does open the svn file but I don't see why? My 'customs' folder in scripts is not shown. Also all the files I generally work with and change are not shown. The 'data' folder, 'config' folder, all my xml files... Do I need to import that stuff manually into the project?

Quite a learning curve ahead ha ha
 
Last edited:

I appreciate you pointing me in the right direction and the video seems to be a good start, however there are several things I am still confused about that maybe you or someone else can help clarify. I think the author of the video made a good attempt, but the concepts are a little muddy.

The usage of the terms origin/master and origin/HEAD?

Commit? What am I committing to?

Fetch?

Pull?

Push?

Branch?

Merge?

Here I think it is important to stress that I am not experienced enough to contribute to the ServUO Code base. I only wish to be able to always have the most up to date ServUO from the repo, while at the same time keeping custom scripts and add-ons that I am using. And without having any changes I've made being overwritten.
(Example: updating CharacterCreation.cs to add extra starting equipment.)

I am also worried that I might accidentally do something that messes up the ServUO codebase, unless there are safeties in place to prevent that from happening.
 
I am also worried that I might accidentally do something that messes up the ServUO codebase, unless there are safeties in place to prevent that from happening.

This you should not worry about. The code is protected because only authorized persons are able to Pull changes you made in your version into the codebase. You are free to create "Pull requests". These are changes you suggest based on your testing. If someone authorized agrees, they can pull your code into the server.

I only wish to be able to always have the most up to date ServUO from the repo, while at the same time keeping custom scripts and add-ons that I am using. And without having any changes I've made being overwritten.

I am not an expert on Git, but I think I comprehend it enough to comment on this. This is more complex to understand than many people realize, but for most people it should still be easy to implement. Basically, let's say for example that you have modified Guide.cs with some custom content. If the ServUO devs have updated Guide.cs with important changes, those changes are not pushed out to everyone as "complete files" but rather in small code files called "commits". These files show the differences between the original code and the new code. For example, in a recent change:

Code:
Scripts/Mobiles/Personal Attendants/Guide.cs
@@ -58,7 +58,7 @@ public static void Initialize()
             try
             {
-                using (FileStream stream = File.OpenRead("Data\\Guide\\Definitions.cfg"))
+                using (FileStream stream = File.OpenRead(Path.Combine("Data", "Guide", "Definitions.cfg")))
                     using (StreamReader reader = new StreamReader(stream))
                     {
                         while (!reader.EndOfStream)
@@ -75,7 +75,7 @@ public static void Initialize()
                         }
                     }
-                foreach (string file in Directory.GetFiles("Data\\Guide\\", "*.graph"))
+                foreach (string file in Directory.GetFiles(Path.Combine("Data", "Guide"), "*.graph"))
                 {
                     using (FileStream stream = File.OpenRead(file))
                         using (StreamReader reader = new StreamReader(stream))
@@ -1008,4 +1008,4 @@ public override void Deserialize(GenericReader reader)
             int version = reader.ReadEncodedInt();
         }
     }
-}
+}

The pluses and minuses are lines that are added or subtracted. If you merge this file into your server, it will replace the matching sections (the minus lines) with the new code (the plus lines). You do not have to worry about the customized parts you wrote.
 
That is starting to make sense. :)

In the video I think he assumed a basic level of knowledge... that I do not yet have ha ha...

So it looks like I cannot accidentally upload my changes, and as long as I do not do a pull request the main repo will never know what changes I make. That makes me feel better.

All the online documentation for Git and Source Tree take the assumption that I want to make commits to the main code, so their instructions all go that route. It makes it look like we could easily mess up the source.

~Edit~
If we have specific Source Tree questions (ServUO related) would this be the proper forum to ask, or should I use the '3rd party support' forum?
 
Last edited:
Not sure if this is a general ServUO question or EC... (does ServUO all use the config folder?)
In the character creation cfg file you can change stat & skill cap. But you still cannot set any one stat higher than 125. Is there a way to change that?
Also, when you edit a cfg file do you have to recompile or not? I set stat cap to 500 as a test and made a new character - he was still capped at 225. I recompiled, made a new character.... still 225.
 
Whenever you edit a file in the core (/Server), you have to recompile to see those changes.

The following features/buttons do not exist in Express versions of Visual Studio

If some files in Visual Studio in the Solution Explorer on the right are not showing where you expect them, then they won't be 'included' in the project. If this s the case, you can click the "Show All Files" button:
ai.imgur.com_zktN58O.png

After that, click the "Refresh" button and any files that are 'missing' will turn up, but they will be white in color.
Right-click these white files and select "Include In Project" - that will include them properly into VS and allow you to reference them without errors.

Also, to do a full recompile, right-click the Solution node (the very first node) in the Solution Explorer tree and select "Build Solution" - you can also right-click the individual Project nodes (the green ones) and do the same to compile them one at a time.
If you make changes to /Server, right-click the Server project and Build/Rebuild it - that will also put out a new ServUO.exe for you :)
 
The 'config' directory is not under 'sever', so I guess a recompile is not needed... Just not seeing why the config changes did not take.
 
Sorry, I missed that question.

Someone mentioned that the stat cap is also influenced by the Veteran Reward System, so you may need to check on that as it could be resetting the value given by Character Creation.
 
This you should not worry about. The code is protected because only authorized persons are able to Pull changes you made in your version into the codebase. You are free to create "Pull requests". These are changes you suggest based on your testing. If someone authorized agrees, they can pull your code into the server.

I am not an expert on Git, but I think I comprehend it enough to comment on this. This is more complex to understand than many people realize, but for most people it should still be easy to implement. Basically, let's say for example that you have modified Guide.cs with some custom content. If the ServUO devs have updated Guide.cs with important changes, those changes are not pushed out to everyone as "complete files" but rather in small code files called "commits". These files show the differences between the original code and the new code. For example, in a recent change:

The pluses and minuses are lines that are added or subtracted. If you merge this file into your server, it will replace the matching sections (the minus lines) with the new code (the plus lines). You do not have to worry about the customized parts you wrote.

OK now this starts to make a little more sense I think, although I am not 100% yet. If I am starting to understand correctly, Git is an all around collaboration tool that allows one to "Clone" and then choose to update (or not) from a repository through the use of "commits". And Git also allows one to suggest changes or updates to a repository's codebase through the use of "pull requests."

I also did some reading yesterday around the internet and some excellent learning resources I found are GitHub guides, GitHub Glossary, and Getting started with SourceTree, Git, and git flow.

From what I also found there are multiple tools that use Git, all with the same end result in mind. (Just to name a few: SourceTree, GitHub Desktop, and TortoiseGit) (I am trying both SourceTree and GitHub Desktop for my learning)

Now my next question is, would it be smart to create a "Fork" or "Clone" of ServUO, and then create a "Branch" of that "Clone" or "Fork" to work from?

Please correct me on any misuse of terms.
 

@Norman Lancaster , I have actually read this posting of yours as well, and the following part from that post is part of what leads me to ask my question above. If I am understanding you and the Git process correctly.


  • 3. Click on the "Fork" button. This will create a fork of the ServUO project under your user account.
  • 4. Rules about the fork:
    1. Never commit to master! The master branch of your fork will track the remote upstream master (ServUO/ServUO) and will be where we pull changes from upstream. It is very important that you never make your own changes to the master branch.
    2. Always branch from master unless you really know what you are doing. This means that before you create any branch in the GitHub interface, the master branch should be selected and displayed in the branch drop-down.
  • 5. Now create a branch for your shard. As of the time of this writing this is done by opening the branch drop-down and typing in the new name of the branch. Name it something descriptive, like "Ponies Forever Shard".
 
Right. So my recommendation is to fork the ServUO project on GitHub, and make a branch for your shard within your own fork.

Ok it seems that I might be starting to understand this more.

Am I correct in thinking that a "Fork" on GitHub, is the same as a "Clone" on my local machine?

And with that, am I correct in thinking that I could also "branch" my shard from a "Clone" on my local machine?
 
You make a fork on Github (or others) and then you clone your fork local on your computer. When you push updates you push to your repo and pull updates from servuo from the main repo of servuo.
 
@Lokai , @Norman Lancaster , @Crome969

Thanks. I really appreciate each of your help and pointing me in the right direction here on this topic. Between each of your responses and my reading over the last couple of days I think my knowledge base has really expanded.

I am going to put together what I've learned as "best practices" and over the next week or so utilize what I've learned. If I find that I am missing or not understanding something, I will come back to this thread for clarification. :)
 
Branches are like virtual directories that you can switch between. Whatever work you do on a branch will stay on that branch, until you merge it in to another branch (like 'master').

A fork is a complete copy of an existing repository and is usually linked directly with the repository it was forked from.
The source repository will not be affected by any changes made to your fork unless you submit a pull request, which is basically a request to have the source repository include your changes with a small patch.

"Cloning" a GIT repository is basically short for "create an existing repository here and download it from the source"; when you Clone your Fork, you're simply downloading the repository in whole.
 
Listen to Voxpire and Norman, those guys have the knowlegde. I only know partial what they know and their english is prolly better. Thank you Voxpire for your work in the uo scene !

sorry for hijacking this now, i just feel it should be said..:)
 
Last edited:
Branches are like virtual directories that you can switch between. Whatever work you do on a branch will stay on that branch, until you merge it in to another branch (like 'master').

A fork is a complete copy of an existing repository and is usually linked directly with the repository it was forked from.
The source repository will not be affected by any changes made to your fork unless you submit a pull request, which is basically a request to have the source repository include your changes with a small patch.

"Cloning" a GIT repository is basically short for "create an existing repository here and download it from the source"; when you Clone your Fork, you're simply downloading the repository in whole.

It seems that there are actually a few different ways to approach this. So which of the following would be the best practice.?

Should the "Fork" or the "Clone" of the Fork be the working copy of my Server / Shard?

Or should a "Branch" of the "Fork" or "Clone" be the working copy of my Server / Shard?

And would branching from a "Branch" ever be recommended? Say for testing, before committing to the main Shard branch?

Thanks
 
Please ignore the steps you already know;

1. Fork ServUO
2. Go to your Fork's page on Github and copy the project URL from the source control text box.
3. Create an empty folder on your computer.
4. Right-click empty folder and select "Git Clone..."
5. Paste the copied URL in to the source URL text box at the top.
6. Click OK (all default settings are fine) - The Fork will be downloaded.
7. Edit any file with a small change so that your repository is flagged as 'changed'. (Edit ServerList and name your shard)
8. Right-click the folder again and select "Git Commit -> 'master'"
9. On the commit window, at the top, tick the box "New Branch"
10. Type a branch name in to the text box on the left of the check box, name it your shard's name.
11. Make sure the file you changed is ticked in the list at the bottom.
12. Click commit.
13. All settings/options on the next window are defaults and are usually OK - click OK.
14. Your commit is done, click the Push button to upload your changes to your Fork on GitHub.
15. Your local directory is now working on your new branch, you can make any changes you like!
16. When you're happy with the changes you've made, repeat step 8 and 9, skip step 10 and repeat steps 11 through 14.

Should you want to commit changes to a new branch for testing, repeat all steps from 8 through 14, typing a new branch name in to the box.
 
Yes and yes, but if you keep everything local you won't be able to send pull requests to ServUO, and obviously if your machine crashes your in bad shape.
 
I followed Voxpire's example (I think I did anyway...)

I made a fork, cloned the fork to my desktop. I made some changes and (using Source Tree) committed & pushed them. Now on my fork in Github, the changes are there. So far so good. This actually is very good because I had a hard drive crash last year and lost a lot - now I have an online backup of my changes (I make backups on a removable drive but it was not as current as it should have been)

I suppose next time y'all make some changes I will find out... but does my fork somehow monitor changes from the main repo? I question this because using Source Tree all it looks like it is doing is monitoring my fork. I cannot see that it is looking at the main repo. As I said I suppose next time y'all make a commit I shall see....

...or do I just periodically pull from the repo? (and never push)
 
I'm not sure how to do it in Source Tree as I don't use that tool, in general you merge the changes from the upstream repository into your local copy, fix any conflicts, then commit and push to your fork.
 
If wanted i can make a small screenshot collection when pulling latest changes today.

I would like that, it would be useful to be able to see that I am doing everything correctly on my end.
Your early screenshot above explaining the SourceTree layout helped alot.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back