This commit is contained in:
aozhiwei 2024-04-24 15:02:33 +08:00
parent 5c223abe77
commit 5943ad3871
5 changed files with 44 additions and 0 deletions

View File

@ -75,6 +75,7 @@ type MsgHandler interface {
CMSetAvatar(*f5.MsgHdr, *CMSetAvatar)
CMSetNotice(*f5.MsgHdr, *CMSetNotice)
CMSetJoinCond(*f5.MsgHdr, *CMSetJoinCond)
CMRedDot(*f5.MsgHdr, *CMRedDot)
}
func (this *MsgHandlerImpl) CMPing(hdr *f5.MsgHdr, msg *CMPing) {
@ -197,6 +198,9 @@ func (this *MsgHandlerImpl) CMSetNotice(hdr *f5.MsgHdr, msg *CMSetNotice) {
func (this *MsgHandlerImpl) CMSetJoinCond(hdr *f5.MsgHdr, msg *CMSetJoinCond) {
}
func (this *MsgHandlerImpl) CMRedDot(hdr *f5.MsgHdr, msg *CMRedDot) {
}
func (this *CMPing) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMPing)
}
@ -549,6 +553,14 @@ func (this *SMUserStatusNotify) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMUserStatusNotify)
}
func (this *CMRedDot) GetNetMsgId() uint16 {
return uint16(CMMessageIdE__CMRedDot)
}
func (this *SMRedDot) GetNetMsgId() uint16 {
return uint16(SMMessageIdE__SMRedDot)
}
func (this *SMLogin) Err(errCode int32, errMsg string) *SMLogin {
this.Errcode = proto.Int32(errCode)
this.Errmsg = proto.String(errMsg)
@ -1235,4 +1247,16 @@ func init() {
},
}
handlers[int(CMMessageIdE__CMRedDot)] = &CsNetMsgHandler{
MsgId: int(CMMessageIdE__CMRedDot),
ParseCb: func (data []byte) interface{} {
msg := &CMRedDot{}
proto.Unmarshal(data, msg)
return msg
},
Cb: func (hdr *f5.MsgHdr, handler MsgHandler) {
handler.CMRedDot(hdr, hdr.Msg.(*CMRedDot))
},
}
}

View File

@ -51,6 +51,8 @@ func (this *HandlerMgr) Init() {
cs.RegHandlerId(int(cs.CMMessageIdE__CMSetMemberLevel), constant.PLAYER_HANDLER_ID)
cs.RegHandlerId(int(cs.CMMessageIdE__CMGetTopGuildsByTotalStars), constant.PLAYER_HANDLER_ID)
cs.RegHandlerId(int(cs.CMMessageIdE__CMRedDot), constant.PLAYER_HANDLER_ID)
cs.RegHandlerId(int(cs.CMMessageIdE__CMSendChatMsg), constant.PLAYER_HANDLER_ID)
cs.RegHandlerId(int(cs.CMMessageIdE__CMReadMsgAndOpenChatNotify), constant.PLAYER_HANDLER_ID)
cs.RegHandlerId(int(cs.CMMessageIdE__CMSetCurrPrivateChatTarget), constant.PLAYER_HANDLER_ID)

View File

@ -864,6 +864,11 @@ func (this *player) CMGuildLogs(hdr *f5.MsgHdr, msg *cs.CMGuildLogs) {
//not implements
}
func (this *player) CMRedDot(hdr *f5.MsgHdr, msg *cs.CMRedDot) {
rspMsg := new(cs.SMRedDot)
this.SendMsg(rspMsg)
}
func (this *player) onOffline() {
this.socket.Reset()
f5.GetSysLog().Info("onOffline %s", this.GetAccountId())

View File

@ -33,6 +33,7 @@ enum CMMessageId_e
_CMReadMsgAndOpenChatNotify = 202;
_CMCloseChatNotify = 203;
_CMRedDot = 301;
//
_CMGuildInfo = 120;
@ -99,6 +100,8 @@ enum SMMessageId_e
_SMRecommendGuildList = 139;
_SMGetTopGuildsByTotalStars = 140;
_SMRedDot = 301;
//
_SMUpdateChatRedPointNotify = 1000;
_SMChatMsgNotify = 1001;

View File

@ -740,3 +740,13 @@ message SMUserStatusNotify
optional int32 online_status = 2;
optional int32 battling = 3;
}
//
message CMRedDot
{
}
message SMRedDot
{
optional int32 flags = 1; // 1<<0: 1<<1:
}