(serverId string, userId int, msg []byte)
| 149 | } |
| 150 | |
| 151 | func (task *Task) pushSingleToConnect(serverId string, userId int, msg []byte) { |
| 152 | logrus.Infof("pushSingleToConnect Body %s", string(msg)) |
| 153 | pushMsgReq := &proto.PushMsgRequest{ |
| 154 | UserId: userId, |
| 155 | Msg: proto.Msg{ |
| 156 | Ver: config.MsgVersion, |
| 157 | Operation: config.OpSingleSend, |
| 158 | SeqId: tools.GetSnowflakeId(), |
| 159 | Body: msg, |
| 160 | }, |
| 161 | } |
| 162 | reply := &proto.SuccessReply{} |
| 163 | connectRpc, err := RClient.GetRpcClientByServerId(serverId) |
| 164 | if err != nil { |
| 165 | logrus.Infof("get rpc client err %v", err) |
| 166 | } |
| 167 | err = connectRpc.Call(context.Background(), "PushSingleMsg", pushMsgReq, reply) |
| 168 | if err != nil { |
| 169 | logrus.Infof("pushSingleToConnect Call err %v", err) |
| 170 | } |
| 171 | logrus.Infof("reply %s", reply.Msg) |
| 172 | } |
| 173 | |
| 174 | func (task *Task) broadcastRoomToConnect(roomId int, msg []byte) { |
| 175 | pushRoomMsgReq := &proto.PushRoomMsgRequest{ |
no test coverage detected