コード例 #1
0
 public InputOutputForm(IServerAPI api)
 {
     InitializeComponent();
     this.api = api;
      // uxSendButton.Click += api.SendMessageToChat("hi", 0);
      //  uxLoginStrip.Click += api.LogIn(" ", " ");
 }
コード例 #2
0
        //public IStateData State => _state;
        //public IStaticData Static => _static;
        //public ICommands Commands { get; }
        //public ILogicAPI Logic => _additionalLogics;
        //public IClientLogicContext Context => this;
        //public IChangesApplier ChangesApplier => _changeStorage;

        //private InternalAccessors _accessors;
        //private InternalModules _modules;
        //private InternalAdditionalLogics _additionalLogics;

        public InternalContext(LogicInitData data, IServerAPI api)
        {
            //    var factory = new Internal_IStateFactory();
            //    _accessors = new InternalAccessors(Data, factory);
            //    _additionalLogics = new InternalAdditionalLogics(_accessors, _changeStorage, Data, api);
            //    _modules = new InternalModules(_accessors, _additionalLogics, Data, api);
            //    Commands = new InternalCommands(_modules, _changeStorage, data);
            //}

            //public void InitData(string clientState, string staticData)
            //{
            //     _static = _serializator.Deserialize<Internal_StaticData>(staticData);
            //    _static.PostSerialize();
            //    _accessors.SetStaticData(_static);
            //    _additionalLogics.PostInit();

            //    _state = _serializator.Deserialize<Internal_StateData>(clientState);
            //    _state.InitData(_changeStorage, _accessors);
            //    _accessors.SetStateData(_state);
            //}

            //public IStaticData GetStaticData(string staticData)
            //{
            //    _static = _serializator.Deserialize<Internal_StaticData>(staticData);
            //    _static.PostSerialize();
            //    return _static;
            //}

            //public string Save()
            //{
            //    _state.PreSave();
            //    return _serializator.Serialize(_state);
            //}
        }
コード例 #3
0
 public InputOutputForm(IServerAPI api)
 {
     InitializeComponent();
     this.api = api;
     // uxSendButton.Click += api.SendMessageToChat("hi", 0);
     //  uxLoginStrip.Click += api.LogIn(" ", " ");
 }
コード例 #4
0
 public EmulateContext(LogicInitData data, IServerAPI api)/* : base(data, true)*/
 {
     //var factory = new Emulate_IStateFactory(new Internal_IStateFactory(), _changeStorage);
     //_accessors = new InternalAccessors(Data, factory);
     //_additionalLogics = new InternalAdditionalLogics(_accessors, _changeStorage, Data, api);
     //_modules = new InternalModules(_accessors, _additionalLogics, Data, api);
     //Commands = new EmulateCommands(_modules, data);
     //_state = new Emulate_StateData();
 }
コード例 #5
0
    private GameServer()
    {
        // 做初使化的動作
#if CLIENT
        ServerAPI = new ClientAPI();
#endif
        InitData();
        ServerAPI.InitData();
    }
コード例 #6
0
 public IServerAPIToJSON(IServerAPI Server)
 {
     Config          = Server.Config;
     CurrentRunPhase = Server.CurrentRunPhase.ToString();
     IsDedicated     = Server.IsDedicated;
     IsShuttingDown  = Server.IsShuttingDown;
     Players         = new IServerPlayerToJSON[Server.Players.Length];
     for (var i = 0; i < Server.Players.Length; i++)
     {
         Players[i] = new IServerPlayerToJSON(Server.Players[i]);
     }
     ServerUptimeMilliseconds = Server.ServerUptimeMilliseconds;
     ServerUptimeSeconds      = Server.ServerUptimeSeconds;
     TotalReceivedBytes       = Server.TotalReceivedBytes;
     TotalSentBytes           = Server.TotalSentBytes;
     TotalWorldPlayTime       = Server.TotalWorldPlayTime;
 }
コード例 #7
0
 public GOLAPIService(IServerAPI serverAPI)
 {
     _serverAPI = serverAPI;
 }
コード例 #8
0
 public InternalModules(InternalAccessors accessors, InternalAdditionalLogics additionalLogics, LogicData data, IServerAPI api)
 {
     AchievementModule      = AchievementModule.CreateClient(accessors.AchievementAccessor, additionalLogics.ScorersLogic, additionalLogics.DropLogic, accessors.FormulaController, additionalLogics.ImpactController);
     ActivationModule       = ActivationModule.CreateClient(accessors.FormulaController, additionalLogics.ImpactController, accessors.ExplorerAccessor, accessors.ScorersAccessor, accessors.PlayerAccessor, accessors.UnitsAccessor, additionalLogics.ApplyChangeLogic);
     AutowinModule          = AutowinModule.CreateClient(additionalLogics.ImpactController, accessors.ExplorerAccessor, accessors.ScorersAccessor, additionalLogics.FormulaLogic, additionalLogics.ExplorerLogic);
     BattleModule           = BattleModule.CreateClient(accessors.BattleAccessor, accessors.ExplorerAccessor, accessors.UnitsAccessor, additionalLogics.ContextLogic, additionalLogics.ImpactController, additionalLogics.TriggerLogic, additionalLogics.BattleLogic, additionalLogics.BuffLogic);
     CheatModule            = CheatModule.CreateClient(accessors.UnitsAccessor, accessors.ScorersAccessor, accessors.BattleAccessor, accessors.InventoryAccessor, accessors.PlayerAccessor, accessors.ExplorerAccessor, accessors.LogAccessor, accessors.SettingsAccessor, additionalLogics.ExplorerLogic, additionalLogics.BattleLogic, additionalLogics.ContextLogic, additionalLogics.ImpactController, additionalLogics.DropLogic, additionalLogics.ScorersLogic);
     CutSceneModule         = CutSceneModule.CreateClient(accessors.CutSceneAccessor, additionalLogics.ImpactController, additionalLogics.ApplyChangeLogic);
     EquipmentModule        = EquipmentModule.CreateClient(accessors.InventoryAccessor, accessors.ScorersAccessor, accessors.UnitsAccessor, additionalLogics.ImpactController, additionalLogics.FormulaLogic);
     ExplorerProgressModule = ExplorerProgressModule.CreateClient(accessors.ExplorerAccessor, accessors.InventoryAccessor, accessors.UnitsAccessor, accessors.SettingsAccessor, accessors.ScorersAccessor, accessors.BattleAccessor, additionalLogics.ExplorerLogic, additionalLogics.FormulaLogic, additionalLogics.ImpactController);
     GachaModule            = GachaModule.CreateClient(additionalLogics.ImpactController, accessors.ScorersAccessor, accessors.InventoryAccessor, accessors.UnitsAccessor, accessors.ExplorerAccessor, additionalLogics.DropLogic, accessors.ConditionController, additionalLogics.FormulaLogic);
     SettingsModule         = SettingsModule.CreateClient(accessors.SettingsAccessor, accessors.ScorersAccessor, additionalLogics.ImpactController);
     ShopModule             = ShopModule.CreateClient(accessors.ScorersAccessor, accessors.ShopAccessor, additionalLogics.FormulaLogic, additionalLogics.ImpactController, additionalLogics.ShopLogic, additionalLogics.DropLogic);
     StartSessionModule     = StartSessionModule.CreateClient(accessors.UnitsAccessor, accessors.ScorersAccessor, accessors.BattleAccessor, accessors.InventoryAccessor, accessors.PlayerAccessor, accessors.ExplorerAccessor, accessors.LogAccessor, accessors.SettingsAccessor, accessors.ShopAccessor, accessors.LogAccessor, accessors.AchievementAccessor, additionalLogics.BattleLogic, additionalLogics.ShopLogic, additionalLogics.ExplorerLogic, accessors.FormulaController, additionalLogics.ImpactController);
     StorageModule          = StorageModule.CreateClient(accessors.ScorersAccessor, accessors.InventoryAccessor);
     UnitProgressModule     = UnitProgressModule.CreateClient(accessors.UnitsAccessor, accessors.ScorersAccessor, accessors.BattleAccessor, additionalLogics.FormulaLogic, accessors.PlayerAccessor, additionalLogics.ImpactController);
 }
コード例 #9
0
 public InternalAdditionalLogics(InternalAccessors accessors, IApplyManager storage, LogicData data, IServerAPI api)
 {
     ImpactController = new ImpactController(data.IsEmulate);
     ContextLogic     = ContextLogic.CreateClient(accessors.BattleAccessor, accessors.UnitsAccessor);
     DropLogic        = DropLogic.CreateClient(accessors.ScorersAccessor, accessors.InventoryAccessor, accessors.UnitsAccessor, accessors.ExplorerAccessor, accessors.FormulaController, ImpactController);
     ScorersLogic     = ScorersLogic.CreateClient(accessors.BattleAccessor, accessors.ScorersAccessor, accessors.ExplorerAccessor);
     ShopLogic        = ShopLogic.CreateClient(accessors.SettingsAccessor, accessors.ShopAccessor, accessors.FormulaController);
     ApplyChangeLogic = ApplyChangeLogic.CreateClient(storage, ContextLogic);
     FormulaLogic     = FormulaLogic.CreateClient(ContextLogic, accessors.ScorersAccessor, accessors.UnitsAccessor, accessors.BattleAccessor, accessors.ExplorerAccessor, data, accessors.PlayerAccessor, accessors.SettingsAccessor, accessors.ConditionController, accessors.FormulaController, ScorersLogic);
     BuffLogic        = BuffLogic.CreateClient(accessors.BattleAccessor, ContextLogic, ApplyChangeLogic);
     ExplorerLogic    = ExplorerLogic.CreateClient(accessors.ScorersAccessor, accessors.ExplorerAccessor, accessors.UnitsAccessor, accessors.FormulaController, ScorersLogic, ContextLogic, DropLogic, ImpactController);
     TriggerLogic     = TriggerLogic.CreateClient(accessors.BattleAccessor, FormulaLogic);
     ConditionLogic   = ConditionLogic.CreateClient(accessors.InventoryAccessor, accessors.ScorersAccessor, accessors.PlayerAccessor, accessors.UnitsAccessor, accessors.BattleAccessor, accessors.ExplorerAccessor, accessors.SettingsAccessor, accessors.AchievementAccessor, FormulaLogic, ContextLogic, ScorersLogic, data, accessors.ConditionController);
     BattleLogic      = BattleLogic.CreateClient(ApplyChangeLogic, ContextLogic, ConditionLogic, accessors.FormulaController, accessors.BattleAccessor, accessors.ScorersAccessor, accessors.UnitsAccessor, accessors.ExplorerAccessor, accessors.SettingsAccessor);
     ImpactLogic      = ImpactLogic.CreateClient(accessors.ScorersAccessor, accessors.PlayerAccessor, accessors.InventoryAccessor, accessors.ExplorerAccessor, accessors.UnitsAccessor, accessors.BattleAccessor, accessors.SettingsAccessor, accessors.AchievementAccessor, BattleLogic, FormulaLogic, accessors.ConditionController, ApplyChangeLogic, BuffLogic, ScorersLogic, ContextLogic, ImpactController, data);
 }
コード例 #10
0
 public static IEmulateLogicFacade CreateEmulate(LogicInitData data, IServerAPI api)
 {
     return(new EmulateContext(data, api));
 }
コード例 #11
0
 public static IClientLogicFacade Create(LogicInitData data, IServerAPI api)
 {
     return(new InternalContext(data, api));
 }