ID:270950
 
Hello folks,

I want to do a Pwipe and normly you can just wipe the save files from the host but we've a client side saving system.

---------------------------
mob
proc
LoadPlayer()
var/savefile/client_file = new(client.Import())
Read(client_file)
if(src.Clan)
for(var/stuff in src.V)
src.verbs += stuff
world<<"World: [src]([src.key]) has logged in!"
var/Found[0]//START MULTIKEY CODE
for(var/mob/M in world)
if(Found.Find(M))continue
if(M.client)
for(var/mob/M2 in world)
if(!M2.client)continue
if(!M2)continue
if(M == M2)continue
if(M.client.address == M2.client.address)
Found += M
Found += M2
world <<"[M.name]([M.key]) and [M2.name]([M2.key]) have the same listed IP address!"
src.client.show_verb_panel=1
src.loc = locate(xco,yco,zco)
client.view = src.view
src.OOC = 1
src.cansave=1
src.Frozen = 0
src.AutoSave()
src.logincrap()
else
alert("You dont have any savefile!")
return
----------------------------
So, how can I wipe the savesfrm the client o at least to make it so th can't load there character so they need to create a new one?
I hope you guys can help me, I need to do a pwipe since popleare too strong.
orry its kinda yellow of the multikeycode :P Well hope you guys know how to wipe a client save.
Use the <DM> tag.
For your problem just add a simple variable that's set on every new player, but isn't set on the client-side savefile. You can then check if this variable isn't set and prevent the savefile from being loaded.
In response to Android Data (#2)
Hmm, can you show me an example?
I tried but each time it says: var defined but not used or something.

Thanks for your answe btw.
In response to Ultimate Productions (#3)
Just write a null savefile.
That looks a lot like Naruto's source code. =)

But I'm not going to accuse anyone of anything.

What you could do, is save a number in the savefile, indicating the saves version. Everytime you want to wipe, up the hardcoded version that all savefiles need to be, and just check a savefile that's someone is trying to load and see if its savefile version is the correct one, and if its not, delete the savefile.

[edit]
You're also not closing your tags, hence the yellow text.
In response to Koil (#5)
Thanks for your answer.
But, where do I put that number?
At the saving code and at the loading point or at the saving point OR loading point?
And what should I write in that?
The game has been taken over by me and I'm not a coder or at least someone who cant understand even [no profanity, please] in it.
So, can you give me an example?
Sorry for my nubby question :P
Again thanks for answer.

Regards,

UP
In response to Ultimate Productions (#6)
mob/var/list
V
mob
proc
AutoSave()
if(src.cansave)
src.SaveK()
spawn(5000)
src.AutoSave()
mob
proc
SaveK()
if(src.cansave)
var/savefile/F = new("players/[src.key].sav")
src.V = src.verbs
src.xco = src.x
src.yco = src.y
src.zco = src.z
Write(F)
src.client.Export(F)
src << "<font color=green>Your game has been automatically saved!</FONT>"


mob
verb
Savenow()
set name ="Save"
if(usr.cansave)
var/savefile/F = new("players/[usr.key].sav")
usr.V = usr.verbs
usr.xco = usr.x
usr.yco = usr.y
usr.zco = usr.z
Write(F)
usr.client.Export(F)
spawn(10) usr << "<font color=#ffa500>Your game has been manually saved!</FONT>"

mob
proc
LoadPlayer()
var/savefile/client_file = new(client.Import())
Read(client_file)
if(src.Clan)
for(var/stuff in src.V)
src.verbs += stuff
world<<"World: <font color=yellow>[src]([src.key]) has logged in!</FONT><font size=2>"
var/Found[0]//START MULTIKEY CODE
for(var/mob/M in world)
if(Found.Find(M))continue
if(M.client)
for(var/mob/M2 in world)
if(!M2.client)continue
if(!M2)continue
if(M == M2)continue
if(M.client.address == M2.client.address)
Found += M
Found += M2
world <<"<font size=3><font color=yellow>[M.name]([M.key]) and [M2.name]([M2.key]) have the same listed IP address!</FONT><font size=2>"
src.client.show_verb_panel=1
src.loc = locate(xco,yco,zco)
client.view = src.view
src.OOC = 1
src.cansave=1
src.Frozen = 0
src.AutoSave()
src.logincrap()
else
alert("You dont have any savefile!")
return

----------------
This is the Loading an Saving code.
Could you please give me an example IN the code? Thanks.
In response to Ultimate Productions (#7)
Put your code in the <DM>DM TAGS</DM> otherwise it looks ugly.
In response to Ultimate Productions (#7)
Ultimate Productions wrote:
Could you please give me an example IN the code? Thanks.

You have everything you need to know how to do this. It seems all you'll read is code snippets though I think you'll copy/paste those rather than read them anyway.
Use the <DM> tag, for crying out loud. Did you even read what I wrote? Probably not.
I recommend reading this. You may not like it since you don't like reading important information, but the second you've finished it you'll know all there is about the wonderful language of DM.

And ditch the "Ultimate Productions". You're not a company nor will you ever be, espessially not with this attitude. Companies usually get a lot of money and have lots of people working for them. If you want to make a little team, call it "The Ultimate Team" or something. "Ultimate Productions" sounds and looks crappy.
Oh, and post using your real BYOND key instead of an alt. Thanks.