When the game appears on the hub and you click on it. It'll say "Game hosted by !". It wont state the name of the host, but it states the host's name on the statpanel with host.key. Can anyone help me out?
Below is probaly all the coding I did to do with this situation.
/////////CODE HERE///////////
proc/SetStatus()
world.status="Game hosted by [host.key]!"
world/New()
host = new
client/New()
people +=1
.=..()
if(.)NumberOfPlayers++
..()
.=..()
host.Setup(src)
world
name = "Virtual World"
mob/var/rank = "User"
mob/Login()
src << browse(Introduction,"window=Introduction")
if(!people)
src.rank = "Host"
usr.verbs+=/mob/verb/Change_Density
usr << "UNDER CONSTRUCTION!"
usr.verbs-=/mob/verb/Logged_In_Users
usr.verbs-=/mob/verb/Set_Password
usr.verbs-=/mob/verb/Add_Buddy
usr.verbs-=/mob/verb/Remove_Buddy
usr.verbs-=/mob/verb/VIM_Ware
usr.verbs-=/mob/verb/Hack
usr.verbs-=/mob/verb/Hack_Soft
usr.verbs-=/mob/verb/Block_Buddy
usr.verbs-=/mob/verb/Unblock_Buddy
usr.verbs-=/mob/verb/Send_Message
usr.verbs-=/mob/verb/Server_Soft
SetStatus()
usr.loc = locate(1,1,1)
world << "[usr] logs into Virtual World!"
usr << "Welcome to Virtual World!"
usr << "This project was started on June 18, 2004 @ 9:00PM Central."
people += 1
mob/Logout()
world << "[usr] has logged out!"
people -= 1
del src
Host
var
key
appname
New()
src.Setup()
proc/Setup(client/c)
if (istype(c))
if (!c.address)
src.appname = "DreamSeeker"
src.key = c.key
else if ((c.address == world.address) || (c.address == "127.0.0.1"))
src.appname = "DreamDaemon"
src.key = c.key
var/Host/host
world/New()
host = new
</<>
ID:147359
Jun 21 2004, 3:53 pm
|
|
In response to Garthor
|
|
What's the difference between ..() and .=..()?
|
In response to Zlegend2
|
|
.=..() sets the default return value to whatever ..() returns.
|
In response to Garthor
|
|
Are you sure that was the solution? It's still not appearing... If I knew what to look for. I'd look for it.
|
In response to Zlegend2
|
|
It might not be the solution, but it sure as hell isn't correct.
|
In response to Garthor
|
|
ok. thank you anyway. I appreciate your time. again lol
|
Hmm, some of that code looks familiar. I suppose I ought to take responsibility and help out. :)
The problem is that you're calling SetStatus() before the host key is set. Why? Because as Garthor said, you probably don't yet understand how ..() works. Your client/New() is: client/New() First of all, you call ..() three times. There's generally no need to do so, and certainly not in this case. ..() calls the parent proc. Or in other words, it carries out the default action of the proc, whatever it would have done if you hadn't put anything there. For client/New(), part of what the parent proc does is connect the client to a mob and call mob/Login(). This is the important part. You call SetStatus() from mob/Login(). It gets called from client/New() through ..(). host.Setup() hasn't been called yet because it's the last line of client/New()! Thus host.key is still null. There are numerous ways to fix this. First of all, get rid of the extraneous ..() calls in client/New(). You only need one. Second, use . = ..(). That says, "client/New() should return whatever ..() (the parent proc) returns." (If you don't know what a return value is, you need to spend more time with tutorials; if you do, forgive me, I couldn't quite tell what your level is) :) Finally, you need to call SetStatus() after host.Setup(). You can either put SetStatus() in client/New() or you can call ..() from client/New() (and through it, mob/Login()) after host.Setup(). Any of these should work: Choice 1: client/New() Choice 2 (in this case, remove SetStatus() from mob/Login() - it's not needed there): client/New() Choice 3 (same as choice 2, but it doesn't matter the order we call ..()): client/New() As a courtesy, I'll also note that you have people += 1 in two places (client/New() and mob/Login()) where you probably only wanted it in one of those. Otherwise everyone counts double. Also don't use usr in mob/Login(). Bad habit! :) Everything should be src there. |
people +=1
.=..()
if(.)NumberOfPlayers++
..()
.=..()
host.Setup(src)
Obviously you don't know what .=..() and ..() do. Learn that.