initial refactor-servers commit

This commit is contained in:
wish
2023-12-04 00:00:40 +11:00
parent b6e7f019de
commit 4f889b1bf1
7 changed files with 122 additions and 101 deletions

View File

@@ -2,6 +2,7 @@ package entranceserver
import (
"encoding/hex"
"erupe-ce/server/channelserver"
"fmt"
"io"
"net"
@@ -19,6 +20,7 @@ type Server struct {
sync.Mutex
logger *zap.Logger
erupeConfig *_config.Config
worlds [][]*channelserver.Server
db *sqlx.DB
listener net.Listener
isShuttingDown bool
@@ -68,6 +70,10 @@ func (s *Server) Shutdown() {
s.listener.Close()
}
func (s *Server) SetWorlds(c [][]*channelserver.Server) {
s.worlds = c
}
// acceptClients handles accepting new clients in a loop.
func (s *Server) acceptClients() {
for {