Преглед на файлове

v0.0.1开发:修改等待队列的类型为treemap

#Suyghur преди 2 години
родител
ревизия
2cb3d7755e

+ 15 - 4
comm/globalkey/globalkey.go

@@ -5,11 +5,22 @@
 package globalkey
 
 const (
-	ConnectTypePlayer = 0
-	ConnectTypeCs     = 1
+	ConnectTypeNormalPlayer = 0
+	ConnectTypeVipPlayer    = 1
+	ConnectTypeCs           = 2
 )
 
 const (
-	EventRemoveTimeoutJob = "EventRemoveTimeoutJob"
-	EventUnsubscribeRmq   = "EventUnsubscribeRmq"
+	EventRemoveTimeoutJob     = "EventRemoveTimeoutJob"
+	EventHandleRmqJob         = "EventHandleRmqJob"
+	EventUnsubscribeRmqJob    = "EventUnsubscribeRmq"
+	EventNotifyUserOfflineJob = "EventNotifyUserOfflineJob"
+)
+
+const (
+	All             = "all"
+	AllPlayer       = "all_player"
+	AllVipPlayer    = "all_vip_player"
+	AllNormalPlayer = "all_normal_player"
+	AllCs           = "all_cs"
 )

+ 10 - 6
comm/model/message.go

@@ -5,11 +5,17 @@
 package model
 
 const (
-	CMD_SEND_MESSAGE = 0
-	CMD_CHAT_TIMEOUT = 2001
+	CMD_SEND_MESSAGE         = 0
+	CMD_UPDATE_WAITING_QUEUE = 2000
+	CMD_CHAT_TIMEOUT         = 2001
 )
 
 type KqMessage struct {
+	Opt     int32  `json:"opt"`
+	Payload string `json:"payload"`
+	Ext     string `json:"ext"`
+}
+type ChatMessage struct {
 	CreateTime string `json:"create_time"`
 	Content    string `json:"content"`
 	Pic        string `json:"pic"`
@@ -17,13 +23,11 @@ type KqMessage struct {
 	SenderId   string `json:"sender_id"`
 	GameId     string `json:"game_id"`
 	Uid        string `json:"uid"`
-	Ext        string `json:"ext"`
 }
 
-type KqCmdMessage struct {
-	Opt        int32  `json:"opt"`
+type CommandMessage struct {
+	Payload    string `json:"payload"`
 	ReceiverId string `json:"receiver_id"`
 	GameId     string `json:"game_id"`
 	Uid        string `json:"uid"`
-	Ext        string `json:"ext"`
 }

+ 7 - 2
core/cmd/rpc/internal/logic/cssendmsglogic.go

@@ -28,7 +28,7 @@ func NewCsSendMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CsSendM
 
 func (l *CsSendMsgLogic) CsSendMsg(in *pb.CsSendMsgReq) (*pb.CsSendMsgResp, error) {
 	// 投递到自己的发件箱
-	message := &model.KqMe