当前位置: 首页>>代码示例>>Java>>正文


Java Leaderboards.SubmitScoreResult方法代码示例

本文整理汇总了Java中com.google.android.gms.games.leaderboard.Leaderboards.SubmitScoreResult方法的典型用法代码示例。如果您正苦于以下问题:Java Leaderboards.SubmitScoreResult方法的具体用法?Java Leaderboards.SubmitScoreResult怎么用?Java Leaderboards.SubmitScoreResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.gms.games.leaderboard.Leaderboards的用法示例。


在下文中一共展示了Leaderboards.SubmitScoreResult方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: A

import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
public Leaderboards.SubmitScoreResult A(final Status paramStatus)
{
  return new Leaderboards.SubmitScoreResult()
  {
    public ScoreSubmissionData getScoreData()
    {
      return new ScoreSubmissionData(DataHolder.empty(14));
    }

    public Status getStatus()
    {
      return paramStatus;
    }

    public void release()
    {
    }
  };
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:20,代码来源:fw.java

示例2: submitScoreWithResult

import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
@Override
public void submitScoreWithResult(int highScore, IScoreCallback scoreCallback) {
    if (isSignedIn()) {
        PendingResult<Leaderboards.SubmitScoreResult> result = Games.Leaderboards.submitScoreImmediate(
                gameHelper.getApiClient(),
                activity.getString(R.string.leaderboard_highscore),
                highScore);
        result.setResultCallback(new ScoreCallback(scoreCallback), 3000, TimeUnit.SECONDS);
    }

}
 
开发者ID:ezet,项目名称:penguins-in-space,代码行数:12,代码来源:AndroidNetworkService.java

示例3: onResult

import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
@Override
public void onResult(@NonNull Leaderboards.SubmitScoreResult submitScoreResult) {
    final boolean alltimeBest = submitScoreResult.getScoreData().getScoreResult(TIME_SPAN_ALL_TIME).newBest;
    final boolean weeklyBest = submitScoreResult.getScoreData().getScoreResult(TIME_SPAN_WEEKLY).newBest;
    final boolean dailyBest = submitScoreResult.getScoreData().getScoreResult(TIME_SPAN_DAILY).newBest;
    callback.onScoreResult(alltimeBest, weeklyBest, dailyBest);
}
 
开发者ID:ezet,项目名称:penguins-in-space,代码行数:8,代码来源:AndroidNetworkService.java

示例4: call

import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
@Override
public FREObject call(FREContext context, FREObject[] args) {
    super.call(context, args);

    AIR.log( "GameServices::reportScore" );

    String leaderboardId = FREObjectUtils.getString( args[0] );
    double scoreValue = FREObjectUtils.getDouble( args[1] );
    boolean immediate = FREObjectUtils.getBoolean( args[2] );

    GameServicesHelper helper = GameServicesHelper.getInstance();
    if( helper.isAuthenticated() ) {
        if( immediate ) {
            PendingResult<Leaderboards.SubmitScoreResult> result = Games.Leaderboards.submitScoreImmediate( helper.getClient(), leaderboardId, (long) scoreValue );
            result.setResultCallback( this, 10, TimeUnit.SECONDS );
            return null;
        }

        Games.Leaderboards.submitScore( GameServicesHelper.getInstance().getClient(), leaderboardId, (long) scoreValue );
        AIR.log( "Successfully submitted score to leaderboard: " + leaderboardId );
        AIR.dispatchEvent( GameServicesEvent.REPORT_SCORE_SUCCESS );
    } else {
        AIR.log( "Cannot report score, user is not signed in." );
        AIR.dispatchEvent( GameServicesEvent.REPORT_SCORE_ERROR, "Cannot report score, user is not signed in." );
    }

    return null;
}
 
开发者ID:marpies,项目名称:game-services-ane,代码行数:29,代码来源:ReportScoreFunction.java

示例5: onResult

import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
@Override
public void onResult( @NonNull Leaderboards.SubmitScoreResult result ) {
    com.google.android.gms.common.api.Status status = result.getStatus();

    if( !status.isSuccess() ) {
        AIR.log( "Failed to submit score: " + status.getStatusMessage() );
        AIR.dispatchEvent( GameServicesEvent.REPORT_SCORE_ERROR, status.getStatusMessage() );
        return;
    }

    result.release();

    AIR.log( "Successfully submitted score" );
    AIR.dispatchEvent( GameServicesEvent.REPORT_SCORE_SUCCESS );
}
 
开发者ID:marpies,项目名称:game-services-ane,代码行数:16,代码来源:ReportScoreFunction.java

示例6: onResult

import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
/**
 Scored pushed online.
 Update of the value NEED_TO_SYNC on SharedPreferences: there's no need to sync.
 */
@Override
public void onResult(@NonNull Leaderboards.SubmitScoreResult res) {
    if (res.getStatus().getStatusCode() == 0) {
        // data sent successfully to server.
        // display toast.
        Log.d("##ClassicLeaderboardCal","SCORE SENT");
        final SharedPreferences pref = getApplicationContext().getSharedPreferences(Constants.PREF_KEY, Context.MODE_PRIVATE);
        pref.edit().putInt(Constants.NEED_TO_SYNC_CLASSIC, 0).apply();
    }
}
 
开发者ID:simoneapp,项目名称:S3-16-simone,代码行数:15,代码来源:ClassicLeaderboardCallback.java

示例7: onResult

import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
/**
 Scored pushed online.
 Update of the value NEED_TO_SYNC on SharedPreferences: there's no need to sync.
 */
@Override
public void onResult(@NonNull Leaderboards.SubmitScoreResult res) {
    if (res.getStatus().getStatusCode() == 0) {
        // data sent successfully to server.
        // display toast.
        Log.d("##HardLeaderboardCall","SCORE SENT");
        final SharedPreferences pref = getApplicationContext().getSharedPreferences(Constants.PREF_KEY, Context.MODE_PRIVATE);
        pref.edit().putInt(Constants.NEED_TO_SYNC_HARD, 0).apply();
    }
}
 
开发者ID:simoneapp,项目名称:S3-16-simone,代码行数:15,代码来源:HardLeaderboardCallback.java

示例8: onResult

import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
@Override
public void onResult(Leaderboards.SubmitScoreResult res) {
    if (res.getStatus().getStatusCode() == 0) {
        // data sent successfully to server.
        // display toast.
        Log.d("##LeaderboardCallback","SCORE SENT");
    }
}
 
开发者ID:simoneapp,项目名称:S3-16-simone,代码行数:9,代码来源:LeaderboardCallback.java

示例9: submitScoreImmediate

import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
public final PendingResult<Leaderboards.SubmitScoreResult> submitScoreImmediate(GoogleApiClient paramGoogleApiClient, final String paramString1, final long paramLong, String paramString2)
{
  return paramGoogleApiClient.b(new d()
  {
    protected void a(fl paramAnonymousfl)
    {
      paramAnonymousfl.a(this, paramString1, paramLong, this.vg);
    }
  });
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:11,代码来源:fw.java


注:本文中的com.google.android.gms.games.leaderboard.Leaderboards.SubmitScoreResult方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。