Author Topic: Best practice for saving server-wide variables? (team and player scores, etc.)  (Read 1778 times)

Lumos

  • Newbie
  • *
  • Thank You
  • -Given: 7
  • -Receive: 4
  • Posts: 21
    • View Profile
Greetings!
I'm pretty sure the answer to this is quite straightforward, but I've been busy with lots of different things and my memories of TNet's inner workings is a bit rusty. Tried a bit of searching, but that sort of failed to bring up anything interesting, so before I do something stupid, here I am.

The thread's title says it all: I'm wondering what the best way to save "global" variables is. Given that the dedicated servers in my game should behave more like any given first-person shooter's dedicated servers (though my game isn't an FPS), and not like a co-op game where the server stops existing once all players leave, I want to save stuff like team scores, and which team controls which objectives, that will then be relayed to newly-joining players.
What would be the most elegant way of storing these values? Encoding them into the TNManager.channelData string?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Check TNManager.channelData. As an added benefit you get this data when retrieving a list of channels.