The perfect place to get data from GAMEDLL to CGAMEDLL?


(Ancalagon) #1

I’ve been trying for a while now to store a number for every player in GAMEDLL which can then be accessed by any player in CGAMEDLL.

I’ve been able to do this with each individual player, but then that player can’t access anyone elses. The only structures I’ve found that are shared by both the game and client are the ones that are hardcoded into the executable - and therefor crash the game or cause random wierdness.

Does anyone know of a good modifiable area to do this? Or is it simply easier to create an EV_* message ( sounds to me like that’d be more work on the network though ).


(Rain) #2

Can you give some more details? That’ll help determine the best way to send the data and could elicit more helpful responses.

The way data is generally transmitted to all clients in ET is via server command (trap_SendServerCommand), configstring (trap_SetConfigString), event with SVF_BROADCAST set (G_TempEntity), or modifying the entityState of a permanent SVF_BROADCAST entity (look at level.gameManager in the source—the number of landmines remaining and the command post status are transmitted this way.)


(bacon) #3

The way I do it is use trap_SendServerCommand() and makeup a command then in CG_ServerCommand() I defined the command.


(Ancalagon) #4

Thanks, trap_SendServerCommand() seems to be working. I had a server command overflow when I tried sending it to everyone but it I’ve fixed it by making sure it is only sent when it changes.