Developer Store
Support
Member Forums

Screenshots
FAQ
Documentation
License
Known Issues
Downloads

MMOWorkshop.com Store Opened!
Torque MMO Kit - Open Sourced!
Torque MMO Kit - 1.5.2 Port Alpha Test
Torque MMO Kit - OSX Status

GarageGames.com irc.prairiegames.com
#mmoworkshop

PyTorque
TGB Web Browser


talentraspel

hallsofvalhalla - After a long epiphany
Leathel - FoHO pre-Alpha 2.42
OldRod - More Musings on the MMO Industry
xapken - nice
J.C. Smith - 0.0.4.1 Build Notes
Wolf Dreamer - Pointless blog of pointless things
AthlonJedi2 - Server Nuked !!!!!
gamer_goof - New character model GIRL1 available only $4
... MORE BLOGS!

My other project
A Message to all the new people.
MyGame
changing the primary class
See Ya Classes, Hello Skills!
XP Based Skills
fxFoliageReplicator zone loading...
Is it just me, or is it slow in ...
Places where NPC quest-givers ha...
TalentRaspel Grid

Introduction

This is another tutorial provided by Xerves. This will allow you to create a separate SVN for your code (py, gui, cs) so you can check in and out changes and do differentials if you wish. Hopefully in the future as more patches and such come out, this will become more useful. I am hoping this will eventually become part of the kit in some fashion since it is a very useful and simple to setup addition. So without much more...here we go.

Version

The instructions are written for Version 1.1 according to the documentation of how to originally setup the SVN. Please be aware that these instructions have changed since even I installed it (Dec 2007) and could be slightly different for you. If the directories I mention do not exist check your instructions for the version you installed for the correct directory.

Requirements

SVN must be installed. TortoiseSVN is HIGHLY suggested to be installed so you can use the GUI aspect of it to look at differentials and easily create diffs if you want.

Instructions

We need to create the repository for our code. Perform the following commands to do this. Please replace mycodepwd with your own password you want to use.

cd c:\
cd svnrepo
svnadmin create code
"c:\program files\apache group\apache2\bin\htpasswd.exe" -b htpasswd code mycodepwd

Open up the file svnaccess.txt in c:\svnrepo and add this to the end of it. Save the file when you are done.

[code:/]
admin = rw
code = rw

After this is done you need to restart Apache. You should have a program icon for it on your server (little green arrow). If you click on it you should get a menu and an option to restart it. Go ahead and do that.

Now we need to checkout a folder to store the changes. You can do this through the GUI or we do it via the command prompt. Here is the instructions for the command prompt.

cd c:\
cd mygame
svn co http://127.0.0.1/svn/code code

You can also create a folder in mygame and right click on it and choose checkout. It will do the same thing. If everything is well you won't get any errors and you will check a checkmark on the folder. This is going to be used to copy over the working changes to. In order to do that you need to create two folders in your working directory for your game (c:\tmmokit for me). Those two files and the code to save in them are:

buildcodesvn.py

# Copyright (C) 2004-2007 Prairie Games, Inc
# Please see LICENSE.TXT for details

import sys,os
sys.path.append(os.getcwd())
import string
import shutil

#starting directory is pulled from where it is running the file from.
startdir = os.getcwd() + "/"
startdir = string.replace(startdir,'\\','/')
#If your SVN code directory is different please replace it here
svndir = "c:/mygame/code/"

def dirwalk(dir):
    for f in os.listdir(dir):
        fullpath = os.path.join(dir,f)
        fullpath = string.replace(fullpath,'\\','/')
        if os.path.isdir(fullpath) and not os.path.islink(fullpath):
            dirwalk(fullpath)
        #If you need to add additional files, put them in the or list statement
        if (fullpath.find(".py") !=-1 or fullpath.find(".cs") !=-1 or fullpath.find(".gui") !=-1) and fullpath.find(".pyc") == -1 and fullpath.find(".pyd") == -1 and fullpath.find(".dso") == -1:
            path,f = fullpath.split(startdir)
            rootf = f
            path,f = os.path.split(f)
            if not os.path.exists(svndir + path):
               os.makedirs(svndir + path)
            try:
               shutil.copy(startdir + rootf,svndir + rootf)
            except:
               print "WARNING: Couldn't copy %s"%startdir + rootf

#Recurses through the directory looking for code files
dirwalk(startdir)

publishcodesvn.bat

@echo off 
echo "---------------------------"
echo "Moving files to SVN..."
echo "---------------------------" 
buildcodesvn.py

echo "---------------------------" 
echo "Adding files to SVN..." 
echo "---------------------------" 
cd \ 
cd mygame 
cd code 
svn add --force * 

echo "---------------------------" 
echo "Commit to SVN..." 
echo "---------------------------" 
svn commit -m "Update"

pause

If your SVN and working tmmokit are on different drives you might need to modify the batch file. Once everything is done you should be able to run the batch file and it will copy all of your code files over to the c:\mygame\code directory and then commit it. You can also manually commit it via the GUI and just run the python file to copy the files over. This will update any added files or changed files, but deleted files/folders will need to be done manually.

Well that is it. Play around with the GUI tools