ID:264511
 
Code:
mob
player
Login()
if(world.host == src.key)
if(src.gmrank >= 2)
return 0
else
if(client.CheckPassport("mysubpass"))
src.AddHostVerbs()


Problem description:
It doesn't seem to care to check if they're subscribers and gives them host powers anyway.
Ripper man5 wrote:
try getting rid of the return 0, and just try return?

That part of the code has no relation to the problem he is discussing, furthermore the change you suggest would not make any difference even if it did because calling return with no argument after defaults to return 0.

Please refrain from offering advice unless you know what you're talking about.

To OP:

There are too many possible reasons they are receiving the verbs.

For start, do some debugging. See if that check is returning true for everyone. You would do this as follows:
if(client.CheckPassport("mysubpass"))
src.AddHostVerbs()
world<<"[src] is a subscriber!"

If that is sending out the message every time a non-sub hosts, then there is something else wrong with the code and you didn't copy/paste everything.

If it ISN'T sending out that message, then either
A: AddHostVerbs() is being called elsewhere
B: The verbs are naturally accessible for whatever reason.
In response to AJX
AJX wrote:
Ripper man5 wrote:
try getting rid of the return 0, and just try return?

That part of the code has no relation to the problem he is discussing, furthermore the change you suggest would not make any difference even if it did because calling return with no argument after defaults to return 0.

Technically, return defaults to returning the . variable, which by default will be null. They both evaluate to false anyway, though.
In response to Garthor
Garthor wrote:
AJX wrote:
Ripper man5 wrote:
try getting rid of the return 0, and just try return?

That part of the code has no relation to the problem he is discussing, furthermore the change you suggest would not make any difference even if it did because calling return with no argument after defaults to return 0.

Technically, return defaults to returning the . variable, which by default will be null. They both evaluate to false anyway, though.

Sigh. I still have to teach myself that 0 != null" but 0 == FALSE.

I'm very used to considering them all the same thing.
In response to AJX
Also, incidentally, if you execute 0 == FALSE you will get a true result, but if you execute null == FALSE you will get a false result.
Yeah... just a random attempt to confuse you more. :P
In response to Kaioken
Kaioken wrote:
Also, incidentally, if you execute 0 == FALSE you will get a true result, but if you execute null == FALSE you will get a false result.
Yeah... just a random attempt to confuse you more. :P

Of course. Ahah! When you try to confuse me, it doesn't work, but when you don't, it does... :(

That is because FALSE is in fact 0 as far as the compiler is concerned. Like someone permanently typed DEFINE FALSE == 0 (don't correct me on the define syntax, I don't use it, shhh)
In response to AJX
Um I think I'm doing this wayyyyyyyyy wrong so it's not achieving my desire effect.I wanted to establish a connection from server to hub and tell the server to check if the host is a subscriber.
In response to Gr1m d4 r34p3r
Gr1m d4 r34p3r wrote:
Um I think I'm doing this wayyyyyyyyy wrong so it's not achieving my desire effect.I wanted to establish a connection from server to hub and tell the server to check if the host is a subscriber.

Dream Maker Help wrote:
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

mob/var
full_access

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

You need goto your game page

Now click the checkbox next to Give in-game bonuses to subscribers with CheckPassport() in the Subscription Options box

Next copy the code it give you & paste it in "if(client.CheckPassport("0123456789abcdef"))" at the 0123456789abcdef part
In response to Prf X
Okay!It worked,thanks.
In response to Gr1m d4 r34p3r
This was an old thread but my problem arise again.After it "fixed" itself,the problem of checking for subscriber happened again.I did exactly like how BYOND ref told me.I copied and paste my passport string,paste it in,took of my key from subscriber list,and host it and I still get host powers.I've searched up for Passport check too,and I found a a way I think Data Android(?) said is to put PassportCheck(key).I did that and now no one gets power.
In response to Gr1m d4 r34p3r
Also, before making posts asking for help, perhaps you should look through the Help! manual on the Help tab in Dream maker next time? (Just a thought, although I'll probably get insulted with, "Who the hell reads a manual"; or, "What help tab?"....Sorry, just typing to myself)
In response to Gr1m d4 r34p3r
Gr1m d4 r34p3r wrote:
This was an old thread but my problem arise again.After it "fixed" itself,the problem of checking for subscriber happened again.I did exactly like how BYOND ref told me.I copied and paste my passport string,paste it in,took of my key from subscriber list,and host it and I still get host powers.

Removing yourself from the subscriber list won't necessarily show up right away the next time you join a game. The change definitely won't show up during the same session, since the info on your passports is sent by the hub when you log in. This may be why you're seeing subscriber rights granted in some cases.

I've searched up for Passport check too,and I found a a way I think Data Android(?) said is to put PassportCheck(key).I did that and now no one gets power.

You need to use the passport string for your hub entry, not a key.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
Removing yourself from the subscriber list won't necessarily show up right away the next time you join a game. The change definitely won't show up during the same session, since the info on your passports is sent by the hub when you log in. This may be why you're seeing subscriber rights granted in some cases.
I have waited for 2 days and it doesn't react.
You need to use the passport string for your hub entry, not a key.
Well,I have also done that and it doesn't seem to work.
In response to Gr1m d4 r34p3r
You need to make sure the Hub Subscribe ID is the same as the code you are using
In response to Ernesto5432
I already told you I did that.
In response to Gr1m d4 r34p3r
Gr1m d4 r34p3r wrote:
I've searched up for Passport check too,and I found a a way I think Data Android(?) said is to put PassportCheck(key).I did that and now no one gets power.

I did the who to the what now? o.O
In response to Gr1m d4 r34p3r
Bump..
In response to Gr1m d4 r34p3r
1) Look up CheckPassport() in the Reference. Read.
2) Configure the respective hub entry in question to work with CheckPassport() calls, as was explained to you in this topic. It should be a checkbox.
3) Set up a subscription for that hub entry. Copy the subscription code it gives you which should look somewhat like "198b6d4deb15ba09c5d74fc908b".
4) Use that code as the argument to CheckPassport().
In response to Kaioken
Kaioken wrote:
1) Look up CheckPassport() in the Reference. Read.
....I'm not sure what's your guys problem but you keep thinking I don't read. Sorry to get up in your gizzard, but I do.
2) Configure the respective hub entry in question to work with CheckPassport() calls, as was explained to you in this topic. It should be a checkbox.
....I told you I have done so.
3) Set up a subscription for that hub entry. Copy the subscription code it gives you which should look somewhat like "198b6d4deb15ba09c5d74fc908b".
.....I done that to.
4) Use that code as the argument to CheckPassport().
......Exactly what I done.
In response to Gr1m d4 r34p3r
Is anything else using mob/Login and not ending or starting with ..() or returning?

If the codes exactly the same then maybe something else is overriding it.
Page: 1 2