EchoesGLSurfaceView$4.smali

.class Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;
.super Lcom/sandboxol/common/base/web/OnResponseListener;
.source "EchoesGLSurfaceView.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/sandboxol/blockmango/EchoesGLSurfaceView;->followGame(JLjava/lang/String;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/sandboxol/common/base/web/OnResponseListener<",
        "Lcom/sandboxol/center/entity/Dispatch;",
        ">;"
    }
.end annotation


# instance fields
.field final synthetic this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

.field final synthetic val$gameType:Ljava/lang/String;

.field final synthetic val$targetUserId:J


# direct methods
.method constructor <init>(Lcom/sandboxol/blockmango/EchoesGLSurfaceView;Ljava/lang/String;J)V
    .registers 5

    .line 1
    iput-object p1, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

    iput-object p2, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->val$gameType:Ljava/lang/String;

    iput-wide p3, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->val$targetUserId:J

    invoke-direct {p0}, Lcom/sandboxol/common/base/web/OnResponseListener;-><init>()V

    return-void
.end method


# virtual methods
.method public onError(ILjava/lang/String;)V
    .registers 9

    .line 1
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "onError code: "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v1, " msg: "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p2

    const-string v0, "web.followGame"

    invoke-static {v0, p2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 2
    iget-object p2, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

    const/4 v0, 0x0

    invoke-static {p2, v0}, Lcom/sandboxol/blockmango/EchoesGLSurfaceView;->access$002(Lcom/sandboxol/blockmango/EchoesGLSurfaceView;Z)Z

    .line 3
    iget-object p2, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

    invoke-virtual {p2}, Landroid/opengl/GLSurfaceView;->getContext()Landroid/content/Context;

    move-result-object p2

    if-nez p2, :cond_2d

    return-void

    .line 4
    :cond_2d
    invoke-static {}, Lcom/sandboxol/center/entity/AccountCenter;->newInstance()Lcom/sandboxol/center/entity/AccountCenter;

    move-result-object p2

    iget-object p2, p2, Lcom/sandboxol/center/entity/AccountCenter;->login:Landroidx/databinding/ObservableField;

    invoke-virtual {p2}, Landroidx/databinding/ObservableField;->get()Ljava/lang/Object;

    move-result-object p2

    check-cast p2, Ljava/lang/Boolean;

    invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z

    move-result p2

    .line 5
    invoke-static {}, Lcom/sandboxol/common/base/app/BaseApplication;->getApp()Lcom/sandboxol/common/base/app/BaseApplication;

    move-result-object v0

    invoke-virtual {v0}, Lcom/sandboxol/common/base/app/BaseApplication;->getCurUserId()J

    move-result-wide v0

    const/4 v2, 0x2

    if-ne p1, v2, :cond_50

    .line 6
    iget-object p1, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

    const/4 p2, 0x7

    invoke-virtual {p1, p2}, Lcom/sandboxol/blockmango/EchoesGLSurfaceView;->onResetGameResult(I)V

    goto/16 :goto_b5

    :cond_50
    const/4 v3, 0x3

    if-ne p1, v3, :cond_63

    if-eqz p2, :cond_5c

    .line 7
    iget-wide p1, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->val$targetUserId:J

    cmp-long v2, v0, p1

    if-nez v2, :cond_5c

    goto :goto_5d

    :cond_5c
    const/4 v3, 0x4

    .line 8
    :goto_5d
    iget-object p1, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

    invoke-virtual {p1, v3}, Lcom/sandboxol/blockmango/EchoesGLSurfaceView;->onResetGameResult(I)V

    goto :goto_b5

    :cond_63
    const/16 v4, 0x7da

    const/4 v5, 0x5

    if-eq p1, v4, :cond_9b

    const/16 v4, 0x7d9

    if-ne p1, v4, :cond_6d

    goto :goto_9b

    :cond_6d
    const/16 v4, 0x7db

    if-ne p1, v4, :cond_8c

    .line 9
    iget-object p1, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

    invoke-virtual {p1}, Landroid/opengl/GLSurfaceView;->getContext()Landroid/content/Context;

    move-result-object p1

    sget v2, Lcom/sandboxol/game/R$string;->game_version_not_match:I

    invoke-static {p1, v2}, Lcom/sandboxol/common/utils/ToastUtils;->showShortToast(Landroid/content/Context;I)V

    if-eqz p2, :cond_85

    .line 10
    iget-wide p1, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->val$targetUserId:J

    cmp-long v2, v0, p1

    if-nez v2, :cond_85

    goto :goto_86

    :cond_85
    const/4 v3, 0x5

    .line 11
    :goto_86
    iget-object p1, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

    invoke-virtual {p1, v3}, Lcom/sandboxol/blockmango/EchoesGLSurfaceView;->onResetGameResult(I)V

    goto :goto_b5

    :cond_8c
    if-eqz p2, :cond_95

    .line 12
    iget-wide p1, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->val$targetUserId:J

    cmp-long v4, v0, p1

    if-nez v4, :cond_95

    const/4 v2, 0x3

    .line 13
    :cond_95
    iget-object p1, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

    invoke-virtual {p1, v2}, Lcom/sandboxol/blockmango/EchoesGLSurfaceView;->onResetGameResult(I)V

    goto :goto_b5

    .line 14
    :cond_9b
    :goto_9b
    iget-object p1, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

    invoke-virtual {p1}, Landroid/opengl/GLSurfaceView;->getContext()Landroid/content/Context;

    move-result-object p1

    sget v2, Lcom/sandboxol/game/R$string;->game_version_too_low:I

    invoke-static {p1, v2}, Lcom/sandboxol/common/utils/ToastUtils;->showShortToast(Landroid/content/Context;I)V

    if-eqz p2, :cond_af

    .line 15
    iget-wide p1, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->val$targetUserId:J

    cmp-long v2, v0, p1

    if-nez v2, :cond_af

    goto :goto_b0

    :cond_af
    const/4 v3, 0x5

    .line 16
    :goto_b0
    iget-object p1, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

    invoke-virtual {p1, v3}, Lcom/sandboxol/blockmango/EchoesGLSurfaceView;->onResetGameResult(I)V

    :goto_b5
    return-void
.end method

.method public onServerError(I)V
    .registers 6

    .line 1
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "onServerError code: "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    const-string v0, "web.followGame"

    invoke-static {v0, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 2
    iget-object p1, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

    const/4 v0, 0x0

    invoke-static {p1, v0}, Lcom/sandboxol/blockmango/EchoesGLSurfaceView;->access$002(Lcom/sandboxol/blockmango/EchoesGLSurfaceView;Z)Z

    .line 3
    iget-object p1, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

    invoke-virtual {p1}, Landroid/opengl/GLSurfaceView;->getContext()Landroid/content/Context;

    move-result-object p1

    if-nez p1, :cond_25

    return-void

    .line 4
    :cond_25
    invoke-static {}, Lcom/sandboxol/center/entity/AccountCenter;->newInstance()Lcom/sandboxol/center/entity/AccountCenter;

    move-result-object p1

    iget-object p1, p1, Lcom/sandboxol/center/entity/AccountCenter;->login:Landroidx/databinding/ObservableField;

    invoke-virtual {p1}, Landroidx/databinding/ObservableField;->get()Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Ljava/lang/Boolean;

    invoke-virtual {p1}, Ljava/lang/Boolean;->booleanValue()Z

    move-result p1

    if-eqz p1, :cond_47

    invoke-static {}, Lcom/sandboxol/common/base/app/BaseApplication;->getApp()Lcom/sandboxol/common/base/app/BaseApplication;

    move-result-object p1

    invoke-virtual {p1}, Lcom/sandboxol/common/base/app/BaseApplication;->getCurUserId()J

    move-result-wide v0

    iget-wide v2, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->val$targetUserId:J

    cmp-long p1, v0, v2

    if-nez p1, :cond_47

    const/4 p1, 0x3

    goto :goto_48

    :cond_47
    const/4 p1, 0x2

    .line 5
    :goto_48
    iget-object v0, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

    invoke-virtual {v0, p1}, Lcom/sandboxol/blockmango/EchoesGLSurfaceView;->onResetGameResult(I)V

    return-void
.end method

.method public onSuccess(Lcom/sandboxol/center/entity/Dispatch;)V
    .registers 7

    .line 2
    iget-object v0, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lcom/sandboxol/blockmango/EchoesGLSurfaceView;->access$002(Lcom/sandboxol/blockmango/EchoesGLSurfaceView;Z)Z

    .line 3
    invoke-static {}, Lcom/sandboxol/blocky/router/RealmsController;->getMe()Lcom/sandboxol/blocky/router/RealmsController;

    move-result-object v0

    if-eqz v0, :cond_93

    .line 4
    invoke-virtual {v0}, Lcom/sandboxol/blocky/router/Controller;->getEnterRealmsResult()Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;

    move-result-object v2

    invoke-virtual {v2}, Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;->getGame()Lcom/sandboxol/greendao/entity/Game;

    move-result-object v2

    iget-object v3, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->val$gameType:Ljava/lang/String;

    invoke-virtual {v2, v3}, Lcom/sandboxol/greendao/entity/Game;->setGameId(Ljava/lang/String;)V

    .line 5
    invoke-virtual {v0}, Lcom/sandboxol/blocky/router/Controller;->getEnterRealmsResult()Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;

    move-result-object v2

    iget-object v3, p1, Lcom/sandboxol/center/entity/Dispatch;->gAddr:Ljava/lang/String;

    invoke-virtual {v2, v3}, Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;->setGameAddr(Ljava/lang/String;)V

    .line 6
    invoke-virtual {v0}, Lcom/sandboxol/blocky/router/Controller;->getEnterRealmsResult()Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;

    move-result-object v2

    iget-object v3, p1, Lcom/sandboxol/center/entity/Dispatch;->signature:Ljava/lang/String;

    invoke-virtual {v2, v3}, Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;->setUserToken(Ljava/lang/String;)V

    .line 7
    invoke-virtual {v0}, Lcom/sandboxol/blocky/router/Controller;->getEnterRealmsResult()Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;

    move-result-object v2

    iget-object v3, p1, Lcom/sandboxol/center/entity/Dispatch;->dispUrl:Ljava/lang/String;

    invoke-virtual {v2, v3}, Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;->setDispatchUrl(Ljava/lang/String;)V

    .line 8
    invoke-virtual {v0}, Lcom/sandboxol/blocky/router/Controller;->getEnterRealmsResult()Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;

    move-result-object v2

    iget-wide v3, p1, Lcom/sandboxol/center/entity/Dispatch;->timestamp:J

    invoke-virtual {v2, v3, v4}, Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;->setTimestamp(J)V

    .line 9
    invoke-virtual {v0}, Lcom/sandboxol/blocky/router/Controller;->getEnterRealmsResult()Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;

    move-result-object v2

    iget-object v3, p1, Lcom/sandboxol/center/entity/Dispatch;->chatRoomId:Ljava/lang/String;

    invoke-virtual {v2, v3}, Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;->setChatRoomId(Ljava/lang/String;)V

    .line 10
    invoke-virtual {v0}, Lcom/sandboxol/blocky/router/Controller;->getEnterRealmsResult()Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;

    move-result-object v2

    iget-object v3, p1, Lcom/sandboxol/center/entity/Dispatch;->mapName:Ljava/lang/String;

    invoke-virtual {v2, v3}, Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;->setMapName(Ljava/lang/String;)V

    .line 11
    invoke-virtual {v0}, Lcom/sandboxol/blocky/router/Controller;->getEnterRealmsResult()Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;

    move-result-object v2

    iget-object v3, p1, Lcom/sandboxol/center/entity/Dispatch;->mapUrl:Ljava/lang/String;

    invoke-virtual {v2, v3}, Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;->setMapUrl(Ljava/lang/String;)V

    .line 12
    invoke-virtual {v0}, Lcom/sandboxol/blocky/router/Controller;->getEnterRealmsResult()Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;

    move-result-object v2

    iget-object v3, p1, Lcom/sandboxol/center/entity/Dispatch;->mapId:Ljava/lang/String;

    invoke-virtual {v2, v3}, Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;->setMapId(Ljava/lang/String;)V

    .line 13
    invoke-virtual {v0}, Lcom/sandboxol/blocky/router/Controller;->getEnterRealmsResult()Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;

    move-result-object v2

    iget-wide v3, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->val$targetUserId:J

    invoke-virtual {v2, v3, v4}, Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;->setTargetUserId(J)V

    .line 14
    invoke-virtual {v0}, Lcom/sandboxol/blocky/router/Controller;->getEnterRealmsResult()Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;

    move-result-object v2

    iget-object p1, p1, Lcom/sandboxol/center/entity/Dispatch;->requestIds:Ljava/util/Map;

    invoke-static {}, Lcom/sandboxol/common/base/app/BaseApplication;->getApp()Lcom/sandboxol/common/base/app/BaseApplication;

    move-result-object v3

    invoke-virtual {v3}, Lcom/sandboxol/common/base/app/BaseApplication;->getCurUserId()J

    move-result-wide v3

    invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v3

    invoke-interface {p1, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Ljava/lang/String;

    invoke-virtual {v2, p1}, Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;->setRequestId(Ljava/lang/String;)V

    .line 15
    invoke-virtual {v0}, Lcom/sandboxol/blocky/router/Controller;->getEnterRealmsResult()Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;

    move-result-object p1

    invoke-virtual {p1, v1}, Lcom/sandboxol/center/router/moduleInfo/game/EnterRealmsResult;->setTeam(Z)V

    .line 16
    iget-object p1, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

    const/4 v0, 0x1

    invoke-virtual {p1, v0}, Lcom/sandboxol/blockmango/EchoesGLSurfaceView;->initGame(Z)V

    goto :goto_a0

    :cond_93
    const-string p1, "web.followGame"

    const-string v0, "controller is null."

    .line 17
    invoke-static {p1, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 18
    iget-object p1, p0, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->this$0:Lcom/sandboxol/blockmango/EchoesGLSurfaceView;

    const/4 v0, 0x6

    invoke-virtual {p1, v0}, Lcom/sandboxol/blockmango/EchoesGLSurfaceView;->onResetGameResult(I)V

    :goto_a0
    return-void
.end method

.method public bridge synthetic onSuccess(Ljava/lang/Object;)V
    .registers 2

    .line 1
    check-cast p1, Lcom/sandboxol/center/entity/Dispatch;

    invoke-virtual {p0, p1}, Lcom/sandboxol/blockmango/EchoesGLSurfaceView$4;->onSuccess(Lcom/sandboxol/center/entity/Dispatch;)V

    return-void
.end method