Author Topic: Help with Lobby Server  (Read 2556 times)

fretnoize

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
Help with Lobby Server
« on: June 03, 2014, 09:47:14 PM »
Hi, I'm still new to TNet and I'm trying to find information on setting up a Lobby server. I looked around and can't seem to find a tutorial or something that guides you through it. I found info on running a lobby server, and registering a server to it, and I've been able to do these successfully, but as far as connecting to the lobby server with a client, retrieving a list of available servers and joining one, I haven't been successful yet.

I'll keep trying some things, but I'm hoping someone can point me to an overview of this. :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Help with Lobby Server
« Reply #1 on: June 04, 2014, 02:28:24 AM »
Attach the TNTcpLobbyClient script (or UDP, depending on which one you're using) to a game object and specify the remote address. The script will take care of connecting and retrieving the server data that you can access via TNLobbyClient.knownServers, or register a notification via TNLobbyClient.onChange = YourFunction;

fretnoize

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: Help with Lobby Server
« Reply #2 on: June 04, 2014, 04:09:37 AM »
Ah great, exactly what I was missing! Thanks!
We're running a TCP Lobby on a separate computer on our local network, and likely will eventually move to an amazon server. But this leads me to two more questions.

In the FAQ you say "Start the TNServer as a lobby server on a remote PC. Note that it has to be a remote PC as this is a lobby server" Do you mean "remote" as in a separate computer, or as in off the local network? (we're having trouble getting more than one server appearing, it could be likely it's just something on my end, but if this is the case, it would save us a lot of time troubleshooting)

The 2nd question is that I thought I read somewhere that you had trouble with one of the Lobby server types using Amazon's service (I think maybe the UDP Lobby), am I remembering incorrectly or is/was this a problem?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Help with Lobby Server
« Reply #3 on: June 05, 2014, 01:46:57 AM »
Remote as in, remotely accessible computer, like an Amazon EC2 instance. You can (and should) register multiple game servers on the same lobby server.

Yes, you can't use UDP with Amazon for incoming traffic. Security purposes.

fretnoize

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: Help with Lobby Server
« Reply #4 on: June 06, 2014, 01:33:59 AM »
Ok thanks for the help. If I wanted a way to list Local (LAN) servers, is there a way to approach that? Basically basically for testing and development purposes I'd like to create a system where developers can run game servers and you can join the server you want, for testing your code or levels or what not.

I tried running two servers, on separate local computers, of the example but only one server would appear.

Is just having one server and hosting separate channels the better approach?

Sorry if my questions are weird... I'm still trying to wrap my head around TNet... I'm tasked with switching our network code over from Unity's system to TNet. I recommended TNet since it can send unreliable function calls, and it seems Unity can't. Anyway, thanks for your help so far!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Help with Lobby Server
« Reply #5 on: June 06, 2014, 03:15:38 AM »
You can run two game servers, but you must only have one Lobby server. TNet's example has a built-in lobby server when you hit the Host button, so if you have multiple ones active it simply won't work as they'll fight with each other.