I honestly think that the CPlayerResource class approach is the best.
It really doesn't matter how your class sends/stores that data, since
it'd just be abstracted by functions like C_PlayerResource::GetFrags(
int index ). It's probably not worth the trouble of getting it to
network custom data structures, especially because the existing
network var types are optimized already.
My suggestion would be to break up the problem into two parts, players
and structures. For players, extend the CPlayerResource class to send
the player's x and y values (it already handles the team).
For your structures, I assume you have server-side entities for each?
You could network each of these, to send only the position and type.
By overloading ShouldTransmit( const CCheckTransmitInfo *pInfo ) in
the server class, you can return FL_EDICT_DONTSEND when
pInfo->m_pClientEnt isn't on the corresponding team, and
FL_EDICT_ALWAYS when they are. This will probably require a function
like: int UpdateTransmitState() { return SetTransmitState(
FL_EDICT_FULLCHECK ); }.
I realize that this doesn't directly answer your initial question, but
hope it helps nonetheless,
Casey
epicar at dystopia-mod.com
On 5/21/05, Spk Spk <[EMAIL PROTECTED]> wrote:
> Yeah I know about this class, I've mentionned it in my previous mail. I
> wanted to avoid using this method though (doing one array per property I
> want to send over the network) and was wondering if it was possible to send
> non base type data over the network. That way instead of having 3 arrays for
> the player's X,Y,TEAM, and 4 arrays for the structures X,Y,TEAM,TYPE, I
> would just have 2 arrays (1 for players, 1 for structures) holding these
> data.
>
> - Spk
>
> >From: "Mike Dussault" <[EMAIL PROTECTED]>
> >Reply-To: [email protected]
> >To: <[email protected]>
> >Subject: RE: [hlcoders] Networking Minimap entities
> >Date: Fri, 20 May 2005 17:15:49 -0700
> >
> >Take a look at dlls\player_resource.cpp and cl_dll\c_playerresource.cpp.
> >It has arrays of per-player data that get periodically updated. You
> >could add player X and Y coordinates here so you'd have minimap
> >coordinates.
> >
>
>
>
> _______________________________________________
> 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