public IActionResult AddItem([FromBody] IdItemStack aItem)
 {
     try
     {
         BackpackManager.Request_Player_AddItem(aItem);
         TaskWait.Delay(5, () => BackpackManager.Request_Player_Info(new Id(aItem.id)).Wait());
         return(Ok());
     }
     catch (Exception Error)
     {
         return(NotFound(Error.Message));
     }
 }
Пример #2
0
        public static void Request_Player_AddItem(IdItemStack 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_Player_AddItem,
                arg,
                wiredCallback,
                onError ?? noOpErrorHandler
                );

            Broker.Execute(apiCmd);
        }
Пример #3
0
 public async Task <bool> Request_Player_AddItem(IdItemStack arg, CancellationToken ct)
 {
     return(await Broker.SendRequestAsync(CmdId.Request_Player_AddItem, arg, ct));
 }
Пример #4
0
 public async Task <bool> Request_Player_AddItem(IdItemStack arg)
 {
     return(await Broker.SendRequestAsync(CmdId.Request_Player_AddItem, arg));
 }
Пример #5
0
 public void Request_Player_AddItem(IdItemStack arg, Action callback = null, Action <ErrorInfo> onError = null)
 {
     Broker.Request_Player_AddItem(arg, callback, onError);
 }
Пример #6
0
 public static Task <object> Request_Player_AddItem(IdItemStack param)
 {
     return(Broker.CreateCommandWithArgAndReturn <IdItemStack, object>(CmdId.Request_Player_AddItem, param));
 }
Пример #7
0
 public static Task <object> Request_Player_AddItem(IdItemStack param, Action callback, Action <ErrorInfo> onError = null)
 {
     return(Broker.CreateCommandWithArgAndReturn <IdItemStack, object>(CmdId.Request_Player_AddItem, param, callback, onError));
 }