mirror of
https://github.com/roflmuffin/CounterStrikeSharp.git
synced 2025-12-08 08:56:34 -08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb6d86a54d | ||
|
|
d4a2ae68e1 | ||
|
|
82c92f555b | ||
|
|
19a0923559 | ||
|
|
cef9758c12 |
1
.github/workflows/cmake-single-platform.yml
vendored
1
.github/workflows/cmake-single-platform.yml
vendored
@@ -56,7 +56,6 @@ jobs:
|
||||
- name: Add API to Artifacts
|
||||
run: |
|
||||
mkdir -p build/output/addons/counterstrikesharp/api
|
||||
mkdir -p build/output/addons/counterstrikesharp/plugins
|
||||
cp -r managed/CounterStrikeSharp.API/bin/Release/net7.0/publish/* build/output/addons/counterstrikesharp/api
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
|
||||
@@ -114,7 +114,8 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||
PREFIX ""
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/addons/counterstrikesharp/bin/linuxsteamrt64"
|
||||
)
|
||||
add_custom_target(build-time-make-directory ALL
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/addons/metamod")
|
||||
configure_file(configs/counterstrikesharp.vdf "${CMAKE_BINARY_DIR}/addons/metamod/counterstrikesharp.vdf" COPYONLY)
|
||||
configure_file(configs/gamedata.json "${CMAKE_BINARY_DIR}/addons/counterstrikesharp/gamedata/gamedata.json" COPYONLY)
|
||||
add_custom_command(
|
||||
TARGET ${PROJECT_NAME} PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_SOURCE_DIR}/configs ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
4
configs/addons/counterstrikesharp/plugins/README.txt
Normal file
4
configs/addons/counterstrikesharp/plugins/README.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Place plugins in this folder. Each plugin should be in its own subfolder, e.g.
|
||||
|
||||
TestPlugin/TestPlugin.dll
|
||||
AnotherPlugin/AnotherPlugin.dll
|
||||
@@ -165,7 +165,7 @@ namespace CounterStrikeSharp.API.Core
|
||||
|
||||
private PluginContext? FindPluginByIdOrName(string query)
|
||||
{
|
||||
|
||||
|
||||
PluginContext? plugin = null;
|
||||
if (Int32.TryParse(query, out var pluginNumber))
|
||||
{
|
||||
@@ -180,9 +180,12 @@ namespace CounterStrikeSharp.API.Core
|
||||
|
||||
private void OnCSSCommand(CCSPlayerController? caller, CommandInfo info)
|
||||
{
|
||||
var currentVersion = Api.GetVersion();
|
||||
|
||||
Utilities.ReplyToCommand(caller, " CounterStrikeSharp was created and is maintained by Michael \"roflmuffin\" Wilson.\n" +
|
||||
" Counter-Strike Sharp uses code borrowed from SourceMod, Source.Python, FiveM, Saul Rennison and CS2Fixes.\n" +
|
||||
" See ACKNOWLEDGEMENTS.md for more information.", true);
|
||||
" See ACKNOWLEDGEMENTS.md for more information.\n" +
|
||||
" Current API Version: " + currentVersion, true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -206,7 +209,7 @@ namespace CounterStrikeSharp.API.Core
|
||||
sb.Append(plugin.Description);
|
||||
}
|
||||
Utilities.ReplyToCommand(caller, sb.ToString(), true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -231,7 +234,7 @@ namespace CounterStrikeSharp.API.Core
|
||||
{
|
||||
path = Path.Combine(rootDir.FullName, path);
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
LoadPlugin(path);
|
||||
@@ -240,7 +243,7 @@ namespace CounterStrikeSharp.API.Core
|
||||
{
|
||||
Console.WriteLine($"Failed to load plugin {path} with error {e}");
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ using System;
|
||||
|
||||
namespace CounterStrikeSharp.API.Modules.Entities
|
||||
{
|
||||
public class SteamID
|
||||
public class SteamID : IEquatable<SteamID>
|
||||
{
|
||||
const long Base = 76561197960265728;
|
||||
public ulong SteamId64 { get; set; }
|
||||
@@ -46,5 +46,35 @@ namespace CounterStrikeSharp.API.Modules.Entities
|
||||
}
|
||||
|
||||
public override string ToString() => $"[SteamID {SteamId64}, {SteamId2}, {SteamId3}]";
|
||||
|
||||
public bool Equals(SteamID? other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
return SteamId64 == other.SteamId64;
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
return Equals((SteamID)obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return SteamId64.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(SteamID? left, SteamID? right)
|
||||
{
|
||||
return Equals(left, right);
|
||||
}
|
||||
|
||||
public static bool operator !=(SteamID? left, SteamID? right)
|
||||
{
|
||||
return !Equals(left, right);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -79,7 +79,7 @@ namespace CounterStrikeSharp.API
|
||||
{
|
||||
var controller = GetPlayerFromIndex(i);
|
||||
|
||||
if (!controller.IsValid || controller.UserId < 0)
|
||||
if (!controller.IsValid || controller.UserId == -1)
|
||||
continue;
|
||||
|
||||
players.Add(controller);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using CounterStrikeSharp.API;
|
||||
|
||||
Reference in New Issue
Block a user