|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
package server
|
|
|
|
|
package sim
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
@ -12,7 +12,6 @@ import (
|
|
|
|
|
|
|
|
|
|
"github.com/gorilla/websocket"
|
|
|
|
|
"github.com/jordanorelli/astro-domu/internal/errors"
|
|
|
|
|
"github.com/jordanorelli/astro-domu/internal/server/sim"
|
|
|
|
|
"github.com/jordanorelli/astro-domu/internal/wire"
|
|
|
|
|
"github.com/jordanorelli/blammo"
|
|
|
|
|
)
|
|
|
|
@ -20,7 +19,7 @@ import (
|
|
|
|
|
type Server struct {
|
|
|
|
|
*blammo.Log
|
|
|
|
|
http *http.Server
|
|
|
|
|
world *sim.World
|
|
|
|
|
world *World
|
|
|
|
|
|
|
|
|
|
sync.Mutex
|
|
|
|
|
lastSessionID int
|
|
|
|
@ -42,7 +41,7 @@ func (s *Server) Start(host string, port int) error {
|
|
|
|
|
s.Log = blammo.NewLog("astro", options...).Child("server")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s.world = sim.NewWorld(s.Log.Child("world"))
|
|
|
|
|
s.world = NewWorld(s.Log.Child("world"))
|
|
|
|
|
go s.world.Run(3)
|
|
|
|
|
|
|
|
|
|
addr := fmt.Sprintf("%s:%d", host, port)
|