Giter Site home page Giter Site logo

cs2-autoupdater's Introduction

CS2-AutoUpdater

The Auto Updater plugin automates the update process for your Counter-Strike 2 (CS2) server.

Important

It is required for the server to have hibernation disabled: sv_hibernate_when_empty set to false.

Features

  • Automatically checks the current game version of Counter-Strike 2 by querying Steam's API.
  • Notifies players about the upcoming server restart.
  • Translations.
  • Match cancelation on update found.
  • Pterodactyl API intergration.

Installation

Requirements

Download the latest release of CS2-AutoUpdater from the GitHub Release Page.

Extract the contents of the archive into your counterstrikesharp folder.

Build Instructions

If you want to build CS2-AutoUpdater from the source, follow these instructions:

git clone https://github.com/dran1x/CS2-AutoUpdater && cd CS2-AutoUpdater

# Make sure the CounterStrikeSharp dependacy has a valid path.
dotnet publish -f net7.0 -c Release 

Confiuration

{
 "ConfigVersion": 2,
 "UpdateCheckInterval": 180,
 "ShutdownDelay": 120,
 "MinPlayersInstantShutdown": 1,
 "MinPlayerPercentageShutdownAllowed": 0.6,
 "ShutdownOnMapChangeIfPendingUpdate": true
}

cs2-autoupdater's People

Contributors

crashzk avatar dran1x 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

Watchers

 avatar  avatar  avatar  avatar

cs2-autoupdater's Issues

Server shutdown while latest

[CS2AutoUpdater] New Counter-Strike 2 update released (Build: 13968)                                                                                   
[CS2AutoUpdater] Restarting the server due to the new game update. (Build: 13968)

But output of status includes:

version  : 1.39.6.8/13968 9842 secure  public

Before launch, SteamCMD's app_update is always run and shows:

Success! App '730' already up to date.

The steam.inf file reads:

ClientVersion=2000188
ServerVersion=2000188
PatchVersion=1.39.6.8
ProductName=cs2
appID=730
ServerAppID=<redacted>
SourceRevision=8483395
VersionDate=Nov 09 2023
VersionTime=17:22:26

Restart server not shutdown

Hi,
Don't use stop command but combination

execute server command -> sv_cheats 1
and crash server -> auto restart
execute server command -> crash

Autoupdater nor working

Hi, i got this error in my server console,

10:41:30 [EROR] (plugin:AutoUpdater) An error occurred checking the server for updates: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.

Server is not updating.

Console error

Hi, Im on latest css v141 & meta and i got this error.

17:48:26 [EROR] (cssharp:Core) Error invoking callback System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'CS2AutoUpdater.CS2AutoUpdater' threw an exception. ---> CounterStrikeSharp.API.Core.NativeException: Global Variables not initialized yet. at CounterStrikeSharp.API.Core.ScriptContext.CheckErrors() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/ScriptContext.cs:line 176 at CounterStrikeSharp.API.Core.NativeAPI.GetMaxClients() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/API.cs:line 320 at CounterStrikeSharp.API.Server.get_MaxPlayers() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Server.cs:line 78 at CS2AutoUpdater.CS2AutoUpdater..cctor() --- End of inner exception stack trace --- at CS2AutoUpdater.CS2AutoUpdater.OnMapEnd() at InvokeStub_OnMapEnd.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.BasePlugin.<>c__DisplayClass45_01.b__2(ScriptContext context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/BasePlugin.cs:line 365
at InvokeStub_Action1.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 /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 46

Server does not restart

1
2
If an update is available, the server shuts down but does not restart.
Is that the purpose of the plugin or should it automatically download the update and restart the server? Isn't it called auto updater for nothing?

Server shuts down?

I think my server is crashing with this.. Or the plugin sends quit, and it doesn't restart again after that?
Any way to get logs to see whats going on?

CS2AutoUpdater 1.0.2
counterstrikesharp-build-16

With this in my command line:
-autoupdate -steam_dir ~/csgo -steamcmd_script ~/csgo/retakes1.txt

@ShutdownOnFailedCommand 1
@NoPromptForPassword 1
login anonymous
force_install_dir /home/retakes1
app_update 730
quit

Docker Support and .NET 8

Hello @dran1x,
first of all congratulations on the plugin, I was able to test it here and it was really good.

I forked your project to add support for Docker containers, so instead of shutting down (quit) the server, I'm connecting to local docker and restarting the container so it can update itself. I tested it on my servers and it is working beautifully. If you find it interesting to add to the plugin's support in general, this is my fork repository.

https://github.com/vitordarela/CS2-AutoUpdater

Cheers

Issue with the update

CS2 just got changes to SteamDB Unknown App 2275530
Changelist 21065092 and plugin issued reboot becuase it was thinking there is game update but its not even released you should change the method how updates are detected.

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.