|
|
|
@ -2,6 +2,7 @@ package gameServer |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"daydev.org/shipsgs/internal/config" |
|
|
|
|
"daydev.org/shipsgs/internal/player" |
|
|
|
|
"daydev.org/shipsgs/internal/utils" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
@ -14,6 +15,14 @@ type GameServer struct { |
|
|
|
|
|
|
|
|
|
maxPlayers int |
|
|
|
|
currentPlayers int |
|
|
|
|
|
|
|
|
|
// Channel to register players and their connection
|
|
|
|
|
join chan *player.Player |
|
|
|
|
|
|
|
|
|
// Storing connected Players
|
|
|
|
|
playerConns map[*player.Player]bool |
|
|
|
|
|
|
|
|
|
// Channel to un register players
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (m *GameServer) Init(logger *utils.Logger, config *config.S_Config) { |
|
|
|
@ -29,7 +38,11 @@ func (m *GameServer) Init(logger *utils.Logger, config *config.S_Config) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (m *GameServer) Update() { |
|
|
|
|
//p := <-m.join
|
|
|
|
|
|
|
|
|
|
// If room doesnt exist, spawn it, name it
|
|
|
|
|
//Add a player to a room
|
|
|
|
|
//
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (m *GameServer) Scheduled1S() { |
|
|
|
|