Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
custom: ['https://paypal.me/lucauy']
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
bin
obj
.vs
.vs
*.sln
86 changes: 0 additions & 86 deletions Config.cs

This file was deleted.

22 changes: 22 additions & 0 deletions Configs/BaseConfigs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using CounterStrikeSharp.API.Core;
using System.Text.Json.Serialization;

namespace NeedSystem.Configs;

public class BaseConfigs : BasePluginConfig
{
[JsonPropertyName("Commands")]
public CommandSettings Commands { get; set; } = new();

[JsonPropertyName("ServerSettings")]
public ServerSettings Server { get; set; } = new();

[JsonPropertyName("DiscordSettings")]
public DiscordSettings Discord { get; set; } = new();

[JsonPropertyName("PlayerSettings")]
public PlayerSettings Player { get; set; } = new();

[JsonPropertyName("Database")]
public DatabaseConfig Database { get; set; } = new();
}
12 changes: 12 additions & 0 deletions Configs/CommandSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;

namespace NeedSystem.Configs;

public class CommandSettings
{
[JsonPropertyName("Command")]
public List<string> Command { get; set; } = new List<string> { "css_need", ".need" };

[JsonPropertyName("CommandCooldownSeconds")]
public int CooldownSeconds { get; set; } = 120;
}
24 changes: 24 additions & 0 deletions Configs/DatabaseConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Text.Json.Serialization;

namespace NeedSystem.Configs;

public class DatabaseConfig
{
[JsonPropertyName("Enabled")]
public bool Enabled { get; set; } = false;

[JsonPropertyName("Host")]
public string Host { get; set; } = "localhost";

[JsonPropertyName("Port")]
public uint Port { get; set; } = 3306;

[JsonPropertyName("User")]
public string User { get; set; } = "root";

[JsonPropertyName("Password")]
public string Password { get; set; } = "";

[JsonPropertyName("DatabaseName")]
public string DatabaseName { get; set; } = "needsystem";
}
21 changes: 21 additions & 0 deletions Configs/DiscordSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.Text.Json.Serialization;

namespace NeedSystem.Configs;

public class DiscordSettings
{
[JsonPropertyName("WebhookUrl")]
public string WebhookUrl { get; set; } = "";

[JsonPropertyName("MentionRoleID")]
public string MentionRoleID { get; set; } = "";

[JsonPropertyName("MentionMessage")]
public bool MentionMessage { get; set; } = true;

[JsonPropertyName("PlayerNameList")]
public bool ShowPlayerNameList { get; set; } = true;

[JsonPropertyName("EmbedSettings")]
public EmbedSettings Embed { get; set; } = new();
}
54 changes: 54 additions & 0 deletions Configs/EmbedSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using System.Text.Json.Serialization;

namespace NeedSystem.Configs;

public class EmbedSettings
{
[JsonPropertyName("EmbedColor")]
public string Color { get; set; } = "#ffb800";

[JsonPropertyName("EmbedImage")]
public bool ShowImage { get; set; } = true;

[JsonPropertyName("ImagesURL")]
public string ImagesURL { get; set; } = "https://cdn.jsdelivr.net/gh/wiruwiru/MapsImagesCDN-CS/png/{map}.png";

[JsonPropertyName("FooterSettings")]
public EmbedFooterSettings Footer { get; set; } = new();

[JsonPropertyName("AuthorSettings")]
public EmbedAuthorSettings Author { get; set; } = new();

[JsonPropertyName("ThumbnailSettings")]
public EmbedThumbnailSettings Thumbnail { get; set; } = new();
}

public class EmbedFooterSettings
{
[JsonPropertyName("EmbedFooter")]
public bool Enabled { get; set; } = true;

[JsonPropertyName("EmbedFooterImage")]
public string ImageUrl { get; set; } = "https://avatars.githubusercontent.com/u/61034981?v=4";
}

public class EmbedAuthorSettings
{
[JsonPropertyName("EmbedAuthor")]
public bool Enabled { get; set; } = true;

[JsonPropertyName("EmbedAuthorURL")]
public string Url { get; set; } = "https://lucauy.dev";

[JsonPropertyName("EmbedAuthorImage")]
public string ImageUrl { get; set; } = "https://avatars.githubusercontent.com/u/61034981?v=4";
}

public class EmbedThumbnailSettings
{
[JsonPropertyName("EmbedThumbnail")]
public bool Enabled { get; set; } = true;

[JsonPropertyName("EmbedThumbnailImage")]
public string ImageUrl { get; set; } = "https://avatars.githubusercontent.com/u/61034981?v=4";
}
15 changes: 15 additions & 0 deletions Configs/PlayerSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Text.Json.Serialization;

namespace NeedSystem.Configs;

public class PlayerSettings
{
[JsonPropertyName("NotifyAllPlayers")]
public bool NotifyAllPlayers { get; set; } = false;

[JsonPropertyName("DontCountSpecAdmins")]
public bool DontCountSpecAdmins { get; set; } = false;

[JsonPropertyName("AdminBypassFlag")]
public string AdminBypassFlag { get; set; } = "@css/generic";
}
27 changes: 27 additions & 0 deletions Configs/ServerSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Text.Json.Serialization;

namespace NeedSystem.Configs;

public class ServerSettings
{
[JsonPropertyName("IPandPORT")]
public string IPandPORT { get; set; } = "45.235.99.18:27025";

[JsonPropertyName("GetIPandPORTautomatic")]
public bool GetIPandPORTautomatic { get; set; } = true;

[JsonPropertyName("UseHostname")]
public bool UseHostname { get; set; } = false;

[JsonPropertyName("CustomDomain")]
public string CustomDomain { get; set; } = "https://crisisgamer.com/connect";

[JsonPropertyName("MaxServerPlayers")]
public int MaxServerPlayers { get; set; } = 12;

[JsonPropertyName("GetMaxServerPlayers")]
public bool GetMaxServerPlayers { get; set; } = true;

[JsonPropertyName("MinPlayers")]
public int MinPlayers { get; set; } = 10;
}
30 changes: 30 additions & 0 deletions Constants/LocalizationKeys.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
namespace NeedSystem.Constants;

public static class LocalizationKeys
{
public const string Prefix = "Prefix";
public const string UnknownPlayer = "UnknownPlayer";

public const string CommandCooldownMessage = "CommandCooldownMessage";
public const string EnoughPlayersMessage = "EnoughPlayersMessage";
public const string NotifyPlayersMessage = "NotifyPlayersMessage";
public const string NotifyAllPlayersMessage = "NotifyAllPlayersMessage";

public const string EmbedTitle = "EmbedTitle";
public const string EmbedDescription = "EmbedDescription";
public const string NeedInServerMessage = "NeedInServerMessage";

public const string ServerFieldTitle = "ServerFieldTitle";
public const string RequestFieldTitle = "RequestFieldTitle";
public const string MapFieldTitle = "MapFieldTitle";
public const string PlayersFieldTitle = "PlayersFieldTitle";
public const string ConnectionFieldTitle = "ConnectionFieldTitle";
public const string PlayerListTitle = "PlayerListTitle";
public const string Hour = "Hour";

public const string ClickToConnect = "ClickToConnect";
public const string NoPlayersConnectedMessage = "NoPlayersConnectedMessage";

public const string EmbedAuthorName = "EmbedAuthorName";
public const string EmbedFooterText = "EmbedFooterText";
}
Loading