Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

Cannot get UniqueID from Dedicated Server

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Post Reply
kirill240
Fighter
Fighter
Posts: 18
Joined: Mon Jan 09, 2017 1:01 pm
SFD Account: Mr.A woman's heart

Cannot get UniqueID from Dedicated Server

Post by kirill240 » Thu Jul 18, 2019 9:38 am

How to get a unique ID that I see in Dedicated server, for example, S98621949 via script api? UserID and UniqueID give a different number :( How can I distinguish people not by their names and ip, but therefore their identification number.
Example

Update: GetSharedStorage returns empty storage but it is not empty actually, why?
0 x

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Thu Jul 18, 2019 5:45 pm

UniqueID is just the user's current instance ID, which will be different for each connection made.
There's no property to read the AccountID yet for what I can tell (will most likely add it to the next update).

GetSharedStorage returns null if the provided storage name is invalid. The name must only contain letters (and no whitespace characters) and be a valid filename and must not exceed 40 characters and be at least 3 characters long.
0 x
Gurt

kirill240
Fighter
Fighter
Posts: 18
Joined: Mon Jan 09, 2017 1:01 pm
SFD Account: Mr.A woman's heart

Post by kirill240 » Thu Jul 18, 2019 7:20 pm

Gurt wrote:
Thu Jul 18, 2019 5:45 pm
UniqueID is just the user's current instance ID, which will be different for each connection made.
There's no property to read the AccountID yet for what I can tell (will most likely add it to the next update).

GetSharedStorage returns null if the provided storage name is invalid. The name must only contain letters (and no whitespace characters) and be a valid filename and must not exceed 40 characters and be at least 3 characters long.
He returns not null, but empty storage. I have non-empty storage that script on the map fill. After gameover and start map again storage is empty :(
1 x

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Thu Jul 18, 2019 8:36 pm

Closer inspection reveals that the GetSharedStorage("") seem to always return empty storages as the code to load the data for shared storages runs in the wrong context which makes File.Exists always return false - no crash, no nothing. Just a silent "nope - file does not exist here!". Will be fixed for the next update.

Meanwhile, you will have to use LocalStorage instead.

SharedStorage is only required if you want different maps and scripts to be able to share and read data between each other.
0 x
Gurt

kirill240
Fighter
Fighter
Posts: 18
Joined: Mon Jan 09, 2017 1:01 pm
SFD Account: Mr.A woman's heart

Post by kirill240 » Thu Jul 18, 2019 10:10 pm

Gurt wrote:
Thu Jul 18, 2019 8:36 pm
Closer inspection reveals that the GetSharedStorage("") seem to always return empty storages as the code to load the data for shared storages runs in the wrong context which makes File.Exists always return false - no crash, no nothing. Just a silent "nope - file does not exist here!". Will be fixed for the next update.

Meanwhile, you will have to use LocalStorage instead.

SharedStorage is only required if you want different maps and scripts to be able to share and read data between each other.
Thanks!!!!
0 x

Post Reply