付费配置 界面
This commit is contained in:
@@ -193,6 +193,7 @@ export class GlobalConfig {
|
||||
this.Temperature = _buf_.readFloat()
|
||||
this.MaxTokens = _buf_.readInt()
|
||||
this.Timeout = _buf_.readInt()
|
||||
this.FreeChatTimes = _buf_.readInt()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -212,6 +213,10 @@ export class GlobalConfig {
|
||||
* 超时时间(微秒)
|
||||
*/
|
||||
readonly Timeout: number
|
||||
/**
|
||||
* 单个角色免费聊天次数
|
||||
*/
|
||||
readonly FreeChatTimes: number
|
||||
|
||||
resolve(tables:Tables) {
|
||||
|
||||
@@ -219,6 +224,7 @@ export class GlobalConfig {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,6 +276,44 @@ export class Language {
|
||||
|
||||
|
||||
|
||||
export class PurchaseConfig {
|
||||
|
||||
constructor(_buf_: ByteBuf) {
|
||||
this.id = _buf_.readInt()
|
||||
this.name = _buf_.readString()
|
||||
this.desc = _buf_.readString()
|
||||
this.count = _buf_.readInt()
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
readonly id: number
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
readonly name: string
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
readonly desc: string
|
||||
/**
|
||||
* 计费点ID
|
||||
*/
|
||||
readonly count: number
|
||||
|
||||
resolve(tables:Tables) {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export class Theme {
|
||||
|
||||
constructor(_buf_: ByteBuf) {
|
||||
@@ -582,6 +626,10 @@ export class TbGlobalConfig {
|
||||
* 超时时间(微秒)
|
||||
*/
|
||||
get Timeout(): number { return this._data.Timeout; }
|
||||
/**
|
||||
* 单个角色免费聊天次数
|
||||
*/
|
||||
get FreeChatTimes(): number { return this._data.FreeChatTimes; }
|
||||
|
||||
resolve(tables:Tables) {
|
||||
this._data.resolve(tables)
|
||||
@@ -592,6 +640,39 @@ export class TbGlobalConfig {
|
||||
|
||||
|
||||
|
||||
export class TbPurchaseConfig {
|
||||
private _dataMap: Map<number, PurchaseConfig>
|
||||
private _dataList: PurchaseConfig[]
|
||||
constructor(_buf_: ByteBuf) {
|
||||
this._dataMap = new Map<number, PurchaseConfig>()
|
||||
this._dataList = []
|
||||
for(let n = _buf_.readInt(); n > 0; n--) {
|
||||
let _v: PurchaseConfig
|
||||
_v = new PurchaseConfig(_buf_)
|
||||
this._dataList.push(_v)
|
||||
this._dataMap.set(_v.id, _v)
|
||||
}
|
||||
}
|
||||
|
||||
getDataMap(): Map<number, PurchaseConfig> { return this._dataMap; }
|
||||
getDataList(): PurchaseConfig[] { return this._dataList; }
|
||||
|
||||
get(key: number): PurchaseConfig | undefined {
|
||||
return this._dataMap.get(key);
|
||||
}
|
||||
|
||||
resolve(tables:Tables) {
|
||||
for(let data of this._dataList)
|
||||
{
|
||||
data.resolve(tables)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
type ByteBufLoader = (file: string) => ByteBuf
|
||||
|
||||
export class Tables {
|
||||
@@ -607,6 +688,8 @@ export class Tables {
|
||||
get TbAiCharacters(): TbAiCharacters { return this._TbAiCharacters;}
|
||||
private _TbGlobalConfig: TbGlobalConfig
|
||||
get TbGlobalConfig(): TbGlobalConfig { return this._TbGlobalConfig;}
|
||||
private _TbPurchaseConfig: TbPurchaseConfig
|
||||
get TbPurchaseConfig(): TbPurchaseConfig { return this._TbPurchaseConfig;}
|
||||
|
||||
static getTableNames(): string[] {
|
||||
let names: string[] = [];
|
||||
@@ -616,6 +699,7 @@ export class Tables {
|
||||
names.push('tbthemes');
|
||||
names.push('tbaicharacters');
|
||||
names.push('tbglobalconfig');
|
||||
names.push('tbpurchaseconfig');
|
||||
return names;
|
||||
}
|
||||
|
||||
@@ -626,6 +710,7 @@ export class Tables {
|
||||
this._TbThemes = new TbThemes(loader('tbthemes'))
|
||||
this._TbAiCharacters = new TbAiCharacters(loader('tbaicharacters'))
|
||||
this._TbGlobalConfig = new TbGlobalConfig(loader('tbglobalconfig'))
|
||||
this._TbPurchaseConfig = new TbPurchaseConfig(loader('tbpurchaseconfig'))
|
||||
|
||||
this._TbLanguage.resolve(this)
|
||||
this._TbGirls.resolve(this)
|
||||
@@ -633,6 +718,7 @@ export class Tables {
|
||||
this._TbThemes.resolve(this)
|
||||
this._TbAiCharacters.resolve(this)
|
||||
this._TbGlobalConfig.resolve(this)
|
||||
this._TbPurchaseConfig.resolve(this)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user