Some changes to make login.init more consistent.
This commit is contained in:
@@ -32,21 +32,20 @@ end
|
||||
-- tangible.delete(actor) -- If actor is a connected player it will disconnect
|
||||
|
||||
-- This gets called on every login except the admin user.
|
||||
function login.init()
|
||||
function login.init(self, config)
|
||||
local player = global.get("nextplayer")
|
||||
global.set("nextplayer", player + 1)
|
||||
dprint("login.init initializing player ", player)
|
||||
actor.player = player
|
||||
tangible.keepactor(actor) -- do not delete this login when the client disconnects
|
||||
actor.color={0,0,0,0,0,0,0,0,0,0,0,0}
|
||||
actor.kills=0
|
||||
actor.killed=0
|
||||
tangible.animinit{tan=actor, anim={bp="character", mesh="manny", plane="earth", xyz={player * 100, 0, 90}}}
|
||||
dprint("About to start scanning")
|
||||
actor.startscanning()
|
||||
dprintf("login.init initializing %p, player %d", self, player)
|
||||
self.player = player
|
||||
self.color={0,0,0,0,0,0,0,0,0,0,0,0}
|
||||
self.kills=0
|
||||
self.killed=0
|
||||
tangible.animinit{tan=self, anim={bp="character", mesh="manny", plane="earth", xyz={player * 100, 0, 90}}}
|
||||
tangible.start(self, login.startscanning)
|
||||
end
|
||||
|
||||
function login.startscanning()
|
||||
dprintf("Scanning started. Actor=%p Place=%p", actor, place)
|
||||
while true do
|
||||
login.onescan()
|
||||
wait(1)
|
||||
@@ -75,13 +74,13 @@ function login.onescan()
|
||||
end
|
||||
|
||||
-- This gets called on the admin user. You can call login.init in here if you want.
|
||||
function world.init()
|
||||
function world.init(self, config)
|
||||
dprint("world.init")
|
||||
global.set("nextplayer", 0)
|
||||
tangible.build{class=roster, anim={plane="earth", xyz={2000,0,0} } }
|
||||
tangible.build{class=cube, anim={plane="earth", xyz={500,-100,0}, mat_color={1,0,0}}}
|
||||
tangible.build{class=sphere, anim={plane="earth", xyz={500,100,0}, mat_color={0,0,1}}}
|
||||
login.init()
|
||||
login.init(self, config)
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user