| 37 |
37 |
import org.distorted.dialogs.RubikDialogNewRecord;
|
| 38 |
38 |
import org.distorted.dialogs.RubikDialogSolved;
|
| 39 |
39 |
import org.distorted.effects.BaseEffect;
|
|
40 |
import org.distorted.effects.scramble.ScrambleEffect;
|
| 40 |
41 |
import org.distorted.library.message.EffectListener;
|
| 41 |
42 |
import org.distorted.objects.TwistyObject;
|
| 42 |
43 |
import org.distorted.objects.ObjectList;
|
| ... | ... | |
| 77 |
78 |
private long mAddRotationID, mRemoveRotationID;
|
| 78 |
79 |
private int mCubit, mFace, mNewColor;
|
| 79 |
80 |
private int mNearestAngle;
|
|
81 |
private String mDebug;
|
|
82 |
private long mDebugStartTime;
|
| 80 |
83 |
|
| 81 |
84 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
| 82 |
85 |
|
| ... | ... | |
| 104 |
107 |
mScrambleObjectNum = 0;
|
| 105 |
108 |
|
| 106 |
109 |
mEffectID = new long[BaseEffect.Type.LENGTH];
|
|
110 |
|
|
111 |
mDebug = "";
|
| 107 |
112 |
}
|
| 108 |
113 |
|
| 109 |
114 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
| ... | ... | |
| 338 |
343 |
|
| 339 |
344 |
private void reportRecord()
|
| 340 |
345 |
{
|
| 341 |
|
final RubikActivity act = (RubikActivity)mView.getContext();
|
| 342 |
|
FirebaseAnalytics analytics = act.getAnalytics();
|
|
346 |
RubikStatePlay play = (RubikStatePlay) StateList.PLAY.getStateClass();
|
|
347 |
RubikScores scores = RubikScores.getInstance();
|
| 343 |
348 |
|
| 344 |
|
if( analytics!=null )
|
| 345 |
|
{
|
| 346 |
|
RubikStatePlay play = (RubikStatePlay) StateList.PLAY.getStateClass();
|
| 347 |
|
RubikScores scores = RubikScores.getInstance();
|
|
349 |
int object = play.getObject();
|
|
350 |
int size = play.getSize();
|
|
351 |
int level = play.getLevel();
|
|
352 |
ObjectList list = ObjectList.getObject(object);
|
|
353 |
String name = scores.getName();
|
| 348 |
354 |
|
| 349 |
|
int object = play.getObject();
|
| 350 |
|
int size = play.getSize();
|
| 351 |
|
int level = play.getLevel();
|
| 352 |
|
ObjectList list = ObjectList.getObject(object);
|
| 353 |
|
String name = scores.getName();
|
|
355 |
String record = list.name()+"_"+size+" level "+level+" time "+mNewRecord+" isNew: "+mIsNewRecord+" scrambleNum: "+mScrambleObjectNum;
|
| 354 |
356 |
|
| 355 |
|
String record = list.name()+"_"+size+" level "+level+" time "+mNewRecord+" isNew: "+mIsNewRecord;
|
|
357 |
if( BuildConfig.DEBUG )
|
|
358 |
{
|
|
359 |
android.util.Log.e("pre", mDebug);
|
|
360 |
android.util.Log.e("pre", name);
|
|
361 |
android.util.Log.e("pre", record);
|
|
362 |
}
|
|
363 |
else
|
|
364 |
{
|
|
365 |
final RubikActivity act = (RubikActivity)mView.getContext();
|
|
366 |
FirebaseAnalytics analytics = act.getAnalytics();
|
| 356 |
367 |
|
| 357 |
|
Bundle bundle = new Bundle();
|
| 358 |
|
bundle.putString(FirebaseAnalytics.Param.CHARACTER, name);
|
| 359 |
|
bundle.putString(FirebaseAnalytics.Param.LEVEL, record);
|
| 360 |
|
analytics.logEvent(FirebaseAnalytics.Event.LEVEL_UP, bundle);
|
|
368 |
if( analytics!=null )
|
|
369 |
{
|
|
370 |
Bundle bundle = new Bundle();
|
|
371 |
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, mDebug);
|
|
372 |
bundle.putString(FirebaseAnalytics.Param.CHARACTER, name);
|
|
373 |
bundle.putString(FirebaseAnalytics.Param.LEVEL, record);
|
|
374 |
analytics.logEvent(FirebaseAnalytics.Event.LEVEL_UP, bundle);
|
|
375 |
}
|
| 361 |
376 |
}
|
| 362 |
377 |
}
|
| 363 |
378 |
|
| ... | ... | |
| 444 |
459 |
|
| 445 |
460 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
| 446 |
461 |
//
|
|
462 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
463 |
|
|
464 |
void rememberMove(int axis, int row, int angle)
|
|
465 |
{
|
|
466 |
mDebug += (" (m "+axis+" "+(1<<row)+" "+angle+" "+(System.currentTimeMillis()-mDebugStartTime)+")");
|
|
467 |
}
|
|
468 |
|
| 447 |
469 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
| 448 |
470 |
|
| 449 |
471 |
void setScreenSize(int width)
|
| ... | ... | |
| 570 |
592 |
mAddRotationRowBitmap = rowBitmap;
|
| 571 |
593 |
mAddRotationAngle = angle;
|
| 572 |
594 |
mAddRotationDuration = duration;
|
|
595 |
|
|
596 |
if( listener instanceof ScrambleEffect )
|
|
597 |
{
|
|
598 |
mDebug += (" (a "+axis+" "+rowBitmap+" "+angle+" "+(System.currentTimeMillis()-mDebugStartTime)+")");
|
|
599 |
}
|
| 573 |
600 |
}
|
| 574 |
601 |
|
| 575 |
602 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
| ... | ... | |
| 588 |
615 |
{
|
| 589 |
616 |
mScrambleObject = true;
|
| 590 |
617 |
mScrambleObjectNum = num;
|
|
618 |
mDebug = "";
|
|
619 |
mDebugStartTime = System.currentTimeMillis();
|
| 591 |
620 |
}
|
| 592 |
621 |
}
|
| 593 |
622 |
|
More debugging for the case of suspicious submits.