well that should be it for the pqueue shit

slack
Jordan Orelli 10 years ago
parent 720c37d0b6
commit 358958b5a9

@ -93,6 +93,7 @@ func (c *Connection) Dead() bool {
func (c *Connection) Tick(frame int64) { func (c *Connection) Tick(frame int64) {
// fuck // fuck
switch c.state { switch c.state {
case idle: case idle:
case dead: case dead:
@ -157,14 +158,14 @@ func (c *Connection) InTransit() bool {
func (c *Connection) RecordScan() { func (c *Connection) RecordScan() {
fmt.Fprintln(c, "scanning known systems for signs of life") fmt.Fprintln(c, "scanning known systems for signs of life")
c.lastScan = time.Now() c.lastScan = time.Now()
After(1*time.Minute, func() { time.AfterFunc(1*time.Minute, func() {
fmt.Fprintln(c, "scanner ready") fmt.Fprintln(c, "scanner ready")
}) })
} }
func (c *Connection) RecordBomb() { func (c *Connection) RecordBomb() {
c.lastBomb = time.Now() c.lastBomb = time.Now()
After(15*time.Second, func() { time.AfterFunc(15*time.Second, func() {
fmt.Fprintln(c, "bomb arsenal reloaded") fmt.Fprintln(c, "bomb arsenal reloaded")
}) })
} }
@ -231,10 +232,10 @@ func (c *Connection) Die() {
fmt.Fprintf(c, "you were bombed. You will respawn in 1 minutes.\n") fmt.Fprintf(c, "you were bombed. You will respawn in 1 minutes.\n")
c.dead = true c.dead = true
c.System().Leave(c) c.System().Leave(c)
After(30*time.Second, func() { time.AfterFunc(30*time.Second, func() {
fmt.Fprintf(c, "respawn in 30 seconds.\n") fmt.Fprintf(c, "respawn in 30 seconds.\n")
}) })
After(time.Minute, c.Respawn) time.AfterFunc(time.Minute, c.Respawn)
} }
func (c *Connection) Respawn() { func (c *Connection) Respawn() {

@ -153,9 +153,9 @@ func (s *System) Bombed(bomber *Connection) {
if id == s.id { if id == s.id {
continue continue
} }
delay := s.BombTimeTo(index[id]) delay := s.LightTimeTo(index[id])
id2 := id id2 := id
After(delay, func() { time.AfterFunc(delay, func() {
bombNotice(id2, s.id) bombNotice(id2, s.id)
}) })
} }

Loading…
Cancel
Save