Esempio n. 1
0
def storage_API():
    token = account_mobile_run.test_run()
    name = token_extract.header_adder_interceptor('authorization',
                                                  '{}'.format(token))
    channel = grpc.secure_channel('celerx-test.celer.app',
                                  public_key.public_key())
    intercept_channel = grpc.intercept_channel(channel, name)
    stub = storage_mobile_pb2_grpc.MobileStub(intercept_channel)
    response = stub.RecordInviterInfo(
        storage_mobile_pb2.RecordInviterInfoRequest(
            inviter_username='******',
            invitation_code='2PU3W7',
            inviter_avatar_url=
            'https://celerx.app/invitation/?device=ios&app=network.celer.celerx&inviter=proud.asdic&code=2PU3W7',
            inviter_visible_username='******'))
    print(response.error)
Esempio n. 2
0
def history_API():
    token = account_mobile_run.test_run()
    name = token_extract.header_adder_interceptor('authorization',
                                                  '{}'.format(token))
    channel = grpc.secure_channel('celerx-test.celer.app',
                                  public_key.public_key())
    intercept_channel = grpc.intercept_channel(channel, name)
    stub = history_mobile_pb2_grpc.MobileStub(intercept_channel)
    response = stub.c(
        history_mobile_pb2.GetGameHistoryRequest(
            page_request_list=mini,
            primary_account_type=2,
            needs_all_prize_claims=None,
            needs_top_acceptable_challenges=None,
            game_id='000403'))

    print(response.error, response.page_list, response.total_claim_prize,
          response.top_acceptable_challenges)
Esempio n. 3
0
def config_API():
    token = account_mobile_run.test_run()
    name = token_extract.header_adder_interceptor('authorization',
                                                  '{}'.format(token))
    channel = grpc.secure_channel('celerx-test.celer.app',
                                  public_key.public_key())
    intercept_channel = grpc.intercept_channel(channel, name)
    stub = config_mobile_pb2_grpc.MobileStub(intercept_channel)
    response = stub.SetMarketingCampaignTag(
        config_mobile_pb2.SetMarketingCampaignTagRequest(
            marketing_campaign_tag=''))
    print(response.error)

    response2 = stub.SetABTestingExperimentTag(
        config_mobile_pb2.SetABTestingExperimentTagRequest(
            experiment_tag_name='', experiment_user_tag=''))
    print(response2.error)

    response3 = stub.GetGameInfoByGameID(
        config_mobile_pb2.GetGameInfoByGameIDRequest(game_id='000403'))
    print(response3.error, response3.game_info)

    response4 = stub.GetPracticeBucket(
        config_mobile_pb2.GetPracticeBucketRequest(game_id='000403'))
    print(response4.practice_bucket)

    response5 = stub.IsBlockedByDevice(
        config_mobile_pb2.IsBlockedByDeviceRequest(device_type='',
                                                   device_id=''))
    print(response5.error, response5.is_blocked)

    response6 = stub.GetTournamentBuckets(
        config_mobile_pb2.GetTournamentBucketsRequest(
            game_id=
            '',  # if this is not specified, return all tournaments for this app
            primary_account_type='',
            tournament_status='',
            # // could be
            # // "celerx.app" for Android or  "network.celer.celerx" for iOS
            # // "celerx.app.solitaire"
            # // "celerx.app.fruitpunch"
            # // "celerx.app.cubematrix"
            # // "celerx.app.daubcash"
            app_id='',
            app_version='',
            device_type=''))
    print(response6.error, response6.tournament_bucket_detail_list)

    response7 = stub.GetGameBucketList(
        config_mobile_pb2.GetGameBucketListRequest(
            game_id='',
            primary_account_type='',
            tournament_status='',
            # // could be
            # // "celerx.app" for Android or  "network.celer.celerx" for iOS
            # // "celerx.app.solitaire"
            # // "celerx.app.fruitpunch"
            # // "celerx.app.cubematrix"
            # // "celerx.app.daubcash"
            app_id='',
            app_version='',
            device_type='',
            need_special_bucket=''))
    print(response7.error, response7.match_buckets,
          response7.tournament_buckets, response7.special_buckets)

    response8 = stub.GetHomeNotifications(
        config_mobile_pb2.HomeNotificationRequest(primary_account_type=''))
    print(response8.error, response8.exists_unread_history,
          response8.exists_unclaimed_prize)

    response9 = stub.GetGameActivePlayersCount(
        config_mobile_pb2.GetGameActivePlayersCountRequest(game_ids=''))
    print(response9.active_players)