Difference between revisions of "Upgrading Tips"
m (Testing wikisync changes) |
(checked against the current code (wiki review 2026-11-15)) |
||
| Line 1: | Line 1: | ||
| − | + | How to bring your game up to date with the DikuMUD III repository, and how to bring in zones and players from an older VME game. | |
| − | < | + | == Before you start == |
| − | + | Back up <code>vme/lib/</code>. It holds the player files, the boards and everything DIL programs have saved. Once a newer server has saved the players, an older server can no longer read them: it stops with "FATAL: Attempted to read ... version number ... which was NEWER than this implementation can handle". So the backup is your only way back. | |
| − | |||
| − | < | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | Also keep a copy of anything you changed in the repository: <code>vme/etc/server.cfg</code>, <code>vme/etc/zonelist</code>, your zones in <code>vme/zone/</code>. Those files are part of the repository, so an update can change them too. The tidy way is to keep your changes as commits on a git branch of your own and merge the new version into it: | |
| + | <pre> | ||
| + | git checkout -b mygame # once: your changes live on this branch | ||
| + | git commit -a -m "My settings" | ||
| + | ... | ||
| + | git fetch origin | ||
| + | git merge origin/master # take in the new version | ||
| + | </pre> | ||
| + | Git then tells you where the new version and your changes overlap. | ||
| + | |||
| + | == Updating == | ||
| + | From the top of the repository: | ||
| + | <pre> | ||
| + | git pull # or the fetch and merge above | ||
| + | cmake . # only needed if the build files changed, harmless otherwise | ||
| + | make all -j$(nproc) | ||
| + | ctest | ||
| + | </pre> | ||
| + | <code>make all</code> rebuilds the programs, the <code>.dat</code> files in <code>vme/etc/</code> and every zone (all zones recompile when vmc or a header in <code>vme/include/</code> changes), and runs the unit tests. Then restart the server; it reads the programs, zones and definitions only when it starts. If you run the game with <code>startvme.sh</code>, the in-game <code>reboot</code> command does it. Restart mplex too if it changed. mplex can stay up across a server restart: the players get "Please be patient..." and are let in again when the server is back. | ||
| + | |||
| + | If the build fails after an update, check that you still have all the packages in [[Manual:Installation]]; new versions sometimes need another library. | ||
| + | |||
| + | == Player files == | ||
| + | The server reads player files written by older versions and converts them as it loads them; for example, the old <code>&</code> colour codes in titles and descriptions are turned into HTML. Each player is saved in the current format at the next save. To convert all players at once, stop the game, back up <code>vme/lib/</code>, and run from <code>vme/bin/</code>: | ||
| + | <pre> | ||
| + | ./vme -c # load and save every player file again, then exit | ||
| + | </pre> | ||
| + | <code>./vme -L</code> only lists the player files. <code>./vme -C</code> also '''deletes''' corrupt and old characters, so use it with care. | ||
| + | |||
| + | == Zones with the old colour codes == | ||
| + | Before DikuMUD III, zones used codes such as <code>&c+w</code>, <code>&n</code> and <code>&l</code> for colours and layout. DikuMUD III uses HTML instead; see [[Manual:Zone Manual/Color and Formatting Codes]]. The compiler doesn't convert the old codes, so a zone that still has them shows them as text in the game. | ||
| + | |||
| + | <code>vme/src/defcomp/fixhtml.c</code> is a small converter for such zone sources. The build doesn't make it, so compile it yourself: | ||
| + | <pre> | ||
| + | gcc -o fixhtml vme/src/defcomp/fixhtml.c | ||
| + | ./fixhtml < oldzone.zon > oldzone.zon.new | ||
| + | </pre> | ||
| + | It reads a zone on standard input and writes it on standard output. Inside strings it turns the colour codes into <code><div class='...'></code> tags, <code>&n</code> into <code><br/></code>, <code>&l</code> into <code><pre></code> and <code>&&</code> into <code>&amp;</code>. It reports codes it doesn't know and quotes that are never closed. For example, the line | ||
| + | <pre> | ||
| + | title "&c+wHello&cw there&n" | ||
| + | </pre> | ||
| + | comes out as | ||
| + | <pre> | ||
| + | title "<div class='cpw'>Hello</div><div class='cw'> there<br/></div>" | ||
| + | </pre> | ||
| + | |||
| + | <code>vme/zone/removefinal.sh</code> runs the converter over every <code>.zon</code> file in a directory and writes <code>.zon.new</code> files beside them. It expects the program at <code>../vme/bin/fixhtml</code>, so edit that path to where you compiled it. | ||
| + | |||
| + | A way to work: | ||
| + | # Convert all the zones. | ||
| + | # Search the new files for <code>&</code> and check that each one is part of HTML (<code>&amp;</code>, <code>&lt;</code> and so on) and not a leftover old code. | ||
| + | # Where an old code was typed wrongly, fix it in the original zone and convert again. Repeat until no old codes are left. | ||
| + | # Replace the zones with the new files, compile them with vmc and look at them in the game. | ||
| + | |||
| + | == Older conversions == | ||
| + | <code>vme/scripts/</code> still has the gawk scripts (<code>convert.zone</code>, <code>convert.socials</code>, <code>convert.help</code>, <code>convert.wizhelp</code>) that converted a VME 1.x game to VME 2.0 in 2001. They are only of use for a game that old, and its zones will still need the colour conversion above and other fixes before the current vmc accepts them. | ||
Latest revision as of 06:14, 15 November 2026
How to bring your game up to date with the DikuMUD III repository, and how to bring in zones and players from an older VME game.
Contents
Before you start
Back up vme/lib/. It holds the player files, the boards and everything DIL programs have saved. Once a newer server has saved the players, an older server can no longer read them: it stops with "FATAL: Attempted to read ... version number ... which was NEWER than this implementation can handle". So the backup is your only way back.
Also keep a copy of anything you changed in the repository: vme/etc/server.cfg, vme/etc/zonelist, your zones in vme/zone/. Those files are part of the repository, so an update can change them too. The tidy way is to keep your changes as commits on a git branch of your own and merge the new version into it:
git checkout -b mygame # once: your changes live on this branch git commit -a -m "My settings" ... git fetch origin git merge origin/master # take in the new version
Git then tells you where the new version and your changes overlap.
Updating
From the top of the repository:
git pull # or the fetch and merge above cmake . # only needed if the build files changed, harmless otherwise make all -j$(nproc) ctest
make all rebuilds the programs, the .dat files in vme/etc/ and every zone (all zones recompile when vmc or a header in vme/include/ changes), and runs the unit tests. Then restart the server; it reads the programs, zones and definitions only when it starts. If you run the game with startvme.sh, the in-game reboot command does it. Restart mplex too if it changed. mplex can stay up across a server restart: the players get "Please be patient..." and are let in again when the server is back.
If the build fails after an update, check that you still have all the packages in Manual:Installation; new versions sometimes need another library.
Player files
The server reads player files written by older versions and converts them as it loads them; for example, the old & colour codes in titles and descriptions are turned into HTML. Each player is saved in the current format at the next save. To convert all players at once, stop the game, back up vme/lib/, and run from vme/bin/:
./vme -c # load and save every player file again, then exit
./vme -L only lists the player files. ./vme -C also deletes corrupt and old characters, so use it with care.
Zones with the old colour codes
Before DikuMUD III, zones used codes such as &c+w, &n and &l for colours and layout. DikuMUD III uses HTML instead; see Manual:Zone Manual/Color and Formatting Codes. The compiler doesn't convert the old codes, so a zone that still has them shows them as text in the game.
vme/src/defcomp/fixhtml.c is a small converter for such zone sources. The build doesn't make it, so compile it yourself:
gcc -o fixhtml vme/src/defcomp/fixhtml.c ./fixhtml < oldzone.zon > oldzone.zon.new
It reads a zone on standard input and writes it on standard output. Inside strings it turns the colour codes into <div class='...'> tags, &n into <br/>, &l into <pre> and && into &. It reports codes it doesn't know and quotes that are never closed. For example, the line
title "&c+wHello&cw there&n"
comes out as
title "<div class='cpw'>Hello</div><div class='cw'> there<br/></div>"
vme/zone/removefinal.sh runs the converter over every .zon file in a directory and writes .zon.new files beside them. It expects the program at ../vme/bin/fixhtml, so edit that path to where you compiled it.
A way to work:
- Convert all the zones.
- Search the new files for
&and check that each one is part of HTML (&,<and so on) and not a leftover old code. - Where an old code was typed wrongly, fix it in the original zone and convert again. Repeat until no old codes are left.
- Replace the zones with the new files, compile them with vmc and look at them in the game.
Older conversions
vme/scripts/ still has the gawk scripts (convert.zone, convert.socials, convert.help, convert.wizhelp) that converted a VME 1.x game to VME 2.0 in 2001. They are only of use for a game that old, and its zones will still need the colour conversion above and other fixes before the current vmc accepts them.