using System; using System.Collections.Generic; using System.IO; namespace ET.Server { [Invoke] public class GetAllConfigBytes: AInvokeHandler> { public override Dictionary Handle(ConfigComponent.GetAllConfigBytes args) { Dictionary output = new Dictionary(); List startConfigs = new List() { "StartMachineConfigCategory", "StartProcessConfigCategory", "StartSceneConfigCategory", "StartZoneConfigCategory", }; HashSet configTypes = EventSystem.Instance.GetTypes(typeof (ConfigAttribute)); foreach (Type configType in configTypes) { string configFilePath; if (startConfigs.Contains(configType.Name)) { configFilePath = $"../Config/GenFromExcel/s/{Options.Instance.StartConfig}/{configType.Name}.bytes"; } else { configFilePath = $"../Config/GenFromExcel/s/{configType.Name}.bytes"; } output[configType] = File.ReadAllBytes(configFilePath); } return output; } } [Invoke] public class GetOneConfigBytes: AInvokeHandler { public override byte[] Handle(ConfigComponent.GetOneConfigBytes args) { byte[] configBytes = File.ReadAllBytes($"../Config/GenFromExcel/{args.ConfigName}.bytes"); return configBytes; } } }