/// <summary> /// Sends an entity action to be executed on the server /// </summary> public static void SendEntityActionToServer(ServerBlockActions actionID, long entID, Action <byte[]> callback = null, bool uniqueCallback = true) { int callbackID = -1; if ((actionID & ServerBlockActions.RequireReply) == ServerBlockActions.RequireReply) { if (callback != null) { callbackID = instance.callbackManager.RegisterCallback(callback, uniqueCallback); if (callbackID == -1) { return; } } else { throw new Exception($"Callback missing for {actionID}"); } } instance.clientOutgoing.Add(new ClientMessage(actionID, callbackID, entID)); }
public ClientMessage(ServerBlockActions actionID, int callbackID, long entID) { this.actionID = (ulong)actionID; this.callbackID = callbackID; this.entID = entID; }