コード例 #1
0
 public Task <bool> AssignPlayerAsync(int slot, string userId)
 {
     return(request.Create()
            .Identifier(slot.ToString())
            .Method("assign")
            .AddParameter(userId)
            .Build()
            .SendAsync <bool>(
                ApiRequestTarget.Village,
                ApiRequestType.Get));
 }
コード例 #2
0
 public Task <ItemSellResult> SellItemAsync(string userId, Guid itemId, double amount, double pricePerItem)
 {
     return(request.Create()
            .Identifier(userId)
            .Method("sell")
            .AddParameter(itemId.ToString())
            .AddParameter(((long)amount).ToString())
            .AddParameter(((long)pricePerItem).ToString())
            .Build()
            .SendAsync <ItemSellResult>(
                ApiRequestTarget.Marketplace,
                ApiRequestType.Get));
 }
コード例 #3
0
 public Task <AuthToken> AuthenticateAsync(string username, string password)
 {
     return(request.Create()
            .AddParameter("Username", username)
            .AddParameter("Password", password)
            .Build()
            .SendAsync <AuthToken>(ApiRequestTarget.Auth, ApiRequestType.Post));
 }
コード例 #4
0
 public Task <byte[]> DownloadBackupAsync()
 {
     return(request.Create()
            .Identifier("backup")
            .Method("download")
            .Build()
            .SendAsync <byte[]>(ApiRequestTarget.Admin, ApiRequestType.Get));
 }
コード例 #5
0
 public Task <RavenNest.Models.Player> PlayerJoinAsync(string userId, string username)
 {
     return(request.Create()
            .Identifier(userId)
            .AddParameter("value", username)
            .Build()
            .SendAsync <RavenNest.Models.Player>(
                ApiRequestTarget.Players,
                ApiRequestType.Post));
 }
コード例 #6
0
 public Task PlayerRemoveAsync(Guid characterId)
 {
     if (client.Desynchronized)
     {
         return(Task.CompletedTask);
     }
     return(request.Create()
            .AddParameter(characterId.ToString())
            .Build()
            .SendAsync <bool>(
                ApiRequestTarget.Players,
                ApiRequestType.Remove));
 }
コード例 #7
0
 public Task <GameInfo> GetAsync()
 {
     return(request.Create().Build().SendAsync <GameInfo>(ApiRequestTarget.Game, ApiRequestType.Get));
 }
コード例 #8
0
 public Task <ItemCollection> GetAsync()
 {
     return(request.Create()
            .Build()
            .SendAsync <ItemCollection>(ApiRequestTarget.Items, ApiRequestType.Get));
 }