I dont understand the last 3/4's of your post but theres a flag you
can pass when you create a CVAR to make it shared between client and
server. Sorry, dont remember its name right now. Just make the CVAR
once in a file thats compiled into both, and give it that flag.


On Sun, 23 Jan 2005 03:27:49 -0700, Markus Martin <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am trying to share the same console variables between the client and
> server in a file that is compiled into both dlls. What I do in my
> shared file is create a pointer to the cvars like so:
> ConVar *melee_dmg = cvar->FindVar( "melee_dmg" );
>
> And this works fine for both client and server. Now, the actual cvar
> is defined in the normal way in a seperate file, but it is only
> compiled into the server. Compiling a cvar into both dlls causes one
> to override the other, and thus the cvar(s) do not work.
>
> This seems like perfectly sound code as all goes well until actually
> loading the dlls hot off the compiler. For some reason when I load my
> mod, the Half-Life2 dlls are loaded instead. I am thinking the engine
> decides something is wrong with my dlls, but I find this rather
> irritating, as I would prefer a crash that I could perhaps debug.. All
> this happens without any error output whatsoever.
>
> I assume that on the client, FindVar() can find the cvars. Perhaps
> this is not the case. It is not really essential that the client knows
> the value of the cvar, except maybe for flow control later on down the
> road.. However, I am trying to avoid #ifdef hell as much as possible
> as this is a shared file.
>
> Greetings,
> -Markus
>
> _______________________________________________
> 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

Reply via email to