示例#1
0
    private void LoginEventCallback(EventBase eb)
    {
        Debug.Log("LoginEventCallback");
        string eventname = eb.eventName;
        object obj       = eb.eventValue;

        if (CGNetConst.ROUTE_QUICKLOGIN.Equals(eventname))
        {
            if (obj != null)
            {
                CommonResult <LoginData> commonResult = (CommonResult <LoginData>)obj;
                if (commonResult.errcode == -1)
                {
                    Debug.Log("PlayerBase.data =" + commonResult.data.playerData);
                    int status = commonResult.data.loginStatus;
                    PublicTimer.ResetServerTime(commonResult.data.curTime);
                    //PlayerDataManager.GetInstance().GUID = commonResult.GUID;
                    PlayerDataManager.GetInstance().SetPlayerInfo(commonResult.data.playerData);

                    //PlayerDataManager.GetInstance().SetPlayerInfo(commonResult.data.player);
                    switch (status)
                    {
                    case 0:     //新注册用户
                        Debug.Log("新注册用户");
                        break;

                    case 1:    //登录成功
                        Debug.Log("登录成功");
                        break;

                    default:
                        break;
                    }
                    SceneSwitch.GetSceneSwitch().Switch(GameScene.Lobby);
                }
            }
        }
    }
示例#2
0
    public static PublicTimer GetPublicTimer()
    {
        PublicTimer ret = PublicGameObject.publicGameObj.GetComponent <PublicTimer>();

        return(ret);
    }
示例#3
0
 // Use this for initialization
 void Start()
 {
     PublicTimer.GetPublicTimer().serverTimer += ServerTimer;
 }