Removed Fill/ReadNetworkData

These functions needed to be replaced because they rely heavily on reliability.

Instead, new functions called (Write/Read)Data(Server/Client) will be added. 

Separating client and server code into completely separate functions will help ensure that proper security checks are performed.
This commit is contained in:
juanjp600
2016-08-29 20:02:46 -03:00
parent a00ceb5b9f
commit af220dbc2a
28 changed files with 29 additions and 2297 deletions

View File

@@ -92,31 +92,7 @@ namespace Barotrauma
dictionary.Add(id, this);
}
/// <summary>
/// Writes the state of the entity into the message
/// </summary>
/// <param name="data">some data that was saved when the networkevent was created</param>
/// <returns>false if something went wrong when filling the message, true if the msg is ready to be sent</returns>
public virtual bool FillNetworkData(NetworkEventType type, NetBuffer message, object data)
{
return false;
}
/// <summary>
/// Updates the state of the entity based on the data in the message
/// </summary>
/// <param name="sendingTime"></param>
/// <param name="data"></param>
/// <returns>false if the message is not valid (client trying to change something they're not authorized to, corrupt data, etc) and should be ignored</returns>
public virtual bool ReadNetworkData(NetworkEventType type, NetIncomingMessage message, float sendingTime, out object data)
{
data = null;
return false;
}
/// <summary>
/// Find an entity based on the ID
/// </summary>