[bfprog] Client rcon

Forrest Thiessen thiessen at cyberscapearena.com
Sun Jul 10 16:28:13 PDT 2005


ScratchMonkey wrote:

> Can the client use any Python to implement its own rcon? It would be
> nice if one could leave the client running when consulting an external
> browser, and have the browser send the join command via the rcon port.
> I was just looking at the online ASE manual
> (<http://us.games2.yimg.com/download.games.yahoo.com/games/ase/manual/aseusr25.pdf>)
> and section 2.5 shows that it can communicate with other programs via
> DDE, which suggests that one might be able to inject the join command
> into a running client if it's got the right listening code.
>
Interesting thought; I believe the Battlefield 2 Server/admin/default.py
file actually implements the *full* RCon functionality--opens a socket
on port 4711 and listens there for commands, which it sends to the game
engine with a host.rcon_invoke method.  It does password checking and
the works.  Anything you want RCon to do differently, I think you can
accomplish by changing this module.

Or. . . it looks to me like things were designed to accomodate custom
RCon interfaces; write your own RCon in a new module, say, Battlefield 2
Server/admin/custom_rcon.py, (or, much easier, copy the existing one and
edit it), then in ServerSettings.con, put
    sv.adminScript "custom_rcon"
and it looks to me the game engine will load your RCon instead of the
standard one.

I'm sure you could go a lot further with this--you could implement a web
server in your replacement RCon script and create a web-based admin
interface, for example.  I'm not sure using BF2 as a web server is wise,
but if you kept things lite, it might end up being more efficient that
the current RCon (all those "update" cycles it uses can't help game
performance).

I haven't tried any of this yet. . . just thinking aloud. . . hmmm. . . .

--Forrest (aka "Woody")





More information about the BFProg mailing list