Does the client send a command when they deny redirection? If not, can
this be added?
PS: In your example, you forgot to free kv, and you should be using
strtod, not atof.
On 8/8/07, Mike Dussault <[EMAIL PROTECTED]> wrote:
> 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;
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds