Author Topic: [TNet3 (Feb.8)] SetPlayerSave / SetPlayerData not saving  (Read 2460 times)

Ninja

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 21
    • View Profile
[TNet3 (Feb.8)] SetPlayerSave / SetPlayerData not saving
« on: February 08, 2016, 10:55:23 PM »
Having some saving issues now.

Here's what my game currently does:

OnNetworkConnect:
- TNManager.SetPlayerSave("Players/" + TNManager.playerName + "_" + SystemInfo.deviceUniqueIdentifier + ".dat";);
- JoinChannel

During gameplay, I use TNManager.SetPlayerData for a few variables I want to save on each player, but nothing seems to ever be saved on the server. Not sure if it matters, but I'm saving all the variables in one function, so it calls SetPlayerData more than once.

The OnSetPlayerData notification is working fine. The server just never seems to save anything.

What would be the correct way to handle saving player data in the latest version of TNet 3 (Feb. 8)?

Ninja

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 21
    • View Profile
Re: [TNet3 (Feb.8)] SetPlayerSave / SetPlayerData not saving
« Reply #1 on: February 08, 2016, 11:07:08 PM »
Hmm, well sometimes the server decides to save the player (still not sure why or when), but I get an EndOfStreamException: Failed to read past end of stream error directly after calling SetPlayerSave to load the save file. OnSetPlayerData isn't called when this happens.

I'm only saving three rather simple strings (the map the player is on, the last spawn point and their inventory).
« Last Edit: February 08, 2016, 11:12:38 PM by Ninja »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [TNet3 (Feb.8)] SetPlayerSave / SetPlayerData not saving
« Reply #2 on: February 09, 2016, 02:37:07 AM »
I'll send you another update that should fix that issue. It'd be easier if you had Pro access...

Ninja

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 21
    • View Profile
Re: [TNet3 (Feb.8)] SetPlayerSave / SetPlayerData not saving
« Reply #3 on: February 09, 2016, 02:47:04 AM »
Oh awesome, thanks so much! Apologies that I don't have pro access, I am considering it though thanks to your amazing support.