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

Help with NetworkSession.Find() and NetworkSession.Create()

Last post 9/30/2009 6:18 PM by FlukeDude. 2 replies.
  • 9/30/2009 3:30 PM

    Help with NetworkSession.Find() and NetworkSession.Create()

    In my game there are four players, and one machine can have up to three signed in gamers. What I don't want to have (obviously) is a machine with three profiles connecting with a machine with two profiles, or three gamers each on seperate machines connecting with a machine with two profiles because then there are five players. I can't really test out whether what I'm doing is going to work with just a computer and an Xbox with two controllers, and am kinda confused at how NetworkSession.Find() and NetworkSession.Create() work.

    My code when I create a game is:

    networkSession = NetworkSession.Create(NetworkSessionType.SystemLink, 3, 4); 
    networkSession.AllowHostMigration = true
    networkSession.AllowJoinInProgress = false

    And when searching for a game is:

    AvailableNetworkSessionCollection sessions = 
          NetworkSession.Find(NetworkSessionType.SystemLink, 3, null); 

    So is what I'm doing right at the moment? I've seen you can do IEnumberable<SignedInGamers> but I can't figure out how to use it and whether I need to or ont.

    Thanks
  • 9/30/2009 6:04 PM In reply to

    Re: Help with NetworkSession.Find() and NetworkSession.Create()

    Answer
    Reply Quote
    The system won't let more players join a session than it has slots available for them to join. As long as you set the total number of slots correctly (3 and 4 in this case) everything else will "just work".
    XNA Framework Developer - blog - homepage
  • 9/30/2009 6:18 PM In reply to

    Re: Help with NetworkSession.Find() and NetworkSession.Create()

    Shawn Hargreaves:
    The system won't let more players join a session than it has slots available for them to join. As long as you set the total number of slots correctly (3 and 4 in this case) everything else will "just work".


    So will it automatically detect how many profiles are signed in and that I'll never have more than 4 profiles on any combinations of machines? If so that is fantastic.
Page 1 of 1 (3 items) Previous Next