new server
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m19s

This commit is contained in:
Smile Rex
2026-01-17 16:38:45 +03:00
parent 1c60264d1d
commit 3c989c33f8
10 changed files with 156 additions and 85 deletions

View File

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