Forum

> > CS2D > General > Saving Data of Players
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch Saving Data of Players

21 Antworten
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

alt Saving Data of Players

Masea
Super User Off Offline

Zitieren
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?

alt Re: Saving Data of Players

DC
Admin Off Offline

Zitieren
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.

alt Re: Saving Data of Players

Masea
Super User Off Offline

Zitieren
Let's weep together.

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

alt Re: Saving Data of Players

Mora
User Off Offline

Zitieren
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)."

alt Re: Saving Data of Players

Sparty
Reviewer Off Offline

Zitieren
1 hat geschrieben
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.

alt Re: Saving Data of Players

Masea
Super User Off Offline

Zitieren
user Mora hat geschrieben
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

alt Re: Saving Data of Players

_3yrus
User Off Offline

Zitieren
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

alt Re: Saving Data of Players

Mora
User Off Offline

Zitieren
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.

alt Re: Saving Data of Players

Masea
Super User Off Offline

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

user _3yrus hat geschrieben
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


alt Re: Saving Data of Players

_3yrus
User Off Offline

Zitieren
user Masea hat geschrieben
@user _3yrus: This. Is. What. I. Do. For. Saving. Data. Of. Players:

user _3yrus hat geschrieben
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

alt Re: Saving Data of Players

Mora
User Off Offline

Zitieren
@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).
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht