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)); } }
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); }
public async Task <bool> Request_Player_AddItem(IdItemStack arg, CancellationToken ct) { return(await Broker.SendRequestAsync(CmdId.Request_Player_AddItem, arg, ct)); }
public async Task <bool> Request_Player_AddItem(IdItemStack arg) { return(await Broker.SendRequestAsync(CmdId.Request_Player_AddItem, arg)); }
public void Request_Player_AddItem(IdItemStack arg, Action callback = null, Action <ErrorInfo> onError = null) { Broker.Request_Player_AddItem(arg, callback, onError); }
public static Task <object> Request_Player_AddItem(IdItemStack param) { return(Broker.CreateCommandWithArgAndReturn <IdItemStack, object>(CmdId.Request_Player_AddItem, param)); }
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)); }