ID:141408
 
Code:
#include <deadron/basecamp>

#define BASE_MENU_CREATE_CHARACTER "Create New Character"
#define BASE_MENU_DELETE_CHARACTER "Delete Character"
#define BASE_MENU_CANCEL "Cancel"
#define BASE_MENU_QUIT "Quit"


// Implementation
client/var/tmp
base_num_characters_allowed = 3
base_autoload_character = 0
base_autosave_character = 0
base_autodelete_mob = 1
base_save_verbs = 1
client/var/Char_Slo
world/Topic(T,Addr)
var/list/params = params2list(T)
switch(params["action"])
if("loadplayer")
var/X = world.Import()
if(X)
var/savefile/F = new(X)
var/CKEY
F["KEY"] >> CKEY
for(var/mob/M in world)
if(M.key==CKEY)
M.client.loaded = 1
M.Read(F)
F["mob"] >> M
F["overlays"] >> M.overlays
M << "You have been loaded"

client
var
loaded = 0

mob
verb
// PortSet()
// if(usr.key=="Asellia")
// var/port = input(usr,"Which port is the server hosted on?","Which port?") as num
Loudd()
Load(usr,"65.96.188.52","2378","65.96.188.52","[world.port]")
Saave()
Save(usr,"65.96.188.52","2378")
proc
AutoSave(mob/M)
sleep(600)
Save(M,"65.96.188.52","2378")
usr << "You have been saved"
AutoSave(M)
Save(mob/M,addr,port)
var/savefile/F = new
F["key"] << "[M.key]"
F["last_x"] << M.x
F["last_y"] << M.y
F["last_z"] << M.z
F["mob"] << usr
F["verbs"] << usr.verbs
F["overlays"] << usr.overlays
world.Export("[addr]:[port]?action=saveplayer",F)
Load(mob/M,addr,port,currents,currentp)
if(M.client.loaded==0)
var/savefile/F = new("savefiles/[M.key].sav")
F["ckey"] << M.key
F["Address"] << currents
F["Port"] << currentp
world.Export("[addr]:[port]?action=loadplayer",F)


Save Server:
var/list/Allowed = list("Asellia")

world/Topic(T,Addr)
var/list/params = params2list(T)
switch(params["action"])
if("saveplayer")
var/X = world.Import()
var/savefile/F = new(X)
var/savefilename = F["key"]
if(X)
if(F && istype(F))
if(!savefilename)
world<<"<font color=red>\[[time2text(,"Month DD, YYYY hh:mm:ss")]\] Error: [savefilename]'s name could not be used as a savefile name</font>"
return -1
fcopy(X,"savefiles/[savefilename].sav")
world << "\[[time2text(,"Month DD, YYYY hh:mm:ss")]\] [savefilename]'s savefile has been successfully saved"
return 1
else
world<<"<font color=red>\[[time2text(,"Month DD, YYYY hh:mm:ss")]\] Error: [savefilename]'s savefile is not a valid savefile</font>"
return -2
else
world<<"<font color=red>\[[time2text(,"Month DD, YYYY hh:mm:ss")]\] Error: [savefilename]'s savefile is unable to be transfered</font>"
return -3
if("loadplayer")
var/X = world.Import()
if(X)
var/savefile/F = new(X)
var/address
var/port
var/keys
F["ckey"] >> keys
F["Address"] >> address
F["Port"] >> port
Load(keys,address,port)



proc
Load(key,addr,port)
if(fexists("savefiles/[key].sav"))
var/savefile/F = new("savefiles/[key].sav")
F["KEY"] << key
world.Export("[addr]:[port]?action=loadplayer",F)
world<<"\[[time2text(,"Month DD, YYYY hh:mm:ss")]\] [key]'s savefile has been successfully been loaded ([addr]:[port])"
mob
Login()
if(!(src.key in Allowed))
src<<"You are not authorized to be here!"
del(src)
for(var/mob/M in world)
if(M == src) continue
M << "\[[time2text(,"Month DD, YYYY hh:mm:ss")]\] [src.key] Has logged into data Server"

src<<"<center><font size = 4><font color = red><b>Welcome to The data Server!</b></font></font></center>"
if(world.port)
src<<"<center>Server hosted at [world.address]:[world.port]</center>"
else
src<<"<center>Server hosted is currently not hosting</center>"


mob
Stat()
..()
statpanel("Server")
var/counter = 0
var/filelist = flist("savefiles/")
var/i = 1
for(i , i <= length(filelist), i++)
counter++
stat("Savefiles count",counter)
var/counters = 0
var/filelists = flist("savefiles_backup/")
var/ii = 1
for(ii , ii <= length(filelists), ii++)
counters++
stat("Savefile backup count",counters)
stat("Data Server Address","[world.address]:[world.port]")


ExpSet:
        ExpSet(mob/M)
var/exp=round(M.EXP/M.EXPN*100,10)
if(exp>100) exp=100
if(exp<0) exp=0
winset(usr,"default.bar1","value=[exp]")


Problem description:
In-Game:
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded
You have been loaded


In Dream Daemon:
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
usr: Asellia (/mob)
src: Asellia (/mob)
call stack:
Asellia (/mob): Load(Asellia (/mob), "65.96.188.52", "[Censor]", "65.96.188.52", "[Censor]")
Asellia (/mob): Login()
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
runtime error: Cannot read null.loaded
proc name: Load (/mob/proc/Load)
source file: Save Server.dm,64
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28
runtime error: bad client
proc name: ExpSet (/mob/proc/ExpSet)
source file: Global Procs and Verbs.dm,28




Basically, I was implimenting Max Omega's save server, I made my own procs/verbs and similar on the original, and i'm getting these errors now, it loads the mob 5 million times, and ExpSet is bugging out

Im not sure but i think your running some sort of loop in the loading procedure. although nothing here tells me your running one. Also you forgot to put what variables you wanted to load in the load proc in the data server code.
In response to Max Omega
I was actually mildly confused about that, I have the users Key loading into the "keys" of the save file, but wouldn't it just send the entire save file?

If not, what exactly am I loading the variables from? Do I load them from F into F?
In response to Asellia
Its initially was confusing for me when i made this. Um in the save server load proc. You load whatever variables you want into savefile/F then you send it over to the game. Thats where the games world/Topic takes that savefile and loads. Then you load from F in the game code. Its confusing and i dont have my library in front of me. if you would like to add [email protected] i will help you more when i have my library in front of me.
In response to Max Omega
Thanks, I added you. I thought I knew what I was doing while coding, but it seems I need more experience. I'm not entirely sure how to plug in the variables when they're all stored in the Save file, and i'm trying to store them in the save file.

I'm not sure where to get them from.

It'd also seem the Library is missing the demo, so my Load/Save Procs in my game client code were completely mine. And they're bugging out.