Here's some example code that could go in a
IServerPluginCallbacks::ClientCommand handler:
if ( FStrEq( pcmd, "doaskconnect" ) )
{
const char *ip = "MyTestServer.ValveSoftware.com:27015";
if ( engine->Cmd_Argc() >= 2 )
ip = engine->Cmd_Argv(1);
float flDuration = 4.0f;
if ( engine->Cmd_Argc() >= 3 )
flDuration = (float)atof( engine->Cmd_Argv(2) );
KeyValues *kv = new KeyValues("blah");
kv->SetFloat( "time", flDuration );
kv->SetString( "title", ip );
helpers->CreateMessage( pEntity, DIALOG_ASKCONNECT, kv, this );
return PLUGIN_STOP;
}
Here's the DIALOG_TYPE update. It would be in
public\engine\iserverplugin.h, but we'll have to do an sdk release for
that so it's a ways off.
typedef enum
{
DIALOG_MSG = 0, // just an on screen message
DIALOG_MENU, // an options menu
DIALOG_TEXT, // a richtext dialog
DIALOG_ENTRY, // an entry box
DIALOG_ASKCONNECT // Ask the client to connect to a specified IP
address. Only the "time" and "title" keys are used.
} DIALOG_TYPE;
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ray
Sent: Wednesday, August 08, 2007 2:59 PM
To: [email protected]; [EMAIL PROTECTED];
[email protected]
Subject: Re: [hlds] Source Engine/Dedicated Server Beta
- Added a way for server plugins to ask players if they'd like to
connect to a different server
How is this used?
Ray
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlds
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds