feat 模块增加after start

This commit is contained in:
2026-01-20 12:11:26 +08:00
parent 5aeff7c786
commit c0f6cd90c6
11 changed files with 43 additions and 38 deletions

View File

@@ -13,8 +13,6 @@ import (
"time"
)
var GatewaySID string
type Client struct {
sync.WaitGroup
conn socket.ISocketConn // Socket

View File

@@ -45,7 +45,7 @@ func (c *Client) handle(event Event) {
if c.Status == 0 {
c.Status = 1
UserMgr.Add(c.USN, c)
redis.GetClient().HSet(c.ctx, fmt.Sprintf(global.KeyGatewayInfo, c.USN), global.HFieldInfoGatewaySID, GatewaySID)
redis.GetClient().HSet(c.ctx, fmt.Sprintf(global.KeyGatewayInfo, c.USN), global.HFieldInfoGatewaySID, global.GatewaySID)
c.WriteMessage(ss_pb.MessageID_MESSAGE_ID_LOGIN_SUCCESS, &ss_pb.S2C_LoginSuccess{
InstanceID: 1,
})
@@ -61,7 +61,7 @@ func (c *Client) onEnter(msg *ss_pb.C2S_EnterInstance) {
}
resp, err := client.Enter(c.ctx, &grpc_pb.EnterReq{
USN: c.USN,
GatewaySID: GatewaySID,
GatewaySID: global.GatewaySID,
InstanceID: msg.InstanceID,
})
if err != nil {