private void Broker_Event_Playfield_Loaded(PlayfieldLoad obj)
        {
            _nlog.Trace($"Broker_Event_Playfield_Loaded Raised => PlayfieldLoad := \"{obj.playfield}\"");


            //broker.api.Game_Request(CmdId.Request_InGameMessage_SinglePlayer, )
        }
        private void ProcessEvent_Playfield_Unloaded(PlayfieldLoad obj)
        {
            DebugLog("Event_Playfield_Unloaded - Playfield {0} unloaded pid={1}", obj.playfield, obj.processId);

            //lock (_playfieldsByName)
            //{
            //    // TODO: update playfields with info
            //}
        }
 public void HandlePlayfieldUnloaded(PlayfieldLoad playfieldLoad)
 {
     ThreadPool.QueueUserWorkItem(o =>
     {
         try
         {
             _playfieldUnloadedCallback?.Invoke(playfieldLoad);
         }
         catch (Exception ex)
         {
             LogMessage("Error Calling PlayfieldUnloadedCallback: " + ex);
         }
     });
 }
示例#4
0
        public static void Request_Load_Playfield(PlayfieldLoad arg, Action callback = null, Action <ErrorInfo> onError = null)
        {
            Action <CmdId, object> wiredCallback = null;

            if (callback != null)
            {
                wiredCallback = (_, val) => callback();
            }

            var apiCmd = new GenericAPICommand(
                CmdId.Request_Load_Playfield,
                arg,
                wiredCallback,
                onError ?? noOpErrorHandler
                );

            Broker.Execute(apiCmd);
        }
        private void ProcessEvent_Playfield_Loaded(PlayfieldLoad playfieldLoadData)
        {
            DebugLog("Event_Playfield_Loaded - Playfield {0} loaded pid={1}", playfieldLoadData.playfield, playfieldLoadData.processId);

            lock (_playfieldsByName)
            {
                var playfield = GetPlayfield(playfieldLoadData.playfield);
                playfield.UpdateInfo(playfieldLoadData);

                if (Event_Playfield_Loaded != null)
                {
                    SendRequest <Eleon.Modding.GlobalStructureList>(Eleon.Modding.CmdId.Request_GlobalStructure_Update, new Eleon.Modding.PString(playfieldLoadData.playfield))
                    .ContinueWith((task) =>
                    {
                        playfield.UpdateInfo(task.Result);

                        // call event only after structures have been updated.
                        Event_Playfield_Loaded?.Invoke(playfield);
                    });
                }
            }
        }
 public Task RequestPlayfieldLoad(PlayfieldLoad playfieldLoad)
 {
     // PlayfieldLoad (sec = empty playfield hold time, processId not used)
     return(SendRequest(Eleon.Modding.CmdId.Request_Load_Playfield, playfieldLoad));
 }
示例#7
0
 public async Task <bool> Request_Load_Playfield(PlayfieldLoad arg, CancellationToken ct)
 {
     return(await Broker.SendRequestAsync(CmdId.Request_Load_Playfield, arg, ct));
 }
示例#8
0
 public async Task <bool> Request_Load_Playfield(PlayfieldLoad arg)
 {
     return(await Broker.SendRequestAsync(CmdId.Request_Load_Playfield, arg));
 }
示例#9
0
 public void Request_Load_Playfield(PlayfieldLoad arg, Action callback = null, Action <ErrorInfo> onError = null)
 {
     Broker.Request_Load_Playfield(arg, callback, onError);
 }
示例#10
0
 public static Task <object> Request_Load_Playfield(PlayfieldLoad param)
 {
     return(Broker.CreateCommandWithArgAndReturn <PlayfieldLoad, object>(CmdId.Request_Load_Playfield, param));
 }
示例#11
0
 public static Task <object> Request_Load_Playfield(PlayfieldLoad param, Action callback, Action <ErrorInfo> onError = null)
 {
     return(Broker.CreateCommandWithArgAndReturn <PlayfieldLoad, object>(CmdId.Request_Load_Playfield, param, callback, onError));
 }