From 52dfc3cdd33a234ae238cfa1d1b163bb0e593a65 Mon Sep 17 00:00:00 2001 From: chen wei bo <1025839511@qq.com> Date: Tue, 9 Sep 2025 10:30:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Scripts/chat18x/data/AccountData.ts | 10 +++--- assets/Scripts/chat18x/data/PlayerData.ts | 32 +---------------- assets/Scripts/chat18x/data/ThemeData.ts | 10 +++--- .../network/services/MockAuthService.ts | 2 +- .../network/services/MockCommonService.ts | 2 +- .../chat18x/network/services/ThemeService.ts | 2 +- .../Scripts/chat18x/ui/panels/ThemePanel.ts | 2 +- assets/Scripts/proto/proto.pb.d.ts | 4 +-- assets/Scripts/proto/proto.pb.js | 34 ++++++------------- proto_cs | 2 +- 10 files changed, 28 insertions(+), 72 deletions(-) diff --git a/assets/Scripts/chat18x/data/AccountData.ts b/assets/Scripts/chat18x/data/AccountData.ts index 27a8958b..ab33c879 100644 --- a/assets/Scripts/chat18x/data/AccountData.ts +++ b/assets/Scripts/chat18x/data/AccountData.ts @@ -9,7 +9,7 @@ export class AccountData extends BaseData { // 身份类型,1:游客;2:微信;3:googleplay private _identityType = 1; // 用户id - private _accId = 0; + private _accId: string = ""; // 是否新手 private _isNewGuide = true; // 是否刚注册 @@ -18,7 +18,7 @@ export class AccountData extends BaseData { public reset(): void { this._identifier = ""; this._identityType = 1; - this._accId = 0; + this._accId = ""; this._isNewGuide = true; this._isNewRegist = true; } @@ -26,7 +26,7 @@ export class AccountData extends BaseData { public clear(): void { this._identifier = ""; this._identityType = 1; - this._accId = 0; + this._accId = ""; this._isNewGuide = true; this._isNewRegist = true; } @@ -61,12 +61,12 @@ export class AccountData extends BaseData { } /** 设置用户id */ - public set accId(value: number) { + public set accId(value: string) { this._accId = value; } /** 获取用户id */ - public get accId(): number { + public get accId(): string { return this._accId; } diff --git a/assets/Scripts/chat18x/data/PlayerData.ts b/assets/Scripts/chat18x/data/PlayerData.ts index e8034af7..8e3c51dc 100644 --- a/assets/Scripts/chat18x/data/PlayerData.ts +++ b/assets/Scripts/chat18x/data/PlayerData.ts @@ -6,28 +6,18 @@ import { BaseData } from "./BaseData"; export class PlayerData extends BaseData { // 用户名 private _name: string = ''; - // 钻石数 - private _diamond: number = 0; - // vip失效时间戳 - private _vipExpire: number = 0; public reset(): void { this._name = ''; - this._diamond = 0; - this._vipExpire = 0; } public clear(): void { this._name = ''; - this._diamond = 0; - this._vipExpire = 0; } public destroy(): void { super.destroy(); this._name = null; - this._diamond = null; - this._vipExpire = null; } /** 设置用户名 */ @@ -38,25 +28,5 @@ export class PlayerData extends BaseData { /** 获取用户名 */ public get name(): string { return this._name; - } - - /** 设置钻石数 */ - public set diamond(value: number) { - this._diamond = value; - } - - /** 获取钻石数 */ - public get diamond(): number { - return this._diamond; - } - - /** 设置vip失效时间戳 */ - public set vipExpire(value: number) { - this._vipExpire = value; - } - - /** 获取vip失效时间戳 */ - public get vipExpire(): number { - return this._vipExpire; - } + } } \ No newline at end of file diff --git a/assets/Scripts/chat18x/data/ThemeData.ts b/assets/Scripts/chat18x/data/ThemeData.ts index c207f3d1..98a8f6d8 100644 --- a/assets/Scripts/chat18x/data/ThemeData.ts +++ b/assets/Scripts/chat18x/data/ThemeData.ts @@ -33,12 +33,12 @@ export class ThemeData extends BaseData { this._themeIds = []; for (const t of list) { const vo: proto.cs.IThemes = { - id: t.id || 0, // 主题 id - key: t.key || "", // 多语言键 - name: t.name || "", // 主题名称 - category: t.category || 0, // 主题枚举 + id: t.id, // 主题 id + key: t.key, // 多语言键 + name: t.name, // 主题名称 + category: t.category, // 主题枚举 isRelease: t.isRelease, // 是否解锁 - path: t.path || "", // 图片路径 + path: t.path, // 图片路径 }; this._themes.set(vo.id, vo); this._themeIds.push(vo.id); diff --git a/assets/Scripts/chat18x/network/services/MockAuthService.ts b/assets/Scripts/chat18x/network/services/MockAuthService.ts index 045bb0ec..2f28c5aa 100644 --- a/assets/Scripts/chat18x/network/services/MockAuthService.ts +++ b/assets/Scripts/chat18x/network/services/MockAuthService.ts @@ -24,7 +24,7 @@ export class MockAuthService implements IAuthService { const expireSeconds = Math.floor(Date.now() / 1000) + 7 * 24 * 3600; // 模拟用户ID - const accId = Math.floor(Math.random() * 1000000); + const accId = (Math.floor(Math.random() * 1000000)).toString(); // 模拟 CDN 前缀 const cdn = "https://cdn.mockserver.com/"; diff --git a/assets/Scripts/chat18x/network/services/MockCommonService.ts b/assets/Scripts/chat18x/network/services/MockCommonService.ts index 55dad99d..1d6034af 100644 --- a/assets/Scripts/chat18x/network/services/MockCommonService.ts +++ b/assets/Scripts/chat18x/network/services/MockCommonService.ts @@ -17,7 +17,7 @@ export class MockCommonService implements ICommonService { let data = ""; const resName = req.resName; - if (resName === "global_config") { + if (resName === "TbGlobalConfig") { // 全局配置 data = this.getGlobalConfig(); } diff --git a/assets/Scripts/chat18x/network/services/ThemeService.ts b/assets/Scripts/chat18x/network/services/ThemeService.ts index 32f191b6..c5c6f593 100644 --- a/assets/Scripts/chat18x/network/services/ThemeService.ts +++ b/assets/Scripts/chat18x/network/services/ThemeService.ts @@ -5,7 +5,7 @@ import { HttpThemeService } from "./HttpThemeService"; import { MockThemeService } from "./MockThemeService"; // 模拟开关 -const USE_MOCK = true; +const USE_MOCK = false; export class ThemeService implements IThemeService { private static _I: ThemeService | null = null; diff --git a/assets/Scripts/chat18x/ui/panels/ThemePanel.ts b/assets/Scripts/chat18x/ui/panels/ThemePanel.ts index 215ff232..e086b7cc 100644 --- a/assets/Scripts/chat18x/ui/panels/ThemePanel.ts +++ b/assets/Scripts/chat18x/ui/panels/ThemePanel.ts @@ -98,7 +98,7 @@ export class ThemePanel extends li_BaseView { this.recId = girlData.getRecommendGirlId(); this.rectNameKey = girlData.getRecommendGrilName(); let avatarPath = girlData.getRecommendGrilAvatar(); - //this.recName.string = LanguageUtils.getText(this.rectNameKey); + this.recName.string = LanguageUtils.getText(this.rectNameKey); ResManager.I.changeBundleSpriteFrame( this.recSprite, avatarPath, diff --git a/assets/Scripts/proto/proto.pb.d.ts b/assets/Scripts/proto/proto.pb.d.ts index a93fd73e..a92602bb 100644 --- a/assets/Scripts/proto/proto.pb.d.ts +++ b/assets/Scripts/proto/proto.pb.d.ts @@ -5446,7 +5446,7 @@ static getTypeUrl(typeUrlPrefix?: string): string; expire?: (number|Long|null); /** CSLoginRes accId */ - accId?: (number|Long|null); + accId?: (string|null); /** CSLoginRes cdn */ cdn?: (string|null); @@ -5474,7 +5474,7 @@ refreshToken: string; expire: (number|Long); /** CSLoginRes accId. */ -accId: (number|Long); +accId: string; /** CSLoginRes cdn. */ cdn: string; diff --git a/assets/Scripts/proto/proto.pb.js b/assets/Scripts/proto/proto.pb.js index 820d2843..28ba57aa 100644 --- a/assets/Scripts/proto/proto.pb.js +++ b/assets/Scripts/proto/proto.pb.js @@ -12790,7 +12790,7 @@ $root.cs = (function() { * @property {string|null} [token] CSLoginRes token * @property {string|null} [refreshToken] CSLoginRes refreshToken * @property {number|Long|null} [expire] CSLoginRes expire - * @property {number|Long|null} [accId] CSLoginRes accId + * @property {string|null} [accId] CSLoginRes accId * @property {string|null} [cdn] CSLoginRes cdn */ @@ -12843,11 +12843,11 @@ $root.cs = (function() { /** * CSLoginRes accId. - * @member {number|Long} accId + * @member {string} accId * @memberof cs.CSLoginRes * @instance */ - CSLoginRes.prototype.accId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + CSLoginRes.prototype.accId = ""; /** * CSLoginRes cdn. @@ -12890,7 +12890,7 @@ $root.cs = (function() { if (message.expire != null && Object.hasOwnProperty.call(message, "expire")) writer.uint32(/* id 4, wireType 0 =*/32).int64(message.expire); if (message.accId != null && Object.hasOwnProperty.call(message, "accId")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.accId); + writer.uint32(/* id 5, wireType 2 =*/42).string(message.accId); if (message.cdn != null && Object.hasOwnProperty.call(message, "cdn")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.cdn); return writer; @@ -12946,7 +12946,7 @@ $root.cs = (function() { break; } case 5: { - message.accId = reader.int64(); + message.accId = reader.string(); break; } case 6: { @@ -13001,8 +13001,8 @@ $root.cs = (function() { if (!$util.isInteger(message.expire) && !(message.expire && $util.isInteger(message.expire.low) && $util.isInteger(message.expire.high))) return "expire: integer|Long expected"; if (message.accId != null && message.hasOwnProperty("accId")) - if (!$util.isInteger(message.accId) && !(message.accId && $util.isInteger(message.accId.low) && $util.isInteger(message.accId.high))) - return "accId: integer|Long expected"; + if (!$util.isString(message.accId)) + return "accId: string expected"; if (message.cdn != null && message.hasOwnProperty("cdn")) if (!$util.isString(message.cdn)) return "cdn: string expected"; @@ -13037,14 +13037,7 @@ $root.cs = (function() { else if (typeof object.expire === "object") message.expire = new $util.LongBits(object.expire.low >>> 0, object.expire.high >>> 0).toNumber(); if (object.accId != null) - if ($util.Long) - (message.accId = $util.Long.fromValue(object.accId)).unsigned = false; - else if (typeof object.accId === "string") - message.accId = parseInt(object.accId, 10); - else if (typeof object.accId === "number") - message.accId = object.accId; - else if (typeof object.accId === "object") - message.accId = new $util.LongBits(object.accId.low >>> 0, object.accId.high >>> 0).toNumber(); + message.accId = String(object.accId); if (object.cdn != null) message.cdn = String(object.cdn); return message; @@ -13072,11 +13065,7 @@ $root.cs = (function() { object.expire = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.expire = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.accId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.accId = options.longs === String ? "0" : 0; + object.accId = ""; object.cdn = ""; } if (message.name != null && message.hasOwnProperty("name")) @@ -13091,10 +13080,7 @@ $root.cs = (function() { else object.expire = options.longs === String ? $util.Long.prototype.toString.call(message.expire) : options.longs === Number ? new $util.LongBits(message.expire.low >>> 0, message.expire.high >>> 0).toNumber() : message.expire; if (message.accId != null && message.hasOwnProperty("accId")) - if (typeof message.accId === "number") - object.accId = options.longs === String ? String(message.accId) : message.accId; - else - object.accId = options.longs === String ? $util.Long.prototype.toString.call(message.accId) : options.longs === Number ? new $util.LongBits(message.accId.low >>> 0, message.accId.high >>> 0).toNumber() : message.accId; + object.accId = message.accId; if (message.cdn != null && message.hasOwnProperty("cdn")) object.cdn = message.cdn; return object; diff --git a/proto_cs b/proto_cs index 984b9da4..4943c6df 160000 --- a/proto_cs +++ b/proto_cs @@ -1 +1 @@ -Subproject commit 984b9da4046b12f7ee336664cfa28f6165286c0d +Subproject commit 4943c6df6be597204db66bd332e28ea8d4ef2601