diff --git a/game-server/app.ts b/game-server/app.ts index f1c509ac3..08803a696 100644 --- a/game-server/app.ts +++ b/game-server/app.ts @@ -187,6 +187,7 @@ app.configure(ALL_ENVS, function () { app.route('battle', routeUtil.battle); app.route('gm', routeUtil.gm); app.route('guild', routeUtil.guild); + app.route('activity', routeUtil.activity); // filter configures app.filter(new pinus.filters.time()); diff --git a/game-server/app/util/routeUtil.ts b/game-server/app/util/routeUtil.ts index 88c462417..f378be89e 100644 --- a/game-server/app/util/routeUtil.ts +++ b/game-server/app/util/routeUtil.ts @@ -93,6 +93,18 @@ export function guild(session: Session, msg: any, app: Application, cb: (err: Er cb(null, res.id); } +export function activity(session: Session, msg: any, app: Application, cb: (err: Error , serverId ?: string) => void) { + let activityServers = app.getServersByType('activity'); + + if(!activityServers || activityServers.length === 0) { + cb(new Error('can not find activity servers.')); + return; + } + + let res = dispatch(session.get('roleId'), activityServers); + cb(null, res.id); +} + export function gm(session: Session, msg: any, app: Application, cb: (err: Error , serverId ?: string) => void) { let gmServers = app.getServersByType('gm'); diff --git a/game-server/config/adminServer.ts b/game-server/config/adminServer.ts index 7b154f9aa..86218a1cf 100644 --- a/game-server/config/adminServer.ts +++ b/game-server/config/adminServer.ts @@ -22,4 +22,7 @@ module.exports = [{ }, { 'type': 'guild', 'token': 'agarxhqb98rpajloaxn34ga8xrunpagkjwlaw3ruxnpaagl29w4rxn' +}, { + 'type': 'activity', + 'token': 'agarxhqb98rpajloaxn34ga8xrunpagkjwlaw3ruxnpaagl29w4rxn' }]; \ No newline at end of file diff --git a/game-server/config/servers.ts b/game-server/config/servers.ts index f62defe57..3995220c0 100644 --- a/game-server/config/servers.ts +++ b/game-server/config/servers.ts @@ -47,6 +47,9 @@ module.exports = { 'guild': [ {'id': 'guild-server-1', 'host': '127.0.0.1', 'port': 6057, "args": " --inspect=9239"}, {'id': 'guild-server-2', 'host': '127.0.0.1', 'port': 6058, "args": " --inspect=9240"} + ], + 'activity': [ + {'id': 'activity-server-1', 'host': '127.0.0.1', 'port': 6059, "args": " --inspect=9241"}, ] }, 'production': { @@ -83,6 +86,9 @@ module.exports = { 'guild': [ {'id': 'guild-server-1', 'host': '127.0.0.1', 'port': 6057, "args": " --inspect=9239"}, {'id': 'guild-server-2', 'host': '127.0.0.1', 'port': 6058, "args": " --inspect=9240"} + ], + 'activity': [ + {'id': 'activity-server-1', 'host': '127.0.0.1', 'port': 6059, "args": " --inspect=9241"}, ] }, 'alpha': { @@ -121,6 +127,9 @@ module.exports = { 'guild': [ {'id': 'guild-server-1', 'host': '127.0.0.1', 'port': 6057, "args": " --inspect=9239"}, {'id': 'guild-server-2', 'host': '127.0.0.1', 'port': 6058, "args": " --inspect=9240"} + ], + 'activity': [ + {'id': 'activity-server-1', 'host': '127.0.0.1', 'port': 6059, "args": " --inspect=9241"}, ] }, 'dev': { @@ -160,6 +169,9 @@ module.exports = { 'guild': [ {'id': 'guild-server-1', 'host': '127.0.0.1', 'port': 6057, "args": " --inspect=9239"}, {'id': 'guild-server-2', 'host': '127.0.0.1', 'port': 6058, "args": " --inspect=9240"} + ], + 'activity': [ + {'id': 'activity-server-1', 'host': '127.0.0.1', 'port': 6059, "args": " --inspect=9241"}, ] }, 'isbn': { @@ -196,6 +208,9 @@ module.exports = { 'guild': [ {'id': 'guild-server-1', 'host': '127.0.0.1', 'port': 6057, "args": " --inspect=9239"}, {'id': 'guild-server-2', 'host': '127.0.0.1', 'port': 6058, "args": " --inspect=9240"} + ], + 'activity': [ + {'id': 'activity-server-1', 'host': '127.0.0.1', 'port': 6059, "args": " --inspect=9241"}, ] }, 'monitor': { @@ -226,6 +241,9 @@ module.exports = { 'guild': [ {'id': 'guild-server-1', 'host': '127.0.0.1', 'port': 6057, "args": " --inspect=9239"}, {'id': 'guild-server-2', 'host': '127.0.0.1', 'port': 6058, "args": " --inspect=9240"} + ], + 'activity': [ + {'id': 'activity-server-1', 'host': '127.0.0.1', 'port': 6059, "args": " --inspect=9241"}, ] } };