Example #1
0
def _test():
    '''测试'''
    uid = 43522
    c = Building_altarUI(uid)
    #Gcore.resetRuntime()
    
#    print c.GetAltarRank({'Flag':1, 'AltarType':2,'Page':1})
    
#    print c.GetLotteryCnt({'AltarType':1})
#     c.Lottery({"BuildingId":13224, "AltarType":1})
#    Gcore.runtime()
#    for i in range(0,50):
#        print c.Lottery({"BuildingId":10557, "AltarType":1})
    #Gcore.runtime()
#    for i in range(1,100):
    print c.Lottery({"BuildingId":12938, "AltarType":2})
#    print c.GetLotteryLog({'AltarType':1})
    Gcore.runtime()
Example #2
0
def test():
    import time
    uid = 1012
    #uid = 43400
    Gcore.resetRuntime()
    c = ChatUI(uid)
    #p = {'Channel':1,'Content':'fuckyou'}
    import chardet

    #s = u"*\uff65\u309c\uff9f\uff65*:.\uff61..\uff61.:*\uff65'(*\uff9f\u25bd\uff9f*)'\uff65*:.\uff61. .\uff61.:*\uff65\u309c\uff9f\uff65*"
    #print s.encode('utf8') #Content": "*・゜゚・*:.。..。.:*・'(*゚▽゚*)'・*:.。. .。.:*・゜゚・*

    #p = {"Content": "asdasd", "ClientTime": 1371108139, "Channel": 4,"ToName":'孟蓝'}
    p = {"Content": "hhh", "ClientTime": 1371780923, "Channel": 1}
    for _ in range(2):
        print '================='
        print c.Say(p)
        print '================='
        time.sleep(1)

    Gcore.runtime()
Example #3
0
def _test():
    '''模块内测试'''
    r = RedisMod(1032)
    print r.OnCacheFriends()
    db = Gcore.getNewDB()
    for UserId in db.out_list('tb_user', 'UserId', "UserId=1001 or 1"):  # OR 1
        print db.sql
        c = RedisMod(UserId)
        #print c.offCacheAll() #下线
        #print c.onCacheAll()  #上线

        #print c.offCacheWallDefense()
        #c.offCacheGeneral()
        #c = RedisMod(UserId,2)

        #c.offCacheWallDefense()
        #c.cacheUserInfo()
        #c.offCacheGeneral()
    Gcore.runtime()

    import time
    time.sleep(5)
Example #4
0
def test():
    import time
    uid = 1012
    #uid = 43400
    Gcore.resetRuntime()
    c = ChatUI(uid) 
    #p = {'Channel':1,'Content':'fuckyou'}
    import chardet
    
    #s = u"*\uff65\u309c\uff9f\uff65*:.\uff61..\uff61.:*\uff65'(*\uff9f\u25bd\uff9f*)'\uff65*:.\uff61. .\uff61.:*\uff65\u309c\uff9f\uff65*"
    #print s.encode('utf8') #Content": "*・゜゚・*:.。..。.:*・'(*゚▽゚*)'・*:.。. .。.:*・゜゚・*
    
    #p = {"Content": "asdasd", "ClientTime": 1371108139, "Channel": 4,"ToName":'孟蓝'}
    p = {"Content": "hhh", "ClientTime": 1371780923, "Channel": 1}
    for _ in range(2):
        print '================='
        print c.Say(p)
        print '================='
        time.sleep(1)
        
    
    Gcore.runtime()
Example #5
0
def _test():
    '''模块内测试'''
    r = RedisMod(1032)
    print r.OnCacheFriends()
    db = Gcore.getNewDB()
    for UserId in db.out_list('tb_user', 'UserId',"UserId=1001 or 1" ): # OR 1
        print db.sql
        c = RedisMod(UserId)
        #print c.offCacheAll() #下线
        #print c.onCacheAll()  #上线
        
        #print c.offCacheWallDefense()
        #c.offCacheGeneral()
        #c = RedisMod(UserId,2)
        
        #c.offCacheWallDefense()
        #c.cacheUserInfo()
        #c.offCacheGeneral()
    Gcore.runtime() 
    
    import time
    time.sleep(5)
Example #6
0
        stat = modBag.addGoods(2, goods_id, goods_num, False)
        if stat <= 0:
            return Gcore.error(optId, -15133003)  # 背包空间不足

        stat = modBag.useItems(ItemId, ItemNum)
        if stat != 1:
            return Gcore.error(optId, -15133004)  # 武将卡数量不足(并发导致)

        body = {}
        body["GainItemId"] = goods_id
        body["GainItemNum"] = goods_num

        return Gcore.out(optId, body)


# end class BuildingUI


def _test():
    """测试"""
    uid = 43557
    c = Building_pubUI(uid)
    print c.ExchangeGeneralCard({})
    # print c.ConvertGeneralCard({"ItemId":1101, "ItemNum":1})


if __name__ == "__main__":
    _test()
    Gcore.runtime()
Example #7
0
        BuildingInfo = self.buildingMod.getBuildingById(BuildingId)
        if not BuildingInfo:
            return Gcore.error(optId, -15009901)  #用户没有该建筑
        BuildingType = BuildingInfo['BuildingType']
        if BuildingType == 2 or BuildingType == 5:  #军需所或铸币厂
            BuildingStorage = self.mod.touchBuildingStorage(
                BuildingId, ClientTime).get('Storage')
            return Gcore.out(optId, {"BuildingStorage": BuildingStorage})
        return Gcore.error(optId, -15009998)  #建筑非军需所或铸币厂


def _test():
    '''测试'''
    #磨坊军资2,铸币,铜钱5
    import time
    uid = 44448  #1013,1001
    c = Building_resourceUI(uid)
    #    print Gcore.loadCfg(1501)['InitJcoin']
    #    ct = time.time()
    #     print c.GetStorage({"BuildingId":761})
    print c.CollectCoin({"BuildingId": 20726})


#     print c.GetStorage({'BuildingId':41})
#    print ct

if __name__ == '__main__':
    _test()
    Gcore.runtime()