File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -351,7 +351,12 @@ static void OnFriendMsg(SteamFriends.FriendMsgCallback callback)
351351 string pathLog = Settingslist . PathLogs + @"\" + steamClient . SteamID . ConvertToUInt64 ( ) + FriendIDName ;
352352
353353 string FinalMsg = "[" + DateTime . Now + "] " + FriendName + ": " + Message ;
354-
354+
355+ if ( ! Directory . Exists ( Settingslist . PathLogs + @"\" + steamClient . SteamID . ConvertToUInt64 ( ) ) )
356+ {
357+ Directory . CreateDirectory ( Settingslist . PathLogs + @"\" + steamClient . SteamID . ConvertToUInt64 ( ) ) ;
358+ }
359+
355360 string [ ] files = Directory . GetFiles ( Settingslist . PathLogs + @"\" + steamClient . SteamID . ConvertToUInt64 ( ) , "[" + FriendID + "]*.txt" ) ;
356361
357362 if ( files . Length > 0 ) //file exist
@@ -394,8 +399,14 @@ static void OnFriendEchoMsg(SteamFriends.FriendMsgEchoCallback callback)
394399
395400
396401 string FinalMsg = "[" + DateTime . Now + "] " + steamFriends . GetPersonaName ( ) + ": " + Message ;
397- string [ ] files = Directory . GetFiles ( Settingslist . PathLogs + @"\" + steamClient . SteamID . ConvertToUInt64 ( ) , "[" + FriendID + "]*.txt" ) ;
398402
403+ if ( ! Directory . Exists ( Settingslist . PathLogs + @"\" + steamClient . SteamID . ConvertToUInt64 ( ) ) )
404+ {
405+ Directory . CreateDirectory ( Settingslist . PathLogs + @"\" + steamClient . SteamID . ConvertToUInt64 ( ) ) ;
406+ }
407+
408+ string [ ] files = Directory . GetFiles ( Settingslist . PathLogs + @"\" + steamClient . SteamID . ConvertToUInt64 ( ) , "[" + FriendID + "]*.txt" ) ;
409+
399410 if ( files . Length > 0 ) //file exist
400411 {
401412 string [ ] LastDate = File . ReadLines ( files [ 0 ] ) . Last ( ) . Split ( ' ' ) ; LastDate [ 0 ] = LastDate [ 0 ] . Substring ( 1 ) ;
You can’t perform that action at this time.
0 commit comments