Hello everyone,
I have a doubt regarding channel and server creation.
Right now, what I am doing:
- I have a main server hosted in Amazon
- All players will connect there to handle channel creation, hosting and playing (I think it is the same way as the Aren game works)
- How can I setup the name of the channel (in channel parameters, there is only level name, no channel name... is custom data the only way?)
- How can I ping each channel when getting channel list? Right now I can only ping the server I am in... is this the only way? With this, I suppose, all players will have the same ping because they are all in the same main server?
I think I misunderstood the way channels in TNet works.
I still have my old way, which is all players creates their own server instance, so I save their server data in a private database (mySQL) and get info from there to generate my own channel list. I thought having some kind of master server and using hosting channels to provide players host and client will be easier to keep everyone playing without port forwarding.
If anyone can help me, I appreciate it.
Thanks in advance.
I explained in your other thread that players deemed a channels "host" aren't really hosting anything. The channel exists on the server. The server "hosts" the "channel", the player
*operates* the channel. To reiterate: the channel is part of the server. A server can have many channels. A channel exists solely and entirely on the game server. To "join" a channel simply tells the server you're part of a specific group of clients.
You can set the name in the channel data, yes. You can then retrieve the name from the channel data.
Like I said, the channel is just a collection of data on the server. Therefore, the server ping is your ping to each and every channel on the server.
All players will *NOT* have the same ping. I think you misunderstand how networking works. I really don't know where to begin explaining that... so, let's say every networked device is connected via Ethernet (that blue cable thing - I'm sure you've seen it). If this is the case, you can picture the Internet as a huuuuuge collection of devices all connected by blue cable. One giant blue cable with devices breaking it up. So, networking, then, is determining which path to take to reach a destination. You would have to determine which device nearest to you to talk to, and that device determines the next device, and so on and so on until you reach your destination. So how many devices are between you and your destination, the distance between each device, and how fast each device determines the next device greatly effects your ping. I recommend playing around with the "tracert" program in Windows (or "traceroute" in linux / mac). Type "tracert google.com" in command prompt (or "traceroute google.com" in linux / mac terminal). Each "hop" is a device on the way to reaching google, so you can see the exact path your network resolved.
Mine is different.
I have a list of different servers that hook up to the lobby server. Then a simple list showing all the different servers (not rooms). How do I go about pinging each server when not connected to it. In the list I have server name and numbers of players showing, there's no option for ping (only when connected, as done by the example menu).
Cheers
Try TNManager.Ping(IPEndPoint udpEndPoint, GameClient.OnPing callback). You can get the EndPoint from TNLobbyClient.knownServers.list[_index_].externalAddress (or internalAddress).
If it doesn't work then at least you have a starting point