Author Topic: UDP Lobby problems and some questions.  (Read 4993 times)

Alphavladim

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 2
  • Posts: 4
    • View Profile
UDP Lobby problems and some questions.
« on: October 08, 2014, 05:47:13 AM »
First of all, i am a newcomer to TNet and pretty noob when it comes to networking.

I also have a script that creates a server in Start() function.
Also, in a game object, TNManager, TNUdpLobbyClient. Everything works fine, except of this :

  1. Local IPs: 1
  2.   1: 192.168.1.103 (Primary)
  3.  
  4. UPnP discovery failed. TNet won't be able to open ports automatically.
  5. Gateway IP:  None found
  6. External IP: 86.127.41.93
  7.  
  8. UDP Lobby Server started on port 5129
  9. Write 'stop' followed by ENTER to stop the server instance.
  10.  
  11. 86.127.41.93:61950 added a server (192.168.1.103:5127, 86.127.41.93:5127)
  12. 86.127.41.93:61950 added a server (192.168.1.103:5127, 86.127.41.93:5127)
  13. 86.127.41.93:61950 added a server (192.168.1.103:5127, 86.127.41.93:5127)
  14. 86.127.41.93:61950 added a server (192.168.1.103:5127, 86.127.41.93:5127)
  15. 86.127.41.93:61950 added a server (192.168.1.103:5127, 86.127.41.93:5127)
  16. 86.127.41.93:61950 added a server (192.168.1.103:5127, 86.127.41.93:5127)
  17. 86.127.41.93:61950 added a server (192.168.1.103:5127, 86.127.41.93:5127)
  18. 86.127.41.93:61950 added a server (192.168.1.103:5127, 86.127.41.93:5127)
  19.  

Why are so many "ip added server" ? Lobby server is running on UDP, so Gameserver does.

I have some questions :
1. What is the difference between servers and channels ?
2. I want to make a simple multiplayer game, where people can create their "own" room.
    What should i do ? Let the player open a new server or open a new channel ?
3. What is the difference between udp lobby server and tcp one?
4. I want to make a login server. Where should i start ? What files should i look into ?
Sorry for the last question, i am pretty noob when it comes to networking :).

Thanks!
« Last Edit: October 08, 2014, 11:41:48 AM by Alphavladim »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UDP Lobby problems and some questions.
« Reply #1 on: October 08, 2014, 01:45:33 PM »
UDP is a connectionless protocol. It means that messages need to be sent repeatedly to keep the status "alive". Same goes for your server entry. It has an expiration timer, and since there is no active connection to check for when the server should be removed, the lobby server must be notified periodically saying that your server is still active.

If you use a TCP lobby server instead, you won't see this.

Alphavladim

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 2
  • Posts: 4
    • View Profile
Re: UDP Lobby problems and some questions.
« Reply #2 on: October 08, 2014, 02:24:47 PM »
Thanks. But how about my other questions ?
Thanks in advance !

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UDP Lobby problems and some questions.
« Reply #3 on: October 10, 2014, 03:02:45 AM »
1. A server is a program that lets players connect. It's the executable you run (TNServer.exe) or TNServerInstance you start. A channel is like a private chat room on that server. Everyone who joins can send messages.

2. Depends on the game you're making. Do you want to have a dedicated server, or do you want players to host their own servers?

4. What's a login server? Do you mean something players connect to in order to authenticate their account? This should ideally be done with something other than TNet. Send a Post request to a PHP script, that script gives back a result containing the success/fail message, and if successful -- address of the lobby server to connect to. If you want it done with TNet instead, you will need to add this logic to the server code itself, as TNet doesn't have any user authentication.

Alphavladim

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 2
  • Posts: 4
    • View Profile
Re: UDP Lobby problems and some questions.
« Reply #4 on: October 10, 2014, 07:36:30 AM »
Thank you for your answers! I made an auth server using Tnet, by implementing custom packets.

Regarding answer #2:

Reading forums further, found out that using channels i can use a password to protect channel and get player number on that channel.
But can i limit player available spots for a channel ?

Some other questions:
Can i find out if a server is full ?
How can i get server list and adresses from lobby server ?
Also, what approach would you take in this case ?

Thanks again and i hope i didn't bother you with my questions!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UDP Lobby problems and some questions.
« Reply #5 on: October 11, 2014, 05:00:14 AM »
Yes, you can change the number of available slots in a channel. You can actually create a channel with only 1 player limit by default, and then once you set everything up, open it up for other players via TNManager.SetPlayerLimit.

There is no such thing as a full server. It all depends on your hardware.

You get a list of servers from the lobby via TNLobbyClient.knownServers.