def sendChangeBetsConfReq(cls, shadowRoomId, betsConf): mpReq = MsgPack() mpReq.setCmd("room") mpReq.setParam("action", "change_betsConf") mpReq.setParam("roomId", shadowRoomId) mpReq.setParam("betsConf", betsConf) gameRpcRoomOne.srvtable.doChangeBetsConf(shadowRoomId, mpReq.getDict(), 0)
def queryRoomGetPlayingTableListReq(cls, shadowRoomId, **kwargs): msg = MsgPack() msg.setCmd("room") msg.setParam("action", "playingTableList") msg.setParam("roomId", shadowRoomId) for key in kwargs: msg.setParam(key, kwargs[key]) rfc = gameRpcRoomOne.srvtable.getPlayingTableList( shadowRoomId, msg.getDict()) return rfc.getResult()
def sendTableCallObserveReq(cls, userId, shadowRoomId, tableId, clientId): mpReq = MsgPack() mpReq.setCmd("table_call") mpReq.setParam("action", "observe") mpReq.setParam("userId", userId) mpReq.setParam("roomId", shadowRoomId) mpReq.setParam("tableId", tableId) mpReq.setParam("clientId", clientId) gameRpcRoomOne.srvtable.doTableCallObserve(shadowRoomId, mpReq.getDict(), 0)
def doExchangeExchange(self, request): mo = MsgPack() mi = self.checkExchange.check(request) if mi.error: mo.setError(1, mi.error) else: clientId = tysessiondata.getClientId(mi.userId) msg = MsgPack() msg.setKey('apiVersion', 5.0) msg.setCmdAction('exchange5', 'exchange') msg.setParam('phone', request.getParamStr('phone')) msg.setParam('uName', request.getParamStr('uName')) msg.setParam('uAddres', request.getParamStr('uAddres')) msg.setParam('gameId', tyglobal.gameId()) msg.setParam('itemId', mi.itemId) msg.setParam('userId', mi.userId) msg.setParam('extabName', request.getParamStr('extabName')) msg.setParam('clientId', clientId) msg.setParam('wxappid', hallconf.getWeiXinAppId(mi.userId, clientId)) msg.setParam('proviceId', request.getParamStr('proviceId')) msg.setParam('cityId', request.getParamStr('cityId')) msg.setParam('countyId', request.getParamStr('countyId')) msg.setParam('townId', request.getParamStr('townId')) msg.setParam('proviceName', request.getParamStr('proviceName')) msg.setParam('cityName', request.getParamStr('cityName')) msg.setParam('countyName', request.getParamStr('countyName')) msg.setParam('townName', request.getParamStr('townName')) msg = msg.getDict() try: ret = hallRpcOne.hallexchange.doExchangeRequest(mi.userId, msg) datas = ret.getResult() if datas: exchangeId, errMsg = datas[0], datas[1] if exchangeId: mo.setResult('exchangeId', exchangeId) mo.setResult('info', errMsg) else: mo.setError(1, errMsg) else: mo.setError(1, 'doExchangeRequest return is None') except Exception, e: mo.setError(1, str(e))