game/test/client/server/processor.go

31 lines
824 B
Go
Raw Normal View History

2025-05-29 17:54:47 +08:00
package server
import (
"game/common/proto/pb"
"github.com/fox/fox/processor"
)
func (s *ClientService) initProcessor() {
s.processor.RegisterMessages(processor.RegisterMetas{
pb.MsgId_C2SChatId: {pb.C2SChat{}, s.onChat},
})
}
// 收到登陆成功消息,判断是否顶号
func (s *ClientService) onChat(uid int64, msg *pb.C2SChat) {
_ = uid
_ = msg
//switch msg.Type {
//case pb.ChatType_CT_Private:
// sName, err := s.bindService.FindServiceName(msg.DstUser.UserId, pb.ServiceTypeId_STI_Gate)
// if err != nil {
// log.DebugF("find user:%v in gate err: %v", uid, err)
// return
// }
// s.SendServiceMsg(service.TopicEx(sName), msg.DstUser.UserId, int32(pb.MsgId_S2CChatId), msg)
//default:
// s.SendServiceMsg(service.TopicEx(topicName.WorldMessage), uid, int32(pb.MsgId_S2CChatId), msg)
//}
}