/// <summary> /// Sends bytes to targets, calls RecieveCommand on them /// </summary> /// <param name="bytearray">Bytes to send</param> /// <param name="target">Choose between possible recievers</param> public static void SendCommand(byte[] bytearray, GlobalTargets target) { if (BoltNetwork.isRunning) { ChatEvent chatEvent = ChatEvent.Create(target); chatEvent.Message = BytesToString(bytearray); chatEvent.Sender = NetworkConfig.ModNetworkID; chatEvent.Send(); } }
/// <summary> /// Sends the given <paramref name="message"/> to the given <see cref="GlobalTargets"/> /// </summary> /// <param name="message"></param> /// <param name="targets"></param> public static void SendToAllClients(string message, GlobalTargets targets) { GenericStringForModdingEvent genericStringForModdingEvent = GenericStringForModdingEvent.Create(targets); sendEvent(genericStringForModdingEvent, message); }