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)
351
351
string pathLog = Settingslist . PathLogs + @"\" + steamClient . SteamID . ConvertToUInt64 ( ) + FriendIDName ;
352
352
353
353
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
+
355
360
string [ ] files = Directory . GetFiles ( Settingslist . PathLogs + @"\" + steamClient . SteamID . ConvertToUInt64 ( ) , "[" + FriendID + "]*.txt" ) ;
356
361
357
362
if ( files . Length > 0 ) //file exist
@@ -394,8 +399,14 @@ static void OnFriendEchoMsg(SteamFriends.FriendMsgEchoCallback callback)
394
399
395
400
396
401
string FinalMsg = "[" + DateTime . Now + "] " + steamFriends . GetPersonaName ( ) + ": " + Message ;
397
- string [ ] files = Directory . GetFiles ( Settingslist . PathLogs + @"\" + steamClient . SteamID . ConvertToUInt64 ( ) , "[" + FriendID + "]*.txt" ) ;
398
402
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
+
399
410
if ( files . Length > 0 ) //file exist
400
411
{
401
412
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