addPublicVariableEventHandler – Talk

From Bohemia Interactive Community
Revision as of 16:02, 8 January 2008 by Sickboy (talk | contribs)
Jump to navigation Jump to search

So this seems like we can remove many server side loops waiting for a publicVariable to change right?

If true can someone submit more examples?


Yes, exactly. But as said, if the variable is pV'ed from the server, the EH won't trigger there. What examples do you want? --raedor 11:33, 22 December 2007 (CET)

Reliability

I was thinking about a network engine that uses 1 variable per client, and 1 variable for the server. At the clients I would addEventHandler for the server variable. For the server I would add eventhandlers for every client variable. I am wondering now how reliable this is going to be when for instance I update the server variable 100 times in a second, while every time I would also publicVariable it. Would all clients receive all these 100 different values and thus would the eventHandler execute aswell 100 times, or is there optimizations or other stuff in netcode that would prevent this from working properly. (as it f.i would only send the variable update once every second and thus missing 99 updates :p) --Sickboy 16:02, 08 Januari 2008 (CET)