AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   HTTP Server w/ RCon Multiplexer (https://forums.alliedmods.net/showthread.php?t=270962)

asherkin 09-02-2015 13:14

HTTP Server w/ RCon Multiplexer
 
This is something I was working on a while ago but never got around to releasing because it just needed That One Last Thing™.
Rather than leave it sitting around for the next forever while that doesn't happen, here it is!
This release consists of 2 extensions and a handful of partially-completed sample plugins.
Links can be found at the bottom of this post.

Extensions

Conplex
Conplex exposes an interface (both C++ and SourcePawn) to multiplex connections onto the game server's existing RCon socket.

Conplex is engine-independent but requires a small amount of easy-to-find gamedata.
Gamedata is currently provided for TF2, CS:S, and CS:GO.

Conplex includes a couple of protections against attacks to support exposing the RCon socket publicly:
  • Connections that send data that is not matched to a registered protocol are closed and treated as a failed RCon auth (which can cause the sending IP to be banned).
    This prevents a class of attacks that involve sending invalid data to the RCon socket.
  • Connections that do not send enough data to match to a known protocol are closed after a short timeout.
    This prevents a class of attacks that involves opening numerous connections and never closing them.

Webcon
Webcon provides a HTTP server on the RCon port using Conplex.
Specifically, this allows the game server's regular connect address to be visited in a web browser.

Webcon is engine-independent and requires no gamedata, just Conplex.

A rich SourcePawn interface is exposed to allow plugins to handle requests and serve both dynamic and static content.
The include file and test plugin (and of course the samples below) should be perused for developer usage information.

The ultimate goal is web-based SourceMod configuration and management that can even be used by people hosting with a GSP.

Sample Plugins

Scoreboard
A real-time web-based scoreboard. Screenshot.
Made for and styled after TF2, but should work for any game.
Browser support was not a concern, so probably only looks correct in Chrome.

Web Manager
A very incomplete sample showing Steam OpenID login and session persistence.
Ideally these functions would be in a reusable library plugin (along with other stuff like HTML escaping).

IRC Server
Sample for Conplex implementing a basic IRC server.

Download

Source Code
Issue Tracker


Please note that none of the sample plugins come compiled, as only the Scoreboard plugin is designed for actual use rather than just a code example.

Build Status
https://travis-ci.org/asherkin/webcon.svg?branch=master https://ci.appveyor.com/api/projects...aster?svg=true

Maxximou5 09-02-2015 13:21

Re: HTTP Server w/ RCon Multiplexer
 
Excellent work! I love those "That One Last Thing™'s".

Server usage just got more interesting.

Drixevel 09-02-2015 14:46

Re: HTTP Server w/ RCon Multiplexer
 
Oh my god, I can use this for the store system... you are awesome!

Potato Uno 09-02-2015 14:51

Re: HTTP Server w/ RCon Multiplexer
 
Just saw this in your signature. Does the scoreboard thing work for the MvM scoreboard or is it (as it usually is) the pvp board only?

asherkin 09-02-2015 15:03

Re: HTTP Server w/ RCon Multiplexer
 
Quote:

Originally Posted by Potato Uno (Post 2339229)
Just saw this in your signature. Does the scoreboard thing work for the MvM scoreboard or is it (as it usually is) the pvp board only?

It's a basic clone of the regular scoreboard, you get what you see in the screenshot.

Powerlord 09-02-2015 16:23

Re: HTTP Server w/ RCon Multiplexer
 
...granted, the data exists in other entities to give you the MvM score counts. Or at least it should, probably in the tf_objective entity.

Sarabveer 09-03-2015 08:46

Re: HTTP Server w/ RCon Multiplexer
 
I wonder how many people are going to use this exposed to the public, they should at least put it behind a real webserver such as nginx or Apache.

+1 For a PHP Extension for this!

Zephyrus 09-03-2015 09:16

Re: HTTP Server w/ RCon Multiplexer
 
pretty cool, thanks for this. i wanted to multiplex the rcon port for a websocket server for like forever already but didnt have the time

Razmo51 09-03-2015 12:39

Re: HTTP Server w/ RCon Multiplexer
 
Got this error on Linux:

Quote:

sm exts load webcon
[SM] Extension webcon.ext.so failed to load: /..../csgo/addons/sourcemod/extensions/webcon.ext.so: undefined symbol: clock_gettime
CSGO server

asherkin 09-03-2015 12:51

Re: HTTP Server w/ RCon Multiplexer
 
Quote:

Originally Posted by Razmo51 (Post 2339503)
Got this error on Linux:

CSGO server

Try now.


All times are GMT -4. The time now is 11:34.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.