For anybody interested or for future reference, it is possible to obtain
the current game server's port by listening to the 'server_spawn' event
and GetInt("port").

Apparently it was to late to register it [with AddListener(...) ] in the
standard LevelInit(...), I had originally tried moving it to the
Load(...) method, which is typically the first to be called by the
engine. This appears to be too early as adding the Listener here does
not work. I added the Listener to LevelShutdown(...) which is called by
the engine/game server after Load(...) and before LevelInit(...).
Funnily enough it WORKED!. Having it registered here seems to be enough
for the engine/game server event manager to handle it & correctly
FireEvent(...) where you then capture it with the desired port attribute
amongst other attributes.

cheers.
luke.

--
[ Picked text/plain from multipart/alternative ]
I don't believe IServer and IClient are interfaces for server plugins.

On 8/11/06, Luke Duguid <[EMAIL PROTECTED]> wrote:

> Thanks for the info. Like you say, cvars is the easy fix, if it was
> specified...
>
> How would one get a pointer to an the instance of IServer, I have
> scoured the sdk api but come up short! Same goes for IClient as well but
> is iclient applicable if being called from a server-side plugin?
>
> tia,
> luke
>
> David Anderson wrote:

> > If the server was started with +ip/+port you can use the "ip" and "port"
> > cvars.  There's also an IServer interface (public\iserver.h) which looks
> > interesting and accessible from IClient (public\iclient.h) but I've not
> > tried using it.  It has a GetUDPPort() call.
> >
> >    ---bail
> >    http://www.bailopan.net/
> >
> > Luke Duguid wrote:

> >> g;day all,
> >>
> >>     long time reader, first time poster.
> >>
> >>     i have a windows/linux server-side plugin that is capturing CS:S
> >> game events & relevant game data to a log files. the plugin is using
> >> a format of,  csdata_host_domain_yy.mm.dd-hh.mm.ss.csv for the
> >> logging file, i would like to also add port to the filename. ie.
> >> csdata_host_domain_port_yy.mm.dd-hh.mm.ss.csv in case multiple cs:s
> >> servers & instances of the plugin are runnning on the same physical
> >> machine. is their a  interface to  get the current port of the server
> >> from the engine? f not, is this even possible with bsd socket calls?
> >> remembering that it does not make sense to query /etc/services as
> >> cs;s servers typically do not make use of this on nix configurations.
> >>
> >> tia,
> >> luke "use the force" duguid

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to