From 358958b5a97f6cf2f71b58e01183ed930dd251c4 Mon Sep 17 00:00:00 2001 From: Jordan Orelli Date: Wed, 12 Nov 2014 23:00:32 -0500 Subject: [PATCH] well that should be it for the pqueue shit --- connection.go | 9 +++++---- system.go | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/connection.go b/connection.go index 21e7390..a3cdc35 100644 --- a/connection.go +++ b/connection.go @@ -93,6 +93,7 @@ func (c *Connection) Dead() bool { func (c *Connection) Tick(frame int64) { // fuck + switch c.state { case idle: case dead: @@ -157,14 +158,14 @@ func (c *Connection) InTransit() bool { func (c *Connection) RecordScan() { fmt.Fprintln(c, "scanning known systems for signs of life") c.lastScan = time.Now() - After(1*time.Minute, func() { + time.AfterFunc(1*time.Minute, func() { fmt.Fprintln(c, "scanner ready") }) } func (c *Connection) RecordBomb() { c.lastBomb = time.Now() - After(15*time.Second, func() { + time.AfterFunc(15*time.Second, func() { 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") c.dead = true c.System().Leave(c) - After(30*time.Second, func() { + time.AfterFunc(30*time.Second, func() { fmt.Fprintf(c, "respawn in 30 seconds.\n") }) - After(time.Minute, c.Respawn) + time.AfterFunc(time.Minute, c.Respawn) } func (c *Connection) Respawn() { diff --git a/system.go b/system.go index 659ec03..a9ab640 100644 --- a/system.go +++ b/system.go @@ -153,9 +153,9 @@ func (s *System) Bombed(bomber *Connection) { if id == s.id { continue } - delay := s.BombTimeTo(index[id]) + delay := s.LightTimeTo(index[id]) id2 := id - After(delay, func() { + time.AfterFunc(delay, func() { bombNotice(id2, s.id) }) }