Exemple #1
0
        public static void RelayMessageFromClientToAnotherPlayer(long targetID, params object[] message)
        {
            var objectsList = new List <object>()
            {
                (int)MessageTypes.RELAY_MESSAGE_TO_ANOTHER_PLAYER, targetID
            };

            objectsList.AddRange(message);

            var relayMessage = new StardewValley.Network.OutgoingMessage(uniqueMessageType, Game1.player, objectsList.ToArray());

            if (Game1.IsServer)
            {
                throw new Exception("Server should not be sending relay instructions");
            }
            else
            {
                Game1.client.sendMessage(relayMessage);
            }
        }
Exemple #2
0
 public abstract void sendMessage(OutgoingMessage message);
 public OutgoingMessage(IncomingMessage message)
 {
     this = new OutgoingMessage(message.MessageType, message.FarmerID, message.Data);
 }
Exemple #4
0
 public abstract void sendMessage(long peerId, OutgoingMessage message);
 public OutgoingMessage(byte messageType, Farmer sourceFarmer, params object[] data)
 {
     this = new OutgoingMessage(messageType, sourceFarmer.UniqueMultiplayerID, data);
 }