The host can send chat messages, fixed client not being passed to ServerRead methods

This commit is contained in:
Regalis
2016-12-09 16:45:08 +02:00
parent e4744e8385
commit bea523187b
4 changed files with 21 additions and 6 deletions

View File

@@ -52,7 +52,7 @@ namespace Barotrauma.Networking
/// <summary>
/// Read the events from the message, ignoring ones we've already received
/// </summary>
protected void Read(NetIncomingMessage msg, float sendingTime, ref UInt32 lastReceivedID)
protected void Read(NetIncomingMessage msg, float sendingTime, ref UInt32 lastReceivedID, Client sender = null)
{
UInt32 firstEventID = msg.ReadUInt32();
int eventCount = msg.ReadByte();
@@ -75,7 +75,7 @@ namespace Barotrauma.Networking
{
DebugConsole.NewMessage("received msg "+thisEventID, Microsoft.Xna.Framework.Color.Green);
lastReceivedID++;
ReadEvent(msg, entity, sendingTime);
ReadEvent(msg, entity, sendingTime, sender);
}
msg.ReadPadBits();
}

View File

@@ -12,10 +12,14 @@ namespace Barotrauma.Networking
private List<ServerEntityEvent> events;
private UInt32 ID;
private GameServer server;
public ServerEntityEventManager(GameServer server)
{
events = new List<ServerEntityEvent>();
this.server = server;
}
public void CreateEvent(IServerSerializable entity, object[] extraData = null)
@@ -91,7 +95,7 @@ namespace Barotrauma.Networking
public void Read(NetIncomingMessage msg, Client client)
{
base.Read(msg, 0.0f, ref client.lastSentEntityEventID);
base.Read(msg, 0.0f, ref client.lastSentEntityEventID, client);
}
public void Clear()