feat: 닉네임 중복체크 기능 추가

This commit is contained in:
aube.lee
2025-02-28 14:39:25 +09:00
parent a946e8bf72
commit 0a90fe2607
3 changed files with 21 additions and 12 deletions

View File

@@ -94,23 +94,18 @@ namespace TON
/// </summary>
public void ChangeNickname(string newNickname, Action<bool, string> callback)
{
if (string.IsNullOrEmpty(newNickname) || newNickname.Length < 2)
{
callback?.Invoke(false, "닉네임은 2자 이상이어야 합니다.");
return;
}
Backend.BMember.UpdateNickname(newNickname, bro =>
{
if (bro.IsSuccess())
{
Debug.Log("닉네임 변경 성공: " + newNickname);
callback?.Invoke(true, "닉네임이 변경되었습니다.");
callback?.Invoke(true, bro.GetCode());
}
else
{
Debug.LogError("닉네임 변경 실패: " + bro.GetMessage());
callback?.Invoke(false, "닉네임 변경 실패: " + bro.GetMessage());
callback?.Invoke(false, bro.GetCode());
}
});
}