def pushMsg(objPlayerData, objBetHisData): dictOnlineInfo = yield from classOnlineMgr.getInstance().getOnlineClient( objPlayerData.strAccountId) if dictOnlineInfo is not None: # 没在线,不用推送了 objPushSSHead = classSSHead() objPushSSHead.strAccountId = objPlayerData.strAccountId objPushSSHead.strMsgId = pushGuessBetChangeResult objPushSSHead.strClientUdid = dictOnlineInfo['connectUid'] objRsp = protoPushBetResultData() objHisItem = protoGuessHistoryItem(objBetHisData) objRsp.listGuessBetList.append(objHisItem) yield from classPushMgr.getInstance().push(dictOnlineInfo['host'], dictOnlineInfo['groupId'], objPushSSHead, objRsp) # 推送一下金钱 objPushSSHead.strMsgId = pushPlayerCoin objRsp = protoPushCoinData() objRsp.iCoin = "%.2f" % round(objPlayerData.iGuessCoin / 100, 2) yield from classPushMgr.getInstance().push(dictOnlineInfo['host'], dictOnlineInfo['groupId'], objPushSSHead, objRsp)
def handleGetGuessBetList(objHead:classSSHead,objFbReq:dict): objResp = protoGetGuessBetListResp() strAccount = objHead.strAccountId if strAccount == "": return objResp if not cpv.checkIsString(strAccount): raise exceptionLogic(errorLogic.client_param_invalid) listGuessUIds = yield from classSqlBaseMgr.getInstance().getGuessBetHistory(strAccount) # 统一一批拿出guess数据 listBetHistoryData = yield from classDataBaseMgr.getInstance().getBetHistoryList(listGuessUIds) for var_history in listBetHistoryData: objBetHistoryItem = protoGuessHistoryItem(var_history) objResp.listGuessBetList.append(objBetHistoryItem) return objResp