skymp icon indicating copy to clipboard operation
skymp copied to clipboard

How to launch the server and add the mod

Open quenenni opened this issue 2 years ago • 2 comments

I built successfully the mod.

I feel a bit stupid, but now, I don't know what to do to launch the server and add the mod to skyrim, I didn't find any info about it.

  • In my 'skymp/build/dist/server' folder:
drwxr-xr-x 4 quenenni quenenni    4096 26 jun 16:16 data
drwxr-xr-x 2 quenenni quenenni    4096 26 jun 16:22 dist_back
-rw-r--r-- 1 quenenni quenenni   47584 26 jun 16:16 gamemode.js
-rw-r--r-- 1 quenenni quenenni     838 26 jun 16:21 package.json
-rwxr-xr-x 1 quenenni quenenni 9262008 26 jun 16:21 scam_native.node
-rw-r--r-- 1 quenenni quenenni     862 26 jun 16:21 server-settings.json
-rw-r--r-- 1 quenenni quenenni  273702 26 jun 16:21 yarn.lock

in 'dist_back' folder:

-rw-r--r-- 1 quenenni quenenni 1121126 26 jun 16:22 skymp5-server.js
-rw-r--r-- 1 quenenni quenenni 3418200 26 jun 16:22 skymp5-server.js.map

in 'data' folder, I have 2 folders 'scripts' and 'ui', and lots of files inside them.

  • In my 'skymp/build/dist/client/Data/Platform/' folder, I have 2 folders 'Modules' and 'Plugins'. In Modules subdir:
-rw-r--r-- 1 quenenni quenenni 129446 26 jun 16:16 skyrimPlatform.ts

In Plugins subdir:

-rw-r--r-- 1 quenenni quenenni 205858 26 jun 16:16 skymp5-client.js
-rw-r--r-- 1 quenenni quenenni    182 26 jun 16:16 skymp5-client-settings.txt

Can you tell me the command to start the server and how to add the mod in Skyrim?

And... on the second computer, also Debian 11, do I have to compile everything to get the client / mod or can I use the client from the first computer in my second computer (by copying the client files)?

Thanks.

quenenni avatar Jun 26 '22 15:06 quenenni

I noticed the docs folder in the repo I missed before, sorry about that.

  • With the info there, I was able to start the server: (as root or with sudo)
cd skymp/build/dist/server
node dist_back/skymp5-server.js

The server-settings.json:

{
  "dataDir": "data",
  "loadOrder": [
    "/home/quenenni/.steam/steam/steamapps/common/Skyrim Special Edition/Data/Skyrim.esm",
    "/home/quenenni/.steam/steam/steamapps/common/Skyrim Special Edition/Data/Update.esm",
    "/home/quenenni/.steam/steam/steamapps/common/Skyrim Special Edition/Data/Dawnguard.esm",
    "/home/quenenni/.steam/steam/steamapps/common/Skyrim Special Edition/Data/HearthFires.esm",
    "/home/quenenni/.steam/steam/steamapps/common/Skyrim Special Edition/Data/Dragonborn.esm"
  ],
  "name": "SweetPie",
  "ip": "11.22.33.44",
  "startPoints": [
    {
      "pos": [ 18522.08, 10218.17, 624.46 ],
      "worldOrCell": "0x6042b5f",
      "angleZ": 0
    }
  ]
}

(name -> SweetPie is the name that was there originally; I didn't change it / 11.22.33.44 is my public ip for this report)

I had to remove the 2 lines from the setting file:

'/home/quenenni/.steam/steam/steamapps/common/Skyrim Special Edition/Data/RavenOnMyShoulder.esp'
'/home/quenenni/.steam/steam/steamapps/common/Skyrim Special Edition/Data/SweetPie.esp'

If not, I had an error on server start:

Error: ENOENT: no such file or directory, open '/home/quenenni/.steam/steam/steamapps/common/Skyrim Special Edition/Data/SweetPie.esp'
    at Object.openSync (node:fs:599:3)
    at Object.readFileSync (node:fs:467:35)
    at /home/quenenni/Applications/skymp5-server/ts/manifestGen.ts:42:32
    at Array.forEach (<anonymous>)
    at Object.a [as generateManifest] (/home/quenenni/Applications/skymp5-server/ts/manifestGen.ts:33:22)
    at /home/quenenni/Applications/skymp5-server/ts/index.ts:147:15
    at Generator.next (<anonymous>)
    at /home/quenenni/Applications/skymp5-server/ts/index.ts:312:1
    at new Promise (<anonymous>)
    at o (/home/quenenni/Applications/skymp5-server/ts/index.ts:312:1) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/home/quenenni/.steam/steam/steamapps/common/Skyrim Special Edition/Data/SweetPie.esp'
} Promise {
  <rejected> Error: ENOENT: no such file or directory, open '/home/quenenni/.steam/steam/steamapps/common/Skyrim Special Edition/Data/SweetPie.esp'
      at Object.openSync (node:fs:599:3)
      at Object.readFileSync (node:fs:467:35)
      at /home/quenenni/Applications/skymp5-server/ts/manifestGen.ts:42:32
      at Array.forEach (<anonymous>)
      at Object.a [as generateManifest] (/home/quenenni/Applications/skymp5-server/ts/manifestGen.ts:33:22)
      at /home/quenenni/Applications/skymp5-server/ts/index.ts:147:15
      at Generator.next (<anonymous>)
      at /home/quenenni/Applications/skymp5-server/ts/index.ts:312:1
      at new Promise (<anonymous>)
      at o (/home/quenenni/Applications/skymp5-server/ts/index.ts:312:1) {
    errno: -2,
    syscall: 'open',
    code: 'ENOENT',
    path: '/home/quenenni/.steam/steam/steamapps/common/Skyrim Special Edition/Data/SweetPie.esp'
  }
}

I checked in the steam Skyrim folder and your repo but couldn't find any file with these names.

Now I was able to start the server, despite showing still an error on start, error about SweetPie.esm missing

[2022-06-26 20:01:13.117] [console] [info] Hot reload is disabled for Papyrus
[2022-06-26 20:01:13.117] [console] [info] Using data dir 'data'
[2022-06-26 20:01:14.666] [console] [info] Current process ID is 60176
[2022-06-26 20:01:14.668] [console] [info] Using master server on https://skymp.io
[2022-06-26 20:01:14.668] [console] [info] Our endpoint on master is https://skymp.io/api/servers/11.22.33.44:7777
[2022-06-26 20:01:14.670] [console] [info] Initialized MasterClient
[2022-06-26 20:01:14.670] [console] [info] Initialized Spawn
[2022-06-26 20:01:14.671] [console] [info] Login system assumed that 11.22.33.44:7777 is our address on master
[2022-06-26 20:01:14.671] [console] [info] Initialized Login
[2022-06-26 20:01:14.674] [console] [info] websocket server up
[2022-06-26 20:01:14.674] [console] [info] Gamemode path is "/home/quenenni/Applications/skymp/build/dist/server/gamemode.js"
[2022-06-26 20:01:14.686] [console] [info] gamemode.js reloaded 
[2022-06-26 20:01:15.036] [console] [error] Error: Error: SweetPie.esp not found in loaded files
   at Anonymous function (skymp5-gamemode/gamemode.js:2:1006)
   at Global code (skymp5-gamemode/gamemode.js:2:1)
    at T (/home/quenenni/Applications/skymp5-server/ts/index.ts:58:10)
    at x (/home/quenenni/Applications/skymp5-server/ts/index.ts:77:9)
    at /home/quenenni/Applications/skymp5-server/ts/index.ts:260:7
    at Generator.next (<anonymous>)
    at s (/home/quenenni/Applications/skymp5-server/ts/index.ts:312:1)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[2022-06-26 20:01:15.038] [console] [info] Using file with name 'world'
[2022-06-26 20:01:15.038] [console] [info] AttachSaveStorage took 29 ticks, loaded 0 ChangeForms (Including 0 player characters)
[2022-06-26 20:01:15.045] [console] [info] Server resources folder is listening on 3000

The ports 3000 and 8080 are marked as 'open', but port 7777 is still marked as 'close'

I also start to see this repetitve error from the server console:

[2022-06-26 19:54:30.165] [console] [error] Error: 429 - Too many requests
    at r.<anonymous> (/home/quenenni/Applications/skymp5-server/ts/systems/masterClient.ts:51:17)
    at Generator.throw (<anonymous>)
    at a (/home/quenenni/Applications/skymp5-server/ts/systems/masterClient.ts:7:1)

And when I go to the page https://skymp.io/api/servers/11.22.33.44:7777, I see the msg "Too many requests". (the port 7777 UDP is open to the exterior)

  • I succeeded to install the skse mod and modified the steam launcher to start Skyrim from the skse file:

I downloaded the "Current Aniversary Edition build 2.1.5 (game version 1.6.353)". I first tried the SE Edition, but the mod me told at start that I had to use the other one because I had updated my Skyrim SE to the Anniversary one..

To force steam to start Skyrim via the skse64_loader.exe instead of the SkyrimSELauncher.exe, I simply backuped the SkyrimSELauncher.exe and rename skse64_loader.exe to SkyrimSELauncher.exe

When I start Skyrim, a skse log window opens and all seems good (the only thing I found to know if skse is activated as It doesn't appear in the mod list in Skyrim).

  • the client mod to add to skyrim, I modified the file to add the server ip
{
  "server-ip": "11.22.33.44",
  "server-port": 7777,
  "lobbyLocation": {
    "pos": [19256.69, 9777.12, 899.56],
    "rot": [6.36, 0.00, 221.51],
    "worldOrCell": 100936543
  }
}

I copied the 3 files from the client/Data/Platform folder into the Data fodler of Skyrim SE.

I started SKyrim but couldn't find anything different. No mod in the mod list

How can I verify the client mod is working and what do I have to do to connect to the server (or is it automatic)?

If it's supposed to be automatic, with the repetitive "Too many requests" that the server throws in the console, I feel the problem is there and the client can't simply find the server.

quenenni avatar Jun 26 '22 18:06 quenenni

I checked again if I have a file SweetPie.esp somewhere.

And I found in skymp5-server/CMakeLists.txt :

set(server_settings_json "{
  \"dataDir\": \"data\",
  \"loadOrder\": [
    \"${esm_prefix}Skyrim.esm\",
    \"${esm_prefix}Update.esm\",
    \"${esm_prefix}Dawnguard.esm\",
    \"${esm_prefix}HearthFires.esm\",
    \"${esm_prefix}Dragonborn.esm\"
  ],
  \"ip\": \"127.0.0.1\",
  \"name\": \"My Server\",
  \"offlineMode\": true
}
")

set(server_settings_json_sweetpie "{
  \"dataDir\": \"data\",
  \"loadOrder\": [
    \"${esm_prefix}Skyrim.esm\",
    \"${esm_prefix}Update.esm\",
    \"${esm_prefix}Dawnguard.esm\",
    \"${esm_prefix}HearthFires.esm\",
    \"${esm_prefix}Dragonborn.esm\",
    \"${esm_prefix}RavenOnMyShoulder.esp\",
    \"${esm_prefix}SweetPie.esp\"
  ],
  \"name\": \"SweetPie\",
  \"startPoints\": [
    {
      \"pos\": [ 18522.08, 10218.17, 624.46 ],
      \"worldOrCell\": \"0x6042b5f\",
      \"angleZ\": 0
    }
  ]
}
")

if(SWEETPIE)
  file(WRITE ${PROJECT_BINARY_DIR}/server-settings.json.tmp "${server_settings_json_sweetpie}")
else()
  file(WRITE ${PROJECT_BINARY_DIR}/server-settings.json.tmp "${server_settings_json}")
endif()

So SweetPie.esp and RavenOnMyShoulder.esp are only used when server-setting.conf is set to use a public server, and with SWEETPIE to false, the server config is set to use a local server (what I'm trying to achieve). (from the docs https://github.com/skyrim-multiplayer/skymp/blob/main/docs/contributing/en/How%20to%20work%20with%20skyrim-platform.md)

I then start a new build with the param "-DSWEETPIE=OFF"

./build.sh --configure -DCMAKE_BUILD_TYPE=Release -DSWEETPIE=OFF -DSKYRIM_DIR="/home/quenenni/.steam/steam/steamapps/common/Skyrim Special Edition"

Indeed, my default server-settings.json didn't include the SweetPie file nor the RavenOnMyShoulder file). When I start the server, I don't have anymore the error:

[2022-06-27 19:11:23.146] [console] [info] Hot reload is disabled for Papyrus
[2022-06-27 19:11:23.146] [console] [info] Using data dir 'data'
[2022-06-27 19:11:24.611] [console] [info] Current process ID is 98255
[2022-06-27 19:11:24.614] [console] [info] Using master server on https://skymp.io
[2022-06-27 19:11:24.614] [console] [info] Our endpoint on master is https://skymp.io/api/servers/172.19.0.98:7777
[2022-06-27 19:11:24.617] [console] [info] Initialized MasterClient
[2022-06-27 19:11:24.617] [console] [info] Initialized Spawn
[2022-06-27 19:11:24.618] [console] [info] Login system assumed that 172.19.0.98:7777 is our address on master
[2022-06-27 19:11:24.618] [console] [info] Initialized Login
[2022-06-27 19:11:24.621] [console] [info] websocket server up
[2022-06-27 19:11:24.622] [console] [info] Gamemode path is "/home/quenenni/Applications/skymp/build/dist/server/gamemode.js"
[2022-06-27 19:11:24.626] [console] [info] Using file with name 'world'
[2022-06-27 19:11:24.627] [console] [info] AttachSaveStorage took 38 ticks, loaded 0 ChangeForms (Including 0 player characters)
[2022-06-27 19:11:24.633] [console] [info] Server resources folder is listening on 3000
´´´
The ports 3000 and 8080 TCP are marked open and the port UDP 7777 is marked also as open.

Good progress so far.

I removed old client mod in Skyrim folder and put the new one.

I started Skyrim... and.. nothing / no hints  nowhere to be found if it's working or not.
I loaded a save and couldn't find any info if I was connected to the server.
The server console didn't show more info when I was in the game doing things.

I guess I'll try tonight to setup the client and the skse mod on the second computer and see if we see each others in the game.
But if you can tell me how I can check if the client is working, that would be neat.

quenenni avatar Jun 27 '22 17:06 quenenni