This commit is contained in:
2025-08-12 16:08:58 +08:00
parent 752bd6c6f6
commit 75cc583a44
22 changed files with 276 additions and 95 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
+12
View File
@@ -0,0 +1,12 @@
[
{
"id": 10001,
"name": "Anaya Kapoor",
"age": "29",
"category": 0,
"tag": [
"Hot,Horny"
],
"priceType": 0
}
]
+85 -25
View File
@@ -18,12 +18,15 @@
"_children": [
{
"__id__": 2
},
{
"__id__": 32
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 32
"__id__": 34
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -54,7 +57,7 @@
},
"autoReleaseAssets": false,
"_globals": {
"__id__": 33
"__id__": 35
},
"_id": "1a23cd3e-e487-4fd1-a415-346c2087464d"
},
@@ -98,8 +101,8 @@
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 196.5,
"y": 426.00000000000006,
"x": 583.5,
"y": 1266,
"z": 0
},
"_lrot": {
@@ -580,8 +583,8 @@
"__prefab": null,
"_alignFlags": 45,
"_target": null,
"_left": 361,
"_right": 361,
"_left": 359.5,
"_right": 359.5,
"_top": 978,
"_bottom": 978,
"_horizontalCenter": 0,
@@ -663,8 +666,8 @@
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 393,
"height": 852.0000000000001
"width": 1167,
"height": 2532
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -789,8 +792,8 @@
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 393,
"height": 852.0000000000001
"width": 1167,
"height": 2532
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -889,8 +892,8 @@
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 393,
"height": 852.0000000000001
"width": 1167,
"height": 2532
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -941,8 +944,8 @@
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 393,
"height": 852.0000000000001
"width": 1167,
"height": 2532
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -1018,6 +1021,63 @@
},
"_id": "98EWBIubZPlZT+LFQb4IYI"
},
{
"__type__": "cc.Node",
"_name": "ConfigManager",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 33
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "67ZXnZeExFXIu59phK6Xjz"
},
{
"__type__": "fbd43WrI4tK6KXuGCPuxhSR",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 32
},
"_enabled": true,
"__prefab": null,
"_id": "57vDjH7bVD4JDeqZChrdP3"
},
{
"__type__": "cc.PrefabInfo",
"root": null,
@@ -1029,29 +1089,29 @@
{
"__type__": "cc.SceneGlobals",
"ambient": {
"__id__": 34
},
"shadows": {
"__id__": 35
},
"_skybox": {
"__id__": 36
},
"fog": {
"shadows": {
"__id__": 37
},
"octree": {
"_skybox": {
"__id__": 38
},
"skin": {
"fog": {
"__id__": 39
},
"lightProbeInfo": {
"octree": {
"__id__": 40
},
"postSettings": {
"skin": {
"__id__": 41
},
"lightProbeInfo": {
"__id__": 42
},
"postSettings": {
"__id__": 43
},
"bakedWithStationaryMainLight": false,
"bakedWithHighpLightmap": false
},
@@ -1,4 +1,11 @@
import { _decorator, resources, BufferAsset, Component } from "cc";
import {
_decorator,
resources,
BufferAsset,
Component,
assetManager,
AssetManager,
} from "cc";
import * as cfg from "../../schema/schema";
import ByteBuf from "db://assets/Scripts/luban/ByteBuf";
@@ -22,9 +29,27 @@ export default class ConfigManager extends Component {
let promises: Promise<unknown>[] = [];
for (let curFileName of ConfigManager.jsonFileNames) {
let promise = new Promise((resolve, reject) => {
resources.load("test/" + curFileName, BufferAsset, (err, data) => {
resolve(data);
});
let bundle = assetManager.getBundle("DataTable");
if (bundle) {
bundle.load(curFileName, BufferAsset, (err, data) => {
resolve(data);
});
} else {
assetManager.loadBundle(
"DataTable",
(err: Error, _bundle: AssetManager.Bundle) => {
if (err) {
console.log(err);
reject && reject(err);
return;
} else {
_bundle.load(curFileName, BufferAsset, (err, data) => {
resolve(data);
});
}
}
);
}
});
promise.then((data: BufferAsset) => {
if (data) {
@@ -41,7 +66,7 @@ export default class ConfigManager extends Component {
Promise.all(promises).then((values) => {
console.log("静态配置加载完成");
ConfigManager.tables = new cfg.Tables(this.getFileData);
for (let item of ConfigManager.tables.Tbitem.getDataList()) {
for (let item of ConfigManager.tables.TbGirls.getDataList()) {
console.log(item);
}
});
+134
View File
@@ -10,6 +10,52 @@
import ByteBuf from '../luban/ByteBuf'
export enum Category {
/**
* 熟女
*/
shunv = 0,
/**
* 18岁
*/
eighteen = 1,
/**
* 辣妈
*/
lama = 2,
/**
* 捆绑
*/
kunbang = 3,
/**
* 公众野战
*/
publicfight = 4,
/**
* 卡通
*/
cartoon = 5,
}
export enum PriceType {
/**
* 免费
*/
free = 0,
/**
* 试用
*/
first_time_free = 1,
/**
* 收费
*/
pay = 2,
}
@@ -91,6 +137,56 @@ export class Reward {
export class Girls {
constructor(_buf_: ByteBuf) {
this.id = _buf_.readInt()
this.name = _buf_.readString()
this.age = _buf_.readString()
this.category = _buf_.readInt()
{ let n = Math.min(_buf_.readSize(), _buf_.size); this.tag = []; for(let i = 0 ; i < n ; i++) { let _e0 ;_e0 = _buf_.readString(); this.tag.push(_e0);}}
this.priceType = _buf_.readInt()
}
/**
* id
*/
readonly id: number
/**
* 名称
*/
readonly name: string
/**
* 年龄
*/
readonly age: string
/**
* 分类
*/
readonly category: Category
/**
* 标签
*/
readonly tag: string[]
/**
* 付费类型
*/
readonly priceType: PriceType
resolve(tables:Tables) {
}
}
export class vector2 {
constructor(_buf_: ByteBuf) {
@@ -193,6 +289,39 @@ export class TbReward {
}
export class TbGirls {
private _dataMap: Map<number, Girls>
private _dataList: Girls[]
constructor(_buf_: ByteBuf) {
this._dataMap = new Map<number, Girls>()
this._dataList = []
for(let n = _buf_.readInt(); n > 0; n--) {
let _v: Girls
_v = new Girls(_buf_)
this._dataList.push(_v)
this._dataMap.set(_v.id, _v)
}
}
getDataMap(): Map<number, Girls> { return this._dataMap; }
getDataList(): Girls[] { return this._dataList; }
get(key: number): Girls | undefined {
return this._dataMap.get(key);
}
resolve(tables:Tables) {
for(let data of this._dataList)
{
data.resolve(tables)
}
}
}
export namespace demo {
export class Tbitem {
private _dataMap: Map<number, demo.item>
@@ -232,21 +361,26 @@ type ByteBufLoader = (file: string) => ByteBuf
export class Tables {
private _TbReward: demo.TbReward
get TbReward(): demo.TbReward { return this._TbReward;}
private _TbGirls: TbGirls
get TbGirls(): TbGirls { return this._TbGirls;}
private _Tbitem: demo.Tbitem
get Tbitem(): demo.Tbitem { return this._Tbitem;}
static getTableNames(): string[] {
let names: string[] = [];
names.push('demo_tbreward');
names.push('tbgirls');
names.push('demo_tbitem');
return names;
}
constructor(loader: ByteBufLoader) {
this._TbReward = new demo.TbReward(loader('demo_tbreward'))
this._TbGirls = new TbGirls(loader('tbgirls'))
this._Tbitem = new demo.Tbitem(loader('demo_tbitem'))
this._TbReward.resolve(this)
this._TbGirls.resolve(this)
this._Tbitem.resolve(this)
}
}
-9
View File
@@ -1,9 +0,0 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "47f49576-c2c9-44fd-a97b-757a0bde9e65",
"files": [],
"subMetas": {},
"userData": {}
}
-2
View File
@@ -1,2 +0,0 @@
[{"id":1,"AssetName":"music_interface"},
{"id":2,"AssetName":"music_game"}]
-11
View File
@@ -1,11 +0,0 @@
{
"ver": "2.0.1",
"importer": "json",
"imported": true,
"uuid": "0394e147-cf8c-4177-ae8e-509324c5b83f",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}
-5
View File
@@ -1,5 +0,0 @@
[{"id":10000,"AssetName":"click","Priority":0,"Loop":0,"Volume":1,"SpatialBlend":0,"MaxDistance":100,"MinInterval":0},
{"id":10001,"AssetName":"defeat","Priority":0,"Loop":0,"Volume":1,"SpatialBlend":0,"MaxDistance":100,"MinInterval":0},
{"id":10002,"AssetName":"startgame","Priority":0,"Loop":0,"Volume":1,"SpatialBlend":0,"MaxDistance":100,"MinInterval":0},
{"id":10003,"AssetName":"success","Priority":0,"Loop":0,"Volume":1,"SpatialBlend":0,"MaxDistance":100,"MinInterval":0}
]
-11
View File
@@ -1,11 +0,0 @@
{
"ver": "2.0.1",
"importer": "json",
"imported": true,
"uuid": "23b3db89-f554-4f2e-9a97-a82f504572a8",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}
@@ -1,4 +0,0 @@
[
{ "id": 1, "type": 0, "value": 8, "para": "" },
{ "id": 100, "type": 0, "value": 10, "para": "" }
]
@@ -1,11 +0,0 @@
{
"ver": "2.0.1",
"importer": "json",
"imported": true,
"uuid": "ce1d5a04-5bdb-46a4-a347-b41027b9ada2",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}
@@ -2,7 +2,7 @@
"ver": "1.0.3",
"importer": "buffer",
"imported": true,
"uuid": "b6344d4c-c476-4680-baab-fc0ad7e822c3",
"uuid": "63fbd1bd-9cb1-4fa3-aca9-15b259a9c421",
"files": [
".bin",
".json"
@@ -2,7 +2,7 @@
"ver": "1.0.3",
"importer": "buffer",
"imported": true,
"uuid": "f4e901c8-045b-48b6-9dbd-a8e66e836316",
"uuid": "22867eec-f2ee-4997-b2b4-b277af84b625",
"files": [
".bin",
".json"
Binary file not shown.
+12
View File
@@ -0,0 +1,12 @@
{
"ver": "1.0.3",
"importer": "buffer",
"imported": true,
"uuid": "08338d0a-99b7-4506-b4ac-a9ffde3bffef",
"files": [
".bin",
".json"
],
"subMetas": {},
"userData": {}
}
-9
View File
@@ -1,9 +0,0 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "9af205c7-55bf-4df1-9349-5916a429f4fe",
"files": [],
"subMetas": {},
"userData": {}
}
+1 -1
View File
@@ -9,7 +9,7 @@ dotnet %LUBAN_DLL% ^
-d bin ^
--conf %CONF_ROOT%\luban.conf ^
-x outputCodeDir=assets\scripts\schema ^
-x outputDataDir=assets\resources\test ^
-x outputDataDir=assets\bundles\DataTable ^
-x bin.fileExt=bin
pause