I hope I am posting this in the right section... since I started I have always had this problem and no idea what it could come from. Whenever I add something to DataStore, if I stop the server then start it again, that data is not loading (I use server.stop or quit to stop the server).
I made a simple test to see:
If I run /adddata in game, I get:
Adding data to DataStore
Data was added correctly
Then I run /getdata and I get:
Data: this is data
(which is correct and working great!)
Now if I stop the server, start it again and run /getdata I get:
Data: not found!
To make things worse, I know it was store, here is the PlutonDatastore.ds file:
So I know it's saved correctly...
I made a simple test to see:
Python:
__author__ = 'Coersum'
__version__ = '1.0'
import clr
import sys
clr.AddReferenceByPartialName("UnityEngine")
clr.AddReferenceByPartialName("Pluton")
import UnityEngine
import Pluton
class testDS:
def On_Command(self, cmd):
if cmd.cmd == "adddata":
cmd.User.Message("Adding data to DataStore")
DataStore.Add("data_test", cmd.User.GameID, "this is data")
if DataStore.ContainsKey("data_test", cmd.User.GameID):
cmd.User.Message("Data was added successfully")
else:
cmd.User.Message("Data was not added...somehow")
if cmd.cmd == "getdata":
if DataStore.ContainsKey("data_test", cmd.User.GameID):
cmd.User.Message("Data: " + DataStore.Get("data_test", cmd.User.GameID))
else:
cmd.User.Message("Data: not found!")
If I run /adddata in game, I get:
Adding data to DataStore
Data was added correctly
Then I run /getdata and I get:
Data: this is data
(which is correct and working great!)
Now if I stop the server, start it again and run /getdata I get:
Data: not found!
To make things worse, I know it was store, here is the PlutonDatastore.ds file:
Code:
ÿÿÿÿ System.Collections.Hashtable
LoadFactorVersionComparerHashSizeKeysValuesequalityComparer @?
data_test @?
2WÒ this is data