perf与性能优化

This commit is contained in:
flswld
2023-04-15 20:00:37 +08:00
parent 149b773f4b
commit 094ad5add0
26 changed files with 403 additions and 308 deletions

View File

@@ -3,6 +3,7 @@ package controller
import (
"net/http"
"strconv"
"sync"
"hk4e/common/config"
"hk4e/common/rpc"
@@ -12,12 +13,13 @@ import (
)
type Controller struct {
gm *rpc.GMClient
gmClientMap map[uint32]*rpc.GMClient
gmClientMapLock sync.RWMutex
}
func NewController(gm *rpc.GMClient) (r *Controller) {
func NewController() (r *Controller) {
r = new(Controller)
r.gm = gm
r.gmClientMap = make(map[uint32]*rpc.GMClient)
go r.registerRouter()
return r
}