mirror of
https://github.com/roflmuffin/CounterStrikeSharp.git
synced 2025-12-07 08:26:34 -08:00
26 lines
826 B
C#
26 lines
826 B
C#
using System.Reflection;
|
|
using CounterStrikeSharp.API.Core;
|
|
|
|
namespace CounterStrikeSharp.API;
|
|
|
|
public class Api
|
|
{
|
|
/// <summary>
|
|
/// Returns the API version of CounterStrikeSharp running on the server
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static int GetVersion()
|
|
{
|
|
return Assembly.GetAssembly(typeof(BasePlugin))!.GetName().Version!.Build;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns the assembly version of CounterStrikeSharp running on the server as a string including git commit hash
|
|
/// </summary>
|
|
/// <example>1.0.0+9d8b6be</example>
|
|
public static string GetVersionString()
|
|
{
|
|
return Assembly.GetAssembly(typeof(BasePlugin))!.GetCustomAttribute<AssemblyInformationalVersionAttribute>()!
|
|
.InformationalVersion;
|
|
}
|
|
} |