Skip to content

Commit

Permalink
Merge pull request #323 from eesast/dev
Browse files Browse the repository at this point in the history
refact: thuai7.pb -> thuaipb
  • Loading branch information
xiangmy21 authored May 7, 2024
2 parents bf3b5c2 + 7b46b1f commit a6dc0bf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dependency/shell/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ function retry_command {
if [ "$TERMINAL" = "SERVER" ]; then
map_path=$map_dir/$MAP_ID.txt
if [ $EXPOSED -eq 1 ]; then
nice -10 ./Server --port 8888 --teamCount 2 --shipNum 4 --resultFileName $playback_dir/result --gameTimeInSecond $GAME_TIME --mode $MODE_NUM --mapResource $map_path --url $SCORE_URL --token $TOKEN --fileName $playback_dir/video --startLockFile $playback_dir/start.lock > $playback_dir/server.log 2>&1 &
nice -10 ./Server --port 8888 --teamCount 2 --shipNum 4 --resultFileName $playback_dir/result --gameTimeInSecond $GAME_TIME --mode $MODE_NUM --mapResource $map_path --url $SCORE_URL --token $TOKEN --fileName $playback_dir/playback --startLockFile $playback_dir/start.lock > $playback_dir/server.log 2>&1 &
server_pid=$!
else
nice -10 ./Server --port 8888 --teamCount 2 --shipNum 4 --resultFileName $playback_dir/result --gameTimeInSecond $GAME_TIME --mode $MODE_NUM --mapResource $map_path --notAllowSpectator --url $SCORE_URL --token $TOKEN --fileName $playback_dir/video --startLockFile $playback_dir/start.lock > $playback_dir/server.log 2>&1 &
nice -10 ./Server --port 8888 --teamCount 2 --shipNum 4 --resultFileName $playback_dir/result --gameTimeInSecond $GAME_TIME --mode $MODE_NUM --mapResource $map_path --notAllowSpectator --url $SCORE_URL --token $TOKEN --fileName $playback_dir/playback --startLockFile $playback_dir/start.lock > $playback_dir/server.log 2>&1 &
server_pid=$!
fi

Expand All @@ -101,9 +101,9 @@ if [ "$TERMINAL" = "SERVER" ]; then
if [ ! -f $playback_dir/start.lock ]; then
echo "Failed to start game."
touch temp.lock
mv -f temp.lock $playback_dir/video.thuaipb
mv -f temp.lock $playback_dir/playback.thuaipb
kill -9 $server_pid
finish_payload='{"result": {"status": "Crashed", "scores": [0, 0]}}'
finish_payload='{"status": "Crashed", "scores": [0, 0]}'
curl $FINISH_URL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d "${finish_payload}" > $playback_dir/send.log 2>&1
else
echo "Game is started."
Expand Down
2 changes: 1 addition & 1 deletion installer/Manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

### Playback

每次调试后会在 `%InstallPath%\logic\Server` 中生成 `114514.thuai7.pb`,在 `Playback File` 中输入 `114514.thuai7.pb`,点击 `保存``启动`。也可以对回放文件进行改名,输入对应文件名即可。
每次调试后会在 `%InstallPath%\logic\Server` 中生成 `114514.thuaipb`,在 `Playback File` 中输入 `114514.thuaipb`,点击 `保存``启动`。也可以对回放文件进行改名,输入对应文件名即可。

## Login

Expand Down
4 changes: 2 additions & 2 deletions logic/Client/ViewModel/GeneralViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ Show the error message

myLogger.LogInfo(String.Format("ip:{0}, port:{1}, playerid:{2}, teamid:{3}, shiptype:{4}, playbackfile:{5}, playbackspeed:{6}", ip, port, playerID, teamID, shipTypeID, playbackFile, playbackSpeed));

//Playback("E:\\program\\Project\\THUAI7\\logic\\Client\\114514.thuai7.pb", 2.0);
//Playback("E:\\program\\Project\\THUAI7\\logic\\Client\\114514.thuaipb", 2.0);
if (playbackFile.Length == 0)
{
try
Expand Down Expand Up @@ -1129,7 +1129,7 @@ Show the error message
// "1"
//});

//Playback("E:\\program\\Project\\THUAI7\\logic\\Server\\bin\\Debug\\net8.0\\114514.thuai7.pb", 1);
//Playback("E:\\program\\Project\\THUAI7\\logic\\Server\\bin\\Debug\\net8.0\\114514.thuaipb", 1);

timerViewModel = Dispatcher.CreateTimer();
timerViewModel.Interval = TimeSpan.FromMilliseconds(50);
Expand Down
2 changes: 1 addition & 1 deletion playback/Playback/PlaybackConstant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static class Constants
/// <summary>
/// 回放文件扩展名
/// </summary>
public static readonly string FileExtension = $".thuai{Version}.pb";
public static readonly string FileExtension = $".thuaipb";
/// <summary>
/// 回放文件头
/// </summary>
Expand Down

0 comments on commit a6dc0bf

Please sign in to comment.