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

Can host modify sessionproperties while in PlayingState?

Last post 9/11/2009 7:19 PM by jwatte. 3 replies.
  • 9/11/2009 2:48 PM

    Can host modify sessionproperties while in PlayingState?

    [Posted on behalf of BarkersCrest who is having some forum problems]

    ( You can skip down to the very last line and read the question and if it doesn't make sense you can read through the entire post for more of an explanation of the issue )

    If you aren't familiar with Avatar Golf, the network sessions in the game can be set to allow Join In Progress, which I recommend everyone do in their games if possible.  When gamers look for an online match to join I list the AvailableNetworkSessionCollection returned from NetworkSession.Find and let the gamer choose which match to join.  This is working out really well except one problem, I'm not able to identify the NetworkSessionState of each AvailableNetworkSession and display that detail in the list of AvailableNetworkSessions to the gamer.

    So basically, a lot of gamers are joining matches that are almost over but prefer to join matches in the lobby or are early in the match.

    What I'm hoping to do as a work around is let the Host manage this kind of information in the session properties as the AvailableNetworkSession has the SessionProperties available.

    Ideally, I'd like to reserve one position in the SessionProperties array for the current hole the match is on ( 0 for lobby, 1 - 18 for current hole ) and another for the total number of holes on the course that is being played.

    For example, as the game is now, the current list will display:

    Barkers Crest - ( 3 / 8 ) 
    JoeSmithHacker - ( 1 / 8 )

    I'd like it to instead display:

    Barkers Crest - ( 3 / 8 ) - On hole 15 of 18
    JoeSmithHacker - ( 1 / 8 ) - In Lobby Waiting for Gamers

    As you can see, it would really help the gamers decide which match to join.

    The question I have is can the Host modify the SessionProperties once the session is in Playing State?  ...and if so will the NetworkSession.Find return a collection with the latest Host values for SessionProperties when called?

    Play Kissy Poo - a game for 4 year olds on Xbox and windows
    The ZBuffer
    News and information for XNA
      Follow The Zman on twitter, Email me
        Please read the forum FAQs - Bug/Feature reporting
          Don't forget to mark good answers and good playtest feedback when you see it!!!
  • 9/11/2009 3:13 PM In reply to

    Re: Can host modify sessionproperties while in PlayingState?

    As far as I know, you can set the properties from the host at any time after the session is initialized. I have never done this after starting the game, but reflector seems to imply that the properties are synchronized as long as the session is still active regardless of state.

    I don't know how changing these properties after the session starts affect search results, but it's a good question. I'm sure we'll get an official answer.
  • 9/11/2009 6:49 PM In reply to

    Re: Can host modify sessionproperties while in PlayingState?

    You can change session properties at any time: this is exactly the sort of scenario they are intended for.

    There is some lag in changes being propagated to the LIVE matchmaking service, so this isn't strictly realtime, but you will typically see updates within a few seconds.
    XNA Framework Developer - blog - homepage
  • 9/11/2009 7:19 PM In reply to

    Re: Can host modify sessionproperties while in PlayingState?

    Now if we could only do ">" and "<" matches based on the properties...
    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
Page 1 of 1 (4 items) Previous Next