diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml index b21ecf28..4ab40e6a 100644 --- a/.github/workflows/release-package.yml +++ b/.github/workflows/release-package.yml @@ -7,11 +7,16 @@ on: jobs: build: runs-on: ubuntu-latest - steps: + permissions: + contents: read + packages: write + steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: node-version: 14 + registry-url: 'https://npm.pkg.github.com' + scope: '@theflyingape' - run: npm install - run: npm test @@ -20,10 +25,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: node-version: 14 registry-url: https://npm.pkg.github.com/ + scope: '@theflyingape' - run: npm install - run: npm publish env: diff --git a/.npmrc b/.npmrc index af73112b..2c4a31a1 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,4 @@ +registry=https://registry.npmjs.org/ @theflyingape:registry=https://npm.pkg.github.com +//npm.pkg.github.com/:_authToken=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 package-lock=false diff --git a/Dockerfile b/Dockerfile index 10b058fc..15ed07a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ ENV TARGET=/usr/games/dankdomain WORKDIR ${TARGET} # # add package manifest +COPY .npmrc ${TARGET} COPY package.json ${TARGET} # suppress superfluous NPM install messages ENV npm_config_loglevel warn diff --git a/package.json b/package.json index c1ac0246..ed144a3a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@theflyingape/dankdomain", - "version": "3.0.2", + "version": "3.0.4", "description": "Ɗaɳƙ Ɗoɱaiɳ: the return of Hack & Slash", "author": "Robert Hurst", "homepage": "https://www.ddgame.us", @@ -41,9 +41,9 @@ } ], "dependencies": { - "@theflyingape/xvt": "^1.4.5", + "@theflyingape/xvt": "^1.4.6", "animate.css": "^4.1.1", - "better-sqlite3": "^7.3.1", + "better-sqlite3": "^7.4.0", "chokidar": "^3.5.1", "express": "^4.17.1", "fs-extra": "^10.0.0", @@ -61,14 +61,14 @@ "xterm-addon-fit": "^0.5.0", "xterm-addon-unicode11": "^0.2.0", "xterm-addon-web-links": "^0.4.0", - "xterm-addon-webgl": "^0.11.0" + "xterm-addon-webgl": "^0.11.1" }, "devDependencies": { "@types/better-sqlite3": "^5.4.1", "@types/browserify": "^12.0.36", "@types/express": "^4.17.11", "@types/fs-extra": "^9.0.11", - "@types/node": "^15.0.2", + "@types/node": "^15.3.0", "@types/nodemailer": "^6.4.1", "@types/nodemailer-smtp-transport": "^2.7.4", "@types/sprintf-js": "^1.1.2", diff --git a/src/door/app.ts b/src/door/app.ts index ab13396d..5d5f21af 100644 --- a/src/door/app.ts +++ b/src/door/app.ts @@ -148,7 +148,7 @@ interface network { path: string } let network: network = { - address: 'localhost', + address: '0.0.0.0', telnet: true, socket: 1986, limit: 2, emulator: 'VT', rows: 25, web: true, ws: 1939, path: '/' } diff --git a/src/items.ts b/src/items.ts index 11a8807c..692d50e3 100644 --- a/src/items.ts +++ b/src/items.ts @@ -221,7 +221,7 @@ module Items { let fail: number let backfire: number - fail = rpc.int + Math.trunc(rpc.user.level / 10) - (this.spells[spell].cast < 17 ? this.spells[spell].cast : this.spells[spell].cast - 8) - (5 - skill) - +rpc.user.coward + fail = rpc.int + int(rpc.user.level / 10) - (this.spells[spell].cast < 17 ? this.spells[spell].cast : this.spells[spell].cast - 8) - (5 - skill) - (+rpc.user.coward || 0) // is this an attack spell against an opponent? if (nme && [9, 11, 12, 14, 15, 16, 19, 20, 21, 22].indexOf(this.spells[spell].cast) >= 0) { let m = rpc.int - nme.int diff --git a/src/sys.ts b/src/sys.ts index 6e8f06bf..157f1e5d 100644 --- a/src/sys.ts +++ b/src/sys.ts @@ -25,7 +25,7 @@ module sys { export const USERS = pathTo('users') - export function an(item: string, show = true) { + export function an(item: string, show = true): string { return ' ' + (/a|e|i|o|u/i.test(item[0]) ? 'an' : 'a') + ' ' + (show ? item : '') } @@ -154,7 +154,7 @@ module sys { } // non-negative integer - export function whole(n: string | number) { + export function whole(n: string | number): number { const i = int(n) return (i < 0) ? 0 : i }