本文整理汇总了C#中ApiClient.CanUseSleeve方法的典型用法代码示例。如果您正苦于以下问题:C# ApiClient.CanUseSleeve方法的具体用法?C# ApiClient.CanUseSleeve怎么用?C# ApiClient.CanUseSleeve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApiClient
的用法示例。
在下文中一共展示了ApiClient.CanUseSleeve方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadDeck
public void LoadDeck(int[] id, Guid[] type, int[] @group, string[] size, string sleeveString) {
short s = State.Instance.GetPlayer(_sender).Id;
for (int i = 0; i < id.Length; i++)
id[i] = s << 16 | (id[i] & 0xffff);
var sstring = "";
try
{
var split = sleeveString.Split(new char[1] { '\t' }, 2);
if (split.Length == 2)
{
var sid = 0;
if (int.TryParse(split[0], out sid))
{
Uri url = null;
if (Uri.TryCreate(split[1], UriKind.Absolute, out url))
{
if (State.Instance.Engine.IsLocal == false)
{
// Check if the user can even do this
var p = State.Instance.GetPlayer(_sender);
var c = new ApiClient();
var resp = c.CanUseSleeve(p.Nick, sid);
if (resp.Authorized)
{
sstring = split[1];
}
}
else
{
sstring = split[1];
}
}
}
}
}
catch (Exception e)
{
if (State.Instance.Engine.IsLocal)
Log.Warn("LoadDeck", e);
else
Log.Error("LoadDeck", e);
}
_broadcaster.LoadDeck(id, type, group, size, sstring);
}