Giter Site home page Giter Site logo

k4ryuu / cs2_simpleranks Goto Github PK

View Code? Open in Web Editor NEW
27.0 2.0 1.0 2.37 MB

A CS2 server extension that allows you to create an unlimited number of ranks with customizable experience thresholds and rank colors. Players gain or lose experience during various in-game events, enabling them to advance or regress between ranks. The extension is fully configurable using 'configs.json' and utilizes MySQL to store data.

License: GNU General Public License v3.0

C# 100.00%
cs2 extension metamod plugin cssharp counter-strike-2

cs2_simpleranks's Introduction

Who Am I?

  • Game Developer & Modder as Hobby | DevOps Engineer at a Government Agency
  • Passionate about technology, continuous learning, and digital creativity
  • Explorer of new destinations and underground raves

What I Do

Front-End Development: React | C# | JavaScript | TypeScript | HTML | CSS
Back-End Development: Next.js | Node.js | PHP | C++ | Python | SourcePawn
Databases: MySQL | PostgreSQL | MongoDB | SQLite
DevOps: Docker | Kubernetes
Additional Skills: Swift | React Native | GoLang | VB | Unreal Engine | Nginx

Support & Connect


Discord | PayPal | Revolut | BuyMeACoffee

cs2_simpleranks's People

Contributors

k4ryuu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dekhu48

cs2_simpleranks's Issues

[BUG] crash after fresh setup

Describe the bug
After clean setup I have lag when joining to team

To Reproduce
Meta info:

meta list
Listing 4 plugins:
  [01] Mini VIP (1.0.0) by Phoenix (˙·٠●Феникс●٠·˙)
  [02] CounterStrikeSharp (0.1.0) by Roflmuffin
  [03] <NOFILE>
  [04] Base Admin (1.2) by Pisex
meta version
 Metamod:Source Version Information
    Metamod:Source version 2.0.0-dev+1256
    Plugin interface version: 16:14
    SourceHook version: 5:5
    Loaded As: GameDLL (gameinfo.txt)
    Compiled on: Oct 26 2023 10:57:52
    Built from: https://github.com/alliedmodders/metamod-source/commit/6ee74f0
    Build ID: 1256:6ee74f0
    http://www.metamodsource.net/

Steps to reproduce the behavior:

  1. Fresh install
  2. Setup db, nothing more
  3. join team
  4. type !rank

Expected behavior
A clear and concise description of what you expected to happen.

Media (Optional)
If applicable, add screenshots or videos to help explain your problem.

Logs (Optional)

SV:  Disconnect client 'DZAGU GLOBALELITE.pl' from server(5): NETWORK_DISCONNECT_OVERFLOW
[#784628046 UDP steamid:[email protected]:59274] recv queue overflow 1000 messages already queued.
[#784628046 UDP steamid:[email protected]:59274] recv queue overflow 1000 messages already queued.
[#784628046 UDP steamid:[email protected]:59274] recv queue overflow 1000 messages already queued.
[#784628046 UDP steamid:[email protected]:59274] recv queue overflow 1000 messages already queued.
[#784628046 UDP steamid:[email protected]:59274] recv queue overflow 1000 messages already queued.
[#784628046 UDP steamid:[email protected]:59274] recv queue overflow 1000 messages already queued.
[#784628046 UDP steamid:[email protected]:59274] recv queue overflow 1000 messages already queued.
[#784628046 UDP steamid:[email protected]:59274] recv queue overflow 1000 messages already queued.
[#784628046 UDP steamid:[email protected]:59274] recv queue overflow 1000 messages already queued.
[#784628046 UDP steamid:[email protected]:59274] recv queue overflow 1000 messages already queued.
[#784628046 UDP steamid:[email protected]:59274] recv queue overflow 1000 messages already queued.
[#784628046 UDP steamid:[email protected]:59274] recv queue overflow 1000 messages already queued.
[#784628046 UDP steamid:[email protected]:59274] recv queue overflow 1000 messages already queued.
[#784628046 UDP steamid:[email protected]:59274] recv queue overflow 1000 messages already queued.
[#784628046 UDP steamid:[email protected]:59274] recv queue overflow 1000 messages already queued.

Additional context (Optional)
Add any other context about the problem here.

[BUG] 2.0.2. Ranks are not visible in the tab

OC Debian 11
Metamod:Source version 2.0.0-dev+1256
Counterstrikesharp-build-16-d4a2ae6
[6]: "Simple Ranks" (v2.0.2) by K4ryuu

"ScoreboardRanks": true
Ranks are not visible in the tab, even after rankup. At the same time information is displayed correctly in chat.
There are no errors in the logs. Simple Ranks [v2.0.2] by K4ryuu has been loaded.

Support for resetting points

It would be interesting to have support for the player and the admin to reset the players' points.

The option for the player to reset their own points would be interesting to include as an option to leave this feature activated or not for them.

And the option to reset the points of all players at once, only access for players with admin.

[BUG]

Failed to load plugin /home/container/game/csgo/addons/counterstrikesharp/plugins/K4ryuuSimpleRanks/K4ryuuSimpleRanks.dll with error System.MissingMethodException: Method not found: 'CounterStrikeSharp.API.Core.CCSPlayerController CounterStrikeSharp.API.Utilities.GetPlayerFromIndex(Int32)'.
at K4ryuuSimpleRanks.SimpleRanks.Load(Boolean hotReload)
at CounterStrikeSharp.API.Core.PluginContext.Load(Boolean hotReload)
at CounterStrikeSharp.API.Core.GlobalContext.LoadPlugin(String path)
at CounterStrikeSharp.API.Core.GlobalContext.LoadAllPlugins()

what is it?

[BUG] After using the command, it throws errors

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.InvalidOperationException: Nullable object must have a value.
   at K4ryuuPlaytimePlugin.PlaytimePlugin.OnClientSpawn(EventPlayerSpawn event, GameEventInfo info) in /Users/sples/Documents/GitHub/CS2_PlaytimeTracker/src/K4ryuuPlaytimeTracker.cs:line 91
   at InvokeStub_GameEventHandler`1.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext* context) in /__w/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 81
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at CounterStrikeSharp.API.Modules.Utils.CHandle`1.get_Index() in /__w/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Utils/CHandle.cs:line 26
   at CounterStrikeSharp.API.Modules.Utils.CHandle`1.get_IsValid() in /__w/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Utils/CHandle.cs:line 24
   at K4ryuuSimpleRanks.SimpleRanks.<>c.<SetupGameEvents>b__11_10(EventPlayerSpawn event, GameEventInfo info) in /Users/sples/Documents/GitHub/CS2_SimpleRanks/src/K4ryuuSimpleRanks.cs:line 449
   at InvokeStub_GameEventHandler`1.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext* context) in /__w/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 81
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.Collections.Generic.KeyNotFoundException: The given key '238' was not present in the dictionary.
   at K4ryuuPlaytimePlugin.PlaytimePlugin.OnClientConnect(EventPlayerConnectFull event, GameEventInfo info) in /Users/sples/Documents/GitHub/CS2_PlaytimeTracker/src/K4ryuuPlaytimeTracker.cs:line 71
   at InvokeStub_GameEventHandler`1.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext* context) in /__w/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 81
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.Collections.Generic.KeyNotFoundException: The given key '238' was not present in the dictionary.
   at K4ryuuPlaytimePlugin.PlaytimePlugin.OnClientTeam(EventPlayerTeam event, GameEventInfo info) in /Users/sples/Documents/GitHub/CS2_PlaytimeTracker/src/K4ryuuPlaytimeTracker.cs:line 117
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext* context) in /__w/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 81
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.Collections.Generic.KeyNotFoundException: The given key '238' was not present in the dictionary.
   at K4ryuuPlaytimePlugin.PlaytimePlugin.OnClientSpawn(EventPlayerSpawn event, GameEventInfo info) in /Users/sples/Documents/GitHub/CS2_PlaytimeTracker/src/K4ryuuPlaytimeTracker.cs:line 91
   at InvokeStub_GameEventHandler`1.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext* context) in /__w/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 81
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.Collections.Generic.KeyNotFoundException: The given key '238' was not present in the dictionary.
   at K4ryuuPlaytimePlugin.PlaytimePlugin.OnClientSpawn(EventPlayerSpawn event, GameEventInfo info) in /Users/sples/Documents/GitHub/CS2_PlaytimeTracker/src/K4ryuuPlaytimeTracker.cs:line 91
   at InvokeStub_GameEventHandler`1.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext* context) in /__w/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 81

!rank not working, points not saved.

plugin works, but !rank is not working, points won't be saved in external mysql server but plugin creates the mysql table k4ranks.

edit: i have a ' in front of my name, mysql does not add my name. if i change my name to test, it works fine.

i change collation to utf8mb4_unicode_ci, still does not work, it does not add me when i have ' in front of my name for example 'TESTUSERNAME

New Release Scoreboard ranks

I just tested your new release, and "ScoreboardRanks": is set to true, but I dont get ranks on scoreboard, what did i do wrong :P. I Reinstalled everything except ranks.json

does not load

csharp running, added all files from this plugin in counterstrikesharp/plugins

  • created a folder in .../plugins/K4ryuuSimpleRanks

but nothing works.

[REQ] Support for rank images on the scoreboard

Implement players' rankings to be displayed on the scoreboard based on their points.

image
image
image

Each rank has its points configured in the plugin configuration, it would be interesting for each rank that the player reaches to show the rank he is in on the score.

To begin with, we can use the patents that are in CS2, Competitive and PREMIER and Wingman, and thus allow us to configure which patent image it will show as default.

In the future, if CS2 allows the use of FastDL, we can start creating our own patent images and using them.

Error mysql [BUG]

Error: Error while getting groupped points: This MySqlConnection is already in use. See https://fl.vu/mysql-conn-reuse
Error: Error while getting or updating rank info: Can't call this method when MySqlDataReader is closed.

[BUG] in FFA not expected behaviour

Describe the bug
Great Plugin! However its not behaving normal in FFA servers, when you kill a teammate u get -XP.

To Reproduce
Steps to reproduce the behavior:

  1. Change Setting to FFA
  2. Kill Teammate
  3. See error in chat

Expected behavior
Should give u regular XP for the kill, because FFA is enabled.

Does not create config[BUG]

meta plugins
[Client] [01] CounterStrikeSharp (0.1.0) by Roflmuffin
[Client] [02] Base Admin (1.2) by Pisex
meta version
[Client] Metamod:Source Version Information
[Client] Metamod:Source version 2.0.0-dev+1256
[Client] Plugin interface version: 16:14
[Client] SourceHook version: 5:5
[Client] Loaded As: GameDLL (gameinfo.txt)
[Client] Compiled on: Oct 26 2023 10:57:52
[Client] Built from: alliedmodders/metamod-source@6ee74f0
[Client] Build ID: 1256:6ee74f0
[Client] http://www.metamodsource.net/

After uploading everything and resetting the server, it does not create a config.json file for me

obraz_2023-11-04_142202500

[BUG]

Hello,
after installed this plugin, my server is crashing when i want to start it..
If I delete this plugin, the crash is gone.
Whats the problem?

SRKHOST~ The server is marked as down...
SRKHOST~ ---------- The server is down (crash) ----------
SRKHOST~ Exit code: 139
SRKHOST~ Out of memory?: false

[REQ] Killed by bot take points

If you play DM FFA "FFAMode": true, and there are some bots you get minus point when you killed by Bot.
In config is "PointsForBots": false, - you can't get point for killing bot, but there is no parameter for PointsBotsKill false.
You can lost all points when you play with 10 bots and 1 more players.
Could be posible to add this? :]

[REQ] ResetAll command & More statistics

  • Add "reset_all" command only for root
  • More statistics:
    • Kills
    • Deaths
    • Headshots
    • Knives
    • C4 exploded/defused
    • Rounds won as CT/T
    • Penetrated
    • NoScope
    • Thrusmoke
    • BlindKill
    • MVPs
    • Maybe you can add in config the length of ranktop command to be increased from 5 to 10(in this range)

Thanks for your work. You are awesome!

[BUG] !ranktop

When we do the !ranktop command, it displays our rank for all the players on the list, as shown in the image below:

20231110025527_1

My ranks :

Silver I - Exp: 0
Silver II - Exp: 50
Silver III - Exp: 100
Silver IV - Exp: 150
Silver Elite - Exp: 200
Silver Elite Master - Exp: 250
Gold Nova I - Exp: 300

ect ...

Error: Error while getting groupped points

First of all, when the server was rebooted, no new table was created in the database.
After using the command:

CREATE TABLE IF NOT EXISTS k4ranks (idMEDIUMINT(8) AUTO_INCREMENT PRIMARY KEY,steam_idVARCHAR(32) NOT NULL,rankVARCHAR(64) DEFAULT NULL,points INT(11) NOT NULL, UNIQUE (steam_id));

After rebooting the server, the server successfully communicates with the database and data is written.
After using the !rank command, the following error occurs:

Screenshot_1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.