XNA Creators Club Online
Page 1 of 1 (2 items)
Sort Posts: Previous Next

Clean the writer-reader packet’s buffer?

Last post 03/07/2009 14:45 by dadoo Games. 1 replies.
  • 03/07/2009 14:26

    Clean the writer-reader packet’s buffer?

    Normal 0 14 false false false IT X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Tabella normale"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-fareast-language:EN-US;}

    Hello there, I’m kind of new on this forum and I’m creating a multiplayer game with XNA 3.0.
    First of all I apologize for my bad English, hope that you’ll understand anyway.
    I need to send 2 kind of information with the pressure of a key:
    -    A simple int variable;
    -    A group of variables that refreshes the game terrain, the current player sending these variables works as “host”.
    The real host is actually the same, but the terrain’s information are sent by the current player to all the other players.
    If the variable in the packet-writer is 0,1,2,3 or 4 it will contain the first kind of information, when it is different it will contain the second type of information (map details).
    This variable contains in a first time the turn of a player (a player has 4 turns in his round) and when is reach the 4 the player will change and it will begin a new round.
    Here is my problem: the map received by the second player is not changed. It just doesn’t refresh the other player’s map and the position of the cursor for the turn is received with a lot of delay.
    I thought that the information has been memorized in the packet writer of the previous player. How can I clean that buffer every turn?
    Any suggestions? Thank you, Matteo.

  • 03/07/2009 14:45 In reply to

    Re: Clean the writer-reader packet’s buffer?

    I'm not really sure what you are asking, so I'll make some possibly related statements:

    • The PacketWriter raw data is called each time you call LocalNetworkGamer.SendData (unfortunately). It won't persist across multiple SendData calls.
    • You say the delay until the packet arrives is large - how often are you calling networkSession.Update()? If you don't call update on the sender and receiver side the data won't arrive.
    I think we need more information before we can really say what the issue is.
    www.dadoogames.com
    Curling 2010 - in playtest soon, this month or next, this year for sure (maybe)
Page 1 of 1 (2 items) Previous Next