public override void sendMessage(byte which, object[] data) { NetOutgoingMessage netOutgoingMessage = this.client.CreateMessage(); MultiplayerUtility.writeData(netOutgoingMessage, which, data); this.client.SendMessage(netOutgoingMessage, NetDeliveryMethod.ReliableOrdered); }
public override void sendMessages(GameTime time) { LidgrenServer.messageSendCounter -= time.ElapsedGameTime.Milliseconds; if (LidgrenServer.messageSendCounter >= 0) { return; } LidgrenServer.messageSendCounter = 50; foreach (NetConnection connection in this.server.Connections) { if (Game1.otherFarmers.ContainsKey(connection.RemoteUniqueIdentifier) && Game1.otherFarmers[connection.RemoteUniqueIdentifier].multiplayerMessage.Count > 0) { NetOutgoingMessage message = this.server.CreateMessage(); for (int index = 0; index < Game1.otherFarmers[connection.RemoteUniqueIdentifier].multiplayerMessage.Count; ++index) { MultiplayerUtility.writeData(message, (byte)Game1.otherFarmers[connection.RemoteUniqueIdentifier].multiplayerMessage[index][0], ((IEnumerable <object>)Game1.otherFarmers[connection.RemoteUniqueIdentifier].multiplayerMessage[index]).Skip <object>(1).ToArray <object>()); } int num = (int)this.server.SendMessage(message, connection, NetDeliveryMethod.ReliableOrdered); } } foreach (KeyValuePair <long, Farmer> otherFarmer in Game1.otherFarmers) { otherFarmer.Value.multiplayerMessage.Clear(); } }
// Token: 0x06000B41 RID: 2881 RVA: 0x000E4388 File Offset: 0x000E2588 public override void sendMessages(GameTime time) { LidgrenServer.messageSendCounter -= time.ElapsedGameTime.Milliseconds; if (LidgrenServer.messageSendCounter < 0) { LidgrenServer.messageSendCounter = 50; foreach (NetConnection player in this.server.Connections) { if (Game1.otherFarmers.ContainsKey(player.RemoteUniqueIdentifier) && Game1.otherFarmers[player.RemoteUniqueIdentifier].multiplayerMessage.Count > 0) { NetOutgoingMessage msg = this.server.CreateMessage(); for (int i = 0; i < Game1.otherFarmers[player.RemoteUniqueIdentifier].multiplayerMessage.Count; i++) { MultiplayerUtility.writeData(msg, (byte)Game1.otherFarmers[player.RemoteUniqueIdentifier].multiplayerMessage[i][0], Game1.otherFarmers[player.RemoteUniqueIdentifier].multiplayerMessage[i].Skip(1).ToArray <object>()); } this.server.SendMessage(msg, player, NetDeliveryMethod.ReliableOrdered); } } foreach (KeyValuePair <long, Farmer> v in Game1.otherFarmers) { v.Value.multiplayerMessage.Clear(); } } }