Skip to content

Commit 27d252d

Browse files
committed
NeedSystem v1.1.4
- Moved the base configuration to Config.cs for better code readability. - Updated the default url of “ImagesURL” (the previous one stopped working).
1 parent 4d39ad5 commit 27d252d

File tree

2 files changed

+78
-75
lines changed

2 files changed

+78
-75
lines changed

Config.cs

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
using CounterStrikeSharp.API.Core;
2+
using System.Text.Json.Serialization;
3+
4+
namespace NeedSystem;
5+
6+
public class BaseConfigs : BasePluginConfig
7+
{
8+
[JsonPropertyName("WebhookUrl")]
9+
public string WebhookUrl { get; set; } = "";
10+
11+
[JsonPropertyName("IPandPORT")]
12+
public string IPandPORT { get; set; } = "45.235.99.18:27025";
13+
14+
[JsonPropertyName("GetIPandPORTautomatic")]
15+
public bool GetIPandPORTautomatic { get; set; } = true;
16+
17+
[JsonPropertyName("UseHostname")]
18+
public bool UseHostname { get; set; } = true;
19+
20+
[JsonPropertyName("CustomDomain")]
21+
public string CustomDomain { get; set; } = "https://crisisgamer.com/connect";
22+
23+
[JsonPropertyName("MentionRoleID")]
24+
public string MentionRoleID { get; set; } = "";
25+
26+
[JsonPropertyName("MentionMessage")]
27+
public bool MentionMessage { get; set; } = true;
28+
29+
[JsonPropertyName("MaxServerPlayers")]
30+
public int MaxServerPlayers { get; set; } = 12;
31+
32+
[JsonPropertyName("GetMaxServerPlayers")]
33+
public bool GetMaxServerPlayers { get; set; } = true;
34+
35+
[JsonPropertyName("MinPlayers")]
36+
public int MinPlayers { get; set; } = 10;
37+
38+
[JsonPropertyName("CommandCooldownSeconds")]
39+
public int CommandCooldownSeconds { get; set; } = 120;
40+
41+
[JsonPropertyName("Command")]
42+
public List<string> Command { get; set; } = new List<string> { "css_need", ".need" };
43+
44+
[JsonPropertyName("EmbedImage")]
45+
public bool EmbedImage { get; set; } = true;
46+
47+
[JsonPropertyName("EmbedColor")]
48+
public string EmbedColor { get; set; } = "#ffb800";
49+
50+
[JsonPropertyName("ImagesURL")]
51+
public string ImagesURL { get; set; } = "https://imagenes.lucauy.dev/CS2/{map}.png";
52+
53+
[JsonPropertyName("PlayerNameList")]
54+
public bool PlayerNameList { get; set; } = true;
55+
56+
[JsonPropertyName("EmbedFooter")]
57+
public bool EmbedFooter { get; set; } = true;
58+
59+
[JsonPropertyName("EmbedFooterImage")]
60+
public string EmbedFooterImage { get; set; } = "https://avatars.githubusercontent.com/u/61034981?v=4";
61+
62+
[JsonPropertyName("EmbedAuthor")]
63+
public bool EmbedAuthor { get; set; } = true;
64+
65+
[JsonPropertyName("EmbedAuthorURL")]
66+
public string EmbedAuthorURL { get; set; } = "https://lucauy.dev";
67+
68+
[JsonPropertyName("EmbedAuthorImage")]
69+
public string EmbedAuthorImage { get; set; } = "https://avatars.githubusercontent.com/u/61034981?v=4";
70+
71+
[JsonPropertyName("EmbedThumbnail")]
72+
public bool EmbedThumbnail { get; set; } = true;
73+
74+
[JsonPropertyName("EmbedThumbnailImage")]
75+
public string EmbedThumbnailImage { get; set; } = "https://avatars.githubusercontent.com/u/61034981?v=4";
76+
77+
}

NeedSystem.cs

Lines changed: 1 addition & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -2,94 +2,20 @@
22
using System.Text.Json;
33
using CounterStrikeSharp.API;
44
using CounterStrikeSharp.API.Core;
5-
using System.Text.Json.Serialization;
65
using Microsoft.Extensions.Localization;
76
using CounterStrikeSharp.API.Modules.Commands;
87
using CounterStrikeSharp.API.Modules.Cvars;
98

109
namespace NeedSystem;
1110

12-
public class BaseConfigs : BasePluginConfig
13-
{
14-
[JsonPropertyName("WebhookUrl")]
15-
public string WebhookUrl { get; set; } = "";
16-
17-
[JsonPropertyName("IPandPORT")]
18-
public string IPandPORT { get; set; } = "45.235.99.18:27025";
19-
20-
[JsonPropertyName("GetIPandPORTautomatic")]
21-
public bool GetIPandPORTautomatic { get; set; } = true;
22-
23-
[JsonPropertyName("UseHostname")]
24-
public bool UseHostname { get; set; } = true;
25-
26-
[JsonPropertyName("CustomDomain")]
27-
public string CustomDomain { get; set; } = "https://crisisgamer.com/connect";
28-
29-
[JsonPropertyName("MentionRoleID")]
30-
public string MentionRoleID { get; set; } = "";
31-
32-
[JsonPropertyName("MentionMessage")]
33-
public bool MentionMessage { get; set; } = true;
34-
35-
[JsonPropertyName("MaxServerPlayers")]
36-
public int MaxServerPlayers { get; set; } = 12;
37-
38-
[JsonPropertyName("GetMaxServerPlayers")]
39-
public bool GetMaxServerPlayers { get; set; } = true;
40-
41-
[JsonPropertyName("MinPlayers")]
42-
public int MinPlayers { get; set; } = 10;
43-
44-
[JsonPropertyName("CommandCooldownSeconds")]
45-
public int CommandCooldownSeconds { get; set; } = 120;
46-
47-
[JsonPropertyName("Command")]
48-
public List<string> Command { get; set; } = new List<string> { "css_need", ".need" };
49-
50-
[JsonPropertyName("EmbedImage")]
51-
public bool EmbedImage { get; set; } = true;
52-
53-
[JsonPropertyName("EmbedColor")]
54-
public string EmbedColor { get; set; } = "#ffb800";
55-
56-
[JsonPropertyName("ImagesURL")]
57-
public string ImagesURL { get; set; } = "https://imagenes.redage.es/CS2/{map}.png";
58-
59-
[JsonPropertyName("PlayerNameList")]
60-
public bool PlayerNameList { get; set; } = true;
61-
62-
[JsonPropertyName("EmbedFooter")]
63-
public bool EmbedFooter { get; set; } = true;
64-
65-
[JsonPropertyName("EmbedFooterImage")]
66-
public string EmbedFooterImage { get; set; } = "https://avatars.githubusercontent.com/u/61034981?v=4";
67-
68-
[JsonPropertyName("EmbedAuthor")]
69-
public bool EmbedAuthor { get; set; } = true;
70-
71-
[JsonPropertyName("EmbedAuthorURL")]
72-
public string EmbedAuthorURL { get; set; } = "https://lucauy.dev";
73-
74-
[JsonPropertyName("EmbedAuthorImage")]
75-
public string EmbedAuthorImage { get; set; } = "https://avatars.githubusercontent.com/u/61034981?v=4";
76-
77-
[JsonPropertyName("EmbedThumbnail")]
78-
public bool EmbedThumbnail { get; set; } = true;
79-
80-
[JsonPropertyName("EmbedThumbnailImage")]
81-
public string EmbedThumbnailImage { get; set; } = "https://avatars.githubusercontent.com/u/61034981?v=4";
82-
83-
}
84-
8511
public class NeedSystemBase : BasePlugin, IPluginConfig<BaseConfigs>
8612
{
8713
private string _currentMap = "";
8814
private DateTime _lastCommandTime = DateTime.MinValue;
8915
private Translator _translator;
9016

9117
public override string ModuleName => "NeedSystem";
92-
public override string ModuleVersion => "1.1.3";
18+
public override string ModuleVersion => "1.1.4";
9319
public override string ModuleAuthor => "luca.uy";
9420
public override string ModuleDescription => "Allows players to send a message to discord requesting players.";
9521

0 commit comments

Comments
 (0)