From 24907f16444e9dedc9a52d2690836cc57d8e825d Mon Sep 17 00:00:00 2001 From: Jordan Orelli Date: Wed, 12 Nov 2014 17:37:56 -0500 Subject: [PATCH] maybe you should set the player --- connection.go | 3 ++- player.go | 8 ++++++++ system.go | 1 - 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/connection.go b/connection.go index 1124c3d..c61b17b 100644 --- a/connection.go +++ b/connection.go @@ -63,10 +63,11 @@ func (c *Connection) Login() { log_error("could not read player: %v", err) player = &Player{name: name} if err := player.Create(); err != nil { - + log_error("unable to create player record: %v", err) } fmt.Fprintf(c, "you look new around these parts, %s.\n", player.name) fmt.Fprintf(c, `if you'd like a description of how to play, type the "help" command`) + c.player = player } else { c.player = player fmt.Fprintf(c, "welcome back, %s.\n", player.name) diff --git a/player.go b/player.go index b119089..caf5469 100644 --- a/player.go +++ b/player.go @@ -29,6 +29,14 @@ func (p *Player) Create() error { return nil } +func (p *Player) Dead() bool { + return false +} + +func (p *Player) Tick(frame int64) { + +} + func playersTable() { stmnt := `create table if not exists players ( id integer not null primary key autoincrement, diff --git a/system.go b/system.go index 35457e6..f8fb062 100644 --- a/system.go +++ b/system.go @@ -246,4 +246,3 @@ func randomSystem() (*System, error) { planet := index[pick] return planet, nil } -