This commit is contained in:
aozhiwei 2023-08-09 19:00:17 +08:00
parent 93d0c372ba
commit 6dc011bcd5

View File

@ -41,11 +41,11 @@ class TestCase {
this.relationUrl = 'ws://127.0.0.1:7132';
this.loginData = null;
/*
this.relationWs = new ClientNet(
this.relationWs = new ClientNet(
this.relationUrl,
'proto/cs_proto.proto',
'proto/cs_msgid.proto'
);*/
);*/
}
async init() {
@ -56,36 +56,50 @@ class TestCase {
}
}
async step1() {
async step1() {
const startTick = getTickCount();
const {err, response} = await httpGet(
'https://login-test.kingsome.cn/webapp/index.php',
{
'c': 'Login',
'a': 'auth',
'gameid': 1006,
'channel': 6000,
'account': 'test1',
'gameid': 2006,
'channel': 6513,
'openid': 'test1'
});
this.loginData = response;
const endTick = getTickCount();
console.log('login auth@Login', endTick - startTick, String(err), response);
}
}
async step2() {
const startTick = getTickCount();
const {err, response} = await httpGet(
'https://game2006api-test.kingsome.cn/webapp/index.php',
{
'c': 'User',
'a': 'login',
'account_id': this.loginData.account_id,
'session_id': this.loginData.session_id,
});
this.userData = response;
const endTick = getTickCount();
console.log('login auth@User', endTick - startTick, String(err), response);
}
async step3() {
/*
await this.relationWs.init();
await this.relationWs.connect();
this.relationWs.on('connect', () => {
await this.relationWs.init();
await this.relationWs.connect();
this.relationWs.on('connect', () => {
console.log('relation onConnect');
this.relationWs.accountId = this.loginData['account_id'];
this.relationWs.sessionId = this.loginData['session_id'];
this.relationWs.sendMsg('CMLogin', {
account_id: this.loginData['account_id'],
session_id: this.loginData['session_id'],
account_id: this.loginData['account_id'],
session_id: this.loginData['session_id'],
});
});*/
});*/
}
}