Author Topic: 1 vs 1 matches  (Read 2668 times)

getafix98

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
1 vs 1 matches
« on: June 15, 2014, 05:03:05 AM »
Hi, I want to do 1 vs 1 matches in my game, will TNet allow me to create a masterserver, then make 1 player host the game and 1 player connect to him?
I don't want all the players to be connected to the masterserver all the time as it will create a lag.
so my idea, is to use it as a masterserver just to handle player requests to start a match and then connect them one to another, then, when they finish the match, they connect back to the masterserver, is it a good idea and a good technique?

also, will it be easier for me (some java and c# knowledge, but not a serious programmer) to develop this kind of thing in TNet rether then unity networking code?
also is it right to do something like that in TNet?

thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 1 vs 1 matches
« Reply #1 on: June 15, 2014, 06:24:16 AM »
What Unity calls a "Master server" TNet calls "Lobby server". You connect to a lobby server to get a list of game servers. Once you connect to a game server, you don't need to stay connected to the lobby server. You can stay connected if you want an up-to-date list of servers, but you can safely disconnect from it if you don't.

Yes, using TNet is easier than Unity's built-in networking, and less buggy.

Deozaan

  • Newbie
  • *
  • Thank You
  • -Given: 44
  • -Receive: 4
  • Posts: 42
    • View Profile
    • Deozaan.com
Re: 1 vs 1 matches
« Reply #2 on: July 29, 2014, 02:32:39 AM »
What Unity calls a "Master server" TNet calls "Lobby server". You connect to a lobby server to get a list of game servers. Once you connect to a game server, you don't need to stay connected to the lobby server. You can stay connected if you want an up-to-date list of servers, but you can safely disconnect from it if you don't.

How would you go about disconnecting from the lobby server but stay connected to the game server?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 1 vs 1 matches
« Reply #3 on: July 29, 2014, 03:52:38 AM »
server.lobbyLink.Stop();