예제 #1
0
    // 신규 유저 데이터 입력
    private void loginDataSave(User.userLoginData.LoginType loginType, string nickname = null, string email = null, string pw = null)
    {
        // 유저 데이터
        var newUser = new User.userLoginData();

        // DB에 저장될 유저데이터 초기화
        newUser.loginType   = tempLoginType;
        newUser.nickname    = nickname;
        newUser.uid         = user.UserId;
        newUser.email       = email;
        newUser.pw          = pw;
        newUser.deviceModel = SystemInfo.deviceModel;
        newUser.deviceName  = SystemInfo.deviceName;
        newUser.deviceType  = SystemInfo.deviceType;
        newUser.deviceOS    = SystemInfo.operatingSystem;
        newUser.createDate  = auth.CurrentUser.Metadata.CreationTimestamp;
        string json = JsonUtility.ToJson(newUser);

        PlayerID = newUser.uid;
        DBRef.Child("users").Child(newUser.uid).Child("username").SetValueAsync(newUser.nickname);

        // 코인 저장용
        var newUserInventory = new User.userGoodsData();

        // DB에 저장될 유저데이터 초기화
        newUserInventory.uid  = user.UserId;
        newUserInventory.coin = 0;

        LoadingPanel.SetActive(true);
        LoginPanel.SetActive(false);
        NicknamePanel.SetActive(false);

        // 위에 정리한 json을 서버에 보내 DB에 저장한다.
        // 새로운 유저에 대한 데이터를 DB에 보낸다.
        Server.Instance.NewUserJsonDBSave(json, () =>
        {
            // DB에 저장 후 디바이스 user정보에도 저장한다.
            User.Instance.mainUser = newUser;

            // 새로운 유저의 인벤토리 데이터를 DB에 보낸다.
            Server.Instance.NewUserInventoryJsonDBSave(JsonUtility.ToJson(newUserInventory), () =>
            {
                // DB에 저장 후 디바이스 user정보에도 저장한다.
                User.Instance.mainInventory = newUserInventory;

                ShowIntro();
            });
        });
    }
예제 #2
0
 // 유저 데이터 임시 저장
 private void userDataTempSave(User.userLoginData.LoginType loginType, string email = null, string pw = null)
 {
     tempLoginType = loginType;
     tempemail     = email;
     temppw        = pw;
 }
예제 #3
0
 // 유저 임시 데이터 초기화
 private void userDataInit()
 {
     tempLoginType = User.userLoginData.LoginType.None;
     tempemail     = string.Empty;
     temppw        = string.Empty;
 }