Some other problems I have. (Previous one is still unsolved)
* Computer A is listening and accepting new players.
* Computer B connects.
* After some time the player on Computer B quits the game.
* The game on computer A also quits the game for some strange reason.
No error messages are shown. Why is this happening?
And the other problem.
The local player is looping through all bullets. If they are localy created their position is updated. If they are remote ones their position is compared with the local player to see if they hit:
This is similar to how the gnetdemo is doing it. The local player are later going through all messages:
Again, this is similar to how the gnetdemo is doing things. But the frags isn't always updated. The gnetdemo is updating the score inside the If obj.State()<>GNET_CLOSED .. EndIf part, but I moved it outside because it got a little bit better on updating the frags. But it doesn't always update them.
Anyone got any ideas about these problems?
* Computer A is listening and accepting new players.
* Computer B connects.
* After some time the player on Computer B quits the game.
* The game on computer A also quits the game for some strange reason.
No error messages are shown. Why is this happening?
And the other problem.
The local player is looping through all bullets. If they are localy created their position is updated. If they are remote ones their position is compared with the local player to see if they hit:
If Abs( x - localplayer.x ) < 16 And Abs( y - localplayer.y ) < 16 Then Local msg:TGNetObject=CreateGNetMessage( host ) If localplayer.damage() Then ' Frag SetGNetString msg,SLOT_TYPE,"died" Else ' Just some damage SetGNetString msg,SLOT_TYPE,"gotme" EndIf SendGNetMessage msg,obj EndIf
This is similar to how the gnetdemo is doing it. The local player are later going through all messages:
For Local msg:TGNetObject=EachIn GNetMessages( host ) Local typ$=GetGNetString( msg,SLOT_TYPE ) Select typ Case "gotme", "died" If typ = "died" Then Local frags = GetGNetInt( localplayer.nobj, SLOT_FRAGS ) frags=frags+1 SetGNetInt( localplayer.nobj, SLOT_FRAGS, frags ) EndIf Local obj:TGNetObject=GNetMessageObject(msg) If obj.State()<>GNET_CLOSED CloseGNetObject obj EndIf End Select Next
Again, this is similar to how the gnetdemo is doing things. But the frags isn't always updated. The gnetdemo is updating the score inside the If obj.State()<>GNET_CLOSED .. EndIf part, but I moved it outside because it got a little bit better on updating the frags. But it doesn't always update them.
Anyone got any ideas about these problems?