Author Topic: Heeeeeeeeeeeeeeeelp  (Read 1822 times)

Rannion

  • Not-a-newbie
  • *
  • Posts: 25
  • Karma: 0
    • View Profile
Heeeeeeeeeeeeeeeelp
« on: December 07, 2006, 07:58:48 AM »
I have rewrite my test bed with RakNet3.0 using the PeerInterface.
I have a server running in console.
I connect with one client and everything is working fine.
I connect with a second client and receive the first deserialize properly updating player positions etc...
The first client is working fine and can move but the second client is receiving the deserialize with nothing in the data.
The second client, when I'm moving is receiving the deserialize with nothing in the data. BUT the first client is receiving the deserialize properly so I can see the player moving !?!
Please help me ! Any idea why the second client isn't receiving the same data as the first one !!!
The server is doing this gReplicaServer.SignalSerializeNeeded(player, UNASSIGNED_SYSTEM_ADDRESS, true);
And then in the serialize it's alright because the first client is always receiving everthing properly !
Thx for any help

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 292
    • View Profile
    • RakNet
Re: Heeeeeeeeeeeeeeeelp
« Reply #1 on: December 07, 2006, 12:44:38 PM »
Maybe it's scoping?  Did you add the 2nd client as a participant?  You can trace through all this in ReplicaManager::Update .  After you do the send, put a breakpoint there.  The second time it goes through the loop (the second participant) is the one you want.

Rannion

  • Not-a-newbie
  • *
  • Posts: 25
  • Karma: 0
    • View Profile
Re: Heeeeeeeeeeeeeeeelp
« Reply #2 on: December 08, 2006, 06:30:33 AM »
I'm starting to look for that.
But then I quickly try to use SetDefaultScope(true) in both client and server at init time and then I'm not receiving anything anymore. Is that depreciated ?

After some investigations...

Found the problem. And this is something not obvious when implementing ReplicaManager.
I thought Serialize would be called only once and then braocast to all participants so I was flagging my data as sent straight away. Then that's why my first player was working just fine and the others were receiving an empty packet.
Then for now, after the update of the server ( all the Receive() ) I'm resetting my flags for all players. This is not a nice way to do it but everything is working as expected now.
Thx for your helps.

If you see a better way to reset my flag, don't hesitate.
You can flag this post as solved.

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 292
    • View Profile
    • RakNet
Re: Heeeeeeeeeeeeeeeelp
« Reply #3 on: December 08, 2006, 03:18:59 PM »
Serialize is called for every target, because you may want to customize the data-per target.  I will clarify the documentation for that.