This commit is contained in:
aozhiwei 2023-04-17 20:09:29 +08:00
parent c66ce54497
commit 943fd1415c

View File

@ -41,7 +41,7 @@ class TestCase {
this.relationUrl = 'ws://127.0.0.1:7132'; this.relationUrl = 'ws://127.0.0.1:7132';
//this.relationUrl = 'ws://8.133.161.108/game1006/websocket/'; //this.relationUrl = 'ws://8.133.161.108/game1006/websocket/';
this.loginData = null; this.loginData = null;
this.gameWs = new ClientNet( this.gameConn = new ClientNet(
this.relationUrl, this.relationUrl,
'proto/cs_proto.proto', 'proto/cs_proto.proto',
'proto/cs_msgid.proto' 'proto/cs_msgid.proto'
@ -75,13 +75,13 @@ class TestCase {
} }
async step2() { async step2() {
await this.gameWs.init(); await this.gameConn.init();
await this.gameWs.connect(); await this.gameConn.connect();
this.gameWs.on('connect', () => { this.gameConn.on('connect', () => {
console.log('relation onConnect'); console.log('relation onConnect');
this.gameWs.accountId = this.loginData['account_id']; this.gameConn.accountId = this.loginData['account_id'];
this.gameWs.sessionId = this.loginData['session_id']; this.gameConn.sessionId = this.loginData['session_id'];
this.gameWs.sendMsg('CMLogin', { this.gameConn.sendMsg('CMLogin', {
account_id: this.loginData['account_id'], account_id: this.loginData['account_id'],
session_id: this.loginData['session_id'], session_id: this.loginData['session_id'],
}); });