Author Topic: Can a Lobby be dynamic?  (Read 3203 times)

Groad

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 1
    • View Profile
Can a Lobby be dynamic?
« on: August 17, 2016, 03:34:02 PM »
I'm relatively new to networking, and trying to fix some TNet code that is preexisting in our project is causing me trouble. I know what I want to be done, I'm just not sure how to go about coding it. Sorry if this is obvious/ has been posted before, but I searched pretty thoroughly.

We have an application that is creating a local server, and another application for devices to connect to that server over a network with no internet access. Currently, only one server can exist, but I'd like for multiple servers to be supported. Lobbying seems to be the best way to do this, but there won't be a persistent host for the lobby.

My first question is thus;
  • Computer A begins a lobby, then a server, and connects to it
  • Computer B begins a second server, registers it to the lobby, and connects it
  • Computer A is done using the application, and shuts down
  • Computer C wishes to connect to a server
When Computer C wishes to connect, will it have access to the lobby listing Computer B's server, or was that lobby destroyed with Computer A? In other words, can you define the lobby dynamically based on servers that exist? Can Computer A transfer the lobby to Computer B?

I'm assuming no. In that case, my second question is thus; How can one generate a list of locally hosted servers WITHOUT a lobby? Is there any way to do this automatically without manually typing in the address? Would defining a range of ports to check for servers work? Can I just send pings? Through what methods could I automate this?

cmifwdll

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 149
  • Posts: 285
  • TNet Alchemist
    • View Profile
Re: Can a Lobby be dynamic?
« Reply #1 on: August 17, 2016, 05:40:16 PM »
We have an application that is creating a local server, and another application for devices to connect to that server over a network with no internet access.

I don't understand this, can you clarify? Are you saying one application is the dedicated server, and the other application is your game? Further, are you saying that each user can at any point be running both the dedicated server application and the game application?

Reading ahead, in your given scenario, how does Computer B know that the lobby server is currently hosted on Computer A?

I believe LAN broadcast packets were removed in TNet3, but this seems to be the perfect case for them ;)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Can a Lobby be dynamic?
« Reply #2 on: August 18, 2016, 12:20:14 AM »
LAN broadcasts still work fine in TNet 3 -- they are used for LAN discovery. It's the tno.Send broadcasts that no longer work the same as they are no longer needed with the multiple channel support.

@Groad: If playing via LAN, you can use UDP broadcast server discovery to locate active games, as TNet's menu does. Going over the internet however, you need to have a central lobby location that everyone will connect to.

cmifwdll

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 149
  • Posts: 285
  • TNet Alchemist
    • View Profile
Re: Can a Lobby be dynamic?
« Reply #3 on: August 18, 2016, 12:33:53 AM »
LAN broadcasts still work fine in TNet 3 -- they are used for LAN discovery. It's the tno.Send broadcasts that no longer work the same as they are no longer needed with the multiple channel support.

Ah, I was only guessing. One of these days I'll make the upgrade, I swear :)

@Groad, disregard everything in my post then, Aren gave the correct solution.