maybe you should set the player

slack
Jordan Orelli 10 years ago
parent 0d37b9c98b
commit 24907f1644

@ -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)

@ -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,

@ -246,4 +246,3 @@ func randomSystem() (*System, error) {
planet := index[pick]
return planet, nil
}

Loading…
Cancel
Save