> Nice one, just thought I'd add my 2c Maybe a better way of sending some
> stuff would be something like the following
>
> void SendMemory(const char *mem, const int size)
> {
> for(int i=0;i<size;i++)
> WRITE_BYTE(mem[i]);
> }
>
> That would send the structure if you called it like this
> MESSAGE_BEGIN(MSG_ONE, gmsgUserData, NULL, (struct edict_s *)ent);
> SendMemory(pPlayer->UserData, sizeof(user_variables_t));
> MESSAGE_END();
>
> Personally I think its a lot easier..Then to receive it you do the
> following..
>
> char * ReadMemory(int size)
> {
> char *mem=(char*)malloc(size);
> for(int i=0;i<size;i++)
> mem[i] = READ_BYTE();
> return mem;
> }
That way is certainly easier. I just wanted to conserve bandwidth by only sending the
parts that had changed rather than sending the entire structure with each update. (Of
course, not much is gained if every member of the structure is likely to have changed
since the last update).
Thanks for the feedback.
Jim
Jim Hunter
[EMAIL PROTECTED]
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders