Re: [hlcoders] Execute server commands from a VGUI

2006-06-19 Thread Tim Holt
Quoting Garry Newman [EMAIL PROTECTED]:

  What's to stop a client just
 binding a key to vgui_screen_opendoor 234 or whatever? Or am I being
 simple about it?

Could you do some kind of basic encryption of the command?  I know it's just
security by obscurity but it might be a simple approach that takes care of 99%
of the problem.

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



Re: [hlcoders] Execute server commands from a VGUI

2006-06-18 Thread Gregor Brunmar

Ah, thanks!

I always thought that you couldn't do this from the client, but I guess
I was wrong. Must have been some include file I forgot last time I tried it.

-Gregor

Aaron Schiff wrote:

--
[ Picked text/plain from multipart/alternative ]
If you want to execute a server command it would be more efficient to call
engine-ServerCmd() on the client

--
ts2do
--

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








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



Re: [hlcoders] Execute server commands from a VGUI

2006-06-18 Thread Garry Newman

It isn't really executing commands on the server.. well it is.. kinda.

It's the same as typing a command in the console - if it isn't handled
by the client (things like cl_smooth) then it sends it to the server
(things like kill).

I have a follow up question along these lines..

In Dystopia they have VGUI Screens that you press buttons on to open
doors. I haven't even looked into vgui screens yet - but would this
also use the console command system? What's to stop a client just
binding a key to vgui_screen_opendoor 234 or whatever? Or am I being
simple about it?

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



Re: [hlcoders] Execute server commands from a VGUI

2006-06-18 Thread Aaron Schiff
--
[ Picked text/plain from multipart/alternative ]
I've written an article on an attempt to stop this attempt:
http://developer.valvesoftware.com/wiki/Client_to_Server_Messages
I haven't tested it personally...but it all works in theory

--
ts2do
--

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



[hlcoders] Execute server commands from a VGUI

2006-06-14 Thread Gregor Brunmar

Hi,

How do I execute a server command from a VGUI button press for example?
The OnCommand() in the panel is client side and I would like to know how
for example CS:S do with their buying system?

Thanks in advance,
Gregor Brunmar


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



Re: [hlcoders] Execute server commands from a VGUI

2006-06-14 Thread Greg Lindquist
--
[ Picked text/plain from multipart/alternative ]
This has been addressed on the forums at chatbear.

http://www.chatbear.com/board.plm?a=viewthreadt=127,1149978800,2id=989110b=4991v=flatold

They point you to this location:

http://developer.valvesoftware.com/wiki/Customizing_Options:_Keyboard

Hope this helps.

On 6/14/06, Gregor Brunmar [EMAIL PROTECTED] wrote:

 Hi,

 How do I execute a server command from a VGUI button press for example?
 The OnCommand() in the panel is client side and I would like to know how
 for example CS:S do with their buying system?

 Thanks in advance,
 Gregor Brunmar


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


--

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



Re: [hlcoders] Execute server commands from a VGUI

2006-06-14 Thread Benjamin Davison
--
[ Picked text/plain from multipart/alternative ]
I hope this helps, I basically send a console command containing the command
primaryweapon and then a string of the weapon which is held in the
comboboxes in my case. And then on theserver it is worked out from there.

void CWeaponLoadOutMenu::OnCommand( const char *command )
{
if (!stricmp(command, chosenequipment) )
{

//
// Purpose: primaryweapon command - ^Ben

//
int iPrimaryEquipID = m_pPrimaryWeapons-GetActiveItem();
char buf[ 2048 ];
wchar_t playerText[ 80 ];
m_pPrimaryWeapons-GetItemText(iPrimaryEquipID, playerText,
sizeof(playerText));
localize()-ConvertUnicodeToANSI(playerText, buf, sizeof(buf));
const char* sItemText = buf;
const char* szCleanItem = ConvertRawOutPutToWeapon(sItemText);
char command[128];
Q_snprintf( command, sizeof(command), primaryweapon \%s\,
szCleanItem );
engine-ClientCmd(command);
}

And then in player.cpp

Under CbasePlayer::ClientCommand

else if ( stricmp( cmd, primaryweapon ) == 0 ) // chase next player
{
const char *szPrimeWep = engine-Cmd_Argv(1);
m_vEquipmentList.AddToTail(szPrimeWep);
}

On 6/14/06, Gregor Brunmar [EMAIL PROTECTED] wrote:

 Hi,

 How do I execute a server command from a VGUI button press for example?
 The OnCommand() in the panel is client side and I would like to know how
 for example CS:S do with their buying system?

 Thanks in advance,
 Gregor Brunmar


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




--
- Benjamin Davison
--

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



Re: [hlcoders] Execute server commands from a VGUI

2006-06-14 Thread Aaron Schiff
--
[ Picked text/plain from multipart/alternative ]
If you want to execute a server command it would be more efficient to call
engine-ServerCmd() on the client

--
ts2do
--

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