Author Topic: How to ignore Data Saving  (Read 682 times)


  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 62
    • View Profile
How to ignore Data Saving
« on: June 02, 2017, 02:26:04 PM »
Sooo, I understand that one of the main things that TNet does is data saving / persistence (Which would make sense and be good for an MMO style game)

My game however is a simple 2D Arena shooter (Think towerfall)
As such, I don't need to save my game world between play sessions..... But I noticed that when I Create a server, I have to pass a string with a .dat file extension. Is there any way for me to avoid this? Should I just ignore it? The main reason I ask is that I was having trouble with some data being saved when I didn't want it to, so I Wondered if there is a way to just avoid it all together for my project?



  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 149
  • Posts: 285
  • TNet Alchemist
    • View Profile
Re: How to ignore Data Saving
« Reply #1 on: June 04, 2017, 08:21:39 PM »
Yeah, you can pass null or an empty string.
1. Don't mark channels as persistent (so they will be destroyed when the last player leaves)
2. Don't use TNManager.SetPlayerSave

This should result in only a few files being saved: ban.txt, admin.txt, and world.config.
'world' is just the default name of the config file, in this case it would function more as a general server config as it doesn't store any world-specific data (unless you use TNManager.serverData or SetServerData).

It's worth noting that RFCs will still "save" on the channels during *runtime*, they just won't be saved to the filesystem on exit. So Target.AllSaved, Target.OthersSaved, etc will still work correctly if you need them.