From be1dc9dc2df2d1458321dcc853af4292b055dde4 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 28 Apr 2022 12:13:52 +0800 Subject: [PATCH] 1 --- scripts/check_server/app.js | 18 +++-------------- scripts/check_server/testcase.js | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/scripts/check_server/app.js b/scripts/check_server/app.js index 79165f6..d2a00a5 100644 --- a/scripts/check_server/app.js +++ b/scripts/check_server/app.js @@ -2,31 +2,19 @@ const TestCase = require('./testcase'); const urls = { 'login': 'https://login-z2-test.cebg.games', - 'relation': 'wss://relation-test.kingsome.cn/friend/websocket', 'cloud': 'https://cloud-z2-test.cebg.games', 'service': 'https://service-z2-test.cebg.games', 'gamelog': 'https://gamelog-z2-test.cebg.games', 'mail': 'https://gamemail-z2-test.cebg.games', 'game2006api': 'https://game2006api-z2-test.cebg.games', - 'game2006': 'https://game2006-z2-test.cebg.games', - 'game2006-n1': 'https://game2006-n1-z2-test.cebg.games', + 'relation': 'wss://relation-test.kingsome.cn/friend/websocket', + 'game2006': 'wss://game2006-z2-test.cebg.games', + 'game2006-n1': 'wss://game2006-n1-z2-test.cebg.games', }; async function start() { const testCase = new TestCase(urls); await testCase.init(); - /*await clientNet.init(); - await clientNet.connect(); - clientNet.on('connect', () => { - console.log('onConnect'); - clientNet.registerMsgHandle('SMLogin', (msg) => { - - }); - clientNet.sendMsg('CMLogin', { - accountId: loginData['account_id'], - sessionId: loginData['session_id'], - }); - });*/ } start(); diff --git a/scripts/check_server/testcase.js b/scripts/check_server/testcase.js index 27754e5..5faae55 100644 --- a/scripts/check_server/testcase.js +++ b/scripts/check_server/testcase.js @@ -33,6 +33,7 @@ class TestCase { 'proto/friend/cs_proto.proto', 'proto/friend/cs_msgid.proto' ); + console.log(this.urls['game2006']); this.battleWs = new ClientNet( this.urls['game2006'], 'proto/battle/cs_proto.proto', @@ -47,6 +48,8 @@ class TestCase { await this.step4(); await this.step5(); await this.step6(); + await this.step7(); + await this.step8(); } async step1() { @@ -120,6 +123,36 @@ class TestCase { console.log(response); } + async step7() { + await this.relationWs.init(); + await this.relationWs.connect(); + this.relationWs.on('connect', () => { + console.log('relation onConnect'); + this.relationWs.registerMsgHandle('SMLogin', (msg) => { + + }); + this.relationWs.sendMsg('CMLogin', { + accountId: this.loginData['account_id'], + sessionId: this.loginData['session_id'], + }); + }); + } + + async step8() { + await this.battleWs.init(); + await this.battleWs.connect(); + this.battleWs.on('connect', () => { + console.log('battle onConnect'); + this.battleWs.registerMsgHandle('SMJoinedNotify', (msg) => { + + }); + this.battleWs.sendMsg('CMJoin', { + accountId: this.loginData['account_id'], + sessionId: this.loginData['session_id'], + }); + }); + } + } module.exports = TestCase;