协议调试
This commit is contained in:
@@ -276,7 +276,7 @@ export class PreloadUI extends Component {
|
|||||||
const loginData = DataManager.I.getDataById<LoginData>(DataId.Login);
|
const loginData = DataManager.I.getDataById<LoginData>(DataId.Login);
|
||||||
loginData.token = resData.token;
|
loginData.token = resData.token;
|
||||||
loginData.refreshToken = resData.refreshToken;
|
loginData.refreshToken = resData.refreshToken;
|
||||||
loginData.expire = resData.expire;
|
loginData.expire = Number(resData.expire);
|
||||||
const playerData = DataManager.I.getDataById<PlayerData>(DataId.Player);
|
const playerData = DataManager.I.getDataById<PlayerData>(DataId.Player);
|
||||||
playerData.name = resData.name;
|
playerData.name = resData.name;
|
||||||
const accountData = DataManager.I.getDataById<AccountData>(DataId.Account);
|
const accountData = DataManager.I.getDataById<AccountData>(DataId.Account);
|
||||||
@@ -301,8 +301,8 @@ export class PreloadUI extends Component {
|
|||||||
const resData = res.data;
|
const resData = res.data;
|
||||||
// 保存数据
|
// 保存数据
|
||||||
const walletData = DataManager.I.getDataById<WalletData>(DataId.Wallet);
|
const walletData = DataManager.I.getDataById<WalletData>(DataId.Wallet);
|
||||||
walletData.balance = resData.balance;
|
walletData.balance = Number(resData.balance);
|
||||||
walletData.vipExpire = resData.vipExpire;
|
walletData.vipExpire = Number(resData.vipExpire);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export class GirlChatData extends BaseData {
|
|||||||
/** 保存总聊天次数 */
|
/** 保存总聊天次数 */
|
||||||
public setChatTotalCount(value: number): void {
|
public setChatTotalCount(value: number): void {
|
||||||
this.chatTotalCount = value;
|
this.chatTotalCount = value;
|
||||||
console.log("当前总聊天次数:", this.chatTotalCount);
|
console.log("当前技师 ", this.id, " ,总聊天次数:", this.chatTotalCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取剩余聊天次数 */
|
/** 获取剩余聊天次数 */
|
||||||
@@ -67,7 +67,7 @@ export class GirlChatData extends BaseData {
|
|||||||
/** 保存剩余聊天次数 */
|
/** 保存剩余聊天次数 */
|
||||||
public setChatRemainCount(value: number): void {
|
public setChatRemainCount(value: number): void {
|
||||||
this.chatRemainCount = value;
|
this.chatRemainCount = value;
|
||||||
console.log("当前剩余聊天次数:", this.chatRemainCount);
|
console.log("当前技师 ", this.id, " ,剩余聊天次数:", this.chatRemainCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 更新剩余聊天次数 */
|
/** 更新剩余聊天次数 */
|
||||||
|
|||||||
@@ -84,6 +84,9 @@ export class GirlData extends BaseData {
|
|||||||
this.setGirlBrief(categoryId, data.girls);
|
this.setGirlBrief(categoryId, data.girls);
|
||||||
this.setGirlUnlock(categoryId, data.girls);
|
this.setGirlUnlock(categoryId, data.girls);
|
||||||
this.setGirlFavorability(categoryId, data.girls);
|
this.setGirlFavorability(categoryId, data.girls);
|
||||||
|
|
||||||
|
const bucket = this.ensureBucket(categoryId);
|
||||||
|
console.log("保存类别 ", categoryId, " 的技师列表: ", bucket);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 保存技师详细数据 */
|
/** 保存技师详细数据 */
|
||||||
@@ -96,6 +99,9 @@ export class GirlData extends BaseData {
|
|||||||
this.setGirlUnlock(categoryId, details);
|
this.setGirlUnlock(categoryId, details);
|
||||||
this.setGirlChat(categoryId, details);
|
this.setGirlChat(categoryId, details);
|
||||||
this.setGirlFavorability(categoryId, details);
|
this.setGirlFavorability(categoryId, details);
|
||||||
|
|
||||||
|
const bucket = this.ensureBucket(categoryId);
|
||||||
|
console.log("保存类别 ", categoryId, " 的详细数据: ", bucket);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** --------------------------------------------------------- 技师的简要数据 --------------------------------------------------------- */
|
/** --------------------------------------------------------- 技师的简要数据 --------------------------------------------------------- */
|
||||||
@@ -136,7 +142,6 @@ export class GirlData extends BaseData {
|
|||||||
existed.add(g.id);
|
existed.add(g.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log("保存技师的简要数据: ", bucket);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private parseOneGirlBrief(data: proto.cs.IGirls): GirlBriefData | null {
|
private parseOneGirlBrief(data: proto.cs.IGirls): GirlBriefData | null {
|
||||||
@@ -257,7 +262,6 @@ export class GirlData extends BaseData {
|
|||||||
if (!one) continue;
|
if (!one) continue;
|
||||||
bucket.details.set(g.id, one);
|
bucket.details.set(g.id, one);
|
||||||
}
|
}
|
||||||
console.log("保存技师的详细数据: ", bucket);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取某分类 + girlId 的详细数据 */
|
/** 取某分类 + girlId 的详细数据 */
|
||||||
@@ -410,7 +414,6 @@ export class GirlData extends BaseData {
|
|||||||
if (!one) continue;
|
if (!one) continue;
|
||||||
bucket.unlocks.set(g.id, one);
|
bucket.unlocks.set(g.id, one);
|
||||||
}
|
}
|
||||||
console.log("保存技师的解锁数据: ", bucket);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取某分类 + girlId 的解锁数据 */
|
/** 取某分类 + girlId 的解锁数据 */
|
||||||
@@ -476,6 +479,7 @@ export class GirlData extends BaseData {
|
|||||||
if (!data) return null;
|
if (!data) return null;
|
||||||
let oneData = new GirlChatData();
|
let oneData = new GirlChatData();
|
||||||
oneData.init?.(DataId.GirlChat);
|
oneData.init?.(DataId.GirlChat);
|
||||||
|
oneData.setId(data.id);
|
||||||
oneData.setChatTotalCount(data.chatTotalCount);
|
oneData.setChatTotalCount(data.chatTotalCount);
|
||||||
oneData.setChatRemainCount(data.chatRemainCount);
|
oneData.setChatRemainCount(data.chatRemainCount);
|
||||||
return oneData;
|
return oneData;
|
||||||
@@ -490,7 +494,6 @@ export class GirlData extends BaseData {
|
|||||||
if (!one) continue;
|
if (!one) continue;
|
||||||
bucket.chats.set(g.id, one);
|
bucket.chats.set(g.id, one);
|
||||||
}
|
}
|
||||||
console.log("保存技师的聊天数据: ", bucket);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取某分类 + girlId 的聊天数据 */
|
/** 取某分类 + girlId 的聊天数据 */
|
||||||
@@ -542,6 +545,7 @@ export class GirlData extends BaseData {
|
|||||||
if (!data) return null;
|
if (!data) return null;
|
||||||
let oneData = new GirlFavorabilityData();
|
let oneData = new GirlFavorabilityData();
|
||||||
oneData.init?.(DataId.GirlFavorability);
|
oneData.init?.(DataId.GirlFavorability);
|
||||||
|
oneData.setId(data.id);
|
||||||
oneData.setStar(data.star);
|
oneData.setStar(data.star);
|
||||||
return oneData;
|
return oneData;
|
||||||
}
|
}
|
||||||
@@ -555,7 +559,6 @@ export class GirlData extends BaseData {
|
|||||||
if (!one) continue;
|
if (!one) continue;
|
||||||
bucket.favorability.set(g.id, one);
|
bucket.favorability.set(g.id, one);
|
||||||
}
|
}
|
||||||
console.log("保存技师的好感度数据: ", bucket);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取某分类 + girlId 的好感度数据 */
|
/** 取某分类 + girlId 的好感度数据 */
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ export class GirlUnlockData extends BaseData {
|
|||||||
if (!exists) {
|
if (!exists) {
|
||||||
this.unlockedImageIds.push(id);
|
this.unlockedImageIds.push(id);
|
||||||
}
|
}
|
||||||
// console.log("技师 ", this.id, " 当前解锁图片的所有id:",this.unlockedImageIds);
|
console.log("技师 ", this.id, " 当前解锁图片的所有id:",this.unlockedImageIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取所有解锁图片的 id */
|
/** 获取所有解锁图片的 id */
|
||||||
@@ -113,7 +113,7 @@ export class GirlUnlockData extends BaseData {
|
|||||||
if (!exists) {
|
if (!exists) {
|
||||||
this.unlockedVideoIds.push(id);
|
this.unlockedVideoIds.push(id);
|
||||||
}
|
}
|
||||||
// console.log("技师 ", this.id, " 当前解锁视频的所有id:",this.unlockedVideoIds);
|
console.log("技师 ", this.id, " 当前解锁视频的所有id:",this.unlockedVideoIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取所有解锁视频的 id */
|
/** 获取所有解锁视频的 id */
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import type { ApiResponse } from "../client/types";
|
|||||||
import proto from "db://assets/Scripts/proto/proto.pb.js";
|
import proto from "db://assets/Scripts/proto/proto.pb.js";
|
||||||
|
|
||||||
// 模拟开关
|
// 模拟开关
|
||||||
const USE_MOCK = true;
|
const USE_MOCK = false;
|
||||||
|
|
||||||
export class GirlService implements IGirlService {
|
export class GirlService implements IGirlService {
|
||||||
private static _I: GirlService | null = null;
|
private static _I: GirlService | null = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user