Merge branch 'main' of 47.107.44.202:xionglijia/18xchat

This commit is contained in:
2025-09-20 12:22:06 +08:00
5 changed files with 17 additions and 25 deletions
@@ -146,10 +146,6 @@ export default class LanguageUtils {
return defaultText; return defaultText;
} }
if (this.languageCache.has(key)) {
return this.languageCache.get(key);
}
if (!ConfigManager.tables || !ConfigManager.tables.TbLanguage) { if (!ConfigManager.tables || !ConfigManager.tables.TbLanguage) {
console.warn("Language table not loaded yet"); console.warn("Language table not loaded yet");
return defaultText || key; return defaultText || key;
@@ -180,7 +176,6 @@ export default class LanguageUtils {
text = languageData.languageEn || defaultText || key; text = languageData.languageEn || defaultText || key;
} }
this.languageCache.set(key, text);
return text; return text;
} }
@@ -96,10 +96,10 @@ export class GlobalConfig extends BaseConfig {
} }
/** 情绪评分机器人system_prompt,需拼接角色prompt */ /** 情绪评分机器人system_prompt,需拼接角色prompt */
public getEmotionRating(): string | null { public getEmotionBasePrompt(): string | null {
let oneData = this.getAllConfig(); let oneData = this.getAllConfig();
if (!oneData) return null; if (!oneData) return null;
return oneData.EmotionRating; return oneData.EmotionBasePrompt;
} }
/** ai机器人基础规则 */ /** ai机器人基础规则 */
+7 -16
View File
@@ -26,11 +26,9 @@ export class GlobalData extends BaseData {
// 游戏名 // 游戏名
private _gameName: string = ""; private _gameName: string = "";
// 情绪评分机器人system_prompt,需拼接角色prompt // 情绪评分机器人system_prompt,需拼接角色prompt
private _emotionRating: string = ""; private _emotionBasePrompt: string = "";
// ai机器人基础规则 // ai机器人基础规则
private _girlBasePrompt: string = ""; private _girlBasePrompt: string = "";
// emotion基础规则
private _emotionBasePrompt: string = "";
public reset(): void { public reset(): void {
this._apiKey = ""; this._apiKey = "";
@@ -43,9 +41,8 @@ export class GlobalData extends BaseData {
this._onceChatAddScore = 0; this._onceChatAddScore = 0;
this._scoreExchangeStarLevel = 0; this._scoreExchangeStarLevel = 0;
this._gameName = ""; this._gameName = "";
this._emotionRating = "";
this._girlBasePrompt = "";
this._emotionBasePrompt = ""; this._emotionBasePrompt = "";
this._girlBasePrompt = "";
} }
public clear(): void { public clear(): void {
@@ -59,9 +56,8 @@ export class GlobalData extends BaseData {
this._onceChatAddScore = 0; this._onceChatAddScore = 0;
this._scoreExchangeStarLevel = 0; this._scoreExchangeStarLevel = 0;
this._gameName = ""; this._gameName = "";
this._emotionRating = "";
this._girlBasePrompt = "";
this._emotionBasePrompt = ""; this._emotionBasePrompt = "";
this._girlBasePrompt = "";
} }
public destroy(): void { public destroy(): void {
@@ -76,9 +72,8 @@ export class GlobalData extends BaseData {
this._onceChatAddScore = null; this._onceChatAddScore = null;
this._scoreExchangeStarLevel = null; this._scoreExchangeStarLevel = null;
this._gameName = null; this._gameName = null;
this._emotionRating = null;
this._girlBasePrompt = null;
this._emotionBasePrompt = null; this._emotionBasePrompt = null;
this._girlBasePrompt = null;
} }
/** 设置全局数据 */ /** 设置全局数据 */
@@ -96,9 +91,8 @@ export class GlobalData extends BaseData {
this._onceChatAddScore = obj.OnceChatAddScore; this._onceChatAddScore = obj.OnceChatAddScore;
this._scoreExchangeStarLevel = obj.ScoreExchangeStarLevel; this._scoreExchangeStarLevel = obj.ScoreExchangeStarLevel;
this._gameName = obj.GameName; this._gameName = obj.GameName;
this._emotionRating = obj.EmotionRating;
this._girlBasePrompt = obj.girlBasePrompt;
this._emotionBasePrompt = obj.EmotionBasePrompt; this._emotionBasePrompt = obj.EmotionBasePrompt;
this._girlBasePrompt = obj.girlBasePrompt;
console.log("设置全局数据: ", this._gameName); console.log("设置全局数据: ", this._gameName);
} }
} }
@@ -154,15 +148,12 @@ export class GlobalData extends BaseData {
} }
/** 情绪评分机器人system_prompt,需拼接角色prompt */ /** 情绪评分机器人system_prompt,需拼接角色prompt */
public getEmotionRating(): string { public getEmotionBasePrompt(): string {
return this._emotionRating; return this._emotionBasePrompt;
} }
/** ai机器人基础规则 */ /** ai机器人基础规则 */
public getGirlBasePrompt(): string { public getGirlBasePrompt(): string {
return this._girlBasePrompt; return this._girlBasePrompt;
} }
public getEmotionBasePrompt(): string {
return this._emotionBasePrompt;
}
} }
@@ -55,4 +55,10 @@ export class WalletData extends BaseData {
public get vipExpire(): number { public get vipExpire(): number {
return this._vipExpire; return this._vipExpire;
} }
/** 判断用户是否是VIP */
public get isVip(): boolean {
const now = Math.floor(Date.now() / 1000); // 当前时间戳(秒)
return this._vipExpire > now;
}
} }
+2 -2
View File
@@ -32,8 +32,8 @@ export class WebUsdFlow implements PaymentFlow {
private async pollOrder(orderId: string) { private async pollOrder(orderId: string) {
const poller = new PaymentPoller(); const poller = new PaymentPoller();
return poller.poll(orderId, { return poller.poll(orderId, {
maxDurationMs: 2 * 60 * 1000, maxDurationMs: 10 * 60 * 1000,
startIntervalMs: 2000, startIntervalMs: 5000,
maxIntervalMs: 10000, maxIntervalMs: 10000,
jitter: true, jitter: true,
}, (d) => console.log()); }, (d) => console.log());