예제 #1
0
 /// <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();
     }
 }
예제 #2
0
        /// <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);
        }