package hall import ( "fmt" "server/call" "server/common" "server/pb" "github.com/gogo/protobuf/proto" "github.com/liangdas/mqant/gate" "github.com/liangdas/mqant/log" ) type player struct { session gate.Session token string db common.PlayerDBInfo lastLogin int64 // 最近一次登录时间 isRecharge bool // 是否充值 } func (p *player) PushRedPoint() { call.PushRed(p.db.Id, pb.RedPointModule_RedPointFreeCash, uint32(1)) call.PushMailRed(p.db.Id) } // func (p *player) Send(topic string, data proto.Message) { // call.SendSS(p.session, topic, data) // } func (p *player) PushBroadcast() { all := call.GetConfigBroadcast() for _, v := range all { if v.Open == 0 || v.TargetID != common.BrocastIDAll { continue } msg := &pb.BroadcastMsg{ Content: v.Content, Priority: uint32(v.Priority), Loop: int64(v.LoopFrequency), Interval: int64(v.Interval), } send, _ := proto.Marshal(msg) log.Debug("broadcast:%v", msg.Content) p.session.Send(fmt.Sprintf("%v:%v", int(pb.ServerType_ServerTypeCommon), int(pb.ServerCommonResp_CommonBroadcastResp)), send) } }