Updating NWN (and NWNX)
-
Updating NWN
Note: I would recommend doing this in aradev first. Updating the NWN server is not a big deal, but NWNX is a bigger deal. It's easier to get it right in aradev and just copy the files up when you're ready to migrate the main module.
Get the new version of the server from https://nwn.beamdog.net/downloads/
This is named "nwnee-dedicated-81xx-xx" (where xx-xx is currently 37-15).
# As the aradev user cd $HOME wget https://nwn.beamdog.net/downloads/nwnee-dedicated-8193.37-15.zip mkdir nwnee-dedicated-8193.37-15 cd nwnee-dedicated-8193.37-15 unzip ../nwnee-dedicated-8193.37-15.zip
You can do this on a running server. A softlink in $HOME called server points to the currently active server. At cutover time, you would remove this link and link it to the new folder.
$ cd $HOME $ ls -l server lrwxrwxrwx 1 aradev aradev 26 Mar 3 22:13 server -> nwnee-dedicated-8193.37-15 # In this example, you're already on the latest version, but just to show what it looks like. $ rm server $ ln -s nwnee-dedicated-8193.37-15 server
Updating NWNX
Finding the right tag is the hard part. If they're in the middle of working on an update, there will be new tags that are a version ahead of what you may be installing.
get fetch --prune # pull new branches from the server git tag | sort -V | less # list all the available tags (new at the bottom) ... < omitted stuff > .. build8193.36.10-HEAD build8193.36.11 build8193.36.11-HEAD build8193.36.12 build8193.36.12-HEAD build8193.37.13 build8193.37.13-HEAD build8193.37.14-HEAD build8193.37.15-HEAD latest
You need to find the tag that matches the same minor version number as the server you are migrating to (in this example, 8193.37.15). Check out that tag.
Postgres started requiring SSL for connecting to the database a couple of versions ago, and I haven't had a chance (laziness, mostly) to update the DB driver.
Check around line 47 in
Plugins/SQL/Targets/PostgreSQL.cpp
and make sure that line adds " sslmode=disable" on the end.// before const std::string port = "port=" + Config::Get<std::string>("PORT", "5432"); // after const std::string port = "port=" + Config::Get<std::string>("PORT", "5432") + " sslmode=disable";
Usually, when you're switching branches and not much has changed, it will just show that the PostgreSQL.cpp file is modified. This is good and means you probably don't have to change the file, but it's good to check.
# Checkout the new tag $ git checkout build8193.37.15-HEAD M Plugins/SQL/Targets/PostgreSQL.cpp Previous HEAD position was 2f18b7c48f Player: add GetOpenStore() (#1816) branch 'build8193.37' set up to track 'origin/build8193.37'. Switched to a new branch 'build8193.37'
If you get conflicts or errors, stop and figure out why. A foolproof method is to wipe out the nwnx folder and just clone the nwnxee.unified repo locally and make the Postgres change listed above.
Build the binaries.
build_nwnx.sh # this is in the bin folder of aradev. Arabel isn't set up for building.
You don't have to copy or move anything. The
~/bin/server
script points directly to the build folder so building and restarting aradev makes it instantly available.Go find the NWNX release notes and see if there are any structural changes, or check with the NWNX Developers Discord channels.
Fixing up the Module
cd $HOME/nwnx Scripts/packageNWScript.sh
This will create a file called
NWScript.zip
in$HOME/nwnx/Binaries
. Download that to your local computer and unzip it somewhere. You can use a diff utility or copy all the files from there into the Temp0 folder while you have the module open, then recompile and save the module.Some files you don't need like the
redis
stuff. You can prune them out if you want, but it doesn't hurt to have them.Upload the module to Dev and make sure it works.
Updating Aradev
When it's time to switch, you have to do three things:
- Switch the soft link from the old server directory to the new one.
- Copy the nwnx binaries from aradev to arabel
- Dump the new NWNX scripts into the current module and upload it.
Something like:
# As the Arabel user $ cd $HOME # or just "cd" with no arguments $ rm server $ ln -s nwnee-dedicated-8193.37-15 server # Clean out the old binaries $ rm nwnx/Binaries/* # Copy the new ones $ cp /home/aradev/nwnx/Binaries/* nwnx/Binaries
Upload the new module and restart the server.
-
Z Zool pinned this topic
-
Z Zool moved this topic from DM Instructions & Requests