日志控制
This commit is contained in:
@@ -28,6 +28,7 @@ import { GirlData } from "../../data/GirlData";
|
||||
import { GirlService } from "db://assets/Scripts/chat18x/network/services/GirlService";
|
||||
import proto from "db://assets/Scripts/proto/proto.pb.js";
|
||||
import { SceneBgVideoLayer } from "../../../Sub/UI/SceneBgVideoLayer";
|
||||
import { logger } from "db://assets/Scripts/Main/Common/Logger";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -106,18 +107,18 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
|
||||
setVideEnable(enable: boolean) {
|
||||
if (!this.videoLayer) {
|
||||
console.error("GirlDetailPanel: SceneBgVideoLayer 不可用");
|
||||
logger.error("GirlDetailPanel: SceneBgVideoLayer 不可用");
|
||||
return;
|
||||
}
|
||||
|
||||
if (enable) {
|
||||
// 恢复播放
|
||||
this.videoLayer.resume();
|
||||
console.log("GirlDetailPanel: 开启视频播放");
|
||||
logger.log("GirlDetailPanel: 开启视频播放");
|
||||
} else {
|
||||
// 暂停播放
|
||||
this.videoLayer.pause();
|
||||
console.log("GirlDetailPanel: 暂停视频播放");
|
||||
logger.log("GirlDetailPanel: 暂停视频播放");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,9 +160,9 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
|
||||
// 检查 SceneBgVideoLayer 是否可用
|
||||
if (!this.videoLayer) {
|
||||
console.error("GirlDetailPanel: SceneBgVideoLayer.handle 未初始化");
|
||||
logger.error("GirlDetailPanel: SceneBgVideoLayer.handle 未初始化");
|
||||
} else {
|
||||
console.log("GirlDetailPanel: 成功获取 SceneBgVideoLayer 实例");
|
||||
logger.log("GirlDetailPanel: 成功获取 SceneBgVideoLayer 实例");
|
||||
// 初始化视频显示位置
|
||||
//this.initVideoPosition();
|
||||
}
|
||||
@@ -191,7 +192,7 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
this.tags.string = desc;
|
||||
const star = girlData.getStar(this.category.toString(), this.id);
|
||||
const stars = this.starParent.getComponentsInChildren(Sprite);
|
||||
console.log("好感度:" + star);
|
||||
logger.log("好感度:" + star);
|
||||
for (let i = 0; i < stars.length; i++) {
|
||||
const element = stars[i];
|
||||
if (star > i) {
|
||||
@@ -215,7 +216,7 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
|
||||
// 使用 SceneBgVideoLayer 加载并播放视频
|
||||
if (this.videoLayer && firstPath) {
|
||||
console.log(`GirlDetailPanel: 加载视频 ${firstPath}`);
|
||||
logger.log(`GirlDetailPanel: 加载视频 ${firstPath}`);
|
||||
|
||||
// 获取 videoArea 的尺寸和位置
|
||||
const targetSize = this.videoArea
|
||||
@@ -234,7 +235,7 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
this.videoLayer.getVideoPlayer().node.parent;
|
||||
if (videoPlayerParent) {
|
||||
const parentWorldPos = videoPlayerParent.getWorldPosition();
|
||||
console.log(
|
||||
logger.log(
|
||||
`GirlDetailPanel: VideoPlayer 父节点世界位置: (${parentWorldPos.x}, ${parentWorldPos.y}, ${parentWorldPos.z})`
|
||||
);
|
||||
}
|
||||
@@ -339,7 +340,7 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
// 停止视频播放,释放资源
|
||||
if (this.videoLayer) {
|
||||
//this.videoLayer.stop();
|
||||
//console.log("GirlDetailPanel: 停止视频播放");
|
||||
//logger.log("GirlDetailPanel: 停止视频播放");
|
||||
}
|
||||
|
||||
super.onClose();
|
||||
@@ -352,7 +353,7 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
// 确保视频资源被释放
|
||||
if (this.videoLayer) {
|
||||
//this.videoLayer.stop();
|
||||
//console.log("GirlDetailPanel: 销毁时停止视频播放");
|
||||
//logger.log("GirlDetailPanel: 销毁时停止视频播放");
|
||||
}
|
||||
|
||||
// 回收所有使用中的节点到对象池
|
||||
|
||||
@@ -6,6 +6,7 @@ import { PastGirlListItem } from "../../uiitems/PastGirlListItem";
|
||||
import { DataManager, DataId } from "../../data/DataManager";
|
||||
import { GirlData } from "../../data/GirlData";
|
||||
import { ChatHistoryManager } from "../../manager/ChatHistoryManager";
|
||||
import { logger } from "db://assets/Scripts/Main/Common/Logger";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -71,7 +72,7 @@ export class PastGirlListPanel extends li_BaseView {
|
||||
private getUnlockedGirls(): number[] {
|
||||
const GirlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
const allids = GirlData.getAllReleaseGirlIds();
|
||||
console.log(allids);
|
||||
logger.log(allids);
|
||||
return allids;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import {
|
||||
} from "../../manager/NavigationManager";
|
||||
import { PlayerDataService } from "../../network/services/PlayerDataService";
|
||||
import proto from "db://assets/Scripts/proto/proto.pb.js";
|
||||
import { logger } from "db://assets/Scripts/Main/Common/Logger";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -91,7 +92,7 @@ export class PersonalPanel extends li_BaseView {
|
||||
private async refresh() {
|
||||
const reqData = {};
|
||||
let res = await PlayerDataService.I.reqMyInfo(reqData);
|
||||
console.log("个人信息响应数据:", res);
|
||||
logger.log("个人信息响应数据:", res);
|
||||
if (res && res.code === proto.cs.EnmRetCode.SUCCESS) {
|
||||
const resData = res.data;
|
||||
const walletData = DataManager.I.getDataById<WalletData>(DataId.Wallet);
|
||||
|
||||
@@ -22,6 +22,8 @@ import LanguageUtils from "../../../Main/Common/LanguageUtils";
|
||||
import { ImagePopup } from "../components/ImagePopup";
|
||||
import { TipsPanel } from "./TipsPanel";
|
||||
import ResManager from "../../../Main/Manager/ResManager";
|
||||
import { logger } from "db://assets/Scripts/Main/Common/Logger";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("PopupGirlDetailPanel")
|
||||
@@ -115,7 +117,7 @@ export class PopupGirlDetailPanel extends li_BaseView {
|
||||
}
|
||||
async buyCharacter() {
|
||||
// 购买id为girlId的女生
|
||||
console.log(this.girlId + "---" + this.resId);
|
||||
logger.log(this.girlId + "---" + this.resId);
|
||||
|
||||
// 请求解锁
|
||||
const reqData = {
|
||||
@@ -124,7 +126,7 @@ export class PopupGirlDetailPanel extends li_BaseView {
|
||||
type: this.type,
|
||||
};
|
||||
let res = await GirlService.I.reqUnlockGirlRes(reqData);
|
||||
console.log("请求解锁资源响应数据:", res);
|
||||
logger.log("请求解锁资源响应数据:", res);
|
||||
if (res && res.code === proto.cs.EnmRetCode.SUCCESS) {
|
||||
const resData = res.data;
|
||||
// 保存数据
|
||||
|
||||
@@ -15,6 +15,7 @@ import proto from "db://assets/Scripts/proto/proto.pb.js";
|
||||
import { NavigationManager, PanelType } from "../../manager/NavigationManager";
|
||||
import { Web3PopPanel } from "./Web3PopPanel";
|
||||
import { TipsPanel } from "./TipsPanel";
|
||||
import { logger } from "db://assets/Scripts/Main/Common/Logger";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -255,7 +256,7 @@ export class PurchasePanel extends li_BaseView {
|
||||
girlId: 0,
|
||||
};
|
||||
let res = await ShopService.I.reqBuyGood(reqData);
|
||||
console.log("请求使用余额购买商品的响应数据:", res);
|
||||
logger.log("请求使用余额购买商品的响应数据:", res);
|
||||
if (res && res.code === proto.cs.EnmRetCode.SUCCESS) {
|
||||
const resData = res.data;
|
||||
// 保存数据
|
||||
@@ -276,16 +277,16 @@ export class PurchasePanel extends li_BaseView {
|
||||
network,
|
||||
};
|
||||
let res = await PaymentService.I.startPayment(reqData);
|
||||
console.log("支付完成的响应数据:", res);
|
||||
logger.log("支付完成的响应数据:", res);
|
||||
if (res) {
|
||||
let status = res.status;
|
||||
if (status === -1) {
|
||||
console.log("支付失败!!!,错误码:", res.retCode);
|
||||
logger.log("支付失败!!!,错误码:", res.retCode);
|
||||
|
||||
const key = "error_code_" + res.retCode;
|
||||
TipsPanel.show(LanguageUtils.getText(key));
|
||||
} else if (status === 0) {
|
||||
console.log("支付成功!!!");
|
||||
logger.log("支付成功!!!");
|
||||
const walletData = DataManager.I.getDataById<WalletData>(DataId.Wallet);
|
||||
walletData.balance = Number(res.balance);
|
||||
walletData.vipExpire = Number(res.vipExpire);
|
||||
|
||||
@@ -22,6 +22,7 @@ import { ConfigManager } from "../../manager/ConfigManager";
|
||||
import LanguageUtils from "../../../Main/Common/LanguageUtils";
|
||||
import { Dialog } from "../../data/DialogData";
|
||||
import { InnerMsgCode } from "../../../Main/Config/InnerMsgCode";
|
||||
import { logger } from "db://assets/Scripts/Main/Common/Logger";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -132,7 +133,7 @@ export class RecordPanel extends li_BaseView {
|
||||
this.allMessages = ChatHistoryManager.Instance.loadHistory(this.id);
|
||||
|
||||
if (this.allMessages.length === 0) {
|
||||
console.log(`No chat history found for role ${this.id}`);
|
||||
logger.log(`No chat history found for role ${this.id}`);
|
||||
this.updateLoadMoreBtn();
|
||||
return;
|
||||
}
|
||||
@@ -170,7 +171,7 @@ export class RecordPanel extends li_BaseView {
|
||||
// 添加到已显示的消息列表
|
||||
this.displayedMessages.push(...newDialogs);
|
||||
|
||||
console.log(
|
||||
logger.log(
|
||||
`Loaded page ${this.currentPage + 1}, showing ${
|
||||
this.displayedMessages.length
|
||||
}/${this.allMessages.length} messages`
|
||||
@@ -234,7 +235,7 @@ export class RecordPanel extends li_BaseView {
|
||||
*/
|
||||
public clearHistory() {
|
||||
ChatHistoryManager.Instance.clearHistory(this.id);
|
||||
console.log(`Cleared chat history for role ${this.id}`);
|
||||
logger.log(`Cleared chat history for role ${this.id}`);
|
||||
|
||||
// 重置数据
|
||||
this.allMessages = [];
|
||||
|
||||
Reference in New Issue
Block a user