ID:135724
 
I need a way to add this functionality to the hub host as it is way too vexxing to have to manually add Sites.

Automatic via byond passport key would be a good idea, anyone have any suggestions?

Oreldwin
You should take a look at hub://Dantom.Source.Host. Specifically starting on line 118 of host.dm (in client/New()), there's an else if clause that goes like so:
else if(hostconf.free_trial)
// ... 7 lines of code here
else
src << "You must specify a full world path in the URL to get anywhere here!"
return


I'll bet if you add another else if clause before that final else, you could add a check for client.CheckPassPort() and automatically create a site for anyone whose passport is good. Something like the following:
else if(hostconf.free_trial)
// ... the same 7 lines of code
else if (src.CheckPassport("yourpassportstring"))
if(!hostconf.CreateSite(key,LOCKED))
src << "Host space cannot be created at this time. Sorry!"
return

src << "Created host space for you. Welcome!"
Topic = "[ckey]/tools/admin"
else // here's the last else that is still there
src << "You must specify a full world path in the URL to get anywhere here!"
return


Recompile the host server and see if that helps.

[Edit] Ultimately, we'll probably want to modify it ourselves so that the passport string isn't hardcoded like my example above. Instead, it would be a configuration option, along with options to turn on/off automatic creation with passports.
In response to Mike H
Mike H wrote:
You should take a look at hub://Dantom.Source.Host.

But it's so buggy/lacking documentation. Either there's some info in documentation that isn't there anymore, or I've ran into a few bugs trying to use it.
In response to Jon88
It wasn't as easy to insyall on freebsd as i thought it would be.

I'll try the code, but i think , especially now that Byond has stopped hosting files; maybe Byond should find some time to update or fix a more versatile panel :P

Thanks
In response to Mike H
I think making it a conf option would help a lot.
In response to Jon88
Jon88 wrote:
Mike H wrote:
You should take a look at hub://Dantom.Source.Host.

But it's so buggy/lacking documentation. Either there's some info in documentation that isn't there anymore, or I've ran into a few bugs trying to use it.

Do you happen to recall what issues you had? I agree with Oreldwin, we'd like to make fixing this up a priority. Unfortunately there are only so many of us, with only so much free time to devote to all of the various issues of BYOND. Since the source is available, anyone else is also free to improve upon it. :)
In response to Oreldwin
Oreldwin wrote:
It wasn't as easy to insyall on freebsd as i thought it would be.

I managed to get it to install on Debian Linux, but that was it. It ran, but you couldn't actually *do* anything worthwhile. I'm thinking that it's because there's some info in documentation somewhere that I couldn't find.
In response to Mike H
The issue I had was that I was unable to ever create directories(or whatever they were called) properly. Since then I repartitioned my hard drive, so it's no longer installed. I think I'll install it again.
In response to Jon88
What do you mean you couldnt do anything useful?Did you connect to your hub?Did your admin panel come up?Did you try it?

I'm asking basically because it's not obvious. I had to manually link from my hub to actual get into my admin panel and able to setup all the functions/parameters.

Ore
In response to Oreldwin
Logging into it locally, as the key I set up to admin it worked fine. However, from the panel I couldn't do anything useful. I ran into errors when I tried to create directories/sites/whatever for other keys to use to host.
In response to Jon88
Yes, because basically you installed as root, I assume you have checked all permissions, or you would have said.

It does this problem for me as well, even now, but believe it or not, the actual folders are created and content updated, even though i get the normal ../../../../../blah cant change permissions. You also need to take care how you place the files within the directory you host it.

eg I keep everything in its original location, and just subdir into byond/host/home
In response to Mike H
I added those lines of code, now bear in mind DM code is not my strong point, so when i compiled and ran it, It didnt seem to make any difference.


Ore