[Kde-games-devel] Re: Multiplayer in KDE games

Andreas Beckermann b_mann at gmx.de
Tue Dec 16 21:52:51 CET 2003


On Tuesday 16 December 2003 21:43, Neil Stevens wrote:
> > Of course you can do so - easily actually. I think I said that already
> > when your initial question on this came up:
> > simply use PolicyLocal. I.e. register the KGameProperties with
> > PolicyLocal and KGame won't send a bit of them.
> > We do it this way in boson, even though we don't try to keep the data
> > secret.
>
> No, that doesn't work because it's the server that has to generate various
> random numbers, like cards in a poker game.  Having the client generate
> them and use them locally won't work.

Well, PolicyLocal means that all KGameProperty objects are used exactly like 
local variables. So concerning network a
KGameProperty<int> foobar;
in PolicyLocal is totally equal to
int foobar;
-> so you can assign your numbers whenever and whereever you want. In this 
particular example you'd assigne them when a message from the server is 
received.

Of course a different approach would be to do some access-controlling, i.e. 
still sending the variables around autmatically, but only to those players 
that can "see" them, otherwise it is kept on the server only. But thats a 
more complex topic.

CU
Andi





More information about the kde-games-devel mailing list