ATTN: reorganization

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

Post Reply
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

ATTN: reorganization

Post by o11c »

I have implemented a reorganization:
  • Separate stuff into subdirectories
    • login/ for the login-server's configuration and savefiles. (Eventually, this is planned to be moved out of this repository entirely, and placed in the server repository, but with the state of my rewrite, it is not feasible to make changes to the exist server repository)
    • world/ for the char-server's stuff
    • world/map/ for the map-server's stuff
    • This will greatly reduce stress when we implement multiple worlds, e.g. tmwa-adventures
  • Make the client-data a git submodule. After the next update, the +tmw-admins/tmw/tmwa-client-test will become obselete, because every commit of the server data will indicate exactly which commit in tmwa-client-data corresponds, be it 'stable' or not.
    • This means that all commits of client data must be pushed to tmwa-client-data
    • While this is only in testing, the submodule points to tmwa-client-testing. When it's time to push this to the stable server data repository, the submodule URL will change, and you'll have to run 'git submodule sync'.
    • Use: git submodule update [--rebase | --merge] from the server data repository instead of git pull [--rebase] from the client-data repository. There is a git hook that does this when you 'git pull' the server-data repository, which you must copy into .git/hooks manually.
  • Some changes to the map converter.
    • The symlinks are no longer necessary. Instead, command-line arguments are given.
    • The 'Converter' helper class has been obseleted and removed.
    • There is a makefile at the root of the repository which does this automatically. Among other things, this means you will no longer have the problem of running an outdated version of the converter because you forgot to run 'ant' again.
Currently, this is at: https://gitorious.org/~o11c/tmw/o11cs-tmwa-server-reorg


Changes for people running servers:
  • You must run ./move-stuff.sh after updating, in order to move non-git data to the correct location
  • The server binaries (login-server, char-server, map-server) need to be put on your PATH, e.g. /usr/local/bin or possibly ~/bin
  • You should install the post-merge git hook. A symlink is recommended, so that you get (potential) updates automatically.
  • If you are tracking testing rather than stable, you will have to run git submodule sync to update the URL once this gets pushed to stable.
  • You must run git submodule update --init after cloning. (to save download time, you can copy an existing .git/ directory of a clone of the client-data git repository first)
Changes for people with push access:
  • The submodule is initially branchless, you'll want to run 'git checkout master'
  • You must push to client-data before pushing to any server-data repository
  • If there is a clone for a project, clone only the server data, your client-data changes should be put straight into tmwa-client-data if possible
  • Instead of cloning the ssh urls (git@gitorious.org: ...), clone the git:// urls, and run:
    git config --global url.git@gitorious.org:.pushInsteadOf git://gitorious.org
    Besides being necessary for the submodules to work, this will mean faster downloads.
Former programmer for the TMWA server.
User avatar
argul
Novice
Novice
Posts: 237
Joined: 08 Aug 2010, 18:43

Re: ATTN: reorganization

Post by argul »

Cool, that your rewrite is going on / finished :)

I attached a script of the old structure, which pulls all needed repos recompiles server and sets up webserver etc
(all that is needed for a server restart)

Could you please add some comments or even working code, so we can see how restarting is done with the new structure?
Attachments
restart.sh.txt
(1.73 KiB) Downloaded 101 times
---
User avatar
Wombat
TMW Adviser
TMW Adviser
Posts: 1532
Joined: 08 Aug 2008, 16:31

Re: ATTN: reorganization

Post by Wombat »

What happens if someone accidentally pushed server-data before client data? Would the push need to be reverted or would there be a different fix for this issue?

Also, if I had several things to push on both server-data and client-data, I push first on server-data on accident, then add something to client-data...then later add something to client-data, then server-data, would this fix the issue?
Current character is "Abolish".
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: ATTN: reorganization

Post by o11c »

Wombat wrote:What happens if someone accidentally pushed server-data before client data? Would the push need to be reverted or would there be a different fix for this issue?

Also, if I had several things to push on both server-data and client-data, I push first on server-data on accident, then add something to client-data...then later add something to client-data, then server-data, would this fix the issue?
All you have to do is push the relevant commit pointed-to by the server-data to the client-data.

But this shows the importance of maintaining control over the server-data repository: it's committers MUST know what they are doing (i.e., they must keep the client-data commit pointer updated)

So there are 2 kinds of commits in server-data:
Those that are unrelated to client-data (e.g. scripting). These may update the submodule commit pointer. If the pusher has 'git pull'ed the client-data, changes in client-data (e.g. non-map changes such as sprites or *.xml changes) will appear in 'git status'
Those that are in response to a change in client-data (i.e. "Run the converter"). These must update the submodule commit pointer. Since running the converter requires the client-data to be up-to-date (an advantage of having the known path), this will always show up in 'git status'.
Attachments
restart.sh.txt
(2.6 KiB) Downloaded 92 times
Former programmer for the TMWA server.
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: ATTN: reorganization

Post by o11c »

pushed

Edit: to apply a format-patch from before the change, do:
git am --directory=world/map/
Former programmer for the TMWA server.
Post Reply