fix(framework): player_login.version 改为数字 versionCode(联调登录成功)

真机联调发现:协议 version 字段=数字 versionCode(源码 8 处 data.version=GameData.versionCode),
框架原发字符串 '1.1' 被服务器版本校验拒绝(kick_server 检查到新版本)。改为数字后登录成功
(state:0 playerid:430511)。
- ChannelIdentity/LoginRequestData.version: string→number,去掉冗余 versionCode 与未发送的 '1.1' 串
- query-string version 解析为数字;测试 fixture 同步

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-28 20:33:53 +08:00
co-authored by Claude Opus 4.8
parent fee5c8b0a0
commit ad661707ec
11 changed files with 12 additions and 15 deletions
@@ -8,8 +8,7 @@ test('BUILD_IDENTITY 含全部字段且 gameid 为固定 token', () => {
assert.ok('agentid' in BUILD_IDENTITY);
assert.ok('channelid' in BUILD_IDENTITY);
assert.ok('marketid' in BUILD_IDENTITY);
assert.equal(typeof BUILD_IDENTITY.version, 'string');
assert.equal(typeof BUILD_IDENTITY.versionCode, 'number');
assert.equal(typeof BUILD_IDENTITY.version, 'number'); // 协议 version = 数字 versionCode
});
test('resolveIdentity:后面的 source 覆盖前面的', () => {
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict';
import { getParam, resolveServers, type RemoteConfig } from '../../YouleNexus/assets/framework/config/remote-config.ts';
import type { ChannelIdentity } from '../../YouleNexus/assets/framework/config/identity.ts';
const ID: ChannelIdentity = { agentid: 'A', channelid: 'C', gameid: 'G', marketid: 2, version: '1', versionCode: 1 };
const ID: ChannelIdentity = { agentid: 'A', channelid: 'C', gameid: 'G', marketid: 2, version: 1 };
const CONFIG: RemoteConfig = {
data: {
@@ -3,8 +3,8 @@ import assert from 'node:assert/strict';
import { queryStringSource } from '../../../YouleNexus/assets/framework/config/sources/query-string.ts';
test('解析 agentid/channelid/marketid/version', () => {
const src = queryStringSource('?agentid=A1&channelid=C1&marketid=2&version=9.9');
assert.deepEqual(src(), { agentid: 'A1', channelid: 'C1', marketid: '2', version: '9.9' });
const src = queryStringSource('?agentid=A1&channelid=C1&marketid=2&version=10001');
assert.deepEqual(src(), { agentid: 'A1', channelid: 'C1', marketid: '2', version: 10001 }); // version 解析为数字
});
test('缺省键不出现在结果里', () => {