29 lines
641 B
Go
29 lines
641 B
Go
package server
|
|
|
|
import (
|
|
"game/common/proto/pb"
|
|
"github.com/fox/fox/log"
|
|
)
|
|
|
|
func (s *ClientService) chat() {
|
|
//const content = "hello world"
|
|
//s.SendMsg(pb.ServiceTypeId_STI_Chat, int32(pb.MsgId_C2SChatId), &pb.C2SChat{
|
|
// SrcUser: s.userId,
|
|
// DstUser: nil,
|
|
// Type: 0,
|
|
// GameId: 0,
|
|
// Content: "",
|
|
//})
|
|
}
|
|
|
|
// 收到登陆成功消息,判断是否顶号
|
|
func (s *ClientService) onChat(cMsg *pb.ClientMsg, msg *pb.RspUserLogin) {
|
|
if msg.Code != pb.ErrCode_OK {
|
|
log.ErrorF("reqLogin error: %v", msg.Code)
|
|
return
|
|
}
|
|
_ = cMsg
|
|
s.userId = msg.UserId
|
|
log.DebugF("user:%v id:%v reqLogin success", s.username, msg.UserId)
|
|
}
|