using Campofinale.Resource.Dynamic; using Campofinale.Resource.Json; using Campofinale.Resource.Table; using Newtonsoft.Json; using static Campofinale.Resource.ResourceManager.LevelScene; namespace Campofinale.Resource { public class IdConst { public static int IdServerSetTypeBit = 62; public static int IdClientRuntimeSetTypeBit = 61; public static int IdRoleIndexShift = 57; public static ulong LogicIdSegment = 10000; public static ulong MaxLogicIdBound = 100000000; public static int LocalIdSegment = 10000; public static int MaxLocalIdBound = 100000000; public static int MaxLevelIdBound = 100000; public static ulong MaxGlobalId = 10000000000000; public static ulong MaxRuntimeClientId = 2305843009213693952; } //TODO Move all tables to separated class public class ResourceManager { public static Dictionary levelScriptsEvents = new(); // public static Dictionary sceneAreaTable = new(); public static StrIdNumTable strIdNumTable = new StrIdNumTable();// public static Dictionary characterTable = new(); // public static Dictionary systemJumpTable = new(); // public static Dictionary settlementBasicDataTable = new(); public static Dictionary blocMissionTable = new(); public static MissionAreaTable missionAreaTable = new(); // public static Dictionary dialogTextTable = new(); public static Dictionary gameSystemConfigTable = new(); public static Dictionary wikiGroupTable = new(); public static Dictionary blocUnlockTable = new(); public static Dictionary gameMechanicTable = new(); public static Dictionary weaponBasicTable= new(); public static Dictionary blocDataTable = new(); // public static Dictionary itemTable = new(); public static Dictionary domainDataTable = new(); public static Dictionary collectionTable = new(); public static Dictionary charBreakNodeTable = new(); public static Dictionary enemyAttributeTemplateTable = new(); public static Dictionary charLevelUpTable = new(); public static Dictionary expItemDataMap = new(); public static Dictionary charGrowthTable = new(); public static Dictionary weaponUpgradeTemplateTable = new(); //Gacha public static Dictionary gachaCharPoolTable = new(); public static Dictionary gachaCharPoolContentTable = new(); public static Dictionary gachaCharPoolTypeTable = new(); public static Dictionary gachaWeaponPoolTable = new(); // public static Dictionary enemyTable = new(); public static Dictionary equipTable = new(); public static Dictionary equipSuitTable = new(); public static Dictionary spaceShipCharBehaviourTable = new(); public static Dictionary spaceshipRoomInsTable = new(); public static Dictionary dungeonTable = new(); public static Dictionary levelGradeTable = new(); // public static Dictionary rewardTable = new(); public static Dictionary adventureTaskTable = new(); public static DialogIdTable dialogIdTable = new();// public static Dictionary levelShortIdTable = new(); public static Dictionary factoryBuildingTable = new(); public static Dictionary facSTTNodeTable = new(); public static Dictionary facSTTLayerTable = new(); public static Dictionary itemTypeTable = new(); // public static Dictionary snsChatTable = new();// public static Dictionary giftItemTable = new(); public static List missionDataTable = new(); public static InteractiveTable interactiveTable = new(); // public static List levelDatas = new(); public static List interactiveData = new(); public static List spawnerConfigs = new(); public static int GetSceneNumIdFromLevelData(string name) { if (levelDatas.Find(a => a.id == name) == null) return 0; return levelDatas.Find(a => a.id == name).idNum; } public static bool missingResources = false; /// /// Utility method for read a json file /// /// The file path /// Return the file content if the file exist, else it return an empty string public static string ReadJsonFile(string path) { try { return File.ReadAllText(path); } catch(Exception e) { Logger.PrintError($"Error occured while loading {path} Err: {e.Message}"); missingResources = true; return ""; } } public static void Init() { Logger.Print("Loading TableCfg resources"); // TODO: move all tables to the folder sceneAreaTable=JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/SceneAreaTable.json")); strIdNumTable = JsonConvert.DeserializeObject(ReadJsonFile("TableCfg/StrIdNumTable.json")); characterTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/CharacterTable.json")); systemJumpTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/SystemJumpTable.json")); settlementBasicDataTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/SettlementBasicDataTable.json")); blocMissionTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/BlocMissionTable.json")); dialogTextTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/DialogTextTable.json")); gameSystemConfigTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/GameSystemConfigTable.json")); wikiGroupTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/WikiGroupTable.json")); dialogIdTable = JsonConvert.DeserializeObject(ReadJsonFile("Json/GameplayConfig/DialogIdTable.json")); blocUnlockTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/BlocUnlockTable.json")); gameMechanicTable= JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/GameMechanicTable.json")); weaponBasicTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/WeaponBasicTable.json")); missionAreaTable = JsonConvert.DeserializeObject(ReadJsonFile("Json/GameplayConfig/MissionAreaTable.json")); blocDataTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/BlocDataTable.json")); itemTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/ItemTable.json")); domainDataTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/DomainDataTable.json")); collectionTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/CollectionTable.json")); gachaCharPoolTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/GachaCharPoolTable.json")); charBreakNodeTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/CharBreakNodeTable.json")); enemyAttributeTemplateTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/EnemyAttributeTemplateTable.json")); charLevelUpTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/CharLevelUpTable.json")); expItemDataMap = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/ExpItemDataMap.json")); charGrowthTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/CharGrowthTable.json")); weaponUpgradeTemplateTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/WeaponUpgradeTemplateTable.json")); gachaCharPoolContentTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/GachaCharPoolContentTable.json")); enemyTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/EnemyTable.json")); gachaCharPoolTypeTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/GachaCharPoolTypeTable.json")); equipTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/EquipTable.json")); spaceShipCharBehaviourTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/SpaceShipCharBehaviourTable.json")); spaceshipRoomInsTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/SpaceshipRoomInsTable.json")); dungeonTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/DungeonTable.json")); equipSuitTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/EquipSuitTable.json")); levelGradeTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/LevelGradeTable.json")); levelShortIdTable = JsonConvert.DeserializeObject>(ReadJsonFile("DynamicAssets/gamedata/gameplayconfig/jsoncfg/LevelShortIdTable.json")); rewardTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/RewardTable.json")); adventureTaskTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/AdventureTaskTable.json")); factoryBuildingTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/FactoryBuildingTable.json")); facSTTNodeTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/FacSTTNodeTable.json")); facSTTLayerTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/FacSTTLayerTable.json")); itemTypeTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/ItemTypeTable.json")); interactiveTable = JsonConvert.DeserializeObject(ReadJsonFile("Json/Interactive/InteractiveTable.json")); LoadInteractiveData(); LoadLevelDatas(); LoadScriptsEvent(); LoadSpawners(); ResourceLoader.LoadTableCfg(); if (missingResources) { Logger.PrintWarn("Missing some resources. The gameserver will probably crash."); } } public static List GetAllShortIds() { List IDS = new List(); foreach (LevelShortIdTable table in levelShortIdTable.Values) { IDS.AddRange(table.ids.Values); } return IDS; } public static string GetEquipSuitTableKey(string suitTableId) { foreach(var item in equipSuitTable) { if (item.Value.equipList.Contains(suitTableId)) { return item.Key; } } return ""; } public static CharGrowthTable.CharTalentNode GetTalentNode(string c, string id) { return charGrowthTable[c].talentNodeMap[id]; } public static ItemTable GetItemTable(string id) { return itemTable[id]; } public static LevelScene GetLevelData(int sceneNumId) { return levelDatas.Find(e => e.idNum == sceneNumId); } public static ulong[] CalculateWaypointIdsBitset() { return new LongBitSet(GetAllShortIds()).Bits; } public static ulong[] CalculateDocsIdsBitset() { return new LongBitSet(strIdNumTable.char_doc_id.dic.Values).Bits; } public static ulong[] CalculateVoiceIdsBitset() { return new LongBitSet(strIdNumTable.char_voice_id.dic.Values).Bits; } public static LevelScene GetLevelData(string sceneId) { if(levelDatas.Find(e => e.id == sceneId) == null) { return new LevelScene(); } return levelDatas.Find(e => e.id==sceneId); } public static string GetDefaultWeapon(int type) { return weaponBasicTable.Values.ToList().Find(x => x.weaponType == type).weaponId; } public static void LoadInteractiveData() { Logger.Print("Loading InteractiveData resources"); string directoryPath = @"Json/Interactive/InteractiveData"; try { string[] jsonFiles = Directory.GetFiles(directoryPath, "*.json", SearchOption.AllDirectories); foreach (string json in jsonFiles) { InteractiveData data = JsonConvert.DeserializeObject(ReadJsonFile(json)); if (data != null) { interactiveData.Add(data); } } Logger.Print($"Loaded {interactiveData.Count} InteractiveData"); } catch(Exception e) { Logger.PrintError($"Error occured when loading InteractiveData: " + e.Message); } } public static void LoadScriptsEvent() { Logger.Print("Loading ScriptsEvents"); string directoryPath = @"Json/ScriptEvents"; string[] jsonFiles = Directory.GetFiles(directoryPath, "*.json", SearchOption.AllDirectories); foreach (string json in jsonFiles) { Dictionary events = JsonConvert.DeserializeObject>(ReadJsonFile(json)); foreach(KeyValuePair e in events) { if (levelScriptsEvents.ContainsKey(e.Key)) { Logger.PrintWarn($"{e.Key} already added, skipping the one in {json}"); } else { levelScriptsEvents.Add(e.Key,e.Value); } } } Logger.Print($"Loaded {levelScriptsEvents.Count} ScriptsEvents"); } public static void LoadSpawners() { Logger.Print("Loading Spawners"); string directoryPath = @"DynamicAssets\gamedata\spawnerconfig"; string[] jsonFiles = Directory.GetFiles(directoryPath, "*.json", SearchOption.AllDirectories); foreach (string json in jsonFiles) { SpawnerConfig spawner = JsonConvert.DeserializeObject(ReadJsonFile(json)); spawnerConfigs.Add(spawner); } Logger.Print($"Loaded {spawnerConfigs.Count} Spawners"); } public static void LoadLevelDatas() { Logger.Print("Loading LevelData resources"); string directoryPath = @"Json/LevelData"; string[] jsonFiles = Directory.GetFiles(directoryPath, "*.json", SearchOption.AllDirectories); foreach(string json in jsonFiles) { if (json.Contains("_lv_data")) { continue; } LevelScene data = JsonConvert.DeserializeObject(ReadJsonFile(json)); data.levelData = new(); int i = 0; foreach (string path in data.levelDataPaths) { try { LevelData data_lv = JsonConvert.DeserializeObject(File.ReadAllText("Json/" + path)); data.levelData.Merge(data_lv); i++; } catch (Exception ex) { //Logger.PrintError(ex.Message); Logger.PrintWarn("Missing levelData natural spawns file for scene " + data.mapIdStr + " path: " + path); } } levelDatas.Add(data); // Print("Loading " + data.id); } Logger.Print($"Loaded {levelDatas.Count} LevelData"); } public static int GetItemTemplateId(string item_id) { return strIdNumTable.item_id.dic[item_id]; } public class InteractiveData { public string id; public Dictionary propertyKeyToIdMap; } public class FactoryBuildingTable { public int bandwidth; public bool canDelete; public string id; public bool needPower; public int powerConsume; public FacBuildingType type; public FBuildingRange range; public FCNodeType GetNodeType() { string nodeTypeName = type.ToString(); if (Enum.TryParse(nodeTypeName, out FCNodeType fromName)) { return fromName; } return FCNodeType.Invalid; } public struct FBuildingRange { public int depth; public int height; public int width; public int x; public int y; public int z; } public enum FacBuildingType { Unknown = 0, Hub = 1, PowerPole = 2, PowerStation = 3, Storager = 4, Crafter = 5, MachineCrafter = 6, Workshop = 7, Miner = 8, Trader = 9, Loader = 10, Unloader = 11, Recycler = 12, Manufact = 13, Medic = 14, Soil = 15, TravelPole = 16, PowerTerminal = 17, PowerPort = 18, PowerGate = 19, Processor = 20, Battle = 21, SubHub = 22, PowerDiffuser = 23, FluidContainer = 24, FluidPumpIn = 25, FluidPumpOut = 26, FluidReaction = 27, FluidConsume = 28, FluidSpray = 29, VirtualFluidContainer = 30, Empty = 32 } } public class AdventureTaskTable { public int adventureBookStage; public string adventureTaskId; public string conditionId; public int conditionType; public string jumpSystemId; public int progressToCompare; public string rewardId; public int sortId; public TaskDescription taskDesc; public int taskType; } public class TaskDescription { public string Id; public string Text; } public class DungeonTable { public string dungeonId; public string sceneId; } public class EquipSuitTable { public List equipList; } public class BlocMissionTable { public string missionId; } public class ExpItemDataMap { public int expGain; } public class CharLevelUpTable { public int exp; public int gold; } public class GameMechanicTable { public string gameMechanicsId; public int difficulty; public string firstPassRewardId; } public class AttributeModifier { public AttributeType attrType; public double attrValue; public ModifierType modifierType; public int modifyAttributeType; } public class EquipTable { public string domainId; public string itemId; public ulong minWearLv; public int partType; public string suitID; public List displayAttrModifiers; public List attrModifiers; public AttributeModifier displayBaseAttrModifier; } public class WikiGroupTable { public List list; } public class WikiGroup { public string groupId; } public class SpaceShipCharBehaviourTable { public string charId; public string npcId; } public class SpaceshipRoomInsTable { public string id; public int roomType; } public class RewardTable { public string rewardId; public List itemBundles; public class ItemBundle { public int count; public string id; } } public class LevelShortIdTable { public string sceneName; public Dictionary ids; } public class GameSystemConfigTable { public int unlockSystemType; public string systemId; } public class FacSTTLayerTable { public string groupId; public string layerId; } public class FacSTTNodeTable { public string techId; public string groupId; public bool alreadyUnlock; public List uiPos; public int sortId; public string category; } public class LevelScene { public string id; public int idNum; public string mapIdStr; public bool isSeamless; public DefaultState defaultState=new(); public Vector3f playerInitPos; public Vector3f playerInitRot; public List levelDataPaths; [JsonIgnore] public LevelData levelData; //public List levelDataList; public class LevelData { public string sceneId=""; public int levelIdNum; public List enemies=new(); public List interactives = new(); public List npcs = new(); public List levelScripts = new(); public List worldWayPointSets = new(); public List factoryRegions = new(); public List spawners = new(); public void Merge(LevelData other) { this.sceneId = other.sceneId; this.levelIdNum = other.levelIdNum; this.enemies.AddRange(other.enemies); this.interactives.AddRange(other.interactives); this.npcs.AddRange(other.npcs); this.levelScripts.AddRange(other.levelScripts); this.worldWayPointSets.AddRange(other.worldWayPointSets); this.factoryRegions.AddRange(other.factoryRegions); this.spawners.AddRange(other.spawners); } public class WorldWayPointSets { public int id; public Dictionary pointIdToIndex = new(); } public class LevelSpawnerData { public ulong spawnerId; public string configId; public ulong belongLevelScriptId; } public class LevelScriptData { public ulong scriptId; public List properties = new(); public Dictionary propertyIdToKeyMap = new(); public ScriptActionMap actionMap = new(); public int GetPropertyId(string key, List toExclude) { foreach(var keyValuePair in propertyIdToKeyMap) { if(keyValuePair.Value == key && !toExclude.Contains(keyValuePair.Key)) { return keyValuePair.Key; } } return 0; } public class ScriptActionMap { public ActionDataMap dataMap = new(); public class ScriptHeader { public string _uid = ""; public EventKey _eventKey = new(); public class EventKey { public string constValue =""; } } public class ActionDataMap { public List headerList = new(); } } } public class LevelFactoryRegionData { public ulong levelLogicId; public ulong belongLevelScriptId; public ObjectType entityType; public string entityDataIdKey; public bool defaultHide; public Vector3f position; public Vector3f rotation; public Vector3f scale; public bool forceLoad; public string regionId; public List areas; public class LevelFactoryRegionAreaData { public List levelData; public class AreaDataLevel { public int level; public List levelBounds; public class AreaDataBound { public Vector3f start; public Vector3f size; } } } } public class LevelNpcData { public ulong levelLogicId; public ulong belongLevelScriptId; public ObjectType entityType; public string entityDataIdKey; public bool defaultHide; public Vector3f position; public Vector3f rotation; public Vector3f scale; public bool forceLoad; public bool doPatrol; public string npcGroupId; } public class LevelInteractiveData { public ulong levelLogicId; public ulong belongLevelScriptId; public ObjectType entityType; public string entityDataIdKey; public bool defaultHide; public Vector3f position; public Vector3f rotation; public Vector3f scale; public bool forceLoad; public int level; public int dependencyGroupId; public List properties; public Dictionary> componentProperties = new(); } public class ScriptProperty { public int RealType; public int ValueType; public List ValueStringList = new(); public List ValueFloatList = new(); public List ValueIntList = new(); public List ValueBoolList = new(); public ScriptProperty() { } public ScriptProperty(DynamicParameter p) { this.RealType = p.RealType; this.ValueType = p.ValueType; this.ValueBoolList.AddRange(p.ValueBoolList.ToList()); this.ValueFloatList.AddRange(p.ValueFloatList.ToList()); this.ValueIntList.AddRange(p.ValueIntList.ToList()); this.ValueStringList.AddRange(p.ValueStringList.ToList()); } public DynamicParameter ToProto() { return new DynamicParameter() { RealType = RealType, ValueType = ValueType, ValueStringList = { ValueStringList }, ValueBoolList = { ValueBoolList }, ValueFloatList = { ValueFloatList }, ValueIntList = { ValueIntList }, }; } } public class ParamKeyValue { public string key; public ParamValue value; public DynamicParameter ToProto() { DynamicParameter param = new() { RealType = (int)value.type, ValueType= (int)value.type, }; foreach(var val in value.valueArray) { switch (value.type) { case ParamRealType.LangKey: param.ValueStringList.Add(val.valueString); param.ValueType = (int)ParamValueType.String; break; case ParamRealType.LangKeyList: param.ValueStringList.Add(val.valueString); param.ValueType = (int)ParamValueType.StringList; break; case ParamRealType.String: param.ValueStringList.Add(val.valueString); param.ValueType = (int)ParamValueType.String; break; case ParamRealType.StringList: param.ValueStringList.Add(val.valueString); param.ValueType = (int)ParamValueType.StringList; break; case ParamRealType.Vector3: param.ValueFloatList.Add(val.ToFloat()); param.ValueType = (int)ParamValueType.FloatList; break; case ParamRealType.Float: param.ValueFloatList.Add(val.ToFloat()); param.ValueType = (int)ParamValueType.Float; break; case ParamRealType.FloatList: param.ValueFloatList.Add(val.ToFloat()); param.ValueType = (int)ParamValueType.FloatList; break; case ParamRealType.Int: param.ValueIntList.Add(val.valueBit64); param.ValueType = (int)ParamValueType.Int; break; case ParamRealType.IntList: param.ValueIntList.Add(val.valueBit64); param.ValueType = (int)ParamValueType.IntList; break; case ParamRealType.Bool: param.ValueBoolList.Add(val.valueBit64 == 1); param.ValueType = (int)ParamValueType.Bool; break; case ParamRealType.Vector3List: param.ValueFloatList.Add(val.ToFloat()); param.ValueType = (int)ParamValueType.FloatList; break; case ParamRealType.BoolList: param.ValueBoolList.Add(val.valueBit64 == 1); param.ValueType = (int)ParamValueType.BoolList; break; case ParamRealType.EntityPtr: param.ValueIntList.Add(val.valueBit64); param.ValueType = (int)ParamValueType.Int; break; case ParamRealType.EntityPtrList: param.ValueIntList.Add(val.valueBit64); param.ValueType = (int)ParamValueType.Int; break; case ParamRealType.UInt64: param.ValueIntList.Add(val.valueBit64); param.ValueType = (int)ParamValueType.Int; break; case ParamRealType.WaterVolumePtr: param.ValueIntList.Add(val.valueBit64); param.ValueType = (int)ParamValueType.Int; break; default: return null; break; } } return param; } public ScriptProperty ToScriptProperty() { ScriptProperty param = new() { RealType = (int)value.type, ValueType = (int)value.type, }; foreach (var val in value.valueArray) { switch (value.type) { case ParamRealType.LangKey: param.ValueStringList.Add(val.valueString); param.ValueType = (int)ParamValueType.String; break; case ParamRealType.LangKeyList: param.ValueStringList.Add(val.valueString); param.ValueType = (int)ParamValueType.StringList; break; case ParamRealType.String: param.ValueStringList.Add(val.valueString); param.ValueType = (int)ParamValueType.String; break; case ParamRealType.StringList: param.ValueStringList.Add(val.valueString); param.ValueType = (int)ParamValueType.StringList; break; case ParamRealType.Vector3: param.ValueFloatList.Add(val.ToFloat()); param.ValueType = (int)ParamValueType.FloatList; break; case ParamRealType.Float: param.ValueFloatList.Add(val.ToFloat()); param.ValueType = (int)ParamValueType.Float; break; case ParamRealType.FloatList: param.ValueFloatList.Add(val.ToFloat()); param.ValueType = (int)ParamValueType.FloatList; break; case ParamRealType.Int: param.ValueIntList.Add(val.valueBit64); param.ValueType = (int)ParamValueType.Int; break; case ParamRealType.IntList: param.ValueIntList.Add(val.valueBit64); param.ValueType = (int)ParamValueType.IntList; break; case ParamRealType.Bool: param.ValueBoolList.Add(val.valueBit64 == 1); param.ValueType = (int)ParamValueType.Bool; break; case ParamRealType.Vector3List: param.ValueFloatList.Add(val.ToFloat()); param.ValueType = (int)ParamValueType.FloatList; break; case ParamRealType.BoolList: param.ValueBoolList.Add(val.valueBit64 == 1); param.ValueType = (int)ParamValueType.BoolList; break; case ParamRealType.EntityPtr: param.ValueIntList.Add(val.valueBit64); param.ValueType = (int)ParamValueType.Int; break; case ParamRealType.EntityPtrList: param.ValueIntList.Add(val.valueBit64); param.ValueType = (int)ParamValueType.Int; break; case ParamRealType.UInt64: param.ValueIntList.Add(val.valueBit64); param.ValueType = (int)ParamValueType.Int; break; case ParamRealType.WaterVolumePtr: param.ValueIntList.Add(val.valueBit64); param.ValueType = (int)ParamValueType.Int; break; default: return null; break; } } return param; } public void Update(DynamicParameter value) { foreach (var item in value.ValueBoolList) { } } public class ParamValue { public ParamRealType type; public ParamValueAtom[] valueArray; } public class ParamValueAtom { public long valueBit64; public string valueString; public float ToFloat() { int intValueFromBit64 = (int)valueBit64; float floatValueFromBit64 = (float)BitConverter.Int64BitsToDouble(valueBit64); //float floatValueFromBit64 = BitConverter.ToSingle(BitConverter.GetBytes(intValueFromBit64), 0); return floatValueFromBit64; } public int ToInt() { int intValueFromBit64 = (int)valueBit64; return intValueFromBit64; } } } public class LevelEnemyData { public ulong levelLogicId; public ulong belongLevelScriptId; public ObjectType entityType; public string entityDataIdKey; public bool defaultHide; public Vector3f position; public Vector3f rotation; public Vector3f scale; public bool forceLoad; public int level; public string overrideAIConfig; public int enemyGroupId; public bool respawnable; } } } public class Vector3f { public float x; public float y; public float z; public Vector3f() { } public Vector3f(float x, float y, float z) { this.x = x; this.y = y; this.z = z; } public Vector3f(Vector v) : this() { this.x=v.X; this.y=v.Y; this.z=v.Z; } public Vector3f(ScdVec3Int v) { this.x = v.X; this.y = v.Y; this.z = v.Z; } public float Distance(Vector3f other) { float dx = x - other.x; float dy = y - other.y; float dz = z - other.z; return MathF.Sqrt(dx * dx + dy * dy + dz * dz); } public float DistanceXZ(Vector3f other) { float dx = x - other.x; float dy = 0; float dz = z - other.z; return MathF.Sqrt(dx * dx + dy * dy + dz * dz); } public ScdVec3Int ToProtoScd() { return new ScdVec3Int() { X = (int)x, Y = (int)y, Z = (int)z, }; } public Vector ToProto() { return new Vector() { X=x, Y=y, Z=z, }; } } public class DefaultState { public string sourceSceneName=""; public string exportedSceneConfigPath = ""; } public class SettlementBasicDataTable { public string settlementId; public string domainId; } public class GachaCharPoolTable { public string id; public List upCharIds; public int type; } public class GachaCharPoolTypeTable { public int type; public int hardGuarantee; public int softGuarantee; } public class GachaCharPoolContentTable { public List list; } public class GachaCharPoolItem { public string charId; public string isHardGuaranteeItem; public int starLevel; } public class DialogTextTable { } public class StrIdDic { public Dictionary dic; } public class SceneAreaTable { public string areaId; public string sceneId; public int areaIndex; } public class EnemyTable { public string attrTemplateId; public string enemyId; public string templateId; } public class ItemTable { public ItemValuableDepotType valuableTabType; public string id; public int maxStackCount; public bool backpackCanDiscard; public string modelKey; public int type; public ItemStorageSpace GetStorage() { return ResourceManager.itemTypeTable[type].storageSpace; } } public class WeaponBasicTable { public int weaponType; public string weaponId; public string levelTemplateId; } public class WeaponUpgradeTemplateTable { public List list; public class WeaponCurve { public float baseAtk; public ulong lvUpExp; public ulong lvUpGold; public ulong weaponLv; } } public class DomainDataTable { public string domainId; public int sortId; public List levelGroup; public List settlementGroup; } public class CollectionTable { public string prefabId; } public class CharBreakNodeTable { public int breakStage; public string nodeId; } public class EnemyAttributeTemplateTable { public string templateId; public List levelDependentAttributes; public AttributeList levelIndependentAttributes; } public class CharGrowthTable { public Dictionary talentNodeMap; public string defaultWeaponId; public class CharTalentNode { public string nodeId; public TalentNodeType nodeType; public List requiredItem; } } public class RequireItem { public string id; public int count; } public class Attributes { public int breakStage; public AttributeList Attribute; //Enemy public List attrs; } public class AttributeList { public List attrs; } public class Attribute { public int attrType; public double attrValue; } } }