Coder Social home page Coder Social logo

deafps / sharptimer Goto Github PK

View Code? Open in Web Editor NEW
67.0 5.0 19.0 1.98 MB

SharpTimer is a "simple" Surf/KZ/Bhop/MG/Deathrun/etc. CS2 Timer plugin using CounterStrikeSharp

Home Page: https://x.com/DEAFPS_

License: GNU General Public License v3.0

C# 100.00%
bhop counterstrikesharp cs2 kreed metamod source2 surf timer counterstrike2 deathrun mg

sharptimer's Introduction

Buy Me a Coffee at ko-fi.com SharpTimer Discord

SharpTimer

SharpTimer is a "simple" Surf/KZ/Bhop/MG/Deathrun/etc. CS2 Timer plugin using CounterStrikeSharp

Features

Timer, speedometer and key input with color customization
Players PB
Surf Stages and Checkpoints
Replays
Discord Webhook
JumpStats
Map CFGs
Custom PlayerModels
VIP Perks
Bonus stages
Server Point System & Map Ranks
Rank Icons
KZ Checkpoint system (disabled by default, check config)


Dependencies

MetaMod

CounterStrikeSharp (v215 and up)

SharpTimerModelSetter (optional but recommended for custom player models)

MovementUnlocker (optional but recommended)

Web panel (optional but recommended)

Install

  • Download the latest release,

  • Unzip into your servers game/csgo/ directory,

  • โ— See game/csgo/cfg/SharpTimer/config.cfg for basic plugin configuration,

  • โ— It is recommended to have a custom server cfg with your desired settings (for example SURF or KZ),

TODO List

  • HUD
    • Speedometer
    • Pre
    • Timer
    • Info
      • PB
      • Map Rank Icon
      • Map Rank (ie 1/100)
      • Map Tier
      • Map Type
    • Spectator HUD
  • Zones
    • Hook common triggers by default
    • Manual Zones
    • Hook Bonus Zones Triggers (KZ & Surf)
  • Player PBs
    • Save to Json
    • Save to MySQL
  • Ranks
    • Map !top
    • Map !topbonus
    • Global server ranks
      • !points
      • Global Point system
  • Surf Stages/Checkpoint support
    • Stage/Checkpoint PBs with u/s
      • Json Stage/Checkpoint PBs saving
      • MySql Stage/Checkpoint PBs saving
  • MySQL
    • Basic Player Records
    • Player Server Stats
    • Player Map Stats
  • Replays
  • Jumpstats
    • Distance
    • Pre
    • Max
    • Height
    • Width
    • Sync
    • Jump Types
      • Long Jump
      • BunnyHop
      • MultiBunnyHop
      • Jump Bug
      • Edge Bug
      • Ladder Jump
  • Silly Stuff
    • Color customization
    • Special Tester Gifs
    • Custom Player Gifs
    • Dioscord Webhook
    • Strafe Sync Bar on HUD

Author: @DEAFPS_

sharptimer's People

Contributors

angatv avatar deafps avatar rcon420 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sharptimer's Issues

Chat color inconsistencies (config: sharptimer_hud_primary_color)

I'm using v0.2.3 and CSS v193. For some reason certain colours do not work for sharptimer_hud_primary_color in chat, they end up being a random colour. However, the config defined colour still always works on the timer time.

For example, #FFFFFF (white) works fine in both chat and for the timer time. However, if I change it to #FF20EC (violet), then the timer time will be #FF20EC but for some reason the chat colour is #AF85E9 (purple) when I inspect a screenshot of it with a hex colour identifier.

If I change it to #70F0FB (a light blue), the chat colour changes to #B5B8BD (grey). I found that most colours I tested ended up being this grey color in chat.

ERROR

[SharpTimerERROR] Exception in trigger_multiple OnStartTouch hook: Could not find a part of the path '/home/container/game/csgo/cfg/SharpTimer/PlayerRecords/surf_lockdown.json/_bonus1'.

BUG:ERROR INVOKING CALLBACK

08:28:07 [EROR] (cssharp:Core) Error invoking callback
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 SharpTimer.SharpTimer.b__82_5(CEntityIOOutput output, String name, CEntityInstance activator, CEntityInstance caller, CVariant value, Single delay)
at InvokeStub_EntityOutputHandler.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.InvokeWithManyArguments(RuntimeMethodInfo mi, Int32 argCount, Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
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 /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 82

Server Time

Idk if any possible way to stop the timer, or when is nobody onthe server and the first person enter just restart like just changed the map

because today become from work and the server of surf time was stuck on the map time was 0:00 and the map cycle didnt change to another

Out of memory

When using this plugin, as more and more players enter, the server memory usage will reach 3.5G and prompt a memory overflow, causing the server to crash

System: debian 11

possibly implementing rampglitch fix into timer?

helloooo everyone. so I know valve has not fixed this disgusting surf ramp bug yet, but for those who are out of the loop it's been confirmed that it's a problem within CS2 as a game, it is not a problem with the source2 engine itself thankfully for us.

this means there has got to be a way to fix it. it looks like someone has tried to do so before in a CS2 KZ plugin, here

now this may be a bit beyond me, but the commits are there and you can see the changes, maybe there is a possibility we can piggyback off of this, and someone can make a fork of Sharptimer with the fix implemented to see if it helps with the rampbug issue? maybe eventually it can be built into sharptimer itself.

why? well i think this would be beneficial to the community because basically every surf surfer uses this timer plugin and it would effectively fix the ramp bugs for everyone and maybe help to get some traction back into the surf gamemode and community servers as a whole!

Now, I don't know much about changing stuff on the plugin side of things but personally i'm going to do some more research and see if maybe I can implement it as a proof of concept in a fork and see if it works or not. If anyone else wants to try, please feel free. maybe the author will see this and it'll get some gears turning.

hope everyones having a good day :)

[CRASH]: Crash when selecting team on Windows

On Windows the server crashes when you choose a team when SharpTimer is loaded. It does not crash when other plugins like GunGame are loaded and you choose a team.

I understand it is some outdated signatures for Windows, just wondering if you can help debug what calls would be getting made when or soon after choosing a team that the CSSharp team can investigate.

The exact same setup works on Ubuntu.

CounterStrikeSharp: v166

meta version
 Metamod:Source Version Information
    Metamod:Source version 2.0.0-dev+1282
    Plugin interface version: 16:14
    SourceHook version: 5:5
    Loaded As: GameDLL (gameinfo.txt)
    Compiled on: Feb  7 2024 19:03:42
    Built from: https://github.com/alliedmodders/metamod-source/commit/3740821
    Build ID: 1282:3740821
    http://www.metamodsource.net/

meta list
Listing 1 plugin:
  [01] CounterStrikeSharp (0.1.0) by Roflmuffin

css_plugins list
  List of all plugins currently loaded by CounterStrikeSharp: 7 plugins loaded.
  [#1:LOADED]: "CS2-Ultimate-Mapchooser" (1.0.0) by Kus (https://steamcommunity.com/id/kus/)
    The Ultimate Mapchooser for CS2!
  [#2:LOADED]: "CS2Rcon" (1.2.0) by LordFetznschaedl
    Allows for server commands to be executed from the client using !rcon
  [#3:LOADED]: "CS2_ExecAfter" (1.0.0) by Kus (https://github.com/kus)
    Executes a command after server event or a delay. exec_after for help
  [#4:LOADED]: "[Custom] Map Configurator" (V. 1.0.2 [Beta]) by Manifest @Road To Glory
    Allow server owners to easily create unique configuration files on a per map basis.
  [#5:LOADING]: "SimpleAdmin" (0.1.2)
  [#6:LOADED]: "SharpTimer" (0.2.1 - 2/10/2024 11:04:20 PM) by DEAFPS https://github.com/DEAFPS/
    A simple CSS Timer Plugin
  [#7:LOADED]: "Remove Map Weapons" (1.0.0) by Kus (https://steamcommunity.com/id/kus/)
    Remove the weapons from the map

This is the error it throws in the console:

Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Repeat 2 times:
--------------------------------
   at CounterStrikeSharp.API.Core.Helpers.InvokeNative(IntPtr)
--------------------------------
   at CounterStrikeSharp.API.Core.ScriptContext.InvokeNativeInternal()
   at CounterStrikeSharp.API.Core.NativeAPI.ExecuteVirtualFunction[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](IntPtr, System.Object[])
   at CounterStrikeSharp.API.Modules.Memory.VirtualFunction+<>c__DisplayClass2_0`1[[System.IntPtr, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<CreateVoid>b__1(IntPtr)
   at CounterStrikeSharp.API.Modules.Memory.VirtualFunctionVoid`1[[System.IntPtr, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(IntPtr)
   at SharpTimer.SharpTimer.RemovePlayerCollision(CounterStrikeSharp.API.Core.CCSPlayerController)
   at SharpTimer.SharpTimer.TimerOnTick()
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, Void**, System.Signature, Boolean)
   at System.Reflection.MethodInvoker.Invoke(System.Object, IntPtr*, System.Reflection.BindingFlags)
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at System.Delegate.DynamicInvokeImpl(System.Object[])
   at CounterStrikeSharp.API.Core.BasePlugin+<>c__DisplayClass45_0`1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<RegisterListener>b__2(CounterStrikeSharp.API.Core.ScriptContext)
   at DynamicClass.InvokeStub_Action`1.Invoke(System.Object, System.Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(System.Object, IntPtr*, System.Reflection.BindingFlags)
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at System.Delegate.DynamicInvokeImpl(System.Object[])
   at CounterStrikeSharp.API.Core.FunctionReference+<>c__DisplayClass3_0.<.ctor>b__0(CounterStrikeSharp.API.Core.fxScriptContext*)

Add SSJ and Gain

Hello, I wanted to ask if you plan on adding SSJ, gain and sync on future updates?
Something like this, as seen on other servers:
image

Thanks!

Adjustment suggestions

For remote data:
https://steamcommunity.com/sharedfiles/filedetails/3165517928

  1. It would also be nice to have a maptier mysql table in the near future.
  2. Its a bit confusing that the timer doesnt store mapdata if zone triggers are defaults as you mentioned in https://github.com/DEAFPS/SharpTimer/wiki/Map-Data#default-zone-triggers
  3. sv_gameinstructor_enable is not a valid command. But there is a equivalent sv_gameinstructor_disable
  4. Unknown commands:
    sv_clamp_unsafe_velocities sv_ledge_mantle_helper sv_water_movespeed_multiplier sv_water_swim_mode sv_weapon_encumbrance_per_item sv_weapon_encumbrance_scale sv_gameinstructor_enable
  5. Some of the executing convars is cheat protected flag. Like:
    sv_standable_normal sv_infinite_ammo CS_WarnFriendlyDamageInterval
  6. It would be nice if this can get implemented somehow, because CS2 movement is really garbage. https://github.com/Source2ZE/CS2Fixes/blob/9d00b563436c07185f226c5060b94cde55d732d6/cfg/cs2fixes/cs2fixes.cfg#L18

I must commend you on your excellent work thus far. Keep it up! :)

EDIT:
There is also a bug: INFO] (plugin:SharpTimer) [SharpTimerERROR] Error in OnPlayerConnect: Object reference not set to an instance of an object.

Timer doesn't restart while standing into starting zone

SharpTimer version: Release v0.0.6
CounterStrikeSharp Version: v86
Timer doesn't set to 0:00:00 which players can use that to manipulate time run. Timer only resets when leaving the zone not standing into it.

Proof:
Creating a checkpoint, failing a jump and walking into starting zone doesn't restart timer. Using !tp standing in starting zone teleports to checkpoint while restarting a timer. Using this, players can manipulate the timer.
https://www.youtube.com/watch?v=-O9chU_d-F8

Probably the solution:
Standing in a zone should set timer to 0;00:00 and stops it at that time. Right now timer sets at 0:00:00 while leaving the zone.

Rewrite keysLineNoHtml to not hardcode an assumed keyboard layout

string keysLineNoHtml = $"{(hudEnabled ? "<br>" : "")}<font class='fontSize-ml stratum-light-mono' color='{tertiaryHUDcolor}'>{((playerButtons & PlayerButtons.Moveleft) != 0 ? "A" : "_")} " +

not everyone uses qwerty so the displayed keys can be confusing and inaccurate.
if possible i strongly suggest using ๐Ÿ ˆ ๐Ÿ Š ๐Ÿ ‰ ๐Ÿ ‹ or any such variant in place of the movement keys.

Server safety help

Someone fuck the top list with something special i think..... Should I worry about the safety ?
ๅฑๅน•ๆˆชๅ›พ 2023-12-16 005156

[SharpTimerERROR] Error in TimerOnTick:

Was getting this error the past few days. I was running .3 at the time. Just updated to .4. Will check to see if error occurs still.

[SharpTimerERROR] Error in TimerOnTick: Method not found: 'Single ByRef CounterStrikeSharp.API.Core.CCSPlayerPawn
Base.get_VelocityModifier()'.

How to change zones length if is possible ?

Hi guys,
I want to change and re-adjust the zones length and add some checkpoints on some maps (surf server), but unfortunately, i didn't find exactly where I can do this adjustment, is there any possibility of doing this?

Crash on timing

This happens and then a crash once a timer is completed, I save the times in MySQL and its fake zones used

image

Happened on both of those unix timestamps occurences

image

My reasoning to why it must be sharptimer, is cus its the only "timer" plugin I use and also this happens when someone is hitting the endzone (saving the time)

image

Change language

hello it's possible to change language to Slovak ? Or rewrite some files ?

'Error in HandlePlayerStageTimes' When doing a run after resetting.

Hello! When I use the reset run feature, the next time I hit a new stage, it shows the error '[SharpTimerERROR] Error in HandlePlayerStageTimes: An item with the same key has already been added. Key: (Next stage number)'
It stops showing it once you finish a run but then appears again if you use the reset feature. It doesn't seem to effect final saved times but it is annoying that it fills my console view!

1-9 stage Kitsune example
image

Top record print on chat multiple times

SharpTimer version: Release v0.0.8
CounterStrikeSharp Version: v86

Issue:
obraz

I don't know what depends on this. Sometimes top record only print once and sometimes 3-4 at the same time.

valid LJ from slopes

I've encountered this on anubis.
When jumping from stairs I was able to hit insane LJ's (250+)

image

Some features wanted

1.!noclip
2.!goto goto someone else
3.!stop stop timer

Should stop timer when noclip or goto

On Player connect server crashes

Not Running anything other than Metamod and CSS with SharpTimer. Anytime someone tries to connect to the server the server instantly crashes. This is after I edit the gamemode_competitive.cfg to match the one in the read me. Before I changed the cfg file, the server would hang and crash when a team was selected

Issues with !prevcp

Ubuntu 22.04, dockered CS2
CSSharp v77 (https://github.com/roflmuffin/CounterStrikeSharp/releases/tag/v77)
Metamod Build1270

Issue: The !prevcp command, which is intended to teleport players to previous checkpoints, is not functioning correctly. Despite having multiple checkpoints set (e.g., 4 checkpoints), using !prevcp always teleports the player to the latest checkpoint.

Reproduce:
Create multiple checkpoints -> !prevcp

Feature Request:
A feature that enables players to teleport to specific checkpoints using a command format such as !tp [checkpoint_number]. This feature would offer players greater control across bhop/surf etc.../ and improve their ability to practice timers with various checkpoints.

[Bug] ? Team is full

Hey, it looks like something went wrong with the last update because only one person per side is allowed to play. with the previous version (v0.1.1) it works without problems...

Metamod Version: 1275
Cssharp Version: 126v
Sharptimer Version: v0.1.2

3facda31cdba78baf0533fc45d83a8c0

and a huge respect for this project, thanks ๐Ÿ‘๐Ÿผ

[REQ]: Add checkpoint system

This is a fantastic plugin.

Do you have any plans to add a checkpoint system?

You can have it so you can enable/disable via server convar.

It can be basic to start:

!checkpoint - sets your checkpoint
!gocheckpoint - goes too your set checkpoint
!prev - goes to your previous checkpoint (nice to have)
!next - goes to your next checkpoint (nice to have)

BHOP - Custom zones for bonus

This is an example on bhop_bridge_cybershoke where i had to use the !addzone commands to make start/end zones.
There is a bonus tp here but i cannot set the zones for it, and its not done automatically

image

Uploading image.pngโ€ฆ

Bonus: maybe !b for bonus spawn?

server hostname changing itself to "surf | tier: 1 | Staged"

title says it all. when i start the server the hostname i specified in server.cfg shows, but after some time it changes itself to "surf | tier: 1 | Staged", and that's what shows in the server browsers.

only happens on one of the servers i have this plugin on. super weird. any setting i need to change for it to stop doing this?

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.