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