ID:1479562
 
(See the best response by DarkCampainger.)
            if(findtext(path,".dmb",-4))
if(alert("Are you sure you would like to run [path]?", "Run?", "Yes", "No")=="Yes")
var/port = input("What port do you want to host on?", "Port") as num
var/security = input("What level of security do you want to give the game?", "Security") in list("trusted", "safe", "ultrasafe")
world << "DEBUG started " + path
games += startup("[path]", port,"-[security]")
world << "Server [games[games.len-1]] for [path] has been started."
break


So I'm making a sort of game manager utility that the public can edit the source codes and such to their liking and allow other users to start up games that potentially crash or w/e.

In this situation, a path is provided to startup(), which I tested and was "Games/CaveDrifter/CaveDrifter.dmb". Apparently, when startup() is called on trusted, safe, or even ultrasafe, the DreamDaemon does not automatically start the game. Instead, it only opens DreamDaemon with the port and file path set. It doesn't set the security and doesn't auto start it.

I've tried removing the - in the security argument. Doesn't change much.

I think it's because you are feeding it a text string, and not a file in the first argument.
I also forgot to mention I tried file(path) and "[path]"

Current code:
            if(findtext(path,".dmb",-4))
if(alert("Are you sure you would like to run [path]?", "Run?", "Yes", "No")=="Yes")
var/port = input("What port do you want to host on?", "Port") as num
var/security = input("What level of security do you want to give the game?", "Security") in list("trusted", "safe", "ultrasafe")
world << "DEBUG started " + path
games += startup(file(path), port,"[security]")
if(!isnull(games))
world << "Server [games[games.len-1]] for [path] has been started."
break


Entire .dm file (if it helps):
var/list/games = new/list

mob/proc
StartUp()
var/path = "Games/"

if(length(flist(path)) == 0)
src << "There aren't any games available to be managed."
return

var/previousPath = path
while(src)
path = input("Which server would you like to start up?") as null | anything in flist(path) | "Back"

if(path == "Back")
var/spot=0
var/list/spots[]=new
for(var/v = 0 to length(previousPath))
var/lspot=spot
spot=findtext(previousPath,"/",spot+1)
if(spot==lspot||spot==null||spot<lspot)
spot=lspot
break
spots+=spot
if(spots.len>1)
previousPath=copytext(previousPath,1,spots[spots.len-1]+1)
if(previousPath=="")
previousPath = "Games/"
path = "Games/"
continue
else
path = previousPath
continue
else
path = "Games/"
continue

if(isnull(path))
src << "Cancelling the start server verb."
return

path = previousPath + path
src << "[path]"

//If the last 4 characters are .dmb
if(findtext(path,".dmb",-4))
if(alert("Are you sure you would like to run [path]?", "Run?", "Yes", "No")=="Yes")
var/port = input("What port do you want to host on?", "Port") as num
var/security = input("What level of security do you want to give the game?", "Security") in list("trusted", "safe", "ultrasafe")
world << "DEBUG started " + path
games += startup(file(path), port,"[security]")
if(!isnull(games))
world << "Server [games[games.len-1]] for [path] has been started."
break

world << path //debug
var/list/gamelist = flist(path) //debug
world << length(gamelist) //debug

//Failsafe to make sure that if the path is null, go back
if(length(flist(path)) == 0)
src << "There's nothing in that folder. Going back."
path = previousPath
else
previousPath = path

world << path //debug
gamelist = flist(path) //debug
world << length(gamelist) //debug
startup() definitely handles strings passed to it just fine, it seems to be working properly for me on Linux but on Windows it's doing what you're saying -- perhaps a bug?
Perhaps. I'm on 503.1221 on Windows and 501.1217 (Stable) Linux. I haven't tested this on Linux yet. And, I definitely know that startup() used to automatically start the game after being ran. Probably something was changed?
Testing it more, it seems to be working fine now, not sure what was up before:

mob
verb
Test(path as text)
world << startup("[path]",1234,"-trusted","-invisible")


Works as expected except one thing, security seems to stay 'safe' regardless, I think it was because I was running my test environment in safe mode and you can't startup() a world at a higher security access then the parent.

You're not using the latest release of 503, try updating.
I am now on the latest version of beta running this following chunk of code:

            if(findtext(path,".dmb",-4))
if(alert("Are you sure you would like to run [path]?", "Run?", "Yes", "No")=="Yes")
var/port = input("What port do you want to host on?", "Port") as num
var/security = input("What level of security do you want to give the game?", "Security") in list("trusted", "safe", "ultrasafe")
var/visibility = input("How would you like the game to be viewed?", "Visibility") in list ("visible","invisible")
world << "DEBUG started " + path
world << startup("[path]", port,"-[security]","-[visibility]")
if(games.len>0)
world << "Server [games[games.len-1]] for [path] has been started."
break


Does not work.

The process:







However, it does seem to be setting up the port and file path, and now the security and visibility. It just doesn't actually start it up.
Best response
Could just be a bug with the new multi-threading. Did you try version 503.1224 (which has it disabled)? Your post wasn't clear on whether you grabbed the latest 503 or jumped up to the 504's (which re-enabled multi-threading)...
Threading was the issue. I turned it off and added it to the notes file for anyone else that wants to edit the sources or w/e. Everything works fine now.