Forum

> > CS2D > General > Saving Data of Players
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Saving Data of Players

21 replies
Page
To the start Previous 1 2 Next To the start

old Saving Data of Players

Masea
Super User Off Offline

Quote
So now with CS2D being on Steam, there are things that we need to talk.

I can join the server with my USGN ID, or with Steam, or with both. And it doesn't mean if I once joined with both and then I will join as same as always. I could join with only USGN ID or Steam later.

So what if I'm gonna save some data of that player?

He joins to the server with USGN ID first, and then I save his data for his USGN ID but he might join back with his Steam account and could say "Where the fuck has my level gone?".

What should I do about it?

old Re: Saving Data of Players

DC
Admin Off Offline

Quote
Approach 1: Use Both
One approach to tackle this would be: Save both, Steam ID and USGN ID with your data (if present, otherwise save only whats present and update if one becomes present later)

When you do the lookup, first lookup one and if failed lookup the other one (if present).

However one bad scenario then would be (like you already stated):
> first session ONLY USGN login or ONLY Steam login
> next session ONLY the other login (other than first session)

In that case you are screwed. Well, or the player. I think however that this won't occur too often.

Another bad scenario of course is when one Steam user (illegally) uses multiple USGN IDs or one USGN user uses multiple Steam IDs. This will lead to weird things then but it shouldn't be a problem for "good" guys who just have one legit account. Screw the bad guys!

Approach 2: Use only one
Another (simple, stable and straightforward) approach would be to clearly tell the player: "Hey, this only works with USGN login" or "Hey, this only works with Steam login" and then use that for saving your data. Simple and clear. Right now I would use the Steam ID then because right now most players have a Steam login for obvious reasons.

old Re: Saving Data of Players

Masea
Super User Off Offline

Quote
Let's weep together.

Well now, I'll take the Steam IDs as well yet I have no idea about how to use them...

old Re: Saving Data of Players

Mora
User Off Offline

Quote
Well, at the first steps of all this, you can require USGN and STEAM once, so the both data will be caught. Then no matter when you join again with steam or usgn the data will be saved in both.

Or the way which already said, you can use only one, or you can have warning message when you first time joined with steam or usgn like:
"Currently, the only way to save your data is Steam(or USGN). Next time you can log in both and join here to use your Steam or USGN id separately(or both)."

old Re: Saving Data of Players

Sparty
Reviewer Off Offline

Quote
1 has written
Another bad scenario of course is when one Steam user (illegally) uses multiple USGN IDs or one USGN user uses multiple Steam IDs. This will lead to weird things then but it shouldn't be a problem for "good" guys who just have one legit account. Screw the bad guys!


Just stick with Approach 1 seems better and safe.

old Re: Saving Data of Players

Masea
Super User Off Offline

Quote
user Mora has written
Well, at the first steps of all this, you can require USGN and STEAM once, so the both data will be caught. Then no matter when you join again with steam or usgn the data will be saved in both.
That would be an expensive experience and require more files to save data.

I already changed my save system as Steam IDs. Now everything works well.

Thank you all

old Re: Saving Data of Players

_3yrus
User Off Offline

Quote
you also can do something like this :
you can create data files with name => usgn-steamid.txt
1
2
3
example1 : 160368-165646546.txt
example2 : 0-165646546.txt
example3 : 160368-0.txt
and then in lua you can use split to get both of them.
it just need 1 file.
i hope this to be useful

old Re: Saving Data of Players

Mora
User Off Offline

Quote
Which files? It would not require more than one file, where you include steam or usgn id and check it out, like
1
2
3
PLAYER[steamid]={
usgnid=114940,
data={}}

So next time it will be harder for sure to find usgnid in all steamids, or
PLAYERS[usgnid]={...}
, but still it's one file.

old Re: Saving Data of Players

Masea
Super User Off Offline

Quote
@user _3yrus: This. Is. What. I. Do. For. Saving. Data. Of. Players:

user _3yrus has written
you also can do something like this :
you can create data files with name => usgn-steamid.txt
1
2
3
example1 : 160368-165646546.txt
example2 : 0-165646546.txt
example3 : 160368-0.txt
and then in lua you can use split to get both of them.
it just need 1 file.
i hope this to be useful


old Re: Saving Data of Players

_3yrus
User Off Offline

Quote
user Masea has written
@user _3yrus: This. Is. What. I. Do. For. Saving. Data. Of. Players:

user _3yrus has written
you also can do something like this :
you can create data files with name => usgn-steamid.txt
1
2
3
example1 : 160368-165646546.txt
example2 : 0-165646546.txt
example3 : 160368-0.txt
and then in lua you can use split to get both of them.
it just need 1 file.
i hope this to be useful



aha

old Re: Saving Data of Players

Mora
User Off Offline

Quote
@user _3yrus: if you dont know, you can save file with such name
'files\'..PLAYERS[steamid]..'.lua'
or save currently existing players each 5-10 minutes. Is not about having the whole players data on server(as it working in tibia).
To the start Previous 1 2 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview