[hlcoders] Detecting Client Video Mode from Server
Hi, does anyone know if and how we can detect the client's video mode from the server side, like via a Metamod plugin utilizing the HL SDK? We would like to know if the client is in software mode or 3D mode. Thanks in advance! HoundDawg United Admins - Game Server Admin Association http://www.unitedadmins.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Detecting Client Video Mode from Server
Hi, does anyone know if and how we can detect the client's video mode from the server side, like via a Metamod plugin utilizing the HL SDK? We would like to know if the client is in software mode or 3D mode. I haven't checked these out, but there's a vid_describemode CVAR that might do what you want. There's also a vid_mode that seems to be used to set the video mode. Try them and see if they give you anything useful. Actually, I just searched my valve\cmdlist.txt file and those don't seem to be in there, so those commands might not be supported by the engine anymore. I was using a command.pdf file that I had downloaded from the i.am.halflife website a couple of years ago to search for video mode stuff and that's where the vid_xxx stuff came from. Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Detecting Client Video Mode from Server
Hi, does anyone know if and how we can detect the client's video mode from the server side, like via a Metamod plugin utilizing the HL SDK? We would like to know if the client is in software mode or 3D mode. Thanks in advance! These seem to be stored in the Windows Registry HKEY_USERS\.DEFAULT\Software\Valve\Half-Life\Settings EngineMode - video display mode? EngineModeH - video height EngineModeW - video width EngineModeWindowed - running Half-Life in a window Looks like you'll need something running on the client's machine to suck stuff out of the registry then send that to the server. Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Detecting Client Video Mode from Server
-- [ Picked text/plain from multipart/alternative ] Correct me if I am wrong, but wouldn't such a thing trigger firewalls or the sort, it's quite dangerous to allow registry path data to be sent off to the host computer... - Original Message - From: botman Sent: Monday, May 06, 2002 3:11 PM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] Detecting Client Video Mode from Server Hi, does anyone know if and how we can detect the client's video mode from the server side, like via a Metamod plugin utilizing the HL SDK? We would like to know if the client is in software mode or 3D mode. Thanks in advance! These seem to be stored in the Windows Registry HKEY_USERS\.DEFAULT\Software\Valve\Half-Life\Settings EngineMode - video display mode? EngineModeH - video height EngineModeW - video width EngineModeWindowed - running Half-Life in a window Looks like you'll need something running on the client's machine to suck stuff out of the registry then send that to the server. Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcodersGet more from the Web. FREE MSN Explorer download : http://explorer.msn.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Detecting Client Video Mode from Server
Correct me if I am wrong, but wouldn't such a thing trigger firewalls or the sort, it's quite dangerous to allow registry path data to be sent off to the host computer... That depends on the firewall, how it's configured and which application is the one sending the data. If you had something like ZoneAlarm, which would alert the client that some application was attempting to access the Internet, then the player would know that something was being sent or received. If you used a program that had already been given permission to access the Internet (like Half-Life for example), the firewall wouldn't warn the user of anything. If you were using an external firewall that only checked for accesses to/from certain well known TCP/IP ports, you could open up the well known port (say port 80 for HTTP requests) on the server and use that to collect information from the client. The firewall wouldn't block this request because it was one of the ports that you had previously set up to allow access to/from. Just be glad that the Half-Life engine doesn't include any browser type feature that allows servers to download code and run it on the client (that's assuming that Valve has plugged all the buffer overflow problems in the engine network code)! :) Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Detecting Client Video Mode from Server
Just be glad that the Half-Life engine doesn't include any browser type feature that allows servers to download code and run it on the client (that's assuming that Valve has plugged all the buffer overflow problems in the engine network code)! :) Oh, wait a minute. Actually I guess with Steam is does allow this! Now all you've got to do is hack into the domain name server and redirect the speakeasy.net domain to your rogue server and start serving up all kinds of nasty Steam code! ;) Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] deleting animation
yes i've done it, i have another player model without any animations, and i've delete all the reference to pev-sequence in the ACT_ etc... but when i take damage, it return an error in the SV_SetupBones function... (i'm not that it's the exact name). I've looked this function but it looks to only set the vertices position under animating, and i search how to delete the processus that launch anims.. i think the problem comes that the engine try to load an anim that doesnt exist in the model - Original Message - From: David Flor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 06, 2002 6:25 AM Subject: RE: [hlcoders] deleting animation Huh? You want to delete animations?!? I believe most of the references to pev-sequence are done through a LookupSequence or LookupActivity function call, which means it looks for the ACT_... verb and not the index of the animation itself. Therefore, by modifying the .qc file and recompiling the model, you should be fine. Why would you want to delete animations anyway? It's not like they take up a whole lot of space anyway... You can simply not use them! Tnx Rgds... David Nighthawk Flor ( [EMAIL PROTECTED] ) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of MiK Sent: Sunday, May 05, 2002 12:55 PM To: [EMAIL PROTECTED] Subject: [hlcoders] deleting animation This is a multi-part message in MIME format. -- [ Picked text/plain from multipart/alternative ] hi i want to delete animations of player. i've deleted the lines of code that changes the pev-sequence to another value that 0, but it doesnt really work, the game return an error each time a move or i take damage. where can I fix this problem ? i search the code who send to client that an anim must be played (in gamestudiorenderer.cpp or a file like that i think) -- ___ 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 ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] string to #define
This is more general C++, but its for a HL mod so.. If I have a string, is there a way to convert it to integer with a previously enumerated value? eg, #define WEAPON_GARAND 2 then if I read in a string, and it happens to be WEAPON_GARAND can I know that that symbol is defined as 2? Obviously without doing an enormous if/else strcmp block.. Mugsy Day of Defeat mod _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] string to #define
It doesnt have to be a define, it can be an enumerated variable. ( since #define names would probably be tossed in a compiled version ) enum { WEAPON_GARAND = 2 }; From: Mugsy _ [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [hlcoders] string to #define Date: Mon, 06 May 2002 19:17:02 -0700 This is more general C++, but its for a HL mod so.. If I have a string, is there a way to convert it to integer with a previously enumerated value? eg, #define WEAPON_GARAND 2 then if I read in a string, and it happens to be WEAPON_GARAND can I know that that symbol is defined as 2? Obviously without doing an enormous if/else strcmp block.. Mugsy Day of Defeat mod _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _ Chat with friends online, try MSN Messenger: http://messenger.msn.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] string to #define
The pre-processors scan through source files replacing the define with the value. I'm not 100% sure, but about 95% that it looks in strings as well, so someFuncThatTakesAString(WEAPON_GARAND); will get changed to someFuncThatTakesAString(2); //constant string 2\0 before its compiled. david -Original Message- From: Mugsy _ [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 9:17 PM To: [EMAIL PROTECTED] Subject: [hlcoders] string to #define This is more general C++, but its for a HL mod so.. If I have a string, is there a way to convert it to integer with a previously enumerated value? eg, #define WEAPON_GARAND 2 then if I read in a string, and it happens to be WEAPON_GARAND can I know that that symbol is defined as 2? Obviously without doing an enormous if/else strcmp block.. Mugsy Day of Defeat mod _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. ___ 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] string to #define
I'm sure it depends on which preprocessor is being used, but I doubt most modern ones do this. -Original Message- From: Dynerman David M [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 7:35 PM To: [EMAIL PROTECTED] Subject: RE: [hlcoders] string to #define The pre-processors scan through source files replacing the define with the value. I'm not 100% sure, but about 95% that it looks in strings as well, so someFuncThatTakesAString(WEAPON_GARAND); will get changed to someFuncThatTakesAString(2); //constant string 2\0 before its compiled. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] string to #define
Well they say when you're not sure try..so I did and Leon's right (at least with VC++) I'm not sure where I saw/read that it would scan quotes, but the define didn't work for me (it would just print out WEAPON_GARAND instead of 2) Looks like we're stuck defining string literals or numbers, but not mixing matching. david -Original Message- From: Leon Hartwig [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 9:50 PM To: '[EMAIL PROTECTED]' Subject: RE: [hlcoders] string to #define I'm sure it depends on which preprocessor is being used, but I doubt most modern ones do this. -Original Message- From: Dynerman David M [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 7:35 PM To: [EMAIL PROTECTED] Subject: RE: [hlcoders] string to #define The pre-processors scan through source files replacing the define with the value. I'm not 100% sure, but about 95% that it looks in strings as well, so someFuncThatTakesAString(WEAPON_GARAND); will get changed to someFuncThatTakesAString(2); //constant string 2\0 before its compiled. ___ 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] string to #define
I believe it won't work. This works about the same as #define WEAPON_GARAND 2, you can't do things like array[WEAPON_GARAND]. Unfortunataly, the long if else block looks like the way to go. On Mon, 2002-05-06 at 23:20, Mugsy _ wrote: It doesnt have to be a define, it can be an enumerated variable. ( since #define names would probably be tossed in a compiled version ) enum { WEAPON_GARAND = 2 }; From: Mugsy _ [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [hlcoders] string to #define Date: Mon, 06 May 2002 19:17:02 -0700 This is more general C++, but its for a HL mod so.. If I have a string, is there a way to convert it to integer with a previously enumerated value? eg, #define WEAPON_GARAND 2 then if I read in a string, and it happens to be WEAPON_GARAND can I know that that symbol is defined as 2? Obviously without doing an enormous if/else strcmp block.. Mugsy Day of Defeat mod _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _ Chat with friends online, try MSN Messenger: http://messenger.msn.com ___ 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] string to #define
That wasn't the question Marcelo, what I thought (and was wrong) was that the pre-processor would search inside for the #defines, so in your case if I was right it would try to index array[2], which obviously wouldn't work. david -Original Message- From: Marcelo de Paula Bezerra [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 10:18 PM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] string to #define I believe it won't work. This works about the same as #define WEAPON_GARAND 2, you can't do things like array[WEAPON_GARAND]. Unfortunataly, the long if else block looks like the way to go. On Mon, 2002-05-06 at 23:20, Mugsy _ wrote: It doesnt have to be a define, it can be an enumerated variable. ( since #define names would probably be tossed in a compiled version ) enum { WEAPON_GARAND = 2 }; From: Mugsy _ [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [hlcoders] string to #define Date: Mon, 06 May 2002 19:17:02 -0700 This is more general C++, but its for a HL mod so.. If I have a string, is there a way to convert it to integer with a previously enumerated value? eg, #define WEAPON_GARAND 2 then if I read in a string, and it happens to be WEAPON_GARAND can I know that that symbol is defined as 2? Obviously without doing an enormous if/else strcmp block.. Mugsy Day of Defeat mod _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _ Chat with friends online, try MSN Messenger: http://messenger.msn.com ___ 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 ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] string to #define
hmm a possible idea could be a string table maybe an array of string/code structs, like typedef struct { char cStringId[256]; int iId; }weaponchar_id_t; then you could perhaps have like weaponchar_id_t WeaponCodes[] = { { WEAPON_GARAND,2 }, { WEAPON_1911, 1}, NULL, // etc }; then have a support function or two to grab the string/int and compare in this array this could be more work, who knows, but here it looks a bit easier to just reference similar items in an array - Original Message - From: Dynerman David M [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 06, 2002 11:10 PM Subject: RE: [hlcoders] string to #define Well they say when you're not sure try..so I did and Leon's right (at least with VC++) I'm not sure where I saw/read that it would scan quotes, but the define didn't work for me (it would just print out WEAPON_GARAND instead of 2) Looks like we're stuck defining string literals or numbers, but not mixing matching. david -Original Message- From: Leon Hartwig [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 9:50 PM To: '[EMAIL PROTECTED]' Subject: RE: [hlcoders] string to #define I'm sure it depends on which preprocessor is being used, but I doubt most modern ones do this. -Original Message- From: Dynerman David M [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 7:35 PM To: [EMAIL PROTECTED] Subject: RE: [hlcoders] string to #define The pre-processors scan through source files replacing the define with the value. I'm not 100% sure, but about 95% that it looks in strings as well, so someFuncThatTakesAString(WEAPON_GARAND); will get changed to someFuncThatTakesAString(2); //constant string 2\0 before its compiled. ___ 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 ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] string to #define
macros dont work in string blocks, at least not in MSVC - Original Message - From: Dynerman David M [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 06, 2002 11:20 PM Subject: RE: [hlcoders] string to #define That wasn't the question Marcelo, what I thought (and was wrong) was that the pre-processor would search inside for the #defines, so in your case if I was right it would try to index array[2], which obviously wouldn't work. david -Original Message- From: Marcelo de Paula Bezerra [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 10:18 PM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] string to #define I believe it won't work. This works about the same as #define WEAPON_GARAND 2, you can't do things like array[WEAPON_GARAND]. Unfortunataly, the long if else block looks like the way to go. On Mon, 2002-05-06 at 23:20, Mugsy _ wrote: It doesnt have to be a define, it can be an enumerated variable. ( since #define names would probably be tossed in a compiled version ) enum { WEAPON_GARAND = 2 }; From: Mugsy _ [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [hlcoders] string to #define Date: Mon, 06 May 2002 19:17:02 -0700 This is more general C++, but its for a HL mod so.. If I have a string, is there a way to convert it to integer with a previously enumerated value? eg, #define WEAPON_GARAND 2 then if I read in a string, and it happens to be WEAPON_GARAND can I know that that symbol is defined as 2? Obviously without doing an enormous if/else strcmp block.. Mugsy Day of Defeat mod _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _ Chat with friends online, try MSN Messenger: http://messenger.msn.com ___ 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 ___ 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] string to #define
Yeah I thought about that but I think it ends up with a lot of string compares. The particular method I am thinking of ( I might be remembering some magical C++ dream I had ) acutally involved converting a string into a variable name directly. But I'm most likely on crack. From: Josh Coyne [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [hlcoders] string to #define Date: Mon, 6 May 2002 23:25:33 -0400 hmm a possible idea could be a string table maybe an array of string/code structs, like typedef struct { char cStringId[256]; int iId; }weaponchar_id_t; then you could perhaps have like weaponchar_id_t WeaponCodes[] = { { WEAPON_GARAND,2 }, { WEAPON_1911, 1}, NULL, // etc }; then have a support function or two to grab the string/int and compare in this array this could be more work, who knows, but here it looks a bit easier to just reference similar items in an array - Original Message - From: Dynerman David M [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 06, 2002 11:10 PM Subject: RE: [hlcoders] string to #define Well they say when you're not sure try..so I did and Leon's right (at least with VC++) I'm not sure where I saw/read that it would scan quotes, but the define didn't work for me (it would just print out WEAPON_GARAND instead of 2) Looks like we're stuck defining string literals or numbers, but not mixing matching. david -Original Message- From: Leon Hartwig [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 9:50 PM To: '[EMAIL PROTECTED]' Subject: RE: [hlcoders] string to #define I'm sure it depends on which preprocessor is being used, but I doubt most modern ones do this. -Original Message- From: Dynerman David M [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 7:35 PM To: [EMAIL PROTECTED] Subject: RE: [hlcoders] string to #define The pre-processors scan through source files replacing the define with the value. I'm not 100% sure, but about 95% that it looks in strings as well, so someFuncThatTakesAString(WEAPON_GARAND); will get changed to someFuncThatTakesAString(2); //constant string 2\0 before its compiled. ___ 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 ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] string to #define
well with the string array you could just do like char *cGetStringForId(int iId) { weaponchar_id_t *comp_block; int num = 0; while((comp_block = WeaponCodes[num++]) != NULL) { if(comp_block-iId == iId) return comp_block-cStringId; } return NULL;// or return or whatever u want } should give you an idea of what i mean by a list array - Original Message - From: Mugsy _ [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 06, 2002 11:40 PM Subject: Re: [hlcoders] string to #define Yeah I thought about that but I think it ends up with a lot of string compares. The particular method I am thinking of ( I might be remembering some magical C++ dream I had ) acutally involved converting a string into a variable name directly. But I'm most likely on crack. From: Josh Coyne [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [hlcoders] string to #define Date: Mon, 6 May 2002 23:25:33 -0400 hmm a possible idea could be a string table maybe an array of string/code structs, like typedef struct { char cStringId[256]; int iId; }weaponchar_id_t; then you could perhaps have like weaponchar_id_t WeaponCodes[] = { { WEAPON_GARAND,2 }, { WEAPON_1911, 1}, NULL, // etc }; then have a support function or two to grab the string/int and compare in this array this could be more work, who knows, but here it looks a bit easier to just reference similar items in an array - Original Message - From: Dynerman David M [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 06, 2002 11:10 PM Subject: RE: [hlcoders] string to #define Well they say when you're not sure try..so I did and Leon's right (at least with VC++) I'm not sure where I saw/read that it would scan quotes, but the define didn't work for me (it would just print out WEAPON_GARAND instead of 2) Looks like we're stuck defining string literals or numbers, but not mixing matching. david -Original Message- From: Leon Hartwig [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 9:50 PM To: '[EMAIL PROTECTED]' Subject: RE: [hlcoders] string to #define I'm sure it depends on which preprocessor is being used, but I doubt most modern ones do this. -Original Message- From: Dynerman David M [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 7:35 PM To: [EMAIL PROTECTED] Subject: RE: [hlcoders] string to #define The pre-processors scan through source files replacing the define with the value. I'm not 100% sure, but about 95% that it looks in strings as well, so someFuncThatTakesAString(WEAPON_GARAND); will get changed to someFuncThatTakesAString(2); //constant string 2\0 before its compiled. ___ 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 ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. ___ 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] string to #define
I need to go the other way, from string to int. From: Josh Coyne [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [hlcoders] string to #define Date: Mon, 6 May 2002 23:52:26 -0400 well with the string array you could just do like char *cGetStringForId(int iId) { weaponchar_id_t *comp_block; int num = 0; while((comp_block = WeaponCodes[num++]) != NULL) { if(comp_block-iId == iId) return comp_block-cStringId; } return NULL;// or return or whatever u want } should give you an idea of what i mean by a list array - Original Message - From: Mugsy _ [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 06, 2002 11:40 PM Subject: Re: [hlcoders] string to #define Yeah I thought about that but I think it ends up with a lot of string compares. The particular method I am thinking of ( I might be remembering some magical C++ dream I had ) acutally involved converting a string into a variable name directly. But I'm most likely on crack. From: Josh Coyne [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [hlcoders] string to #define Date: Mon, 6 May 2002 23:25:33 -0400 hmm a possible idea could be a string table maybe an array of string/code structs, like typedef struct { char cStringId[256]; int iId; }weaponchar_id_t; then you could perhaps have like weaponchar_id_t WeaponCodes[] = { { WEAPON_GARAND,2 }, { WEAPON_1911, 1}, NULL, // etc }; then have a support function or two to grab the string/int and compare in this array this could be more work, who knows, but here it looks a bit easier to just reference similar items in an array - Original Message - From: Dynerman David M [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 06, 2002 11:10 PM Subject: RE: [hlcoders] string to #define Well they say when you're not sure try..so I did and Leon's right (at least with VC++) I'm not sure where I saw/read that it would scan quotes, but the define didn't work for me (it would just print out WEAPON_GARAND instead of 2) Looks like we're stuck defining string literals or numbers, but not mixing matching. david -Original Message- From: Leon Hartwig [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 9:50 PM To: '[EMAIL PROTECTED]' Subject: RE: [hlcoders] string to #define I'm sure it depends on which preprocessor is being used, but I doubt most modern ones do this. -Original Message- From: Dynerman David M [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 7:35 PM To: [EMAIL PROTECTED] Subject: RE: [hlcoders] string to #define The pre-processors scan through source files replacing the define with the value. I'm not 100% sure, but about 95% that it looks in strings as well, so someFuncThatTakesAString(WEAPON_GARAND); will get changed to someFuncThatTakesAString(2); //constant string 2\0 before its compiled. ___ 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 ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. ___ 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 _ Chat with friends online, try MSN Messenger: http://messenger.msn.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] string to #define
atoi()? - Original Message - From: Dynerman David M [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 07, 2002 6:29 AM Subject: RE: [hlcoders] string to #define What about the engine functions MAKE_STRING() and STRING()? david -Original Message- From: Mugsy _ [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 10:55 PM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] string to #define I need to go the other way, from string to int. From: Josh Coyne [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [hlcoders] string to #define Date: Mon, 6 May 2002 23:52:26 -0400 well with the string array you could just do like char *cGetStringForId(int iId) { weaponchar_id_t *comp_block; int num = 0; while((comp_block = WeaponCodes[num++]) != NULL) { if(comp_block-iId == iId) return comp_block-cStringId; } return NULL;// or return or whatever u want } should give you an idea of what i mean by a list array - Original Message - From: Mugsy _ [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 06, 2002 11:40 PM Subject: Re: [hlcoders] string to #define Yeah I thought about that but I think it ends up with a lot of string compares. The particular method I am thinking of ( I might be remembering some magical C++ dream I had ) acutally involved converting a string into a variable name directly. But I'm most likely on crack. From: Josh Coyne [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [hlcoders] string to #define Date: Mon, 6 May 2002 23:25:33 -0400 hmm a possible idea could be a string table maybe an array of string/code structs, like typedef struct { char cStringId[256]; int iId; }weaponchar_id_t; then you could perhaps have like weaponchar_id_t WeaponCodes[] = { { WEAPON_GARAND,2 }, { WEAPON_1911, 1}, NULL, // etc }; then have a support function or two to grab the string/int and compare in this array this could be more work, who knows, but here it looks a bit easier to just reference similar items in an array - Original Message - From: Dynerman David M [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 06, 2002 11:10 PM Subject: RE: [hlcoders] string to #define Well they say when you're not sure try..so I did and Leon's right (at least with VC++) I'm not sure where I saw/read that it would scan quotes, but the define didn't work for me (it would just print out WEAPON_GARAND instead of 2) Looks like we're stuck defining string literals or numbers, but not mixing matching. david -Original Message- From: Leon Hartwig [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 9:50 PM To: '[EMAIL PROTECTED]' Subject: RE: [hlcoders] string to #define I'm sure it depends on which preprocessor is being used, but I doubt most modern ones do this. -Original Message- From: Dynerman David M [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 7:35 PM To: [EMAIL PROTECTED] Subject: RE: [hlcoders] string to #define The pre-processors scan through source files replacing the define with the value. I'm not 100% sure, but about 95% that it looks in strings as well, so someFuncThatTakesAString(WEAPON_GARAND); will get changed to someFuncThatTakesAString(2); //constant string 2\0 before its compiled. ___ 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 ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. ___ 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] Detecting Client Video Mode from Server
Thank you everyone for answering so quickly. We did find a way and it really wasn't any of these, go figure. ;-) Actually, it was sort of close to botman's first reply. HoundDawg United Admins - Game Server Admin Association http://www.unitedadmins.com - Original Message - From: botman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 06, 2002 12:44 PM Subject: Re: [hlcoders] Detecting Client Video Mode from Server Just be glad that the Half-Life engine doesn't include any browser type feature that allows servers to download code and run it on the client (that's assuming that Valve has plugged all the buffer overflow problems in the engine network code)! :) Oh, wait a minute. Actually I guess with Steam is does allow this! Now all you've got to do is hack into the domain name server and redirect the speakeasy.net domain to your rogue server and start serving up all kinds of nasty Steam code! ;) Jeffrey botman Broome ___ 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