GameServer now supports connections

incorrect_closing_investigation
Evgeny Kovalev 2 years ago
parent 4bc24431d2
commit 0600cb66ab
  1. 13
      internal/gameServer/gameServer.go

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

Loading…
Cancel
Save