Guide to Updating Server for Windows 7

Post Reply
Desufire
Posts: 162
Joined: Sun Feb 22, 2015 2:58 am

Guide to Updating Server for Windows 7

Post by Desufire » Sat Apr 04, 2015 2:41 am

EDIT NOTE: I've noticed that my fork is no longer merging using this method, but my files are updating. So this is still a good method, I've just edited the end "Pull" to instead "Push" the updated files to your repository. Feel free to ask for help if needed and I'll do what I can.

I've learned a ton from everyone on these forums and from setting up my own server. I've always been good at writing out guides and I've noticed that running a server on Windows can be difficult. So I'm hoping that this guide will be helpful to those people and in this way, I at least feel as if I'm contributing to this project in some small way.

The following is a Step by Step "Let me hold your hand through this process" guide on how to Fork your own Repository copy of the darkstar project, then using that Fork for updating your server.

I use Windows 7 Professional and am not familiar with Windows 8, so if this doesn't work for 8, I'm sorry :(.
Also, you should already have Git and Tortoisegit installed.

Let's begin.

First you need to go to the darkstar github here: https://github.com/DarkstarProject/darkstar and create a Github account if you haven't yet.

Once you have an account created, return to the darkstar git using the link above. You'll see a clickable labeled "Fork" on the top right. I have it in a purple box in the below pic.

Image

Once you get it Forked, you'll see the title of the project change from DarkstarProject/darkstar to "YourAccount"/darkstar.

Next we follow the steps provided here https://wiki.dspt.info/index.php/Building_the_Server to Clone and get our darkstar folder. But, we need to clone our new fork instead.
Backup any files you've edited for your server and take the sql files associated with character info and stash them somewhere. There's a nice .bat file you can use found here: viewtopic.php?f=16&t=2440. You will have to do some editing to get it to work or you can manually take away the files.

When you're ready, delete the darkstar folder you have and clone a new one. In the clone window, use your fork url which will look like: https://github.com/"youraccountname"/darkstar.

With our new darkstar folder cloned from our own github, we can now control when we update and what we commit without panic. I recommend finishing setting your server up before continuing so that you have your Conf and settings files edited and ready to commit.

Setting up TortoiseGit -

Right click the darkstar folder, hover over TortoiseGit, then go down to Settings. You should get the below picture.

Image

Click on Remote to bring up the window in the pic above. In the pic you'll see that my origin is my fork which is https://github.com/Desufire/darkstar. Yours should say the same thing except Desufire will be whatever your GitHub account name is.

We need to add an upstream which will be the actual DarkstarProject so that we can get their updates. To do this, just delete the "origin" name and type upstream. Click Rename for the name to stick, then put this: https://github.com/DarkstarProject/darkstar in the url part. Click the ADD/NEW SAVE on the bottom once done. It should look like this when you're done.

Image

Commit -

Now we'll go into Committing and Pushing your commit to your fork.

You should have your Conf and settings files to commit at the least, but it's ok if you have more. Right click anywhere in the darkstar folder and select Git Commit master.

Image

The above window should show and you'll see all the files you've edited in the bottom window. In this pic you see my server message.fr file. Type a message in the top box and make sure all other options look like the pic options. You can click Add Author and/or Add Time if you'd like. These just add your name and the date/time you performed the commit. Click Okay when you're satisfied.

Image

You should see what the above pic shows once you hit Okay for your Commit and it finishes. Now we click the Push button in that window.

Image

This will send those files to your fork. Be sure that your options match the pic! If you see "upstream" anywhere, DO NOT PUSH!

Configuring and Syncing your Fork -

Right click on the darkstar folder itself and select Git Bash.

Image

You'll see a command prompt window. When it's ready to receive commands you'll see a $ symbol next to the flashing underscore.
Go here https://help.github.com/articles/config ... or-a-fork/ and follow the steps beginning with Step 2. When finished, leave the Command Prompt open and continue to next step.

Now we move on to Syncing your fork to Darkstar's.
CAUTION: The next few sectiions will perform an update, so be sure to backup your character, ah, ls, and accounts sqls.

Go here https://help.github.com/articles/syncing-a-fork/ and start at Step 3.

You can close the command prompt and right click your darkstar folder again. This time select Git Sync to get the following window.

Image

Click Push and this will update your repository with the files you just merged from Darkstar. You've just updated using Git! Now replace any files you backed up, use the DSP_Import.bat file you get from the Building Your Server wiki (The 2nd script listed NOT the first), and do your zoneip via Navicat or whatever you use. Rebuild the servers (usually just need to rebuild DSConnect and DSGame).

Whenever you want to update, just open Git Bash and use this page: https://help.github.com/articles/syncing-a-fork/, then follow my steps for Git Sync.
Last edited by Desufire on Tue May 12, 2015 7:41 pm, edited 1 time in total.

Elkazan
Posts: 11
Joined: Sun Mar 30, 2014 4:14 pm

Re: Guide to Updating Server for Windows 7

Post by Elkazan » Sat Apr 04, 2015 3:57 am

This is amazing work!

Thank you for this, Desu!

SwitchVII
Posts: 3
Joined: Fri Nov 15, 2013 8:29 pm

Re: Guide to Updating Server for Windows 7

Post by SwitchVII » Tue May 12, 2015 2:49 pm

A recent update altered the char.sql file and related database table with an additional column (as well as added a brand new character data related .sql file and resulting table - char_style). How do you retain character data when changes like these occur in the upstream repository?

Specific commit I'm referring to: https://github.com/DarkstarProject/dark ... 2093c035cf

Desufire
Posts: 162
Joined: Sun Feb 22, 2015 2:58 am

Re: Guide to Updating Server for Windows 7

Post by Desufire » Tue May 12, 2015 7:37 pm

I edit the table via Navicat manually. I'm unfamiliar with other programs, but if you DO use Navicat, it's quite simple.

Open the new char sql that was updated and you'll see the added column on the bottom "isstylelocked" which was the recent one.

The info is all right there. So open Navicat, open chars sql, click the menu bar next to "Begin Transaction". Hover over File in the drop-down, then select Design Table.

Now scroll down to the bottom and then click "Add Field" from the menu bar above. Proceed to enter the info from the updated chars sql: Name, Type, Length, Decimals (usually 0), Not Null (usually checked). On the bottom window you'll see "Default:" with an empty box. This is usually 0. Leave comment blank and the rest of the options default. Click "Save" in the above menu bar and you've updated your chars sql manually.

Now there is a forum user, Delaide, that has been very kind to provide files that will update your chars table and retain the info. I'm unsure as to where the topic is, but if you look around, you'll find it.

Delaide
Posts: 445
Joined: Sat Jun 14, 2014 8:58 am

Re: Guide to Updating Server for Windows 7

Post by Delaide » Tue May 12, 2015 8:48 pm

Bleh, yeah, sorry, I have not created and tested a new SQL update for my update thread. I really should do that.
The topic is here: viewtopic.php?f=14&t=2591

Edit: I have uploaded the SQL fix to my thread. Please also note the addition of the new table though: char_style.sql
You need to make sure you add this table to the database. The added column isstylelocked will not fix a broken database if the new table is not added.

Desufire
Posts: 162
Joined: Sun Feb 22, 2015 2:58 am

Re: Guide to Updating Server for Windows 7

Post by Desufire » Tue May 12, 2015 11:13 pm

Delaide wrote:Bleh, yeah, sorry, I have not created and tested a new SQL update for my update thread. I really should do that.
The topic is here: viewtopic.php?f=14&t=2591

Edit: I have uploaded the SQL fix to my thread. Please also note the addition of the new table though: char_style.sql
You need to make sure you add this table to the database. The added column isstylelocked will not fix a broken database if the new table is not added.
See? I said Delaide was very kind. ;)

SwitchVII
Posts: 3
Joined: Fri Nov 15, 2013 8:29 pm

Re: Guide to Updating Server for Windows 7

Post by SwitchVII » Wed May 13, 2015 9:50 am

Thanks for the help, you two!

User avatar
TeoTwawki
Developer
Posts: 511
Joined: Mon Jul 15, 2013 9:50 pm
Contact:

Re: Guide to Updating Server for Windows 7

Post by TeoTwawki » Sat Sep 26, 2015 10:34 am

I've never once used git sync on my fork. I push my changes to my fork, I pull my updates from DSP's master. But maybe thats just because of my habit of blowing away branches and making new ones regularly, and keeping my "master" a perfect 1:1 of latest DSP.


edit: now that I've read it all.. this guide can be made simpler. There's no need for both tortoise and git bash in tandem, you can do the entire thing from one or the other. :)

Also, i didn't know exactly wtf sync does because it didn't exist on the command line and I never needed it, heh..Its a unique feature to tortoise. Neat. https://stackoverflow.com/questions/135 ... c-and-pull
Hi, I run The Demiurge server.

Code: Select all

PLS USE [code]CODE TAGS[/code] WHEN POSTING CODE
Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

warlord1352
Posts: 34
Joined: Sat Feb 10, 2018 1:52 am

Re: Guide to Updating Server for Windows 7

Post by warlord1352 » Mon Mar 19, 2018 3:21 pm

I know this is pretty old but I think its a pretty good guide. Only thing though is I can't view any of the screenshots you posted...

Post Reply