private void PushClientConnected(ClientAssigned p) { NetworkLogger.Log("Client connection finalized", LogCategory.Connections); PayloadHandler.RemoveCallback <ClientAssigned>(PushClientConnected); if (ClientManager.TryGetClient(p.id, out var client)) { PayloadHandler.PushPayload(new ClientConnected { Client = client }); } }
/// <summary> /// Remove a function from being invoked when a payload of a certain type is received. /// </summary> /// <typeparam name="T">The payload type being listened for</typeparam> /// <param name="c">The method to remove</param> public void RemoveCallback <T>(FlarePayloadCallback <T> c) where T : INetworkPayload => PayloadHandler.RemoveCallback(c);