Author Topic: Old TNet 2.0 Customer question about 3.0  (Read 2456 times)

Rexima

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 2
  • Posts: 78
    • View Profile
Old TNet 2.0 Customer question about 3.0
« on: September 06, 2016, 09:49:27 AM »
Hi,

i have only one question at the moment.

Is TNet 3.0 still p2p?

Last time i used TNet 2.0, i made an Unity Scene for the "Dedicated server" and an another Client (Menu) Scene.
On the "Dedicated server" i startup an Gameserver and instantly let an dummy player join to it, to become the host.

Reason:
I plan to make a game with a huge number of players(MMO) with multiple channels.
There will be a huge city, with maybe up to 50-100 players.
The players are able to go to several checkpoints in the city and start their own matches.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Old TNet 2.0 Customer question about 3.0
« Reply #1 on: September 06, 2016, 10:28:37 AM »
P2P implies one player connects to another, so no. TNet 2 and 3 are both server-based. The actual game server runs an executable that lets players connect to it and start communicating. The first player to join a channel is marked as its "host", but whether that means anything is up to the developer.

Max number of players in Windward on the same server was ~330, spread around a world split into regions, with each region being a separate channel. I never needed any dummy players.

I'm currently working on a game with a larger scope, where players can explore a procedural world freely, with the terrain getting streamed around them as they explore it. As the new terrain tile gets loaded, I also join its channel ID. Since TNet 3 supports multiple channels, this lets me join appropriate regions around the player as they explore it.

Rexima

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 2
  • Posts: 78
    • View Profile
Re: Old TNet 2.0 Customer question about 3.0
« Reply #2 on: September 06, 2016, 11:00:22 AM »
Thank you for your quick answer.

The first player who joins, has the authority to kick and ban other player?
If it's so, i need to connect a dummy player after the server is created, to be safe.

//EDIT: Solved!
« Last Edit: September 07, 2016, 02:43:15 PM by Rexima »

cmifwdll

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 149
  • Posts: 285
  • TNet Alchemist
    • View Profile
Re: Old TNet 2.0 Customer question about 3.0
« Reply #3 on: September 07, 2016, 08:49:30 PM »
Thank you for your quick answer.

The first player who joins, has the authority to kick and ban other player?
If it's so, i need to connect a dummy player after the server is created, to be safe.

//EDIT: Solved!

No, only authorized players are able to kick and ban. I'm a little out of it right now, but if I'm thinking straight I believe the host has no implicit power. You decide what the host has power over.

To expand, a list is kept on the server (SteamIDs, passwords, whatever you decide to use), and players must supply a correct value via TNManager.SetAdmin(string pass) in order to kick or ban others. The host doesn't have access to this list unless the host is also running the server (can we please rename "host" to "channel operator" :P)

As Aren said, TNet isn't p2p, but it's important to note that the game server acts as a "smart relay". It has no concept of the game, the world, the physics, etc. It simply relays packets. That's not to detract from the genius of TNet, though. There is no "one size fits all" server-authoritative solution. A lot of TNet's worth, in my opinion, comes from how well-written and extensible it is. If you want your server to be authoritative, you can make it so with surprising ease.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Old TNet 2.0 Customer question about 3.0
« Reply #4 on: September 09, 2016, 03:03:52 PM »
cmifwdll is correct -- the host has no explicit power. It's just a flag on a single player per channel that you can use for things like determining who should be running AI and other tasks that should only happen on a single client and then sent to everyone else.

Only administrators can kick/ban players. Administrators are players that authorize themselves as such using TNManager.SetAdmin(passKey).

The "passKey" must match one of the keys in the admin.txt file used by the server.