ID:170916
 
world/OpenPort()
..()
if(client.CheckPassport("[Passport code here]"))
return ..()


Okay,what I'm trying to accomplish is making it so you must be subscribed to the game to host. How can i accomplish this with what i have so far?

~>Jiskuha
...that does do it, doesn't it?
In response to Hell Ramen
Well no it does not because i get the compile error
System\World Status.dm:15:error:client.CheckPassport:undefined proc

Which is why i asked if that was the correct way or not.

~>Jiskuha
Call the if() at Login, and then if it is the host then give them a var equal to one. Then make an if() in the OpenPort() if(var) then do what ever...
client/New()
if(!world.port)
Host=src
world/OpenPort()
if(Host.CheckPassport("CODE")
..()

var/client/Host
In response to Airjoe
client
New()
..()
if(!world.port)
host=src.mob.client
world/OpenPort()
..()
if(host.CheckPassport("1......."))
return ..()


Still getting the compile error.

~>Jiskuha

In response to Jiskuha
Jiskuha wrote:
client
> New()
> ..()
> if(!world.port)
> host=src.mob.client
> world/OpenPort()
> ..()
> if(host.CheckPassport("1......."))
> return ..()
>
>

Still getting the compile error.

~>Jiskuha


A) Get the first ..() out of there.
B) What's the error?
In response to Airjoe
System\World Status.dm:14:error:host.CheckPassport:undefined proc

~>Jiskuha
In response to Jiskuha
How did you define host?
In response to Airjoe
var
host=null


Please note this is a world var.

~>Jiskuha
In response to Jiskuha
How did you define it, not set it.

var/client/host
In response to Airjoe
re-read my post.

~>Jiskuha
In response to Jiskuha
You didn't define it like I said.

var/client/host

not

var/host
In response to Airjoe
Okay time to explain this to me. What if they are hosting from dream-dameon? Will it check to see if they are subscribed still?

~>Jiskuha
In response to Jiskuha
It will next version (Thanks to Lummox. :D)
In response to Hell Ramen
I have to wait for version 342? Darn. I wasn't expecting to wait a long time. Any other ways of accomplishing this?

~>Jiskuha
In response to Jiskuha
Not from DreamDaemon. DreamDaemon doesn't use keys right now and therefor can't check passports. Won't DS work for now? There's not much of a difference.
In response to Airjoe
Airjoe wrote:
Not from DreamDaemon. DreamDaemon doesn't use keys right now and therefor can't check passports. Won't DS work for now? There's not much of a difference.


Well if i do (!world.port) on client new it wont work in DS. I dont want people to be able to host on DS anyways. I guess i shall wait for v342 to continue my project then.

~>Jiskuha
In response to Jiskuha
Couldn't you just work around that...I mean if you stop your project for just a little thing like that. >.>
Jiskuha wrote:
world/OpenPort()
..()
if(client.CheckPassport("[Passport code here]"))
return ..()
Okay,what I'm trying to accomplish is making it so you must be subscribed to the game to host. How can i accomplish this with what i have so far?

I'd remove the first ..() line, since you don't need to call that twice. In fact there's almost never any need to call ..() more than once in a proc.

Note that this will only prevent games from being hosted in DS. In Dream Daemon they can still be hosted, and it's much harder there to tell who's hosting. If this is something like an MMORPG, you could probably do something like this to limit DD hosting to subscription only:
var/list/clients = new

client/New()
..()
clients += src
if(port && !CheckPassport("[Passport code here]"))
src << "You are not an authorized host of this game."
del(world)

Lummox JR