GetGuildInfo
public BackndReturnObject GetGuildInfo(string guildIndate);
BackndGuildListReturnObject
GetReturnValueByGuildList
If an error occurred, null is returned.
BackndGuildListReturnObject bro = Backnd.Guild.GetGuildInfo("guildInDate");
Debug.Log(bro.GetReturnValueByGuildList().ToString());
BackndGuildItem
public class BackndGuildItem
{
public int memberCount;
public Dictionary<string, string> viceMasterList = new Dictionary<string, string>();
public string masterNickname;
public string inDate;
public string guildName;
public int goodsCount;
public bool _immediateRegistration;
public string _countryCode;
public string masterInDate;
public Dictionary<string, string> customGuildInfo = new Dictionary<string, string>();
}
Parameter
Value | Type | Description |
---|---|---|
guildIndate | string | indate of the guild to receive the information from |
Description
Looks up the information of the guild with the guildIndate.
Example
Synchronous
Backnd.Guild.GetGuildInfo("guildIndate");
Asynchronous
Backnd.Guild.GetGuildInfo("guildIndate", callback =>
{
// Post-process
});
Return cases
Success cases
When the lookup is successful
statusCode : 200
returnValue : refer to GetReturnValuetoJSON
Error cases
When the guildIndate does not exist
statusCode : 404
errorCode : NotFoundException
When the old guild is looked up
statusCode : 412
errorCode : PreconditionFailed
GetReturnValuetoJSON
{
// Guild information
guild:
{
// Number of guild members
memberCount:{ N: "5" },
// Vice guild master list
viceMasterList:
{
L:
[
{
M:
{
// Vice guild master indate
inDate: { S: "2019-02-25T06:29:28.849Z" },
// Vice guild master's nickname
nickname: { S: "id23" }
}
},
{
M:
{
inDate: { S: "2019-02-25T06:29:27.533Z" },
nickname: { S: "id22" }
}
}
]
},
// Guild master's nickname
masterNickname: { S: "id24" },
// Guild indate
inDate: { S: "2019-04-12T07:38:16.522Z" },
// Guild name
guildName: { S: "mumin" },
// Amount of guild goods
goodsCount:{ N: "2" },
// Quick join status(Only exists when set through EnableAutoApproveGuildJoinRequest)
_immediateRegistration: { BOOL: "true"},
// Country code(Only exists when country code is added)
_countryCode: {S: "KR"},
// Guild master indate
masterInDate: { S: "2019-02-25T06:29:30.022Z" }
}
}
Sample code
public class GuildItem
{
public int memberCount;
public Dictionary<string, string> viceMasterList = new Dictionary<string, string>();
public string masterNickname;
public string inDate;
public string guildName;
public int goodsCount;
public bool _immediateRegistration;
public string _countryCode;
public string masterInDate;
public override string ToString()
{
string viceMasterString = string.Empty;
foreach(var li in viceMasterList)
{
viceMasterString += $"Vice guild master : {li.Value}({li.Key})\n";
}
return $"memberCount : {memberCount}\n" +
$"masterNickname : {masterNickname}\n" +
$"inDate : {inDate}\n" +
$"guildName : {guildName}\n" +
$"goodsCount : {goodsCount}\n" +
$"_immediateRegistration : {_immediateRegistration}\n" +
$"_countryCode : {_countryCode}\n" +
$"masterInDate : {masterInDate}\n" +
$"memberCount : {memberCount}\n" +
viceMasterString;
}
};
public void GetGuildInfo()
{
var bro = Backnd.Guild.GetGuildInfo("2021-12-16T08:51:00.706Z");
if(!bro.IsSuccess())
return;
BACKND.LitJson.JsonData json = bro.GetFlattenJSON();
List<GuildItem> guildList = new List<GuildItem>();
GuildItem guildItem = new GuildItem();
guildItem.memberCount = int.Parse(json["guild"]["memberCount"].ToString());
guildItem.masterNickname = json["guild"]["masterNickname"].ToString();
guildItem.inDate = json["guild"]["inDate"].ToString();
guildItem.guildName = json["guild"]["guildName"].ToString();
guildItem.goodsCount = int.Parse(json["guild"]["goodsCount"].ToString());
if(json["guild"].ContainsKey("_immediateRegistration"))
{
guildItem._immediateRegistration = json["guild"]["_immediateRegistration"].ToString() == "True" ? true : false;
}
if(json["guild"].ContainsKey("_countryCode"))
{
guildItem._countryCode = json["guild"]["_countryCode"].ToString();
}
guildItem.masterInDate = json["guild"]["masterInDate"].ToString();
BACKND.LitJson.JsonData viceListJson = json["guild"]["viceMasterList"];
for(int j = 0; j < viceListJson.Count; j++)
{
guildItem.viceMasterList.Add(viceListJson[j]["inDate"].ToString(), viceListJson[j]["nickname"].ToString());
}
guildList.Add(guildItem);
Debug.Log(guildItem.ToString());
}