PDA

View Full Version : Connecting to an outside source


TOCie
23-12-00, 07:46pm
Just a wild and crazy idea...

It would be VERY convenient to be able to have an external program connect to adminmod to both receive game information and log messages, as well as be able to send commands to adminmod. This would allow such things as a GUI frontend to the server without needing to hand out rcon. It'd also allow those of us who are much better in other programming languages (i.e. perl) to be able to create simple routines to extend and add functionality without needing to recompile or muck with the configuration files...

How hard would this be to implement?

alfred
24-12-00, 12:19pm
This would be either very hard or easyish. "Will" is currently looking into enabling admin mod commands on the server console, it seems it will be possible to do it.

Having a connection into the scripting engine itself, that would be damn hard. The current engine is not designed to function like that, and it would also be a big security issue (unless you only bound to the loopback addr or via I file...). Anyway, can't do this.

TOCie
24-12-00, 12:32pm
Okey, let me try and elaborate/clarify a bit more.

Before we installed adminmod, I'd created a simple Perl script to read the TFC logfile as items were written, then act on those new items. However, due to some weird buffering issues (or so we think), it couldn't connect to the server and issue commands.

So what I'm hoping could be done is the following
- Adminmod can allow an external client to connect to a certain port to receive either processed or raw log information from TFC.
- Adminmod can allow an external client to connect to a certain port to send in commands as if they were being typed in at a console, in the game.

All connections, of course, would be authenticated somehow. A simple rcon-like prefix and plain text commands might work.

I have no idea how easy or hard this might be to accomplish, but it would be an excellent feature. The ability to extend the system using other languages and programs, andor to use/create a GUI client would be a real plus.

alfred
24-12-00, 12:42pm
can't do the first bit.
As for the second, why not use rcon?
I have seen lots of perl scripts that use it.

TOCie
24-12-00, 01:00pm
I could never get it to work properly - could you provide an example URL to one of the scripts? Part of the problem is that I'd want the script to be able to have access to adminmod script commands.... I don't know how I'd go about doing that using rcon alone.

[ESC]Bean
12-01-01, 07:09am
I have been using <a href="http://linuxhlds.halflife.org">hlds_ld</a> for my server for a while, but wanted more functionallity to the voting system, so I am now using the jag script with adminmod AND the hlds_ld program.

I can remotely view the server and see who is on, what map is currently playing, see the text of people that are playing too. It rocks. (It even has clients for Windows.)

What I am having problems with is things like "vote extend" and some of the map timer code. For instance if a "vote extend" wins in a voting session, the time gets extended with adminmod, but the hlds code is till on the old timer, and does not know about "vote extend", so hlds_ld rotates in the new map at the original timer index, bah....

I am currently reading though the code of hlds_ld to see if I can disable some of the code and just make it a dumb remote monitoring tool.

If we could get these two things to work together, that would ROCK!

Jaguar
12-01-01, 08:16am
Since hlds_ld allows you to extend maps (by voting for the map name again), why not just disable my voting (set ENABLE_HLDSLD_MAP_VOTE to 0 and recompile)?

[ESC]Bean
12-01-01, 08:33am
That just might be crazy enough that it might work!

Unfortunately, doesn't hlds_ld reload the the map (with its voting system) when the timer runs down, instead of extending the timer. Perferably I would like it to extend the time and just keep on playing, but I might just be nit-picking over this.


Other than this small thing, using the two together, seems pretty good. =)

Jaguar
12-01-01, 08:52am
It's been awhile since I've seen hlds_ld in action, but I was under the impression it extended the time left (I remember once being caught in a game of mooncheese for 2 hours).

The only difference being that in hlds_ld, you vote for the map to extend it (if you're playing 2fort, 'vote 2fort' is a vote to extend the map), whereas if you're playing with my voting system, 'vote 2fort' would be a vote to restart the map and 'vote extend' would be a vote to extend it.

[ESC]Bean
12-01-01, 09:21am
Wow. So it actually just extends the timer?
(And not reload the map.)