Author Topic: Host player id  (Read 3681 times)

matt.va

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 5
    • View Profile
Host player id
« on: July 14, 2013, 08:27:28 PM »
hi,

Realise the player id has been allocated round robin fashion, as i disconnect & connect. e.g, 1->2->3
I would like to fix it at 1 for host, and 2 for the next player...increment sequentially, first come first serve basis.
How can i achieve that without exiting and restart the game again ?

Br,
Matt
 
« Last Edit: July 14, 2013, 10:53:48 PM by matt.va »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Host player id
« Reply #1 on: July 15, 2013, 06:49:14 AM »
What are you trying to increment? Host ID is just the ID of the player in the channel who's considered to be the channel's authoritative host. IDs of the player are sequential, incremented by 1 each time a new player connects. If you are trying to control who's host, just do it using TNManager.SetHost.

matt.va

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 5
    • View Profile
Re: Host player id
« Reply #2 on: July 15, 2013, 09:40:30 PM »
What are you trying to increment? Host ID is just the ID of the player in the channel who's considered to be the channel's authoritative host. IDs of the player are sequential, incremented by 1 each time a new player connects. If you are trying to control who's host, just do it using TNManager.SetHost.

In fact try "NOT" to increment for host player, as the host i would like to keep it at 1.
U see, i face the issues when "Disconnect" and get a new playerid everytime....
e.g, in channel, player1 = 1, player =2, player3 = 3,  after disconnect, player1 =4,.....etc

I would like player1 to keep it's original playerid after disconnect.


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Host player id
« Reply #3 on: July 16, 2013, 10:23:30 AM »
You simply can't. The ID is an abstract identifier and is not kept with the player. It's only to be used as a temporary identifier number.

Instead I suggest you have an RFC function that remembers the host's name, IP, or whatever else you want to use that would actually be more appropriate. When a player joins the channel check it against the saved value, and if it matches -- transfer the host status back to that player.