Skip to content
This repository has been archived by the owner on Apr 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #138 from Timothy-LiuXuefeng/timothy
Browse files Browse the repository at this point in the history
Change the result in final game to comma seperated and fix bugs
  • Loading branch information
BryantSuen authored May 12, 2021
2 parents d9eca87 + 1752fc3 commit 6a27aa1
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 5 deletions.
8 changes: 8 additions & 0 deletions logic/LocalUI/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"LocalUI": {
"commandName": "Project",
"commandLineArgs": ".\\Logic.Server\\bin\\Debug\\netcoreapp3.1\\Logic.Server.exe --port=20000 --teamCount=2 --playerCount=4 -g 600"
}
}
}
3 changes: 2 additions & 1 deletion logic/Logic.Server/FinalGameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ protected override void SendGameResult() // 决赛时 server 把比赛结果写
{
for (int i = 0; i < TeamCount; ++i)
{
sw.Write(GetTeamScore(i).ToString() + ' ');
sw.Write(GetTeamScore(i).ToString() + ',');
}
sw.WriteLine();
sw.Flush();
}
}
}
Expand Down
9 changes: 8 additions & 1 deletion logic/Logic.Server/GameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,15 @@ private void SendMessageToAllClients(MessageType msgType, bool requireGaming = t
protected override void OnReceive(MessageToServer msg)
{
#if DEBUG
Console.WriteLine($"Recieve message: from teamID {msg.TeamID}, playerID {msg.PlayerID}: {msg.MessageType}");
Console.WriteLine($"Recieve message: from teamID {msg.TeamID}, playerID {msg.PlayerID}: {msg.MessageType}, args: {msg.TimeInMilliseconds} {msg.Angle}");
#endif
if (msg.TimeInMilliseconds < 0)
{
if (msg.Angle >= 0.0) msg.Angle -= Math.PI;
else msg.Angle += Math.PI;
if (msg.TimeInMilliseconds == int.MinValue) msg.TimeInMilliseconds = int.MaxValue;
else msg.TimeInMilliseconds = -msg.TimeInMilliseconds;
}
if (double.IsNaN(msg.Angle) || double.IsInfinity(msg.Angle)) msg.Angle = 0.0;

switch (msg.MessageType)
Expand Down
2 changes: 1 addition & 1 deletion logic/Logic.Server/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"Logic.Server": {
"commandName": "Project",
"commandLineArgs": "--port=20000 --teamCount=2 --playerCount=2 -g 600"
"commandLineArgs": "--port=20000 --teamCount=2 --playerCount=4 -g 600"
}
}
}
3 changes: 3 additions & 0 deletions logic/runAgentDebug1.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
..\communication\communication_csharp\Agent\bin\Debug\netcoreapp3.1\Agent.exe -s 127.0.0.1:21000 -p 8777
pause
2 changes: 1 addition & 1 deletion logic/runServer.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
.\Logic.Server\bin\Release\netcoreapp3.1\Logic.Server.exe --port=20000 --teamCount=2 --playerCount=4 -g 600 --fileName=video
.\Logic.Server\bin\Release\netcoreapp3.1\Logic.Server.exe --port=20000 --teamCount=2 --playerCount=4 -g 600
pause
2 changes: 1 addition & 1 deletion logic/runServerDebug.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
.\Logic.Server\bin\Debug\netcoreapp3.1\Logic.Server.exe --port=20000 --teamCount=2 --playerCount=2 -g 600
.\Logic.Server\bin\Debug\netcoreapp3.1\Logic.Server.exe --port=20000 --teamCount=2 --playerCount=1 -g 600
pause
3 changes: 3 additions & 0 deletions logic/runServerDebug1.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
.\Logic.Server\bin\Debug\netcoreapp3.1\Logic.Server.exe --port=21000 --teamCount=2 --playerCount=1 -g 600
pause
2 changes: 2 additions & 0 deletions logic/runServerDebugPBR.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
.\Logic.Server\bin\Debug\netcoreapp3.1\Logic.Server.exe --port=20000 --playBack --playBackSpeed=1.0 --fileName=b1112b34-35fe-491f-a9a1-817d966a68a7 --resultOnly
3 changes: 3 additions & 0 deletions logic/runServerPB.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
.\Logic.Server\bin\Release\netcoreapp3.1\Logic.Server.exe --port=20000 --teamCount=2 --playerCount=4 -g 600 --fileName=private\res\5z --playBack --playBackSpeed=4.0
pause
3 changes: 3 additions & 0 deletions logic/runServerPBR.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
.\Logic.Server\bin\Release\netcoreapp3.1\Logic.Server.exe --port=20000 --teamCount=2 --playerCount=4 -g 600 --fileName=private\res\5z --playBack --playBackSpeed=4.0 --resultOnly
pause

0 comments on commit 6a27aa1

Please sign in to comment.