Skip to content

Commit 07cb7b8

Browse files
fix: 🐛 Fix the client's bug when playback file is null.
1 parent 7794745 commit 07cb7b8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: logic/Client/ViewModel/GeneralViewModel.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ Show the error message
10791079
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));
10801080

10811081
//Playback("E:\\program\\Project\\playback.thuaipb", 0.5);
1082-
if (playbackFile.Length == 0)
1082+
if (string.IsNullOrEmpty(playbackFile))
10831083
{
10841084
try
10851085
{
@@ -1099,14 +1099,15 @@ Show the error message
10991099
ConnectToServer(comInfo);
11001100
OnReceive();
11011101
}
1102-
catch
1102+
catch (Exception e)
11031103
{
1104+
myLogger.LogError(e.Message);
11041105
OnReceive();
11051106
}
11061107
}
11071108
else
11081109
{
1109-
//myLogger.LogInfo(String.Format("PlaybackFile:{0}", playbackFile));
1110+
myLogger.LogInfo(String.Format("PlaybackFile:{0}", playbackFile));
11101111
Playback(playbackFile, playbackSpeed);
11111112
}
11121113
//连接Server,comInfo[] 的格式:0 - ip 1 - port 2 - playerID 3 - teamID 4 - ShipType

0 commit comments

Comments
 (0)