| @@ -61,7 +61,9 @@ A: | |||||
| 2. 不要点重新生成,要点生成 | 2. 不要点重新生成,要点生成 | ||||
| 3. 开启下图选项 | 3. 开启下图选项 | ||||
|  |  | ||||
| Q:这是什么错误啊 | |||||
|  | |||||
| ## Python | ## Python | ||||
| @@ -232,14 +232,14 @@ namespace GameClass.GameObj | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| if (ToDel != null) | |||||
| GameObjDict[gameObj.Type].Remove(ToDel); | |||||
| } | } | ||||
| finally | finally | ||||
| { | { | ||||
| GameObjLockDict[gameObj.Type].ExitWriteLock(); | GameObjLockDict[gameObj.Type].ExitWriteLock(); | ||||
| } | } | ||||
| if (ToDel == null) return false; | |||||
| GameObjDict[gameObj.Type].Remove(ToDel); | |||||
| return true; | |||||
| return ToDel != null; | |||||
| } | } | ||||
| public bool RemoveJustFromMap(GameObj gameObj) | public bool RemoveJustFromMap(GameObj gameObj) | ||||
| { | { | ||||
| @@ -147,14 +147,16 @@ namespace GameEngine | |||||
| isDestroyed = true; | isDestroyed = true; | ||||
| return false; | return false; | ||||
| case AfterCollision.MoveMax: | case AfterCollision.MoveMax: | ||||
| MoveMax(obj, res); | |||||
| if (threadNum == 0 || ((ICharacter)obj).ThreadNum == threadNum) | |||||
| MoveMax(obj, res); | |||||
| moveVecLength = 0; | moveVecLength = 0; | ||||
| res = new XY(direction, moveVecLength); | res = new XY(direction, moveVecLength); | ||||
| break; | break; | ||||
| } | } | ||||
| } while (flag); | } while (flag); | ||||
| deltaLen += moveVecLength - Math.Sqrt(obj.MovingSetPos(res, GetPlaceType(obj.Position + res))); | |||||
| if (threadNum == 0 || ((ICharacter)obj).ThreadNum == threadNum) | |||||
| deltaLen += moveVecLength - Math.Sqrt(obj.MovingSetPos(res, GetPlaceType(obj.Position + res))); | |||||
| return true; | return true; | ||||
| }, | }, | ||||
| @@ -172,7 +174,8 @@ namespace GameEngine | |||||
| res = new XY(direction, moveVecLength); | res = new XY(direction, moveVecLength); | ||||
| if ((collisionObj = collisionChecker.CheckCollisionWhenMoving(obj, res)) == null) | if ((collisionObj = collisionChecker.CheckCollisionWhenMoving(obj, res)) == null) | ||||
| { | { | ||||
| obj.MovingSetPos(res, GetPlaceType(obj.Position + res)); | |||||
| if (threadNum == 0 || ((ICharacter)obj).ThreadNum == threadNum) | |||||
| obj.MovingSetPos(res, GetPlaceType(obj.Position + res)); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -186,7 +189,8 @@ namespace GameEngine | |||||
| isDestroyed = true; | isDestroyed = true; | ||||
| break; | break; | ||||
| case AfterCollision.MoveMax: | case AfterCollision.MoveMax: | ||||
| MoveMax(obj, res); | |||||
| if (threadNum == 0 || ((ICharacter)obj).ThreadNum == threadNum) | |||||
| MoveMax(obj, res); | |||||
| moveVecLength = 0; | moveVecLength = 0; | ||||
| res = new XY(direction, moveVecLength); | res = new XY(direction, moveVecLength); | ||||
| break; | break; | ||||
| @@ -272,7 +272,7 @@ namespace Server | |||||
| Y = chest.Position.y | Y = chest.Position.y | ||||
| } | } | ||||
| }; | }; | ||||
| int progress = (chest.WhoOpen!=null) ? ((time - chest.OpenStartTime) * chest.WhoOpen.SpeedOfOpenChest) : 0; | |||||
| int progress = (chest.WhoOpen != null) ? ((time - chest.OpenStartTime) * chest.WhoOpen.SpeedOfOpenChest) : 0; | |||||
| msg.ChestMessage.Progress = (progress > GameData.degreeOfOpenedChest) ? GameData.degreeOfOpenedChest : progress; | msg.ChestMessage.Progress = (progress > GameData.degreeOfOpenedChest) ? GameData.degreeOfOpenedChest : progress; | ||||
| return msg; | return msg; | ||||
| } | } | ||||
| @@ -1,6 +1,6 @@ | |||||
| @echo off | @echo off | ||||
| start cmd /k ..\Server\bin\Debug\net6.0\Server.exe --ip 0.0.0.0 --port 8888 --studentCount 4 --trickerCount 1 --gameTimeInSecond 600 --fileName test | |||||
| start cmd /k ..\Server\bin\Debug\net6.0\Server.exe --ip 0.0.0.0 --port 8888 --studentCount 0 --trickerCount 1 --gameTimeInSecond 600 --fileName test | |||||
| ping -n 2 127.0.0.1 > NUL | ping -n 2 127.0.0.1 > NUL | ||||