Skip to main content
Version: 6.0.0

GetPlayerInfoByInDate

public BackndOtherPlayerReturnObject GetPlayerInfoByInDate(string gamerInDate);

BackndOtherPlayerReturnObject

GetReturnValueByPlayerItem

If an error occurred, null is returned.

BackndOtherPlayerReturnObject bro = Backnd.Player.GetPlayerInfoByInDate("inDate");
string gamerIndate = bro.GetReturnValueByPlayerItem().inDate;

BackndPlayerItem

public class BackndPlayerItem
{
public string nickname = string.Empty;
public string inDate = string.Empty;
public string lastLogin = string.Empty;
public string guildName = string.Empty;
}

Parameter

ValueTypeDescription
gamerInDatestringgamerInDate of the user whose information is to be looked up

Description

Retrieves the user information of the user with the corresponding gamerInDate.
The following information can be looked up:

  • User's nickname
  • User's gamerIndate
  • Last accessed time
  • Name of the guild the user belongs to

Example

Synchronous

BackndOtherPlayerReturnObject bro = Backnd.Player.GetPlayerInfoByInDate("2021-00-00T00:00:00.000Z");

string gamerIndate = bro.GetReturnValueByPlayerItem().inDate;
if(string.IsNullOrEmpty(bro.GetReturnValueByPlayerItem().guildName)) // null is returned when no guild name is registered
{
string guildName = bro.GetReturnValueByPlayerItem().guildName;
}

Asynchronous

Backnd.Player.GetPlayerInfoByInDate("2021-00-00T00:00:00.000Z", (callback) => 
{
string gamerIndate = callback.GetReturnValueByPlayerItem().inDate;
if(string.IsNullOrEmpty(callback.GetReturnValueByPlayerItem().guildName)) // null is returned when no guild name is registered
{
string guildName = callback.GetReturnValueByPlayerItem().guildName;
}
});

Return cases

Success cases

When a user with the corresponding inDate exists
statusCode : 200

returnValue : refer to GetReturnValuetoJSON

When a user with the corresponding inDate does not exist
statusCode : 404
errorCode : NotFoundException

GetReturnValuetoJSON

{
"row":
{
"nickname":"ImATestUser", // User's nickname(null if non-existent)
"inDate":"2021-00-00T00:00:00.000Z", // User inDate
"lastLogin":"2021-06-23T02:08:56.235Z", // Last time of login
"guildName":"testGuild" // Name of the user's guild(null if non-existent)
}
}

Sample code

  public class SearchUserItem
{
public string nickname;
public string inDate;
public string lastLogin;
public string guildName;
public override string ToString()
{
return $"nickname : {nickname}\ninDate : {inDate}\nlastLogin : {lastLogin}\nguildName : {guildName}\n";
}
};
public void GetPlayerInfoByInDateTest()
{
string userNickname = "2021-11-24T02:44:14.638Z";

var bro = Backnd.Player.GetPlayerInfoByInDate(userNickname);

if(!bro.IsSuccess())
return;

BACKND.LitJson.JsonData json = bro.GetReturnValuetoJSON();

SearchUserItem userInfo = new SearchUserItem();

userInfo.nickname = json["row"]["nickname"].ToString();
userInfo.inDate = json["row"]["inDate"].ToString();
userInfo.lastLogin = json["row"]["lastLogin"].ToString();
if(json["row"]["guildName"] != null)
{
userInfo.guildName = json["row"]["guildName"].ToString();
}

Debug.Log(userInfo.ToString());
}