├── .gitattributes ├── LICENSE ├── README.md ├── plugins └── Advertisements │ ├── Advertisements.deps.json │ ├── Advertisements.dll │ ├── Advertisements.pdb │ ├── MySqlConnector.dll │ └── Nexd.MySQL.dll └── source ├── Advertisements.cs ├── Advertisements.csproj ├── Advertisements_Commands.cs ├── Advertisements_Event.cs ├── Advertisements_cfg.cs └── Advertisements_help.cs /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 johnoclockdk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Advertisements Database Plugin 2 | 3 | ## Description 4 | The Advertisements Database plugin is designed for Counter-Strike: 2 (CS2) servers. It allows you to manage and display advertisements stored in a database at specified intervals. 5 | 6 | ## Requirements 7 | To use this plugin, you need to have the following requirements installed: 8 | - [CounterStrikeSharp](https://docs.cssharp.dev/guides/getting-started/) 9 | 10 | ## Installation 11 | Follow these steps to install the plugin on your CSS server: 12 | 13 | 1. **Download the Plugin Files:** 14 | - Obtain the plugin files from the [GitHub repository](https://github.com/johnoclockdk/cs2_Advertisements_Database) or the source of your choice. 15 | - Ensure you have the latest version of the plugin. 16 | 17 | 2. **Extract the Downloaded Files:** 18 | - Extract the downloaded plugin files to a convenient location on your computer. 19 | 20 | 3. **Copy Files to Server Directory:** 21 | - Copy the extracted plugin files to your CSS server's `csgo/` directory. 22 | - This is typically located in your server's root folder. 23 | 24 | 4. **Restart the Server:** 25 | - Restart your CSS server or change the map to apply the changes. 26 | - The plugin should now be installed and ready for use. 27 | 28 | ## Markdown File for Plugin Usage 29 | 30 | This document details the usage of color tags and message tags for a specific plugin. 31 | 32 | # Color Tags 33 | 34 | Color tags can be used to customize text colors in messages. Below is the list of available color tags: 35 | 36 | - `{DEFAULT}`: Default text color 37 | - `{RED}`: Red text 38 | - `{LIGHTPURPLE}`: Light purple text 39 | - `{GREEN}`: Green text 40 | - `{LIME}`: Lime text 41 | - `{LIGHTGREEN}`: Light green text 42 | - `{LIGHTRED}`: Light red text 43 | - `{GRAY}`: Gray text 44 | - `{LIGHTOLIVE}`: Light olive text 45 | - `{OLIVE}`: Olive text 46 | - `{LIGHTBLUE}`: Light blue text 47 | - `{BLUE}`: Blue text 48 | - `{PURPLE}`: Purple text 49 | - `{GRAYBLUE}`: Gray blue text 50 | 51 | # Message Tags 52 | 53 | Message tags are used to dynamically insert specific information into messages. The following tags are available: 54 | 55 | - `{CURRENTMAP}`: Inserts the current map name. 56 | - `{TIME}`: Displays the current time in `HH:mm:ss` format. 57 | - `{DATE}`: Shows the current date in `dd.MM.yyyy` format. 58 | - `{SERVERNAME}`: Includes the server's hostname. 59 | - `{NAME}`: Inserts the player's name. 60 | - `{STEAMID}`: Adds the player's Steam ID. 61 | - `{IP}`: Shows the server's IP address. 62 | - `{PLAYERCOUNT}` : Shows the Current player count. 63 | - `{PORT}`: Includes the server's port number. 64 | - `{NEWLINE}`: Create a newline in the message 65 | 66 | ## Usage Instructions 67 | 68 | To utilize these tags, include them in your message strings as needed. The plugin will automatically replace these tags with the appropriate color codes or information when displaying the messages. 69 | 70 | 71 | ## Configuration 72 | The plugin automatically generates a configuration file in the same location as the plugin DLL. You can edit this configuration file to customize the plugin settings according to your server's needs. 73 | 74 | Example Configuration (`config.json`): 75 | ```json 76 | { 77 | "ChatPrefix": "[Advertisements]", 78 | "DatabaseHost": "ip", 79 | "DatabasePort": 3306, 80 | "DatabaseUser": "root", 81 | "DatabasePassword": "myawsomepassword", 82 | "DatabaseName": "Advertisements", 83 | "Timer": "60" 84 | } 85 | ``` 86 | 87 | ## Credits 88 | - **[partiusfabaa](https://github.com/partiusfabaa):** For their valuable contribution to the code related to replacing tags and colors. 89 | - **[hxppy](https://github.com/Skippydingledoo):** For their help with original sourcemod plugin. 90 | -------------------------------------------------------------------------------- /plugins/Advertisements/Advertisements.deps.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeTarget": { 3 | "name": ".NETCoreApp,Version=v8.0", 4 | "signature": "" 5 | }, 6 | "compilationOptions": {}, 7 | "targets": { 8 | ".NETCoreApp,Version=v8.0": { 9 | "Advertisements/1.0.0": { 10 | "dependencies": { 11 | "CounterStrikeSharp.API": "1.0.247", 12 | "Nexd.MySQL": "1.0.2" 13 | }, 14 | "runtime": { 15 | "Advertisements.dll": {} 16 | } 17 | }, 18 | "CounterStrikeSharp.API/1.0.247": { 19 | "dependencies": { 20 | "McMaster.NETCore.Plugins": "1.4.0", 21 | "Microsoft.CSharp": "4.7.0", 22 | "Microsoft.DotNet.ApiCompat.Task": "8.0.203", 23 | "Microsoft.Extensions.Hosting": "8.0.0", 24 | "Microsoft.Extensions.Hosting.Abstractions": "8.0.0", 25 | "Microsoft.Extensions.Localization.Abstractions": "8.0.3", 26 | "Microsoft.Extensions.Logging": "8.0.0", 27 | "Scrutor": "4.2.2", 28 | "Serilog.Extensions.Logging": "8.0.0", 29 | "Serilog.Sinks.Console": "5.0.0", 30 | "Serilog.Sinks.File": "5.0.0", 31 | "System.Data.DataSetExtensions": "4.5.0" 32 | }, 33 | "runtime": { 34 | "lib/net8.0/CounterStrikeSharp.API.dll": { 35 | "assemblyVersion": "1.0.247.0", 36 | "fileVersion": "1.0.247.0" 37 | } 38 | } 39 | }, 40 | "McMaster.NETCore.Plugins/1.4.0": { 41 | "dependencies": { 42 | "Microsoft.DotNet.PlatformAbstractions": "3.1.6", 43 | "Microsoft.Extensions.DependencyModel": "6.0.0" 44 | }, 45 | "runtime": { 46 | "lib/netcoreapp3.1/McMaster.NETCore.Plugins.dll": { 47 | "assemblyVersion": "1.4.0.0", 48 | "fileVersion": "1.4.0.0" 49 | } 50 | } 51 | }, 52 | "Microsoft.CSharp/4.7.0": {}, 53 | "Microsoft.DotNet.ApiCompat.Task/8.0.203": {}, 54 | "Microsoft.DotNet.PlatformAbstractions/3.1.6": { 55 | "runtime": { 56 | "lib/netstandard2.0/Microsoft.DotNet.PlatformAbstractions.dll": { 57 | "assemblyVersion": "3.1.6.0", 58 | "fileVersion": "3.100.620.31604" 59 | } 60 | } 61 | }, 62 | "Microsoft.Extensions.Configuration/8.0.0": { 63 | "dependencies": { 64 | "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", 65 | "Microsoft.Extensions.Primitives": "8.0.0" 66 | }, 67 | "runtime": { 68 | "lib/net8.0/Microsoft.Extensions.Configuration.dll": { 69 | "assemblyVersion": "8.0.0.0", 70 | "fileVersion": "8.0.23.53103" 71 | } 72 | } 73 | }, 74 | "Microsoft.Extensions.Configuration.Abstractions/8.0.0": { 75 | "dependencies": { 76 | "Microsoft.Extensions.Primitives": "8.0.0" 77 | }, 78 | "runtime": { 79 | "lib/net8.0/Microsoft.Extensions.Configuration.Abstractions.dll": { 80 | "assemblyVersion": "8.0.0.0", 81 | "fileVersion": "8.0.23.53103" 82 | } 83 | } 84 | }, 85 | "Microsoft.Extensions.Configuration.Binder/8.0.0": { 86 | "dependencies": { 87 | "Microsoft.Extensions.Configuration.Abstractions": "8.0.0" 88 | }, 89 | "runtime": { 90 | "lib/net8.0/Microsoft.Extensions.Configuration.Binder.dll": { 91 | "assemblyVersion": "8.0.0.0", 92 | "fileVersion": "8.0.23.53103" 93 | } 94 | } 95 | }, 96 | "Microsoft.Extensions.Configuration.CommandLine/8.0.0": { 97 | "dependencies": { 98 | "Microsoft.Extensions.Configuration": "8.0.0", 99 | "Microsoft.Extensions.Configuration.Abstractions": "8.0.0" 100 | }, 101 | "runtime": { 102 | "lib/net8.0/Microsoft.Extensions.Configuration.CommandLine.dll": { 103 | "assemblyVersion": "8.0.0.0", 104 | "fileVersion": "8.0.23.53103" 105 | } 106 | } 107 | }, 108 | "Microsoft.Extensions.Configuration.EnvironmentVariables/8.0.0": { 109 | "dependencies": { 110 | "Microsoft.Extensions.Configuration": "8.0.0", 111 | "Microsoft.Extensions.Configuration.Abstractions": "8.0.0" 112 | }, 113 | "runtime": { 114 | "lib/net8.0/Microsoft.Extensions.Configuration.EnvironmentVariables.dll": { 115 | "assemblyVersion": "8.0.0.0", 116 | "fileVersion": "8.0.23.53103" 117 | } 118 | } 119 | }, 120 | "Microsoft.Extensions.Configuration.FileExtensions/8.0.0": { 121 | "dependencies": { 122 | "Microsoft.Extensions.Configuration": "8.0.0", 123 | "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", 124 | "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", 125 | "Microsoft.Extensions.FileProviders.Physical": "8.0.0", 126 | "Microsoft.Extensions.Primitives": "8.0.0" 127 | }, 128 | "runtime": { 129 | "lib/net8.0/Microsoft.Extensions.Configuration.FileExtensions.dll": { 130 | "assemblyVersion": "8.0.0.0", 131 | "fileVersion": "8.0.23.53103" 132 | } 133 | } 134 | }, 135 | "Microsoft.Extensions.Configuration.Json/8.0.0": { 136 | "dependencies": { 137 | "Microsoft.Extensions.Configuration": "8.0.0", 138 | "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", 139 | "Microsoft.Extensions.Configuration.FileExtensions": "8.0.0", 140 | "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", 141 | "System.Text.Json": "8.0.0" 142 | }, 143 | "runtime": { 144 | "lib/net8.0/Microsoft.Extensions.Configuration.Json.dll": { 145 | "assemblyVersion": "8.0.0.0", 146 | "fileVersion": "8.0.23.53103" 147 | } 148 | } 149 | }, 150 | "Microsoft.Extensions.Configuration.UserSecrets/8.0.0": { 151 | "dependencies": { 152 | "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", 153 | "Microsoft.Extensions.Configuration.Json": "8.0.0", 154 | "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", 155 | "Microsoft.Extensions.FileProviders.Physical": "8.0.0" 156 | }, 157 | "runtime": { 158 | "lib/net8.0/Microsoft.Extensions.Configuration.UserSecrets.dll": { 159 | "assemblyVersion": "8.0.0.0", 160 | "fileVersion": "8.0.23.53103" 161 | } 162 | } 163 | }, 164 | "Microsoft.Extensions.DependencyInjection/8.0.0": { 165 | "dependencies": { 166 | "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0" 167 | }, 168 | "runtime": { 169 | "lib/net8.0/Microsoft.Extensions.DependencyInjection.dll": { 170 | "assemblyVersion": "8.0.0.0", 171 | "fileVersion": "8.0.23.53103" 172 | } 173 | } 174 | }, 175 | "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.0": { 176 | "runtime": { 177 | "lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { 178 | "assemblyVersion": "8.0.0.0", 179 | "fileVersion": "8.0.23.53103" 180 | } 181 | } 182 | }, 183 | "Microsoft.Extensions.DependencyModel/6.0.0": { 184 | "dependencies": { 185 | "System.Buffers": "4.5.1", 186 | "System.Memory": "4.5.4", 187 | "System.Runtime.CompilerServices.Unsafe": "6.0.0", 188 | "System.Text.Encodings.Web": "8.0.0", 189 | "System.Text.Json": "8.0.0" 190 | }, 191 | "runtime": { 192 | "lib/netstandard2.0/Microsoft.Extensions.DependencyModel.dll": { 193 | "assemblyVersion": "6.0.0.0", 194 | "fileVersion": "6.0.21.52210" 195 | } 196 | } 197 | }, 198 | "Microsoft.Extensions.Diagnostics/8.0.0": { 199 | "dependencies": { 200 | "Microsoft.Extensions.Configuration": "8.0.0", 201 | "Microsoft.Extensions.Diagnostics.Abstractions": "8.0.0", 202 | "Microsoft.Extensions.Options.ConfigurationExtensions": "8.0.0" 203 | }, 204 | "runtime": { 205 | "lib/net8.0/Microsoft.Extensions.Diagnostics.dll": { 206 | "assemblyVersion": "8.0.0.0", 207 | "fileVersion": "8.0.23.53103" 208 | } 209 | } 210 | }, 211 | "Microsoft.Extensions.Diagnostics.Abstractions/8.0.0": { 212 | "dependencies": { 213 | "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", 214 | "Microsoft.Extensions.Options": "8.0.0", 215 | "System.Diagnostics.DiagnosticSource": "8.0.0" 216 | }, 217 | "runtime": { 218 | "lib/net8.0/Microsoft.Extensions.Diagnostics.Abstractions.dll": { 219 | "assemblyVersion": "8.0.0.0", 220 | "fileVersion": "8.0.23.53103" 221 | } 222 | } 223 | }, 224 | "Microsoft.Extensions.FileProviders.Abstractions/8.0.0": { 225 | "dependencies": { 226 | "Microsoft.Extensions.Primitives": "8.0.0" 227 | }, 228 | "runtime": { 229 | "lib/net8.0/Microsoft.Extensions.FileProviders.Abstractions.dll": { 230 | "assemblyVersion": "8.0.0.0", 231 | "fileVersion": "8.0.23.53103" 232 | } 233 | } 234 | }, 235 | "Microsoft.Extensions.FileProviders.Physical/8.0.0": { 236 | "dependencies": { 237 | "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", 238 | "Microsoft.Extensions.FileSystemGlobbing": "8.0.0", 239 | "Microsoft.Extensions.Primitives": "8.0.0" 240 | }, 241 | "runtime": { 242 | "lib/net8.0/Microsoft.Extensions.FileProviders.Physical.dll": { 243 | "assemblyVersion": "8.0.0.0", 244 | "fileVersion": "8.0.23.53103" 245 | } 246 | } 247 | }, 248 | "Microsoft.Extensions.FileSystemGlobbing/8.0.0": { 249 | "runtime": { 250 | "lib/net8.0/Microsoft.Extensions.FileSystemGlobbing.dll": { 251 | "assemblyVersion": "8.0.0.0", 252 | "fileVersion": "8.0.23.53103" 253 | } 254 | } 255 | }, 256 | "Microsoft.Extensions.Hosting/8.0.0": { 257 | "dependencies": { 258 | "Microsoft.Extensions.Configuration": "8.0.0", 259 | "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", 260 | "Microsoft.Extensions.Configuration.Binder": "8.0.0", 261 | "Microsoft.Extensions.Configuration.CommandLine": "8.0.0", 262 | "Microsoft.Extensions.Configuration.EnvironmentVariables": "8.0.0", 263 | "Microsoft.Extensions.Configuration.FileExtensions": "8.0.0", 264 | "Microsoft.Extensions.Configuration.Json": "8.0.0", 265 | "Microsoft.Extensions.Configuration.UserSecrets": "8.0.0", 266 | "Microsoft.Extensions.DependencyInjection": "8.0.0", 267 | "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", 268 | "Microsoft.Extensions.Diagnostics": "8.0.0", 269 | "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", 270 | "Microsoft.Extensions.FileProviders.Physical": "8.0.0", 271 | "Microsoft.Extensions.Hosting.Abstractions": "8.0.0", 272 | "Microsoft.Extensions.Logging": "8.0.0", 273 | "Microsoft.Extensions.Logging.Abstractions": "8.0.0", 274 | "Microsoft.Extensions.Logging.Configuration": "8.0.0", 275 | "Microsoft.Extensions.Logging.Console": "8.0.0", 276 | "Microsoft.Extensions.Logging.Debug": "8.0.0", 277 | "Microsoft.Extensions.Logging.EventLog": "8.0.0", 278 | "Microsoft.Extensions.Logging.EventSource": "8.0.0", 279 | "Microsoft.Extensions.Options": "8.0.0" 280 | }, 281 | "runtime": { 282 | "lib/net8.0/Microsoft.Extensions.Hosting.dll": { 283 | "assemblyVersion": "8.0.0.0", 284 | "fileVersion": "8.0.23.53103" 285 | } 286 | } 287 | }, 288 | "Microsoft.Extensions.Hosting.Abstractions/8.0.0": { 289 | "dependencies": { 290 | "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", 291 | "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", 292 | "Microsoft.Extensions.Diagnostics.Abstractions": "8.0.0", 293 | "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", 294 | "Microsoft.Extensions.Logging.Abstractions": "8.0.0" 295 | }, 296 | "runtime": { 297 | "lib/net8.0/Microsoft.Extensions.Hosting.Abstractions.dll": { 298 | "assemblyVersion": "8.0.0.0", 299 | "fileVersion": "8.0.23.53103" 300 | } 301 | } 302 | }, 303 | "Microsoft.Extensions.Localization.Abstractions/8.0.3": { 304 | "runtime": { 305 | "lib/net8.0/Microsoft.Extensions.Localization.Abstractions.dll": { 306 | "assemblyVersion": "8.0.0.0", 307 | "fileVersion": "8.0.324.11615" 308 | } 309 | } 310 | }, 311 | "Microsoft.Extensions.Logging/8.0.0": { 312 | "dependencies": { 313 | "Microsoft.Extensions.DependencyInjection": "8.0.0", 314 | "Microsoft.Extensions.Logging.Abstractions": "8.0.0", 315 | "Microsoft.Extensions.Options": "8.0.0" 316 | }, 317 | "runtime": { 318 | "lib/net8.0/Microsoft.Extensions.Logging.dll": { 319 | "assemblyVersion": "8.0.0.0", 320 | "fileVersion": "8.0.23.53103" 321 | } 322 | } 323 | }, 324 | "Microsoft.Extensions.Logging.Abstractions/8.0.0": { 325 | "dependencies": { 326 | "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0" 327 | }, 328 | "runtime": { 329 | "lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": { 330 | "assemblyVersion": "8.0.0.0", 331 | "fileVersion": "8.0.23.53103" 332 | } 333 | } 334 | }, 335 | "Microsoft.Extensions.Logging.Configuration/8.0.0": { 336 | "dependencies": { 337 | "Microsoft.Extensions.Configuration": "8.0.0", 338 | "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", 339 | "Microsoft.Extensions.Configuration.Binder": "8.0.0", 340 | "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", 341 | "Microsoft.Extensions.Logging": "8.0.0", 342 | "Microsoft.Extensions.Logging.Abstractions": "8.0.0", 343 | "Microsoft.Extensions.Options": "8.0.0", 344 | "Microsoft.Extensions.Options.ConfigurationExtensions": "8.0.0" 345 | }, 346 | "runtime": { 347 | "lib/net8.0/Microsoft.Extensions.Logging.Configuration.dll": { 348 | "assemblyVersion": "8.0.0.0", 349 | "fileVersion": "8.0.23.53103" 350 | } 351 | } 352 | }, 353 | "Microsoft.Extensions.Logging.Console/8.0.0": { 354 | "dependencies": { 355 | "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", 356 | "Microsoft.Extensions.Logging": "8.0.0", 357 | "Microsoft.Extensions.Logging.Abstractions": "8.0.0", 358 | "Microsoft.Extensions.Logging.Configuration": "8.0.0", 359 | "Microsoft.Extensions.Options": "8.0.0", 360 | "System.Text.Json": "8.0.0" 361 | }, 362 | "runtime": { 363 | "lib/net8.0/Microsoft.Extensions.Logging.Console.dll": { 364 | "assemblyVersion": "8.0.0.0", 365 | "fileVersion": "8.0.23.53103" 366 | } 367 | } 368 | }, 369 | "Microsoft.Extensions.Logging.Debug/8.0.0": { 370 | "dependencies": { 371 | "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", 372 | "Microsoft.Extensions.Logging": "8.0.0", 373 | "Microsoft.Extensions.Logging.Abstractions": "8.0.0" 374 | }, 375 | "runtime": { 376 | "lib/net8.0/Microsoft.Extensions.Logging.Debug.dll": { 377 | "assemblyVersion": "8.0.0.0", 378 | "fileVersion": "8.0.23.53103" 379 | } 380 | } 381 | }, 382 | "Microsoft.Extensions.Logging.EventLog/8.0.0": { 383 | "dependencies": { 384 | "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", 385 | "Microsoft.Extensions.Logging": "8.0.0", 386 | "Microsoft.Extensions.Logging.Abstractions": "8.0.0", 387 | "Microsoft.Extensions.Options": "8.0.0", 388 | "System.Diagnostics.EventLog": "8.0.0" 389 | }, 390 | "runtime": { 391 | "lib/net8.0/Microsoft.Extensions.Logging.EventLog.dll": { 392 | "assemblyVersion": "8.0.0.0", 393 | "fileVersion": "8.0.23.53103" 394 | } 395 | } 396 | }, 397 | "Microsoft.Extensions.Logging.EventSource/8.0.0": { 398 | "dependencies": { 399 | "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", 400 | "Microsoft.Extensions.Logging": "8.0.0", 401 | "Microsoft.Extensions.Logging.Abstractions": "8.0.0", 402 | "Microsoft.Extensions.Options": "8.0.0", 403 | "Microsoft.Extensions.Primitives": "8.0.0", 404 | "System.Text.Json": "8.0.0" 405 | }, 406 | "runtime": { 407 | "lib/net8.0/Microsoft.Extensions.Logging.EventSource.dll": { 408 | "assemblyVersion": "8.0.0.0", 409 | "fileVersion": "8.0.23.53103" 410 | } 411 | } 412 | }, 413 | "Microsoft.Extensions.Options/8.0.0": { 414 | "dependencies": { 415 | "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", 416 | "Microsoft.Extensions.Primitives": "8.0.0" 417 | }, 418 | "runtime": { 419 | "lib/net8.0/Microsoft.Extensions.Options.dll": { 420 | "assemblyVersion": "8.0.0.0", 421 | "fileVersion": "8.0.23.53103" 422 | } 423 | } 424 | }, 425 | "Microsoft.Extensions.Options.ConfigurationExtensions/8.0.0": { 426 | "dependencies": { 427 | "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", 428 | "Microsoft.Extensions.Configuration.Binder": "8.0.0", 429 | "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", 430 | "Microsoft.Extensions.Options": "8.0.0", 431 | "Microsoft.Extensions.Primitives": "8.0.0" 432 | }, 433 | "runtime": { 434 | "lib/net8.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll": { 435 | "assemblyVersion": "8.0.0.0", 436 | "fileVersion": "8.0.23.53103" 437 | } 438 | } 439 | }, 440 | "Microsoft.Extensions.Primitives/8.0.0": { 441 | "runtime": { 442 | "lib/net8.0/Microsoft.Extensions.Primitives.dll": { 443 | "assemblyVersion": "8.0.0.0", 444 | "fileVersion": "8.0.23.53103" 445 | } 446 | } 447 | }, 448 | "MySqlConnector/2.2.7": { 449 | "runtime": { 450 | "lib/net7.0/MySqlConnector.dll": { 451 | "assemblyVersion": "2.0.0.0", 452 | "fileVersion": "2.2.7.0" 453 | } 454 | } 455 | }, 456 | "Nexd.MySQL/1.0.2": { 457 | "dependencies": { 458 | "MySqlConnector": "2.2.7" 459 | }, 460 | "runtime": { 461 | "lib/net7.0/Nexd.MySQL.dll": { 462 | "assemblyVersion": "1.0.2.0", 463 | "fileVersion": "1.0.2.0" 464 | } 465 | } 466 | }, 467 | "Scrutor/4.2.2": { 468 | "dependencies": { 469 | "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", 470 | "Microsoft.Extensions.DependencyModel": "6.0.0" 471 | }, 472 | "runtime": { 473 | "lib/net6.0/Scrutor.dll": { 474 | "assemblyVersion": "4.0.0.0", 475 | "fileVersion": "4.0.0.0" 476 | } 477 | } 478 | }, 479 | "Serilog/3.1.1": { 480 | "runtime": { 481 | "lib/net7.0/Serilog.dll": { 482 | "assemblyVersion": "2.0.0.0", 483 | "fileVersion": "3.1.1.0" 484 | } 485 | } 486 | }, 487 | "Serilog.Extensions.Logging/8.0.0": { 488 | "dependencies": { 489 | "Microsoft.Extensions.Logging": "8.0.0", 490 | "Serilog": "3.1.1" 491 | }, 492 | "runtime": { 493 | "lib/net8.0/Serilog.Extensions.Logging.dll": { 494 | "assemblyVersion": "7.0.0.0", 495 | "fileVersion": "8.0.0.0" 496 | } 497 | } 498 | }, 499 | "Serilog.Sinks.Console/5.0.0": { 500 | "dependencies": { 501 | "Serilog": "3.1.1" 502 | }, 503 | "runtime": { 504 | "lib/net7.0/Serilog.Sinks.Console.dll": { 505 | "assemblyVersion": "5.0.0.0", 506 | "fileVersion": "5.0.0.0" 507 | } 508 | } 509 | }, 510 | "Serilog.Sinks.File/5.0.0": { 511 | "dependencies": { 512 | "Serilog": "3.1.1" 513 | }, 514 | "runtime": { 515 | "lib/net5.0/Serilog.Sinks.File.dll": { 516 | "assemblyVersion": "5.0.0.0", 517 | "fileVersion": "5.0.0.0" 518 | } 519 | } 520 | }, 521 | "System.Buffers/4.5.1": {}, 522 | "System.Data.DataSetExtensions/4.5.0": {}, 523 | "System.Diagnostics.DiagnosticSource/8.0.0": {}, 524 | "System.Diagnostics.EventLog/8.0.0": { 525 | "runtime": { 526 | "lib/net8.0/System.Diagnostics.EventLog.dll": { 527 | "assemblyVersion": "8.0.0.0", 528 | "fileVersion": "8.0.23.53103" 529 | } 530 | }, 531 | "runtimeTargets": { 532 | "runtimes/win/lib/net8.0/System.Diagnostics.EventLog.Messages.dll": { 533 | "rid": "win", 534 | "assetType": "runtime", 535 | "assemblyVersion": "8.0.0.0", 536 | "fileVersion": "0.0.0.0" 537 | }, 538 | "runtimes/win/lib/net8.0/System.Diagnostics.EventLog.dll": { 539 | "rid": "win", 540 | "assetType": "runtime", 541 | "assemblyVersion": "8.0.0.0", 542 | "fileVersion": "8.0.23.53103" 543 | } 544 | } 545 | }, 546 | "System.Memory/4.5.4": {}, 547 | "System.Runtime.CompilerServices.Unsafe/6.0.0": {}, 548 | "System.Text.Encodings.Web/8.0.0": {}, 549 | "System.Text.Json/8.0.0": { 550 | "dependencies": { 551 | "System.Text.Encodings.Web": "8.0.0" 552 | } 553 | } 554 | } 555 | }, 556 | "libraries": { 557 | "Advertisements/1.0.0": { 558 | "type": "project", 559 | "serviceable": false, 560 | "sha512": "" 561 | }, 562 | "CounterStrikeSharp.API/1.0.247": { 563 | "type": "package", 564 | "serviceable": true, 565 | "sha512": "sha512-NkXGs26tIVG02MUgBzUyK4tnrzg10njA7ebP/mRODBVLJHElYtLIRIYO00r+kKk5qj4EsELmz/RihOT0nr9F0A==", 566 | "path": "counterstrikesharp.api/1.0.247", 567 | "hashPath": "counterstrikesharp.api.1.0.247.nupkg.sha512" 568 | }, 569 | "McMaster.NETCore.Plugins/1.4.0": { 570 | "type": "package", 571 | "serviceable": true, 572 | "sha512": "sha512-UKw5Z2/QHhkR7kiAJmqdCwVDMQV0lwsfj10+FG676r8DsJWIpxtachtEjE0qBs9WoK5GUQIqxgyFeYUSwuPszg==", 573 | "path": "mcmaster.netcore.plugins/1.4.0", 574 | "hashPath": "mcmaster.netcore.plugins.1.4.0.nupkg.sha512" 575 | }, 576 | "Microsoft.CSharp/4.7.0": { 577 | "type": "package", 578 | "serviceable": true, 579 | "sha512": "sha512-pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==", 580 | "path": "microsoft.csharp/4.7.0", 581 | "hashPath": "microsoft.csharp.4.7.0.nupkg.sha512" 582 | }, 583 | "Microsoft.DotNet.ApiCompat.Task/8.0.203": { 584 | "type": "package", 585 | "serviceable": true, 586 | "sha512": "sha512-nPEGMojf1mj1oVixe0aiBimSn6xUoZswSjpMPZFMkZ+znYm2GEM5tWGZEWb6OSNIo5gWKyDi1WcI4IL7YiL1Zw==", 587 | "path": "microsoft.dotnet.apicompat.task/8.0.203", 588 | "hashPath": "microsoft.dotnet.apicompat.task.8.0.203.nupkg.sha512" 589 | }, 590 | "Microsoft.DotNet.PlatformAbstractions/3.1.6": { 591 | "type": "package", 592 | "serviceable": true, 593 | "sha512": "sha512-jek4XYaQ/PGUwDKKhwR8K47Uh1189PFzMeLqO83mXrXQVIpARZCcfuDedH50YDTepBkfijCZN5U/vZi++erxtg==", 594 | "path": "microsoft.dotnet.platformabstractions/3.1.6", 595 | "hashPath": "microsoft.dotnet.platformabstractions.3.1.6.nupkg.sha512" 596 | }, 597 | "Microsoft.Extensions.Configuration/8.0.0": { 598 | "type": "package", 599 | "serviceable": true, 600 | "sha512": "sha512-0J/9YNXTMWSZP2p2+nvl8p71zpSwokZXZuJW+VjdErkegAnFdO1XlqtA62SJtgVYHdKu3uPxJHcMR/r35HwFBA==", 601 | "path": "microsoft.extensions.configuration/8.0.0", 602 | "hashPath": "microsoft.extensions.configuration.8.0.0.nupkg.sha512" 603 | }, 604 | "Microsoft.Extensions.Configuration.Abstractions/8.0.0": { 605 | "type": "package", 606 | "serviceable": true, 607 | "sha512": "sha512-3lE/iLSutpgX1CC0NOW70FJoGARRHbyKmG7dc0klnUZ9Dd9hS6N/POPWhKhMLCEuNN5nXEY5agmlFtH562vqhQ==", 608 | "path": "microsoft.extensions.configuration.abstractions/8.0.0", 609 | "hashPath": "microsoft.extensions.configuration.abstractions.8.0.0.nupkg.sha512" 610 | }, 611 | "Microsoft.Extensions.Configuration.Binder/8.0.0": { 612 | "type": "package", 613 | "serviceable": true, 614 | "sha512": "sha512-mBMoXLsr5s1y2zOHWmKsE9veDcx8h1x/c3rz4baEdQKTeDcmQAPNbB54Pi/lhFO3K431eEq6PFbMgLaa6PHFfA==", 615 | "path": "microsoft.extensions.configuration.binder/8.0.0", 616 | "hashPath": "microsoft.extensions.configuration.binder.8.0.0.nupkg.sha512" 617 | }, 618 | "Microsoft.Extensions.Configuration.CommandLine/8.0.0": { 619 | "type": "package", 620 | "serviceable": true, 621 | "sha512": "sha512-NZuZMz3Q8Z780nKX3ifV1fE7lS+6pynDHK71OfU4OZ1ItgvDOhyOC7E6z+JMZrAj63zRpwbdldYFk499t3+1dQ==", 622 | "path": "microsoft.extensions.configuration.commandline/8.0.0", 623 | "hashPath": "microsoft.extensions.configuration.commandline.8.0.0.nupkg.sha512" 624 | }, 625 | "Microsoft.Extensions.Configuration.EnvironmentVariables/8.0.0": { 626 | "type": "package", 627 | "serviceable": true, 628 | "sha512": "sha512-plvZ0ZIpq+97gdPNNvhwvrEZ92kNml9hd1pe3idMA7svR0PztdzVLkoWLcRFgySYXUJc3kSM3Xw3mNFMo/bxRA==", 629 | "path": "microsoft.extensions.configuration.environmentvariables/8.0.0", 630 | "hashPath": "microsoft.extensions.configuration.environmentvariables.8.0.0.nupkg.sha512" 631 | }, 632 | "Microsoft.Extensions.Configuration.FileExtensions/8.0.0": { 633 | "type": "package", 634 | "serviceable": true, 635 | "sha512": "sha512-McP+Lz/EKwvtCv48z0YImw+L1gi1gy5rHhNaNIY2CrjloV+XY8gydT8DjMR6zWeL13AFK+DioVpppwAuO1Gi1w==", 636 | "path": "microsoft.extensions.configuration.fileextensions/8.0.0", 637 | "hashPath": "microsoft.extensions.configuration.fileextensions.8.0.0.nupkg.sha512" 638 | }, 639 | "Microsoft.Extensions.Configuration.Json/8.0.0": { 640 | "type": "package", 641 | "serviceable": true, 642 | "sha512": "sha512-C2wqUoh9OmRL1akaCcKSTmRU8z0kckfImG7zLNI8uyi47Lp+zd5LWAD17waPQEqCz3ioWOCrFUo+JJuoeZLOBw==", 643 | "path": "microsoft.extensions.configuration.json/8.0.0", 644 | "hashPath": "microsoft.extensions.configuration.json.8.0.0.nupkg.sha512" 645 | }, 646 | "Microsoft.Extensions.Configuration.UserSecrets/8.0.0": { 647 | "type": "package", 648 | "serviceable": true, 649 | "sha512": "sha512-ihDHu2dJYQird9pl2CbdwuNDfvCZdOS0S7SPlNfhPt0B81UTT+yyZKz2pimFZGUp3AfuBRnqUCxB2SjsZKHVUw==", 650 | "path": "microsoft.extensions.configuration.usersecrets/8.0.0", 651 | "hashPath": "microsoft.extensions.configuration.usersecrets.8.0.0.nupkg.sha512" 652 | }, 653 | "Microsoft.Extensions.DependencyInjection/8.0.0": { 654 | "type": "package", 655 | "serviceable": true, 656 | "sha512": "sha512-V8S3bsm50ig6JSyrbcJJ8bW2b9QLGouz+G1miK3UTaOWmMtFwNNNzUf4AleyDWUmTrWMLNnFSLEQtxmxgNQnNQ==", 657 | "path": "microsoft.extensions.dependencyinjection/8.0.0", 658 | "hashPath": "microsoft.extensions.dependencyinjection.8.0.0.nupkg.sha512" 659 | }, 660 | "Microsoft.Extensions.DependencyInjection.Abstractions/8.0.0": { 661 | "type": "package", 662 | "serviceable": true, 663 | "sha512": "sha512-cjWrLkJXK0rs4zofsK4bSdg+jhDLTaxrkXu4gS6Y7MAlCvRyNNgwY/lJi5RDlQOnSZweHqoyvgvbdvQsRIW+hg==", 664 | "path": "microsoft.extensions.dependencyinjection.abstractions/8.0.0", 665 | "hashPath": "microsoft.extensions.dependencyinjection.abstractions.8.0.0.nupkg.sha512" 666 | }, 667 | "Microsoft.Extensions.DependencyModel/6.0.0": { 668 | "type": "package", 669 | "serviceable": true, 670 | "sha512": "sha512-TD5QHg98m3+QhgEV1YVoNMl5KtBw/4rjfxLHO0e/YV9bPUBDKntApP4xdrVtGgCeQZHVfC2EXIGsdpRNrr87Pg==", 671 | "path": "microsoft.extensions.dependencymodel/6.0.0", 672 | "hashPath": "microsoft.extensions.dependencymodel.6.0.0.nupkg.sha512" 673 | }, 674 | "Microsoft.Extensions.Diagnostics/8.0.0": { 675 | "type": "package", 676 | "serviceable": true, 677 | "sha512": "sha512-3PZp/YSkIXrF7QK7PfC1bkyRYwqOHpWFad8Qx+4wkuumAeXo1NHaxpS9LboNA9OvNSAu+QOVlXbMyoY+pHSqcw==", 678 | "path": "microsoft.extensions.diagnostics/8.0.0", 679 | "hashPath": "microsoft.extensions.diagnostics.8.0.0.nupkg.sha512" 680 | }, 681 | "Microsoft.Extensions.Diagnostics.Abstractions/8.0.0": { 682 | "type": "package", 683 | "serviceable": true, 684 | "sha512": "sha512-JHYCQG7HmugNYUhOl368g+NMxYE/N/AiclCYRNlgCY9eVyiBkOHMwK4x60RYMxv9EL3+rmj1mqHvdCiPpC+D4Q==", 685 | "path": "microsoft.extensions.diagnostics.abstractions/8.0.0", 686 | "hashPath": "microsoft.extensions.diagnostics.abstractions.8.0.0.nupkg.sha512" 687 | }, 688 | "Microsoft.Extensions.FileProviders.Abstractions/8.0.0": { 689 | "type": "package", 690 | "serviceable": true, 691 | "sha512": "sha512-ZbaMlhJlpisjuWbvXr4LdAst/1XxH3vZ6A0BsgTphZ2L4PGuxRLz7Jr/S7mkAAnOn78Vu0fKhEgNF5JO3zfjqQ==", 692 | "path": "microsoft.extensions.fileproviders.abstractions/8.0.0", 693 | "hashPath": "microsoft.extensions.fileproviders.abstractions.8.0.0.nupkg.sha512" 694 | }, 695 | "Microsoft.Extensions.FileProviders.Physical/8.0.0": { 696 | "type": "package", 697 | "serviceable": true, 698 | "sha512": "sha512-UboiXxpPUpwulHvIAVE36Knq0VSHaAmfrFkegLyBZeaADuKezJ/AIXYAW8F5GBlGk/VaibN2k/Zn1ca8YAfVdA==", 699 | "path": "microsoft.extensions.fileproviders.physical/8.0.0", 700 | "hashPath": "microsoft.extensions.fileproviders.physical.8.0.0.nupkg.sha512" 701 | }, 702 | "Microsoft.Extensions.FileSystemGlobbing/8.0.0": { 703 | "type": "package", 704 | "serviceable": true, 705 | "sha512": "sha512-OK+670i7esqlQrPjdIKRbsyMCe9g5kSLpRRQGSr4Q58AOYEe/hCnfLZprh7viNisSUUQZmMrbbuDaIrP+V1ebQ==", 706 | "path": "microsoft.extensions.filesystemglobbing/8.0.0", 707 | "hashPath": "microsoft.extensions.filesystemglobbing.8.0.0.nupkg.sha512" 708 | }, 709 | "Microsoft.Extensions.Hosting/8.0.0": { 710 | "type": "package", 711 | "serviceable": true, 712 | "sha512": "sha512-ItYHpdqVp5/oFLT5QqbopnkKlyFG9EW/9nhM6/yfObeKt6Su0wkBio6AizgRHGNwhJuAtlE5VIjow5JOTrip6w==", 713 | "path": "microsoft.extensions.hosting/8.0.0", 714 | "hashPath": "microsoft.extensions.hosting.8.0.0.nupkg.sha512" 715 | }, 716 | "Microsoft.Extensions.Hosting.Abstractions/8.0.0": { 717 | "type": "package", 718 | "serviceable": true, 719 | "sha512": "sha512-AG7HWwVRdCHlaA++1oKDxLsXIBxmDpMPb3VoyOoAghEWnkUvEAdYQUwnV4jJbAaa/nMYNiEh5ByoLauZBEiovg==", 720 | "path": "microsoft.extensions.hosting.abstractions/8.0.0", 721 | "hashPath": "microsoft.extensions.hosting.abstractions.8.0.0.nupkg.sha512" 722 | }, 723 | "Microsoft.Extensions.Localization.Abstractions/8.0.3": { 724 | "type": "package", 725 | "serviceable": true, 726 | "sha512": "sha512-k/kUPm1FQBxcs9/vsM1eF4qIOg2Sovqh/+KUGHur5Mc0Y3OFGuoz9ktBX7LA0gPz53SZhW3W3oaSaMFFcjgM6Q==", 727 | "path": "microsoft.extensions.localization.abstractions/8.0.3", 728 | "hashPath": "microsoft.extensions.localization.abstractions.8.0.3.nupkg.sha512" 729 | }, 730 | "Microsoft.Extensions.Logging/8.0.0": { 731 | "type": "package", 732 | "serviceable": true, 733 | "sha512": "sha512-tvRkov9tAJ3xP51LCv3FJ2zINmv1P8Hi8lhhtcKGqM+ImiTCC84uOPEI4z8Cdq2C3o9e+Aa0Gw0rmrsJD77W+w==", 734 | "path": "microsoft.extensions.logging/8.0.0", 735 | "hashPath": "microsoft.extensions.logging.8.0.0.nupkg.sha512" 736 | }, 737 | "Microsoft.Extensions.Logging.Abstractions/8.0.0": { 738 | "type": "package", 739 | "serviceable": true, 740 | "sha512": "sha512-arDBqTgFCyS0EvRV7O3MZturChstm50OJ0y9bDJvAcmEPJm0FFpFyjU/JLYyStNGGey081DvnQYlncNX5SJJGA==", 741 | "path": "microsoft.extensions.logging.abstractions/8.0.0", 742 | "hashPath": "microsoft.extensions.logging.abstractions.8.0.0.nupkg.sha512" 743 | }, 744 | "Microsoft.Extensions.Logging.Configuration/8.0.0": { 745 | "type": "package", 746 | "serviceable": true, 747 | "sha512": "sha512-ixXXV0G/12g6MXK65TLngYN9V5hQQRuV+fZi882WIoVJT7h5JvoYoxTEwCgdqwLjSneqh1O+66gM8sMr9z/rsQ==", 748 | "path": "microsoft.extensions.logging.configuration/8.0.0", 749 | "hashPath": "microsoft.extensions.logging.configuration.8.0.0.nupkg.sha512" 750 | }, 751 | "Microsoft.Extensions.Logging.Console/8.0.0": { 752 | "type": "package", 753 | "serviceable": true, 754 | "sha512": "sha512-e+48o7DztoYog+PY430lPxrM4mm3PbA6qucvQtUDDwVo4MO+ejMw7YGc/o2rnxbxj4isPxdfKFzTxvXMwAz83A==", 755 | "path": "microsoft.extensions.logging.console/8.0.0", 756 | "hashPath": "microsoft.extensions.logging.console.8.0.0.nupkg.sha512" 757 | }, 758 | "Microsoft.Extensions.Logging.Debug/8.0.0": { 759 | "type": "package", 760 | "serviceable": true, 761 | "sha512": "sha512-dt0x21qBdudHLW/bjMJpkixv858RRr8eSomgVbU8qljOyfrfDGi1JQvpF9w8S7ziRPtRKisuWaOwFxJM82GxeA==", 762 | "path": "microsoft.extensions.logging.debug/8.0.0", 763 | "hashPath": "microsoft.extensions.logging.debug.8.0.0.nupkg.sha512" 764 | }, 765 | "Microsoft.Extensions.Logging.EventLog/8.0.0": { 766 | "type": "package", 767 | "serviceable": true, 768 | "sha512": "sha512-3X9D3sl7EmOu7vQp5MJrmIJBl5XSdOhZPYXUeFfYa6Nnm9+tok8x3t3IVPLhm7UJtPOU61ohFchw8rNm9tIYOQ==", 769 | "path": "microsoft.extensions.logging.eventlog/8.0.0", 770 | "hashPath": "microsoft.extensions.logging.eventlog.8.0.0.nupkg.sha512" 771 | }, 772 | "Microsoft.Extensions.Logging.EventSource/8.0.0": { 773 | "type": "package", 774 | "serviceable": true, 775 | "sha512": "sha512-oKcPMrw+luz2DUAKhwFXrmFikZWnyc8l2RKoQwqU3KIZZjcfoJE0zRHAnqATfhRZhtcbjl/QkiY2Xjxp0xu+6w==", 776 | "path": "microsoft.extensions.logging.eventsource/8.0.0", 777 | "hashPath": "microsoft.extensions.logging.eventsource.8.0.0.nupkg.sha512" 778 | }, 779 | "Microsoft.Extensions.Options/8.0.0": { 780 | "type": "package", 781 | "serviceable": true, 782 | "sha512": "sha512-JOVOfqpnqlVLUzINQ2fox8evY2SKLYJ3BV8QDe/Jyp21u1T7r45x/R/5QdteURMR5r01GxeJSBBUOCOyaNXA3g==", 783 | "path": "microsoft.extensions.options/8.0.0", 784 | "hashPath": "microsoft.extensions.options.8.0.0.nupkg.sha512" 785 | }, 786 | "Microsoft.Extensions.Options.ConfigurationExtensions/8.0.0": { 787 | "type": "package", 788 | "serviceable": true, 789 | "sha512": "sha512-0f4DMRqEd50zQh+UyJc+/HiBsZ3vhAQALgdkcQEalSH1L2isdC7Yj54M3cyo5e+BeO5fcBQ7Dxly8XiBBcvRgw==", 790 | "path": "microsoft.extensions.options.configurationextensions/8.0.0", 791 | "hashPath": "microsoft.extensions.options.configurationextensions.8.0.0.nupkg.sha512" 792 | }, 793 | "Microsoft.Extensions.Primitives/8.0.0": { 794 | "type": "package", 795 | "serviceable": true, 796 | "sha512": "sha512-bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g==", 797 | "path": "microsoft.extensions.primitives/8.0.0", 798 | "hashPath": "microsoft.extensions.primitives.8.0.0.nupkg.sha512" 799 | }, 800 | "MySqlConnector/2.2.7": { 801 | "type": "package", 802 | "serviceable": true, 803 | "sha512": "sha512-rwFa71MlOJ142S+BXDvtLRdAIn7l6PTNWu+Xehs2qRehK8dckjKqwvK8azEADCMkQyXS1LXgh9HkSvItpTi6WA==", 804 | "path": "mysqlconnector/2.2.7", 805 | "hashPath": "mysqlconnector.2.2.7.nupkg.sha512" 806 | }, 807 | "Nexd.MySQL/1.0.2": { 808 | "type": "package", 809 | "serviceable": true, 810 | "sha512": "sha512-0Erd5nw7G/K98q3e/JSGBi+mulxzl4FtNsqwRm2aHRV6ClsrDPrSswFtDmPSn4xBBh4yH8ziLBoCwRNAR/+p3w==", 811 | "path": "nexd.mysql/1.0.2", 812 | "hashPath": "nexd.mysql.1.0.2.nupkg.sha512" 813 | }, 814 | "Scrutor/4.2.2": { 815 | "type": "package", 816 | "serviceable": true, 817 | "sha512": "sha512-t5VIYA7WJXoJJo7s4DoHakMGwTu+MeEnZumMOhTCH7kz9xWha24G7dJNxWrHPlu0ZdZAS4jDZCxxAnyaBh7uYw==", 818 | "path": "scrutor/4.2.2", 819 | "hashPath": "scrutor.4.2.2.nupkg.sha512" 820 | }, 821 | "Serilog/3.1.1": { 822 | "type": "package", 823 | "serviceable": true, 824 | "sha512": "sha512-P6G4/4Kt9bT635bhuwdXlJ2SCqqn2nhh4gqFqQueCOr9bK/e7W9ll/IoX1Ter948cV2Z/5+5v8pAfJYUISY03A==", 825 | "path": "serilog/3.1.1", 826 | "hashPath": "serilog.3.1.1.nupkg.sha512" 827 | }, 828 | "Serilog.Extensions.Logging/8.0.0": { 829 | "type": "package", 830 | "serviceable": true, 831 | "sha512": "sha512-YEAMWu1UnWgf1c1KP85l1SgXGfiVo0Rz6x08pCiPOIBt2Qe18tcZLvdBUuV5o1QHvrs8FAry9wTIhgBRtjIlEg==", 832 | "path": "serilog.extensions.logging/8.0.0", 833 | "hashPath": "serilog.extensions.logging.8.0.0.nupkg.sha512" 834 | }, 835 | "Serilog.Sinks.Console/5.0.0": { 836 | "type": "package", 837 | "serviceable": true, 838 | "sha512": "sha512-IZ6bn79k+3SRXOBpwSOClUHikSkp2toGPCZ0teUkscv4dpDg9E2R2xVsNkLmwddE4OpNVO3N0xiYsAH556vN8Q==", 839 | "path": "serilog.sinks.console/5.0.0", 840 | "hashPath": "serilog.sinks.console.5.0.0.nupkg.sha512" 841 | }, 842 | "Serilog.Sinks.File/5.0.0": { 843 | "type": "package", 844 | "serviceable": true, 845 | "sha512": "sha512-uwV5hdhWPwUH1szhO8PJpFiahqXmzPzJT/sOijH/kFgUx+cyoDTMM8MHD0adw9+Iem6itoibbUXHYslzXsLEAg==", 846 | "path": "serilog.sinks.file/5.0.0", 847 | "hashPath": "serilog.sinks.file.5.0.0.nupkg.sha512" 848 | }, 849 | "System.Buffers/4.5.1": { 850 | "type": "package", 851 | "serviceable": true, 852 | "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", 853 | "path": "system.buffers/4.5.1", 854 | "hashPath": "system.buffers.4.5.1.nupkg.sha512" 855 | }, 856 | "System.Data.DataSetExtensions/4.5.0": { 857 | "type": "package", 858 | "serviceable": true, 859 | "sha512": "sha512-221clPs1445HkTBZPL+K9sDBdJRB8UN8rgjO3ztB0CQ26z//fmJXtlsr6whGatscsKGBrhJl5bwJuKSA8mwFOw==", 860 | "path": "system.data.datasetextensions/4.5.0", 861 | "hashPath": "system.data.datasetextensions.4.5.0.nupkg.sha512" 862 | }, 863 | "System.Diagnostics.DiagnosticSource/8.0.0": { 864 | "type": "package", 865 | "serviceable": true, 866 | "sha512": "sha512-c9xLpVz6PL9lp/djOWtk5KPDZq3cSYpmXoJQY524EOtuFl5z9ZtsotpsyrDW40U1DRnQSYvcPKEUV0X//u6gkQ==", 867 | "path": "system.diagnostics.diagnosticsource/8.0.0", 868 | "hashPath": "system.diagnostics.diagnosticsource.8.0.0.nupkg.sha512" 869 | }, 870 | "System.Diagnostics.EventLog/8.0.0": { 871 | "type": "package", 872 | "serviceable": true, 873 | "sha512": "sha512-fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A==", 874 | "path": "system.diagnostics.eventlog/8.0.0", 875 | "hashPath": "system.diagnostics.eventlog.8.0.0.nupkg.sha512" 876 | }, 877 | "System.Memory/4.5.4": { 878 | "type": "package", 879 | "serviceable": true, 880 | "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", 881 | "path": "system.memory/4.5.4", 882 | "hashPath": "system.memory.4.5.4.nupkg.sha512" 883 | }, 884 | "System.Runtime.CompilerServices.Unsafe/6.0.0": { 885 | "type": "package", 886 | "serviceable": true, 887 | "sha512": "sha512-/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==", 888 | "path": "system.runtime.compilerservices.unsafe/6.0.0", 889 | "hashPath": "system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512" 890 | }, 891 | "System.Text.Encodings.Web/8.0.0": { 892 | "type": "package", 893 | "serviceable": true, 894 | "sha512": "sha512-yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ==", 895 | "path": "system.text.encodings.web/8.0.0", 896 | "hashPath": "system.text.encodings.web.8.0.0.nupkg.sha512" 897 | }, 898 | "System.Text.Json/8.0.0": { 899 | "type": "package", 900 | "serviceable": true, 901 | "sha512": "sha512-OdrZO2WjkiEG6ajEFRABTRCi/wuXQPxeV6g8xvUJqdxMvvuCCEk86zPla8UiIQJz3durtUEbNyY/3lIhS0yZvQ==", 902 | "path": "system.text.json/8.0.0", 903 | "hashPath": "system.text.json.8.0.0.nupkg.sha512" 904 | } 905 | } 906 | } -------------------------------------------------------------------------------- /plugins/Advertisements/Advertisements.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnoclockdk/CS2_Advertisements/e41be54b2f41716c589d522d6b556cd385a4e133/plugins/Advertisements/Advertisements.dll -------------------------------------------------------------------------------- /plugins/Advertisements/Advertisements.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnoclockdk/CS2_Advertisements/e41be54b2f41716c589d522d6b556cd385a4e133/plugins/Advertisements/Advertisements.pdb -------------------------------------------------------------------------------- /plugins/Advertisements/MySqlConnector.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnoclockdk/CS2_Advertisements/e41be54b2f41716c589d522d6b556cd385a4e133/plugins/Advertisements/MySqlConnector.dll -------------------------------------------------------------------------------- /plugins/Advertisements/Nexd.MySQL.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnoclockdk/CS2_Advertisements/e41be54b2f41716c589d522d6b556cd385a4e133/plugins/Advertisements/Nexd.MySQL.dll -------------------------------------------------------------------------------- /source/Advertisements.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API.Core; 2 | using CounterStrikeSharp.API.Core.Attributes; 3 | using Nexd.MySQL; 4 | using static CounterStrikeSharp.API.Core.Listeners; 5 | 6 | namespace Advertisements; 7 | [MinimumApiVersion(240)] 8 | public partial class AdvertisementsCore : BasePlugin, IPluginConfig 9 | { 10 | public override string ModuleName => "Advertisements"; 11 | public override string ModuleVersion => "2.0"; 12 | public override string ModuleAuthor => "Johnoclock, xWidovV"; 13 | public override string ModuleDescription => "Display Advertisements from database"; 14 | 15 | private MySqlDb? g_Db = null; 16 | HashSet g_AdvertisementsList = new(); 17 | private CounterStrikeSharp.API.Modules.Timers.Timer? timer; 18 | public required AdvertisementConfig Config { get; set; } 19 | 20 | public void OnConfigParsed(AdvertisementConfig config) 21 | { 22 | Config = config; 23 | } 24 | 25 | public override void Load(bool hotReload) 26 | { 27 | RegisterEventHandler(EventCsWinPanelRound, HookMode.Pre); 28 | 29 | RegisterListener(OnClientAuthorized); 30 | RegisterListener(OnClientDisconnect); 31 | 32 | g_Db = new(Config.DatabaseHost!, Config.DatabaseUser!, Config.DatabasePassword!, Config.DatabaseName!, Config.DatabasePort); 33 | Console.WriteLine(g_Db.ExecuteNonQueryAsync("CREATE TABLE IF NOT EXISTS `advertisements` (`id` INT NOT NULL AUTO_INCREMENT,`message` VARCHAR(1024) NOT NULL,`location` VARCHAR(128),`server` VARCHAR(512), `flag` VARCHAR(512), `enable` int(12),PRIMARY KEY (`id`));").Result); 34 | 35 | GetAdvertisements(); 36 | 37 | Console.WriteLine("Advertisements is loaded"); 38 | } 39 | 40 | public override void Unload(bool hotReload) 41 | { 42 | timer!.Kill(); 43 | Console.WriteLine("Advertisements is unloaded"); 44 | } 45 | } -------------------------------------------------------------------------------- /source/Advertisements.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net8.0 4 | enable 5 | enable 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /source/Advertisements_Commands.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API.Core; 2 | using CounterStrikeSharp.API.Core.Attributes.Registration; 3 | using CounterStrikeSharp.API.Modules.Admin; 4 | using CounterStrikeSharp.API.Modules.Commands; 5 | using Nexd.MySQL; 6 | namespace Advertisements; 7 | public partial class AdvertisementsCore 8 | { 9 | [ConsoleCommand("css_adv", "advertisements command")] 10 | [ConsoleCommand("css_advertisements", "advertisements command")] 11 | [RequiresPermissionsOr("@css/slay", "@adv/adv", "@adv/root")] 12 | public void Command_Adv(CCSPlayerController? player, CommandInfo command) 13 | { 14 | if (!ValidClient(player)) return; 15 | 16 | if (command.ArgCount == 1) 17 | { 18 | player.PrintToChat($" {ModifyColorValue(Config.ChatPrefix!)} Please provide one argment"); 19 | player.PrintToChat("- reload"); 20 | player.PrintToChat("- add"); 21 | player.PrintToChat("- edit"); 22 | player.PrintToChat("- remove or delete"); 23 | player.PrintToChat("- list"); 24 | } 25 | } 26 | 27 | [ConsoleCommand("css_adv_add")] 28 | [ConsoleCommand("css_advertisements_add", "advertisements command")] 29 | [RequiresPermissionsOr("@css/slay", "@adv/add", "@adv/root")] 30 | public void Command_AddAdv(CCSPlayerController player, CommandInfo command) 31 | { 32 | if (command.ArgCount < 3 || command.ArgCount > 5) 33 | { 34 | player.PrintToChat($" {ModifyColorValue(Config.ChatPrefix!)} Usage: css_advertisements add []"); 35 | return; 36 | } 37 | 38 | g_Db!.ExecuteNonQueryAsync($"INSERT INTO `advertisements` (`message`, `location`, server) VALUES ('{command.ArgByIndex(2)}', '{command.ArgByIndex(3)}', '{command.ArgByIndex(4)}');"); 39 | 40 | ReloadAdvertisements(); 41 | 42 | player.PrintToChat($" {ModifyColorValue(Config.ChatPrefix!)} Successfully added {command.ArgByIndex(2)}"); 43 | } 44 | 45 | [ConsoleCommand("css_adv_edit")] 46 | [ConsoleCommand("css_advertisements_edit", "advertisements command")] 47 | [RequiresPermissionsOr("@css/slay", "@adv/edit", "@adv/root")] 48 | public void Command_EditAdv(CCSPlayerController player, CommandInfo command) 49 | { 50 | if (command.ArgCount < 3 || command.ArgCount > 4) 51 | { 52 | player.PrintToChat($" {ModifyColorValue(Config.ChatPrefix!)} Usage: css_advertisements edit "); 53 | return; 54 | } 55 | 56 | g_Db!.ExecuteNonQueryAsync($"UPDATE `advertisements` SET message = '{command.ArgByIndex(3)}' WHERE id = '{command.ArgByIndex(2)}'"); 57 | 58 | ReloadAdvertisements(); 59 | 60 | player.PrintToChat($" {ModifyColorValue(Config.ChatPrefix!)} Successfully edit {command.ArgByIndex(2)}"); 61 | } 62 | 63 | [ConsoleCommand("css_adv_delete")] 64 | [ConsoleCommand("css_adv_remove")] 65 | [ConsoleCommand("css_advertisements_remove", "advertisements command")] 66 | [ConsoleCommand("css_advertisements_delete", "advertisements command")] 67 | [RequiresPermissionsOr("@css/slay", "@adv/delete", "@adv/root")] 68 | public void Command_DelAdv(CCSPlayerController player, CommandInfo command) 69 | { 70 | if (command.ArgCount != 3) 71 | { 72 | player.PrintToChat($" {ModifyColorValue(Config.ChatPrefix!)} Usage: css_advertisements remove "); 73 | return; 74 | } 75 | 76 | g_Db!.ExecuteNonQueryAsync($"DELETE FROM `advertisements` WHERE `id` = '{command.ArgByIndex(2)}';"); 77 | 78 | ReloadAdvertisements(); 79 | 80 | player.PrintToChat($" {ModifyColorValue(Config.ChatPrefix!)} Successfully Removed {command.ArgByIndex(2)}"); 81 | } 82 | 83 | 84 | [ConsoleCommand("css_adv_reload")] 85 | [ConsoleCommand("css_advertisements_reload", "advertisements command")] 86 | [RequiresPermissionsOr("@css/slay", "@adv/reload", "@adv/root")] 87 | public void Command_ReloadAdv(CCSPlayerController player, CommandInfo command) 88 | { 89 | ReloadAdvertisements(); 90 | 91 | player.PrintToChat($" {ModifyColorValue(Config.ChatPrefix!)} advertisements reloaded"); 92 | } 93 | 94 | [ConsoleCommand("css_adv_list")] 95 | [ConsoleCommand("css_advertisements_list", "advertisements command")] 96 | [RequiresPermissionsOr("@css/slay", "@adv/list", "@adv/root")] 97 | public void Command_ListAdv(CCSPlayerController player, CommandInfo command) 98 | { 99 | player.PrintToChat($" {ModifyColorValue(Config.ChatPrefix!)} See Console for the list"); 100 | 101 | 102 | var results = g_Db!.ExecuteQuery("select * from advertisements"); 103 | 104 | foreach (KeyValuePair pair in results) 105 | { 106 | // Assuming 'id' is the column name for the ID in your database 107 | string id = pair.Value["id"]!.ToString(); 108 | string location = pair.Value["location"]!.ToString(); 109 | string message = pair.Value["message"]!.ToString(); 110 | string server = pair.Value["server"]!.ToString(); 111 | if (string.IsNullOrEmpty(server)) server = "any"; 112 | string enable = pair.Value["enable"]!.ToString(); 113 | string flag = pair.Value["flag"]!.ToString(); 114 | if (string.IsNullOrEmpty(flag)) flag = "all"; 115 | 116 | // Print both ID and message to the console 117 | player.PrintToConsole("ID: " + id + ", Message: " + message + ", Location: " + location + ", Port: " + server + ", Flag: " + flag + ", Enable: " + enable + "\n"); 118 | } 119 | } 120 | } -------------------------------------------------------------------------------- /source/Advertisements_Event.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API.Core; 2 | using CounterStrikeSharp.API; 3 | namespace Advertisements; 4 | 5 | public partial class AdvertisementsCore 6 | { 7 | private int panelAdIndex = 0; // New index for panel advertisements 8 | 9 | private HookResult EventCsWinPanelRound(EventCsWinPanelRound handle, GameEventInfo info) 10 | { 11 | foreach (CCSPlayerController player in Utilities.GetPlayers()) 12 | { 13 | if (!ValidClient(player)) 14 | { 15 | continue; 16 | } 17 | 18 | Advertisement advertisement = g_AdvertisementsList.ElementAt(currentAdIndex[player.SteamID]); 19 | 20 | if (!advertisement.Location.Equals("panel", StringComparison.OrdinalIgnoreCase)) 21 | { 22 | continue; 23 | } 24 | // Handle advertisements with location "panel" 25 | handle.FunfactToken = ReplaceMessageTags(advertisement.Message, player); 26 | handle.TimerTime = 5; 27 | } 28 | panelAdIndex = (panelAdIndex + 1) % g_AdvertisementsList.Count; // Update panelAdIndex 29 | 30 | return HookResult.Continue; 31 | } 32 | } -------------------------------------------------------------------------------- /source/Advertisements_cfg.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API.Core; 2 | 3 | namespace Advertisements; 4 | 5 | public class AdvertisementConfig : BasePluginConfig 6 | { 7 | public string? ChatPrefix { get; set; } = "{lightblue}Advertisement{defualt} | "; 8 | public string? DatabaseHost { get; set; } = "ip"; 9 | public int DatabasePort { get; set; } = 3306; 10 | public string? DatabaseUser { get; set; } = "root"; 11 | public string? DatabasePassword { get; set; } = "passoword"; 12 | public string? DatabaseName { get; set; } = "database"; 13 | public float Timer { get; set; } = 60; 14 | } 15 | -------------------------------------------------------------------------------- /source/Advertisements_help.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API.Core; 2 | using CounterStrikeSharp.API.Modules.Cvars; 3 | using CounterStrikeSharp.API.Modules.Timers; 4 | using CounterStrikeSharp.API.Modules.Utils; 5 | using System.Reflection; 6 | using CounterStrikeSharp.API; 7 | using Nexd.MySQL; 8 | using CounterStrikeSharp.API.Modules.Admin; 9 | using System.Collections.Generic; 10 | using CounterStrikeSharp.API.Modules.Entities; 11 | namespace Advertisements; 12 | 13 | public partial class AdvertisementsCore 14 | { 15 | private void ReloadAdvertisements() 16 | { 17 | g_AdvertisementsList.Clear(); 18 | FetchAdvertisements(); 19 | } 20 | 21 | private void GetAdvertisements() 22 | { 23 | FetchAdvertisements(); 24 | timer = AddTimer(Config.Timer, Timer_Advertisements, TimerFlags.REPEAT); 25 | } 26 | 27 | private void FetchAdvertisements() 28 | { 29 | string currentServerPort = ConVar.Find("hostport")!.GetPrimitiveValue().ToString(); 30 | var results = g_Db!.ExecuteQuery("select * from `advertisements`"); 31 | 32 | foreach (KeyValuePair pair in results) 33 | { 34 | string serverPorts = pair.Value["server"]?.ToString() ?? ""; 35 | string enable = pair.Value["enable"]?.ToString() ?? ""; 36 | if (enable == "0") continue; 37 | 38 | if (string.IsNullOrEmpty(serverPorts) || serverPorts.Split(',').Select(p => p.Trim()).Contains(currentServerPort)) 39 | { 40 | string message = pair.Value["message"]!.ToString(); 41 | string location = pair.Value["location"]!.ToString(); 42 | string flags = pair.Value["flag"]?.ToString() ?? ""; 43 | 44 | g_AdvertisementsList.Add(new Advertisement(message, location, flags)); 45 | } 46 | } 47 | } 48 | 49 | Dictionary currentAdIndex = new(); 50 | Dictionary> PlayerAdvertisement = new(); 51 | 52 | private void Timer_Advertisements() 53 | { 54 | 55 | if (g_AdvertisementsList == null || g_AdvertisementsList.Count < 1) 56 | { 57 | Console.WriteLine("No advertisements to display."); 58 | return; 59 | } 60 | 61 | foreach (CCSPlayerController player in Utilities.GetPlayers()) 62 | { 63 | if (!ValidClient(player)) continue; 64 | 65 | if (!PlayerAdvertisement[player.SteamID].Any()) 66 | { 67 | continue; 68 | } 69 | 70 | DisplayAdvertisement(player, PlayerAdvertisement[player.SteamID].ElementAt(currentAdIndex[player.SteamID])); 71 | // Move to the next advertisement for the next timer tick 72 | currentAdIndex[player.SteamID] = (currentAdIndex[player.SteamID] + 1) % PlayerAdvertisement[player.SteamID].Count; 73 | } 74 | } 75 | 76 | private void OnClientAuthorized(int playerSlot, SteamID steamId) 77 | { 78 | if (playerSlot == 65535 || !steamId.IsValid()) 79 | { 80 | return; 81 | } 82 | 83 | // Tror ikke dette er nødvendigt 84 | currentAdIndex[steamId.SteamId64] = 0; 85 | PlayerAdvertisement[steamId.SteamId64] = g_AdvertisementsList.Where(x => string.IsNullOrEmpty(x.Flag) || AdminManager.PlayerHasPermissions(steamId, x.Flag.Split(','))).ToHashSet(); 86 | } 87 | 88 | private void OnClientDisconnect(int playerSlot) 89 | { 90 | CCSPlayerController player = Utilities.GetPlayerFromSlot(playerSlot); 91 | if (!ValidClient(player)) return; 92 | currentAdIndex.Remove(player.SteamID); 93 | PlayerAdvertisement.Remove(player.SteamID); 94 | } 95 | 96 | 97 | private void DisplayAdvertisement(CCSPlayerController player, Advertisement advertisement) 98 | { 99 | // Ensure both player and advertisement are valid 100 | if (player == null || advertisement == null) 101 | { 102 | Console.WriteLine("Invalid player or advertisement."); 103 | return; 104 | } 105 | 106 | // Display the advertisement based on its specified location 107 | switch (advertisement.Location) 108 | { 109 | case "chat": 110 | // Display the advertisement in chat 111 | player.PrintToChat($" {ModifyColorValue(Config.ChatPrefix!)} {ReplaceMessageTags(advertisement.Message, player)}"); 112 | break; 113 | 114 | case "center": 115 | // Display the advertisement in the center of the screen 116 | player.PrintToCenter($" {ModifyColorValue(Config.ChatPrefix!)} {ReplaceMessageTags(advertisement.Message, player)}"); 117 | break; 118 | 119 | default: 120 | // Handle unknown locations, perhaps log an error or ignore 121 | Console.WriteLine($"Unknown advertisement location: {advertisement.Location}"); 122 | break; 123 | } 124 | } 125 | 126 | 127 | // Essential method for replacing chat colors from the config file, the method can be used for other things as well. 128 | public static string ModifyColorValue(string msg) 129 | { 130 | if (!msg.Contains('{')) 131 | { 132 | return string.IsNullOrEmpty(msg) ? "" : msg; 133 | } 134 | 135 | string modifiedValue = msg; 136 | 137 | foreach (FieldInfo field in typeof(ChatColors).GetFields()) 138 | { 139 | string pattern = $"{{{field.Name}}}"; 140 | if (msg.Contains(pattern, StringComparison.OrdinalIgnoreCase)) 141 | { 142 | modifiedValue = modifiedValue.Replace(pattern, field.GetValue(null)!.ToString(), StringComparison.OrdinalIgnoreCase); 143 | } 144 | } 145 | return modifiedValue; 146 | } 147 | 148 | public class Advertisement 149 | { 150 | public string Message { get; set; } 151 | public string Location { get; set; } 152 | public string Flag { get; set; } 153 | 154 | public Advertisement(string message, string location, string flag) 155 | { 156 | Message = message; 157 | Location = location; 158 | Flag = flag; 159 | } 160 | } 161 | 162 | private bool ValidClient(CCSPlayerController player) 163 | { 164 | if (player == null || !player.IsValid || player.Connected != PlayerConnectedState.PlayerConnected || player.IsHLTV || !player.PlayerPawn.IsValid || player.UserId == -1 || player.IsBot || player.Slot == 65535) return false; 165 | return true; 166 | } 167 | 168 | private string ReplaceMessageTags(string message, CCSPlayerController player) 169 | { 170 | // Replace various tags with corresponding values 171 | message = message 172 | .Replace("{CURRENTMAP}", Server.MapName) 173 | .Replace("{TIME}", DateTime.Now.ToString("HH:mm:ss")) 174 | .Replace("{DATE}", DateTime.Now.ToString("dd.MM.yyyy")) 175 | .Replace("{SERVERNAME}", ConVar.Find("hostname")!.StringValue) 176 | .Replace("{NAME}", player.PlayerName) 177 | .Replace("{STEAMID}", player.SteamID.ToString()) 178 | .Replace("{PLAYERCOUNT}", Utilities.GetPlayers().FindAll(x => ValidClient(x)).Count.ToString()) 179 | .Replace("{MAXPLAYERS}", Server.MaxPlayers.ToString()) 180 | .Replace("{IP}", ConVar.Find("ip")!.StringValue) 181 | .Replace("{PORT}", ConVar.Find("hostport")!.GetPrimitiveValue().ToString()) 182 | .Replace("{NEWLINE}", "\u2029"); 183 | return ModifyColorValue(message); 184 | } 185 | } 186 | --------------------------------------------------------------------------------