Author Topic: Updating Lobby Details Dynamically  (Read 2595 times)

rxmarcus

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 62
    • View Profile
Updating Lobby Details Dynamically
« on: June 11, 2017, 09:30:11 PM »
Is there a way to update a Server's details (name for example) dynamically with the Lobby server? In my case I'm going to be sending mapName and gameMode properties through my Lobby server so a player can know what the map and gametypes are before joining. How can I update these details as the online matches are played, and new matches / gametypes are loaded up on a server?

cmifwdll

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 149
  • Posts: 285
  • TNet Alchemist
    • View Profile
Re: Updating Lobby Details Dynamically
« Reply #1 on: June 12, 2017, 01:40:04 AM »
Not sure how you're sending the details to begin with, but on the GameServer you can call lobbyLink.SendUpdate(this). This is already called every time a player connects or disconnects. You can use Packet.RequestRenameServer to change the name of the GameServer from any client.
You could modify the GameServer to also call lobbyLink.SendUpdate(this) when that packet is received (near the bottom of the ProcessPlayerPacket function).

rxmarcus

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 62
    • View Profile
Re: Updating Lobby Details Dynamically
« Reply #2 on: June 18, 2017, 11:54:05 AM »
Thanks to cmifwdll for the help!

Here is what the syntax looks like to update the server name for anyone that might need help. (I didn't know how to do this)
  1. BinaryWriter writer = TNManager.BeginSend(Packet.RequestRenameServer);
  2. writer.Write("Server name here");
  3. TNManager.EndSend();
  4.