# Touhou Patch Center:Servers

Project overview

## Mirrors

To ensure the availability of our translations, the patch data used by the Touhou Community Reliant Automatic Patcher is mirrored across multiple servers.

Server URL
thpatch.net main server http://srv-origin.thpatch.net/
CloudFront CDN http://thcrap-cdn.thpatch.net/
Nmlgc's mirror http://thcrap.nmlgc.net/repos/thpatch/

As the main server, srv.thpatch.net is the most up-to-date resource and directly receives translations after they were made in the wiki. The other mirrors pull the latest state from there every minute.

Just like the content on the wiki, the translations and images on this server are licensed under Creative Commons Attribution-ShareAlike 3.0 Unported.

## Neighbors

This list contains links to third-party patch repositories not under our control. When pointed to Touhou Patch Center, the configuration tool will offer to choose patches from these repositories as well.

If you want your repository to be included in this list, please send a mail to submissions@thpatch.net, containing the public path to your repository (this is the "servers" value in repo.js). In case you use Git to manage your server, you can also request it to be automatically mirrored on mirrors.thpatch.net. This is highly recommended in order to keep your patches available in case the original host happens to go down.

URL Title Patches
http://thcrap.nmlgc.net/repos/nmlgc/ Nmlgc's patch repository
• aero (Enable Aero compositing)
• base_tasofro (Basic support for Tasogare Frontier games)
• base_tsa (Basic support for Team Shanghai Alice games)
• bitch (Keep Alice's "bitch" line in TH08)
• cheat (Various cheats, ported from SpoilerAL .ssg files)
• instant_ending (Show the ending immediately upon entering Stage 1
                         (missing support for TH07 and TH08))

• real_bullet_size (Resize bullets to match their actual hitbox
                         (by sibgamer, http://tinyurl.com/real-bullet-size))

• script_latin (Shared data for languages using Latin script)
• tsa_en (Official English translation by ZUN)
• western_name_order (Western name order)
https://raw.githubusercontent.com/Nazeo/thcrap-nazeo/master/ Nazeo's patches
• gangster (Gizoogle Translations)
https://raw.githubusercontent.com/Gamer251/thcrap-gamer251/master/ The Amateur Modder
• mima (The return of Mima! (English)
                         This mod has a few bugs in the fighting games.)

https://raw.githubusercontent.com/soap925/BurntToast-Mod-Stockhouse/master/ BurntToast12's Mod Stockhouse
• Sakuya! (This Adds Sakuya As A Playable Character)
• Sakuya!NoBackgroundOnWatch (This Removes Th13's Pocketwatch Background.)
• Yuuka! (Adds Yuuka As A Playable Character)
https://raw.githubusercontent.com/Nutzer/Touhou-8.3/master/ Nutzer
• Touhou-8.3 (Nutzer's Touhou 8.3 (Demo 0.1a))
https://raw.githubusercontent.com/Zrrg/UnKnwn/master/ UnKnwn Thcrap Repository
• bl_reimu (BlueReimu: Sprite and portraits replacement. (Th10+))
• untanned_cirno (UntannedCirno)
https://raw.githubusercontent.com/DTM9025/DTM/master/ DTM's Patch Repository
• alphes (Alphes Styled Character Portraits (Art by Dairi))
• lang_en-shifted_bgm (English Language pack with shifted music titles in stage)
• transparent_season_items (Increases the transparency of season items (by Namusan))
https://raw.githubusercontent.com/wobuffet3/wobuffet3-thcrap/master/ Wobuffet3's patches
• spaghetti (Turns everything in HSiFS into spaghetti.)
http://mirrors.thpatch.net/PookChang'e/ Pook Chang'e's Patches
• kirisa_ha (Help Marisa Kirisa and Reimu Ha transcend into the games)
• reimu_rod (Restore Reimu's purification rod in TH15 and TH16)
http://mirrors.thpatch.net/MasterGameFTW3561/ MGFTWH3561's Mods
• Hatless (Hatless Edits by MasterGameFTW3561 (WIP))
• JzBoy_Styled (JzBoy Styled by MasterGameFTW3561 and Art by JzBoy Anims)
• Koichi_Pose (Koichi_Pose from JJBA by MasterGameFTW3561 and Art by Fr00sk)
https://raw.githubusercontent.com/Tearff/Tear/master/ Tear's Touhou Mods
• alphes-alt (Alphes-style portraits (art by kaoru))
https://raw.githubusercontent.com/GhostPhanom/GhostPhanom-Thcrap/master/ GhostPhanom's strange thoughts
• BossRush (Turbo youkai extermination (Currently supports TH10, TH11, TH12, 128Ex, 13, 14, 15, 16))
• MikoPopsicle (Changes her shaku and aura for a Cirno Popsicle in TH13)
https://mirrors.thpatch.net/Bravi/  ?\n|}

## Building your own patch server

As of the 2014-01-26 build, thcrap includes a Python script to assist in building your own self-updating patch server, where you can publish your own patches while having full control over them. While this may sound pretty involved, it really is not that complex – we deliberately designed the system in such a way that no specific server software is required. Anything that uses the HTTP protocol and allows for arbitrary files to be stored and served to the Web while retaining their file names and directory structure can be used.

You don't even have to pay for webspace in order to do this; there are a number of free cloud storage providers that work just as well. Below, you can find tutorials on how to set up your own repository on one of these. All these tutorials are written for Windows only, but if you use a different operating system, you should have no trouble adapting them. ☺

### Overview

To explain the terminology:

• First, we have patches. These are basically just unordered collections of files that provide replacements for certain original game data. One patch can provide data for an unlimited number of games.
• Patches are grouped in repositories. These are in turn collections of all the different patches offered and controlled by one person or community.

You start by creating a repository, then one or more patches, which you then regularly publish on a server.

### Local setup

First, you need to think of a globally unique, short ID for your repository. This could simply be your name, or the name of your community. For the sake of this tutorial, we'll call it RepoDir.

You also need to do the following:

1. Download and install Python 3, if you don't have it already. Be sure to make a note of the path it gets installed to.
(This is the programming language the repository build script is written in.)
2. Create a new directory named RepoDir inside your thcrap directory.
This will be your local repository path, where all your patch development will take place.
3. Inside RepoDir, create a new directory for each of your patches, named after their respective short ID. We'll use PatchDir as an example.

### Patch setup

For each patch, create a file named patch.js in RepoDir\PatchDir. This is mandatory, the build script won't recognize the patch otherwise.

All files with a JS extension are JSON format files. You can validate their syntax using sites like JSONLint.

#### Dependencies

These are set using the dependencies array in patch.js, and ensure that the configuration tool automatically pulls in all required functionality for your patch.

Dependency statements have the form repo_id/patch_id. repo_id is optional - leaving it out will resolve the given patch first on your repository, then globally across all repositories a user has discovered. Be careful, this might have unintended consequences when used with a patch not in your repository.

Some of the patches from the network you may want to bundle are:

• nmlgc/base_tsa: The basic technical support for Windows Touhou games. If your patch targets any of these games, make absolutely sure to include this one in some way! Otherwise, the configuration tool may not pull it in and the resulting configurations may not work!
• nmlgc/script_latin: Contains a font with sufficient Unicode coverage for Latin, Greek and Cyrillic scripts, some settings to make it look as nice as possible for every game, as well as Hepburn romanizations for common terms and images.
• nmlgc/western_name_order: Exactly what it says – Western name order for the enemy names during boss battles.
• thpatch/lang_en: Not only does this give you our up-to-date English translation, it also ensures that any other dependencies for a translation patch (such as all three patches mentioned above) will be present when selecting your patch in the configuration tool.
##### Examples

A basic configuration for a translation patch using a non-English Latin script language:

{
"dependencies": [
"nmlgc/base_tsa",
"nmlgc/script_latin",
"nmlgc/western_name_order"
]
}

Pulls in all of the above (and maybe even more in the future) plus the English translations:

{
"dependencies": [
"thpatch/lang_en"
]
}

#### Fonts

If your patch includes custom fonts, register them using the fonts object. This is a simple list of every font file name to load before starting the patched game:

{
"fonts": {
"Font1.ttf": true,
"Font2.otf": true
}
}

(thcrap does not look at the actual value of the key, true in this example.)

#### OK, and how do I do X?

Well, thcrap can do a lot of things. ☺ Until we have described them all, your best bet is to look at how our patches do the things you intend to do. If you still have questions, just visit our IRC chat, ask us, and we'll be glad to help you.

### Server setup

The rest of this tutorial differs depending on the webspace or server provider you use.

#### Using GitHub

This is the recommended option. It will keep your repository under a revision control system and thus store the entire history of your patches, which can then be viewed nicely on the GitHub website. We are also thinking about adding direct Git support to the thcrap updater in the future, which would make this setup even simpler.

If you're already familiar with Git: Just run repo_update.py every time before you commit. If you aren't, how to set it up on Windows:

1. Make sure you have version 2014-05-08 or later of thcrap. This build introduces some important changes to the repository script which make GitHub support possible in the first place. Also make sure that thcrap.zip and it's contents are in the same directory as your patches. Otherwise you will get an error that repo_update is missing.
2. Register a new free account on GitHub if you don't have one yet.
3. On your dashboard, create a new repository with the default settings. Its name does not necessarily have to correspond with the name you chose for RepoDir in your local setup.

5. In the Options menu, set the default storage directory to your thcrap directory, and put your name and e-mail address in the configure git section.

6. Clone the repository you created on GitHub into your thcrap directory.
If your local repository directory shares its name with the one on GitHub, this will fail. In that case, just rename your local directory temporarily, then move all of its contents into the newly created directory after the cloning process is complete.

7. In the newly cloned directory, create a file named Update.bat, which you will use to launch thcrap's update script:

C:\path\to\python.exe ..\scripts\repo_update.py
pause
Then run Update.bat and set the basic parameters of your repository. The repository ID should be the same as its directory name, and the public URL for GitHub is:
https://raw.githubusercontent.com/GitHub-user-name/GitHub-repository-name/master/

That's it for the basic setup. After you have made some edits to your patches, this is how you publish them:

1. Run Update.bat.
2. Open the GitHub client and navigate to your patch repository. This should give you all changes since the last commit as well as the option to create a new one.
Be sure to do this immediately after running the update script! If you run thcrap with the patch you are editing before committing, the updater will overwrite your changes with the last state on the server!
3. Verify the changes you are about to commit. If everything went fine, each file you changed should now have a different checksum in the files.js file of the affected patches:

4. Then, simply click commit to master, followed by publish, and your changes are live.