]> git.deb.at Git - rhonda/impostor.git/commitdiff
Fixes #95 - Ignores GameData for the fake client
authorAeonLucid <aeonlucid@outlook.com>
Fri, 30 Oct 2020 18:19:51 +0000 (19:19 +0100)
committerAeonLucid <aeonlucid@outlook.com>
Fri, 30 Oct 2020 18:19:51 +0000 (19:19 +0100)
src/Impostor.Server/Net/State/Game.Data.cs

index eff155c0afcf4fbbf645271cf81c460e7fc8db53..f42280857cf7421fc199004dfbd5c0bb3b1e46a3 100644 (file)
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections.Generic;
 using System.Threading;
 using System.Threading.Tasks;
@@ -270,6 +270,13 @@ namespace Impostor.Server.Net.State
                             var innerNetObject = (InnerNetObject) ActivatorUtilities.CreateInstance(_serviceProvider, SpawnableObjects[objectId], this);
                             var ownerClientId = reader.ReadPackedInt32();
 
+                            // Prevent fake client from being broadcasted.
+                            // TODO: Remove message from stream properly.
+                            if (ownerClientId == FakeClientId)
+                            {
+                                return false;
+                            }
+
                             innerNetObject.SpawnFlags = (SpawnFlags) reader.ReadByte();
 
                             var components = innerNetObject.GetComponentsInChildren<InnerNetObject>();