Browse Source

fix: 💩 fix the bug temporarily

tags/0.1.0
shangfengh 2 years ago
parent
commit
0bf578191d
6 changed files with 16 additions and 10 deletions
  1. +3
    -1
      docs/QandA.md
  2. +3
    -3
      logic/GameClass/GameObj/Map/Map.cs
  3. +8
    -4
      logic/GameEngine/MoveEngine.cs
  4. +1
    -1
      logic/Server/CopyInfo.cs
  5. +1
    -1
      logic/cmd/gameServerAndClient.cmd
  6. BIN
      resource/vector.png

+ 3
- 1
docs/QandA.md View File

@@ -61,7 +61,9 @@ A:
2. 不要点重新生成,要点生成
3. 开启下图选项
![CompileFaster](https://raw.githubusercontent.com/shangfengh/THUAI6/new/resource/CompileFaster.png)

Q:这是什么错误啊
![vector](https://raw.githubusercontent.com/shangfengh/THUAI6/new/resource/vector.png)

## Python



+ 3
- 3
logic/GameClass/GameObj/Map/Map.cs View File

@@ -232,14 +232,14 @@ namespace GameClass.GameObj
break;
}
}
if (ToDel != null)
GameObjDict[gameObj.Type].Remove(ToDel);
}
finally
{
GameObjLockDict[gameObj.Type].ExitWriteLock();
}
if (ToDel == null) return false;
GameObjDict[gameObj.Type].Remove(ToDel);
return true;
return ToDel != null;
}
public bool RemoveJustFromMap(GameObj gameObj)
{


+ 8
- 4
logic/GameEngine/MoveEngine.cs View File

@@ -147,14 +147,16 @@ namespace GameEngine
isDestroyed = true;
return false;
case AfterCollision.MoveMax:
MoveMax(obj, res);
if (threadNum == 0 || ((ICharacter)obj).ThreadNum == threadNum)
MoveMax(obj, res);
moveVecLength = 0;
res = new XY(direction, moveVecLength);
break;
}
} 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;
},
@@ -172,7 +174,8 @@ namespace GameEngine
res = new XY(direction, moveVecLength);
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
{
@@ -186,7 +189,8 @@ namespace GameEngine
isDestroyed = true;
break;
case AfterCollision.MoveMax:
MoveMax(obj, res);
if (threadNum == 0 || ((ICharacter)obj).ThreadNum == threadNum)
MoveMax(obj, res);
moveVecLength = 0;
res = new XY(direction, moveVecLength);
break;


+ 1
- 1
logic/Server/CopyInfo.cs View File

@@ -272,7 +272,7 @@ namespace Server
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;
return msg;
}


+ 1
- 1
logic/cmd/gameServerAndClient.cmd View File

@@ -1,6 +1,6 @@
@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


BIN
resource/vector.png View File

Before After
Width: 929  |  Height: 731  |  Size: 37 kB

Loading…
Cancel
Save