Coldest

General Category => Game Discussion => : wulfderay April 21, 2012, 10:42:09 PM



: Code Refactoring
: wulfderay April 21, 2012, 10:42:09 PM
Hi, I'm wulfderay.   I'm very impressed with your game.  I am a programmer (4th year student) and I was wondering if I could offer my help.  I downloaded your source code and took the liberty of doing a bit of refactoring.
Here's what I've done so far:
- moved the source code into its own directory
- moved the xml in the gui dir into its own directory (so there is a ./gui dir for xml and a ./src/gui directory for the source)
- separated the source code into directories (roughly) and updated the includes and CMakeList.txt to reflect this
- separated the code in coldest.cpp that pertains to the dedicated server and put it in its own file, updating CMakeList.txt to reflect this
- abstracted out some code that was used for both the dedicated server and the client and put in its own file

If you are interested in taking a look at these changes, I can give you back a copy of the code, just let me know if you do and how you'd like the copy.
I'm not super great with git (more used to svn), but if you want a branch or something we can figure it out.

Again, sweet game.  I look forward to working on it (if you want me to).


: Re: Code Refactoring
: Cybertron April 24, 2012, 05:01:58 PM
Sorry for not getting back to you quicker, been busy the past couple of days.

Those sound like good changes.  I've even considered making some of them myself, but never had the motivation. ;)  I'm not positive what the best way for you to send the changes to me is, but the first thing I would try is running a git diff and sending me the output.  Git's pretty smart about recognizing changes like this so hopefully it will be able to figure out what you've done.  If not, we'll have to figure something else out.

If the resulting file is small enough, just attach it to a forum post.  Otherwise, let me know how big it is and we'll figure out some other way to get it to me.


: Re: Code Refactoring
: wulfderay April 25, 2012, 08:24:04 AM
The diff is about 2 mb, so I'll email it to you.  I don't actually know your email address, and all of the ways I have to message you have a character limit ... can you send me your email addy in a private message? BTW, I'm not 100% sure if it picked up the fact that I moved some files  (I didn't know about git mv) but if it didn't I can go back and do it the proper way.  Note that this is still a work in progress to give you an idea of what I'm up to.
Thanks,

Mark/wulfderay 


: Re: Code Refactoring
: Cybertron April 28, 2012, 11:09:43 PM
Okay, I sent you my address.  If it just missed moved files I shouldn't have much trouble reproducing those changes, but we'll see how it goes.


: Re: Code Refactoring
: Cybertron May 14, 2012, 10:05:39 PM
Sorry, I should have gotten back to you earlier.  It's a bad time of year for this because the weather here is so nice that I'm spending all of my time outside. :)

The diff was definitely problematic because it didn't pick up the new locations for any of the files.  I also had some problems with inconsistencies between our source trees because of changes I've made since you last pulled from the repository.

Unfortunately, at this point I think the simplest solution is going to be to pull down a fresh copy of the Git repo, reproduce your file moves with git mv, and then copy over the changed files from the original edited source tree (so don't overwrite it with the new copy ;)).  The git diff for that should cover all the changes and as long as I don't make any further changes it should apply cleanly here.

You could also try git adding all of the moved files again, but I'm not sure if that will retain their history and it won't solve the inconsistency problem.


: Re: Code Refactoring
: wulfderay May 14, 2012, 10:09:21 PM
Ok. Will do.


Sorry, the copyright must be in the template.
Please notify this forum's administrator that this site is missing the copyright message for SMF so they can rectify the situation. Display of copyright is a legal requirement. For more information on this please visit the Simple Machines website.