Giter VIP home page Giter VIP logo

gmsv_rcon2's Introduction

gmsv_rcon2

Garry's Mod binary module for controlling RCON authentication directly from Lua!

Supported hooks

OnRconWriteRequest (listenerId, requestId, requestType, data, isLanIpAddress, ip, port)

Main rcon hook OnRconWriteRequest, according engine function is - CServerRemoteAccess::WriteDataRequest.

On both platforms ::WriteDataRequest checks for password first time and then process RCON requests. But here's a little difference between platforms. In Linux build each request bein logged with external call of CServerRemoteAccess::LogCommand (which is a hook OnRconLogCommand), but on Windows this function are force-inlined. Than means, you won't be not able to use OnRconLogCommand for Windows game server. Although ::LogCommand function exists on both platforms, it is not being called on Windows.

OnRconCheckPassword (password, listenerId, isLanIpAddress, ip, port)

Hook for engine function CServerRemoteAccess::IsPassword, which is being called in CServerRemoteAccess::WriteDataRequest to verity that incoming user password matches server (originally rcon_password console variable). You may not wanted to use OnRconWriteRequest but wish to override default password, or make it dynamic over time - so this is an option.

OnRconLogCommand (listenerId, msg, isKnownListener, isLanIpAddress, ip, port)

Hook for engine function CServerRemoteAccess::LogCommand, originally it print out messages like rcon from \"%s\": %s\n. You can override printing on Linux platform using this hook. Does not work under Windows, see OnRconWriteRequest.

Building module

Requirements for manual build:

  • SSDK2013
  • CMake 3.8+
  • GCC (g++)

Build variables:

  • GMSV_SSDK_PATH - Path to Valve Source SDK 2013
  • GMSV_PLATFORM - [Optional] Set build platform (only LINUX or WINDOWS values allowed), by default platform is deteching automatically.
  • GMSV_TARGET - [Optional] Type of target build, can be Debug or Release (default).

Linux

First, go to root folder of gmsv_rcon2 files and configure build with follow commands (example):

  • cmake -D GMSV_SSDK_PATH=/usr/lib/ssdk-2013 .
  • make

Windows

You can use Visual Studio 2019 (my version is 16.7.6) to open gmsv_rcon2 root folder, then select x86-debug-win configuration and press Ctrl+Shit+B. Another option is to open x64_x86 Cross Tools Command Prompt for VS 2019 and run following commands (example):

  • cmake -D GMSV_SSDK_PATH=B:\libs\ssdk2013 -A Win32 .
  • cmake --build .

Updates & Issues

Module uses specific patterns for signature scanning and should work after game updates, but still better to test it before updating server. In case of problems with newer versions or other things, feel free to open an issue.

gmsv_rcon2's People

Contributors

draiget avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

blackra1nfr

gmsv_rcon2's Issues

Error when trying to require module.

I downloaded the latest release (1.2), put the downloaded gmsv_rcon2_win32_release.dll file in /garrysmod/lua/bin where all my other modules are, but when i try to require it using require("rcon2") it gives me this error:

Couldn't include file 'includes\modules\rcon2.lua' (File not found) (@lua/autorun/server/module_test.lua (line 1))

[ERROR] lua/autorun/server/module_test.lua:1: Module not found!
  1. require - [C]:-1
   2. unknown - lua/autorun/server/module_test.lua:1

I am using the same code as this file.

Am I doing something wrong? Why is it giving me errors?

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.