| @@ -474,7 +474,7 @@ namespace Gaming | |||||
| var gameObjList = new List<IGameObj>(); | var gameObjList = new List<IGameObj>(); | ||||
| foreach (var keyValuePair in gameMap.GameObjDict) | foreach (var keyValuePair in gameMap.GameObjDict) | ||||
| { | { | ||||
| if (!GameData.IsMap(keyValuePair.Key)) | |||||
| if (GameData.NeedCopy(keyValuePair.Key)) | |||||
| { | { | ||||
| gameMap.GameObjLockDict[keyValuePair.Key].EnterReadLock(); | gameMap.GameObjLockDict[keyValuePair.Key].EnterReadLock(); | ||||
| try | try | ||||
| @@ -27,10 +27,13 @@ namespace Preparation.Utility | |||||
| public const int numOfGenerator = 9; | public const int numOfGenerator = 9; | ||||
| public const int numOfChest = 8; | public const int numOfChest = 8; | ||||
| private const int numOfObjNotMap = 5; | |||||
| public static bool IsMap(GameObjType gameObjType) | public static bool IsMap(GameObjType gameObjType) | ||||
| { | { | ||||
| return (uint)gameObjType > numOfObjNotMap; | |||||
| return (uint)gameObjType > 5; | |||||
| } | |||||
| public static bool NeedCopy(GameObjType gameObjType) | |||||
| { | |||||
| return gameObjType != GameObjType.Null && gameObjType != GameObjType.Grass && gameObjType != GameObjType.OutOfBoundBlock && gameObjType != GameObjType.Window && gameObjType != GameObjType.Wall; | |||||
| } | } | ||||
| public static XY GetCellCenterPos(int x, int y) // 求格子的中心坐标 | public static XY GetCellCenterPos(int x, int y) // 求格子的中心坐标 | ||||
| @@ -90,7 +90,6 @@ namespace Server | |||||
| } | } | ||||
| } | } | ||||
| public static Protobuf.PlayerState ToPlayerState(Preparation.Utility.PlayerStateType playerState) | public static Protobuf.PlayerState ToPlayerState(Preparation.Utility.PlayerStateType playerState) | ||||
| { | { | ||||
| switch (playerState) | switch (playerState) | ||||
| @@ -238,10 +237,10 @@ namespace Server | |||||
| case Preparation.Utility.GameObjType.EmergencyExit: | case Preparation.Utility.GameObjType.EmergencyExit: | ||||
| if (((EmergencyExit)gameObj).CanOpen) | if (((EmergencyExit)gameObj).CanOpen) | ||||
| return HiddenGate((EmergencyExit)gameObj); | return HiddenGate((EmergencyExit)gameObj); | ||||
| else return null; | |||||
| else return new MessageOfObj(); | |||||
| case Preparation.Utility.GameObjType.Door: | case Preparation.Utility.GameObjType.Door: | ||||
| return Door((Door)gameObj); | return Door((Door)gameObj); | ||||
| default: return null; | |||||
| default: return new MessageOfObj(); | |||||
| } | } | ||||
| } | } | ||||
| public static MessageOfObj? Auto(MessageOfNews news) | public static MessageOfObj? Auto(MessageOfNews news) | ||||