new server
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m19s
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m19s
This commit is contained in:
@@ -5,16 +5,20 @@ import (
|
||||
"net/http"
|
||||
"server/models"
|
||||
"sync"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
)
|
||||
|
||||
type Hub struct {
|
||||
Players map[uint32]*models.Player
|
||||
Mu sync.RWMutex
|
||||
Entities map[uint32]models.Entity
|
||||
Clients map[uint32]*websocket.Conn
|
||||
Mu sync.RWMutex
|
||||
}
|
||||
|
||||
func NewHub() *Hub {
|
||||
return &Hub{
|
||||
Players: make(map[uint32]*models.Player),
|
||||
Entities: make(map[uint32]models.Entity),
|
||||
Clients: make(map[uint32]*websocket.Conn),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user