A few more security checks

This commit is contained in:
juanjp600
2016-08-29 18:38:06 -03:00
parent 8a3b901fa2
commit bf686ae997
4 changed files with 10 additions and 6 deletions

View File

@@ -528,6 +528,8 @@ namespace Barotrauma
public override void ReadNetworkData(NetIncomingMessage message)
{
if (GameMain.Server != null) return;
AiState newState = AiState.None;
Vector2 newWallAttackPos = Vector2.Zero;
float wanderAngle;

View File

@@ -670,6 +670,8 @@ namespace Barotrauma.Items.Components
public override void ReadNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetIncomingMessage message, float sendingTime)
{
if (GameMain.Server != null) return;
bool isDocked = message.ReadBoolean();
if (isDocked)

View File

@@ -487,9 +487,9 @@ namespace Barotrauma.Items.Components
public override void ReadNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetIncomingMessage message, float sendingTime)
{
if (sendingTime < lastReceivedMessage) return;
if (GameMain.Server != null)
{
return;
if (GameMain.Server != null)
{
return;
}
lastReceivedMessage = sendingTime;

View File

@@ -337,8 +337,8 @@ namespace Barotrauma.Networking
var outmsg = client.CreateMessage();
string saltedPw = password;
saltedPw = saltedPw + Convert.ToString(nonce);
string saltedPw = password;
saltedPw = saltedPw + Convert.ToString(nonce);
saltedPw = Encoding.UTF8.GetString(NetUtility.ComputeSHAHash(Encoding.UTF8.GetBytes(saltedPw)));
NetEncryption algo = new NetXtea(client, saltedPw);
outmsg.Write((byte)PacketTypes.Login);
@@ -832,7 +832,7 @@ namespace Barotrauma.Networking
}
public bool HasPermission(ClientPermissions permission)
{
{
return false;// permissions.HasFlag(permission);
}