(roomId, count int)
| 191 | } |
| 192 | |
| 193 | func (task *Task) broadcastRoomCountToConnect(roomId, count int) { |
| 194 | msg := &proto.RedisRoomCountMsg{ |
| 195 | Count: count, |
| 196 | Op: config.OpRoomCountSend, |
| 197 | } |
| 198 | var body []byte |
| 199 | var err error |
| 200 | if body, err = json.Marshal(msg); err != nil { |
| 201 | logrus.Warnf("broadcastRoomCountToConnect json.Marshal err :%s", err.Error()) |
| 202 | return |
| 203 | } |
| 204 | pushRoomMsgReq := &proto.PushRoomMsgRequest{ |
| 205 | RoomId: roomId, |
| 206 | Msg: proto.Msg{ |
| 207 | Ver: config.MsgVersion, |
| 208 | Operation: config.OpRoomCountSend, |
| 209 | SeqId: tools.GetSnowflakeId(), |
| 210 | Body: body, |
| 211 | }, |
| 212 | } |
| 213 | reply := &proto.SuccessReply{} |
| 214 | rpcList := RClient.GetAllConnectTypeRpcClient() |
| 215 | for _, rpc := range rpcList { |
| 216 | logrus.Infof("broadcastRoomCountToConnect rpc %v", rpc) |
| 217 | rpc.Call(context.Background(), "PushRoomCount", pushRoomMsgReq, reply) |
| 218 | logrus.Infof("reply %s", reply.Msg) |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | func (task *Task) broadcastRoomInfoToConnect(roomId int, roomUserInfo map[string]string) { |
| 223 | msg := &proto.RedisRoomInfo{ |
no test coverage detected