ID:173744
 
I am try to make it so that the list of Admins for my game is on the hub. So I don't have to code in every byond key, So that if I add or remove a Admin I don't have to update the code and update the game. Here is the save file for my Admins

world
New()
..()
var/savefile/F = new ("m_admin.sav")

F["GM"] >> GM
if(isnull(GM))
GM = new /list
F["Admin"] >> Admin
if(isnull(Admin))
Admin = new /list
F["banned"] >> banned
if(isnull(banned))
banned = new /list


Del()
var/savefile/F = new ("m_admin.sav")
F["GM"] << GM
F["Admin"] << Admin
F["banned"] << banned


How do you call the hub? I looked over the HubfilesDemo and it made almost no sence at all. I shwed me how it could be used, but not how to call it. Thanks in advance for the help.

TK6000
I'd suggest setting up a subscription based system of Administrators using the HUB. Because I do believe the thing you're speaking of costs money to rent storage space. But, all you need to do is make a new HUB entry, make a subscription to it then add/remove keys manually without having to upload a new version/patch every time an Admin's being "bad"...
In response to Goku72
I am actualy talking about Admins for a game I made. I will look into what you sugested, sounds like it will work fine. One more question, how do you call subscribers?
In response to TK6000
CheckPassport proc (client)
Format:
CheckPassport(passport_identifier)
Args:
passport_identifier: a text string assigned to you by BYOND Hub.
This built-in procedure checks to see if the user is subscribed to a particular BYOND Hub entry.

Example:
world
hub = "My.Hub" //change this to your own hub entry

client/var
full_access

mob/Login()
if(client.CheckPassport("0123456789abcdef"))
full_access = 1
else
usr << "For full access, <a href = \
'http://www.byond.com/hub/[world.hub]' >subscribe!"
return ..()

Note that in general the value of world.hub has nothing to do with the passport you happen to check. This example assumes the passport number belongs to world.hub just for the purpose of forwarding the user to the appropriate subscription page.
In response to Goku72
How do I find that string of numbers and letters?

if(client.CheckPassport("0123456789abcdef"))
In response to TK6000
when you click subscriptions on the hub entry, it gives you the passport_identifier.
In response to Airjoe
Thanks, I am having a problem with it though. Here is my code.

mob
proc
DoTheGM()
if(client.CheckPassport("*beep* Not showing this"))
if(usr.gmrank >= 1)
world << "GM [usr] has joined"
alert("Welcome [usr], your GM powers are ready for you.")
else
world << "GM [usr] has joined"
GM += usr.key
usr.AddGMVerbs()
alert("Welcome [usr], your GM powers are ready for you.")

That does nothing, and I have the right identafer. Whats up?
In response to TK6000
For one, you're using usr in a proc.
In response to Jon88
That should work fine though right? Because it is the usr of the proc. Am I wrong? Should I use something else?
In response to TK6000
I just changed usr to src and it worked. Why?
In response to TK6000
Simply put: usr!=src.

"usr" does NOT equal src. "usr" is the one who called the proc, not necessarily the one that will be affected by it. src on the other hand though is the mob that called it and in most cases (unless you specify otherwise) is who's being affected. If you wish to know more I do believe there's an article by Lummox somewhere's on BYONDScape about it, but I can't seem to find it right now.
In response to Goku72
http://bwicki.byond.com/ByondBwicki.dmb?UsrIsEvil
http://www.byondscape.com/ascape.dmb/LummoxJR.2002-1104/

Goku72, usr is not necesarilly the one who called the proc. Src also may not be the mob that called the proc!