Skip to content

Commit

Permalink
add plugins: web3 and auth
Browse files Browse the repository at this point in the history
  • Loading branch information
RSamaium committed Jan 25, 2024
1 parent 277e0b7 commit d9acea6
Show file tree
Hide file tree
Showing 32 changed files with 6,495 additions and 314 deletions.
4 changes: 3 additions & 1 deletion packages/client/src/RpgClientEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,14 +430,16 @@ export class RpgClientEngine {
*/
async connection(uri?: string) {
const { standalone } = this.gameEngine
const { globalConfig } = this

this._serverUrl = uri || ''

if (!standalone) {
this.socket = this.io(uri, {
auth: {
token: this.session
}
},
...(globalConfig.socketIoClient || {})
})
}
else {
Expand Down
4 changes: 3 additions & 1 deletion packages/compiler/src/jsonSchema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import compilerOptions from "./compilation.js";
import canvasOptions from "./canvas.js";
import expressOptions from "./express.js";
import vitestOptions from "./vitest.js";
import socketIoClient from './socket.js'

export default {
"server": {
Expand Down Expand Up @@ -91,7 +92,8 @@ export default {
"type": "object",
"additionalProperties": true
},
...canvasOptions
...canvasOptions,
...socketIoClient
}
},
"*": {
Expand Down
6 changes: 6 additions & 0 deletions packages/compiler/src/jsonSchema/socket.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"socketIoClient": {
"type": "object",
"additionalProperties": true
}
}
16 changes: 16 additions & 0 deletions packages/plugins/auth/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"namespace": "auth",
"server": {
"type": "object",
"properties": {
"jwtSecret": {
"type": "string"
}
},
"required": [
"jwtSecret"
]
},
"client": {},
"*": {}
}
Loading

0 comments on commit d9acea6

Please sign in to comment.