Skip to content

Commit 86d383d

Browse files
authored
1.1.4
1 parent 50008c0 commit 86d383d

File tree

8 files changed

+270
-156
lines changed

8 files changed

+270
-156
lines changed

Config/Configs.cs

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ public string Link
272272
[Comment("Enable Early Connection Of The Players?\ntrue = Yes\nfalse = No (Wait When Player Fully Connected)")]
273273
public bool EarlyConnection { get; set; }
274274

275-
[Comment("Disable Looping Connections To Anti Spam Chat?\ntrue = Yes\nfalse = No")]
276-
public bool DisableLoopConnections { get; set; }
275+
[Comment("Ignore These Disconnect Reasons Add , For Multiple Reasons Check In disconnect_reasons.json\n\"\" = Disable")]
276+
public string IgnoreTheseDisconnectReasons { get; set; }
277277

278278
[Comment("Make sv_hibernate_when_empty false?\nWhy? It is Important To Disable sv_hibernate_when_empty Otherwise Will Bug Log Last Player Disconnect From The Server\ntrue = Yes (Recommended)\nfalse = No")]
279279
public bool DisableServerHibernate { get; set; }
@@ -285,23 +285,32 @@ public string Link
285285
[Range(0, 2, 0, "[CnD] RemoveDefaultDisconnect: is invalid, setting to default value (2) Please Choose From 0 To 2.\n[CnD] 0 = No\n[CnD] 1 = Yes Completely\n[CnD] 2 = Yes Completely Also Remove Disconnect Icon In Killfeed")]
286286
public int RemoveDefaultDisconnect { get; set; }
287287

288-
[Comment("Commands To Toggle On/Off Sounds\n\"\" = Disable")]
288+
[Comment("Default Value Of Sounds To New Players?\ntrue = On\nfalse = Off")]
289+
public bool Default_Sounds { get; set; }
290+
291+
[Comment("Commands To Toggle On/Off Sounds\nNote: If The Command Starts With '!' or 'css_' You Will Have The Ability To Toggle It On The Console And Chat\n\"\" = Disable")]
289292
public string Toggle_Sounds_CommandsInGame { get; set; }
290293

291294
[Comment("Required [Toggle_Sounds_CommandsInGame]\nFlags Or Group Or SteamID To Toggle On/Off Sounds\nExample:\n\"SteamID: 76561198206086993,76561198974936845 | Flag: @css/vips,@css/admins | Group: #css/vips,#css/admins\"\n\"\" = To Allow Everyone")]
292295
public string Toggle_Sounds_Flags { get; set; }
293296

294-
[Comment("Commands To Toggle On/Off Messages Connect/Disconnect\n\"\" = Disable")]
297+
[Comment("Required [Toggle_Sounds_CommandsInGame]\nHide Chat After Toggle Successfully?\ntrue = Yes\nfalse = No")]
298+
public bool Toggle_Sounds_Hide { get; set; }
299+
300+
[Comment("Default Value Of Messages To New Players?\ntrue = On\nfalse = Off")]
301+
public bool Default_Messages { get; set; }
302+
303+
[Comment("Commands To Toggle On/Off Messages Connect/Disconnect\nNote: If The Command Starts With '!' or 'css_' You Will Have The Ability To Toggle It On The Console And Chat\n\"\" = Disable")]
295304
public string Toggle_Messages_CommandsInGame { get; set; }
296305

297306
[Comment("Required [Toggle_Messages_CommandsInGame]\nFlags Or Group Or SteamID To Toggle On/Off Messages Connect/Disconnect\nExample:\n\"SteamID: 76561198206086993,76561198974936845 | Flag: @css/vips,@css/admins | Group: #css/vips,#css/admins\"\n\"\" = To Allow Everyone")]
298307
public string Toggle_Messages_Flags { get; set; }
299308

300-
[Comment("Default Value Of Sounds To New Players?\ntrue = On\nfalse = Off")]
301-
public bool Default_Sounds { get; set; }
309+
[Comment("Required [Toggle_Messages_CommandsInGame]\nHide Chat After Toggle Successfully?\ntrue = Yes\nfalse = No")]
310+
public bool Toggle_Messages_Hide { get; set; }
311+
312+
302313

303-
[Comment("Default Value Of Messages To New Players?\ntrue = On\nfalse = Off")]
304-
public bool Default_Messages { get; set; }
305314
[Comment("How Do You Like Date Format Message\nExamples:\ndd MM yyyy = 25 12 2023\nMM/dd/yy = 12/25/23\nMM-dd-yyyy = 12-25-2025")]
306315
public string DateFormat { get; set; }
307316

@@ -312,18 +321,18 @@ public string Link
312321
[Comment("Log Connect/Disconnect Locally (In ../Connect-Disconnect-Sound-GoldKingZ/logs/)?\ntrue = Yes\nfalse = No")]
313322
public bool Log_Locally_Enable { get; set; }
314323

315-
[Comment("Required [Log_Locally_Enable = true]\nHow Do You Like Date Format\nExamples:\ndd MM yyyy = 25 12 2023\nMM/dd/yy = 12/25/23\nMM-dd-yyyy = 12-25-2025")]
316-
public string Log_Locally_DateFormat { get; set; }
317-
318-
[Comment("Required [Log_Locally_Enable = true]\nHow Do You Like Time Format\nExamples:\nHH:mm = 14:30\nhh:mm a = 02:30 PM\nHH:mm:ss = 14:30:45")]
319-
public string Log_Locally_TimeFormat { get; set; }
320-
321324
[Comment("Required [Log_Locally_Enable = true]\nHow Do You Like Connect Message Format\n{DATE} = Log_Locally_DateFormat\n{TIME} = Log_Locally_TimeFormat\n{PLAYERNAME} = Player Name\n{STEAMID} = STEAM_0:1:122910632\n{STEAMID3} = U:1:245821265\n{STEAMID32} = 245821265\n{STEAMID64} = 76561198206086993\n{IP} = 123.45.67.89\n{CONTINENT} = Asia\n{LONGCOUNTRY} = United Arab Emirates\n{SHORTCOUNTRY} = AE\n{CITY} = Abu Dhabi\"\n\"\" = Disable")]
322325
public string Log_Locally_Connect_Format { get; set; }
323326

324327
[Comment("Required [Log_Locally_Enable = true]\nHow Do You Like Disconnect Message Format\n{DATE} = Log_Locally_DateFormat\n{TIME} = Log_Locally_TimeFormat\n{PLAYERNAME} = Player Name\n{STEAMID} = STEAM_0:1:122910632\n{STEAMID3} = U:1:245821265\n{STEAMID32} = 245821265\n{STEAMID64} = 76561198206086993\n{IP} = 123.45.67.89\n{CONTINENT} = Asia\n{LONGCOUNTRY} = United Arab Emirates\n{SHORTCOUNTRY} = AE\n{CITY} = Abu Dhabi\n{DISCONNECT_REASON} = Disconnect Reason\"\n\"\" = Disable")]
325328
public string Log_Locally_Disconnect_Format { get; set; }
326329

330+
[Comment("Required [Log_Locally_Enable = true]\nHow Do You Like Date Format\nExamples:\ndd MM yyyy = 25 12 2023\nMM/dd/yy = 12/25/23\nMM-dd-yyyy = 12-25-2025")]
331+
public string Log_Locally_DateFormat { get; set; }
332+
333+
[Comment("Required [Log_Locally_Enable = true]\nHow Do You Like Time Format\nExamples:\nHH:mm = 14:30\nhh:mm a = 02:30 PM\nHH:mm:ss = 14:30:45")]
334+
public string Log_Locally_TimeFormat { get; set; }
335+
327336
[Comment("Required [Log_Locally_Enable = true]\nAuto Delete File Logs That Pass Than X Old Days\n0 = Disable This Feature")]
328337
public int Log_Locally_AutoDeleteLogsMoreThanXdaysOld { get; set; }
329338

@@ -357,15 +366,15 @@ public string Link
357366
[Comment("Required [Discord_Disconnect_Style 2/3/4/5]\nHow Would You Side Color Message To Be Use This Site (https://htmlcolorcodes.com/color-picker) For Color Pick")]
358367
public string Discord_Disconnect_SideColor { get; set; }
359368

369+
[Comment("Required [Discord_Disconnect_WebHook]\nHow Do You Like Disconnect Message Format\n{DATE} = Discord_DateFormat\n{TIME} = Discord_TimeFormat\n{PLAYERNAME} = Player Name\n{STEAMID} = STEAM_0:1:122910632\n{STEAMID3} = U:1:245821265\n{STEAMID32} = 245821265\n{STEAMID64} = 76561198206086993\n{IP} = 123.45.67.89\n{CONTINENT} = Asia\n{LONGCOUNTRY} = United Arab Emirates\n{SHORTCOUNTRY} = AE\n{CITY} = Abu Dhabi\n{DISCONNECT_REASON} = Disconnect Reason\"\n\"\" = Disable")]
370+
public string Discord_Disconnect_Format { get; set; }
371+
360372
[Comment("Required [Discord_Connect_WebHook Or Discord_Disconnect_WebHook]\nHow Do You Like Date Format\nExamples:\ndd MM yyyy = 25 12 2023\nMM/dd/yy = 12/25/23\nMM-dd-yyyy = 12-25-2025")]
361373
public string Discord_DateFormat { get; set; }
362374

363375
[Comment("Required [Discord_Connect_WebHook Or Discord_Disconnect_WebHook]\nHow Do You Like Time Format\nExamples:\nHH:mm = 14:30\nhh:mm a = 02:30 PM\nHH:mm:ss = 14:30:45")]
364376
public string Discord_TimeFormat { get; set; }
365377

366-
[Comment("Required [Discord_Disconnect_WebHook]\nHow Do You Like Disconnect Message Format\n{DATE} = Discord_DateFormat\n{TIME} = Discord_TimeFormat\n{PLAYERNAME} = Player Name\n{STEAMID} = STEAM_0:1:122910632\n{STEAMID3} = U:1:245821265\n{STEAMID32} = 245821265\n{STEAMID64} = 76561198206086993\n{IP} = 123.45.67.89\n{CONTINENT} = Asia\n{LONGCOUNTRY} = United Arab Emirates\n{SHORTCOUNTRY} = AE\n{CITY} = Abu Dhabi\n{DISCONNECT_REASON} = Disconnect Reason\"\n\"\" = Disable")]
367-
public string Discord_Disconnect_Format { get; set; }
368-
369378
[Comment("Required [Discord_Disconnect_Style Or Discord_Connect_SideColor 3/4/5]\nFooter Image")]
370379
public string Discord_FooterImage { get; set; }
371380

@@ -413,24 +422,26 @@ public ConfigData()
413422
Link = "https://github.com/oqyh/cs2-Connect-Disconnect-Sound-GoldKingZ";
414423

415424
EarlyConnection = true;
416-
DisableLoopConnections = true;
425+
IgnoreTheseDisconnectReasons = "1,54,55";
417426
DisableServerHibernate = true;
418427
PickRandomSounds = true;
419428
RemoveDefaultDisconnect = 2;
429+
Default_Sounds = true;
420430
Toggle_Sounds_CommandsInGame = "!sound,!sounds";
421431
Toggle_Sounds_Flags = "SteamID: 76561198206086993,76561198974936845 | Flag: @css/vips,@css/admins | Group: #css/vips,#css/admins";
422-
Toggle_Messages_CommandsInGame = "!message,!message";
423-
Toggle_Messages_Flags = "SteamID: 76561198206086993,76561198974936845 | Flag: @css/vips,@css/admins | Group: #css/vips,#css/admins";
424-
Default_Sounds = true;
432+
Toggle_Sounds_Hide = true;
425433
Default_Messages = true;
434+
Toggle_Messages_CommandsInGame = "!message,!messages";
435+
Toggle_Messages_Flags = "SteamID: 76561198206086993,76561198974936845 | Flag: @css/vips,@css/admins | Group: #css/vips,#css/admins";
436+
Toggle_Messages_Hide = true;
426437
DateFormat = "MM-dd-yyyy";
427438
TimeFormat = "HH:mm:ss";
428439

429440
Log_Locally_Enable = true;
430-
Log_Locally_DateFormat = "MM-dd-yyyy";
431-
Log_Locally_TimeFormat = "HH:mm:ss";
432441
Log_Locally_Connect_Format = "[{DATE} - {TIME}] [{STEAMID64} - {PLAYERNAME}] Connected From [{CONTINENT} - {LONGCOUNTRY} - {CITY}] [{IP}]";
433442
Log_Locally_Disconnect_Format = "[{DATE} - {TIME}] [{STEAMID64} - {PLAYERNAME}] Disconnected From [{CONTINENT} - {LONGCOUNTRY} - {CITY}] [{IP} - {DISCONNECT_REASON}]";
443+
Log_Locally_DateFormat = "MM-dd-yyyy";
444+
Log_Locally_TimeFormat = "HH:mm:ss";
434445
Log_Locally_AutoDeleteLogsMoreThanXdaysOld = 7;
435446
Cookies_Enable = true;
436447
Cookies_AutoRemovePlayerOlderThanXDays = 7;

Config/Cookies.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ public static Globals_Static.PersonData RetrievePersonDataById(ulong targetId)
8888

8989
public static void FetchAndRemoveOldJsonEntries()
9090
{
91+
if(Configs.GetConfigData().Cookies_AutoRemovePlayerOlderThanXDays < 1) return;
92+
9193
string cookiesDirectory = Path.Combine(MainPlugin.Instance.ModuleDirectory, "cookies");
9294
string cookiesFilePath = Path.Combine(cookiesDirectory, "cookies.json");
9395
try

0 commit comments

Comments
 (0)