Post by Enzo on May 31, 2021 3:26:43 GMT
Having major problems
tinypng.com/web/output/bc5kp62bryyw31cz9tu7ytzgvgm3rfq9/Screenshot%20from%202021-05-30%2023-22-45.png
Doesnt seem to register a file I've called out
tinypng.com/web/output/bc5kp62bryyw31cz9tu7ytzgvgm3rfq9/Screenshot%20from%202021-05-30%2023-22-45.png
Doesnt seem to register a file I've called out
global command, clientcount, pid
global file$, Default$, pid$, closed$, looping, footer$, header$, closed$, space$, upload$, closefile$, filen$, fileaname$, path$ 'open$ would be null / i.e. reset
set = 3
Default$ = DefaultDir$+"\folder\"
link$ = "null"
fileextension$ = "txt"
est$ ="."+fileextension$
filen$ = link$
clientsamount$ = str$(set)
clientcount = set
footer$ = "AB"
dataloading = time$("ms")
dim pid$(10)
pid$(1) = "A"
pid$(2) = "B"
pid$(3) = "C"
header$ = est$
closed$ = "closed"
space$ = " "
print "loading test null pagefile list"
for looping = 1 to set
string$=pid$(ooping)
open Default$+string$+footer$+est$ for output as #handle
print #handle, "data"
close #handle
string$=pid$(looping)
open Default$ + string$+est$ for output as #handle
print #handle, "data"
close #handle
next looping
print "done."
print "prefetch"
[reset]
if fileExists(Default$, link$+est$) then
print "Server file found,"
print ""
print "..."
print "test start server clients"
else
open link$+est$ for output as #main
print #main, clientsamount$
close #main
end if
[MAINserver]
dim arrayinfo$(10) 'max clients
'setup constants
print "done."
print "startingservernow"
print "."
print ".."
print "done,"
dataload = time$("ms")
print "started in;";dataload-dataloading
print "-------------------"
timer 1000, [serverloop]
wait
[serverloop] 'get current player count
timer 0
startloop = time$("ms")
if fileExists(Default$, link$+header$) then 'if fileclientcount > 0 (exists) then
command$ = renamefileclosed$(Default$, pid$, closed$, header$, filen$, closefile$, link$, filename$) 'rename to not allow anyone else to open
if reloop = 1 then
reloop = 0
goto [serverloop]
end if
rename = time$("ms")
clientcount$=openfileclient$(Default$,pid$, header$, filen$) 'open and read client count for current loop
command$ = renamefileopen$(Default$, pid$,closed$, header$, filen$, closefile$, filename$) 'once file is closed rename back to allow to be opened
print time$("ms") -rename;"rename file loop in ms"
else
goto [serverloop]
end if
[looppid] 'download clients upload
startpid = time$("ms")
for pid = 1 to clientcount 'loop all saved pid files
startpid2 = time$("ms")
pid$ =pid$(pid)
if fileExists(Default$, pid$+header$) then 'if fileclientcount > 0 (exists) then / else reloop if file is being edited
command$ = renamefileclosed$(Default$, pid$, closed$, header$, file$, closefile$,link$, filename$) 'rename to not allow anyone else to open
if reloop = 1 then
reloop = 0
start = pid
goto [loopid]
end if
array$ = openfile$(pid,header$) 'open each pid load into array
arrayinfo$(pid) = array$
command$ = renamefileopen$(Default$, pid$,closed$, header$, file$, closefile$, filename$) 'once file is closed rename back to allow to be opened
'if reloop = 2 then
'null=null
'notice "err2"
'reloop = 0
'end if
else
goto [looppid] 'reloop if file is being edited
end if
if pid = set then
print "LOOP"
END IF
next pid
[uploadforclientdownload]
startpid2 = time$("ms")
for pid = 1 to clientcount 'now loop all pid
pid$ = pid$(pid)
print time$("ms")-startpid2
if fileExists(Default$, pid$+header$) then 'if fileclientcount > 0 (exists) then / else reloop if files are being read
command$= renamefileclosed$(Default$, pid$, closed$, header$, file$, closefile$,link$, filename$) 'rename to not allow anyone else to open
open str$(pid)+footer$+header$ for output as #2pid
for pid2 = 1 to clientcount
upload$ =arrayinfo$(pid)
print #2pid, str$(pid)+space$+upload$
next pid2
close #2pid
command$ = renamefileopen$(Default$, pid$, closed$, header$, file$, closefile$, filename$) 'once file is closed rename back to allow to be opened
else
goto [uploadforclientdownload] 'reloop if file is being read to not skip protocol
end if
print time$("ms")-startpid2;" file loaded"
if pid = set then
print "LOOOP"
END IF
next pid
print time$("ms") - startpid; " looped all files in total of in ms"
print time$("ms")-startloop;" server loop entirely of 17 ms pause and latter d/u w/r status in ms"; startloop- startpid ;" / ";startpid2-time$("ms")
startpid= 0
startpid= 0
startpid= 0
startloop= 0
timer 20, [serverloop]
print "LOOP"
wait
'/------------Functions
'-----------------------------------------------------------------------------------------
function openfile$(pid, header$)
pid$=pid$(pid)+header$
open pid$ for input as #pid
input #pid, info$
close #pid
openfile = val(info$)
info$ = ""
end function
function openfileclient$(Default$, pid$, header$, filen$)
filen$=Default$+pid$
'pen filen$ for input as #clientcount
' input #clientcount, count$
' close #clientcount
openfile = val(count$)
openfile =3
end function
function renamefileclosed$(Default$, pid$, closed$, header$, file$, closefile$, link$, filename$)
file$ = Default$ + pid$ + filen$ + header$
closefile$ = pid$ + closed$ + header$
closefile$ =""
files$=""
file$=""
fileb$=""
end function
function renamefileopen$(Default$, pid$, closed$, header$,file$,closefile$, filename$)
'Default$ pid$ .txt
file$ = Default$ + pid$+ filen$+closed$+ header$
closefile$ = pid$ + header$
closefile$ =""
files$=""
file$=""
fileb$=""
end function
function fileExists(Default$, filename$)
dim info$(0, 0)
files Default$, filename$, info$()
fileExists = val(info$(0, 0)) 'non zero is true
if fileExists > 0 then
print "null"
else
print "non-null error"
end if
end function