Beispiel #1
0
        /// <summary>
        /// Request game item transfer to player.
        /// </summary>
        /// <param name="sender">Transfer address of sender.</param>
        /// <param name="recipientID">Transfer address of recipient.</param>
        /// <param name="item">Game item to be transfered.</param>
        /// <param name="amount">Amount of game item to be transfered.</param>
        /// <returns>Async task that transfer game item to the other player.</returns>
        public async Task <bool> RequestGameItemTransfer(Profile sender, HoardID recipientID, GameItem item, BigInteger amount)
        {
            IGameItemProvider gameItemProvider = GetGameItemProvider(item);

            if (gameItemProvider != null && sender != null && recipientID != null)
            {
                return(await gameItemProvider.Transfer(sender, recipientID, item, amount));
            }

            return(false);
        }
 /// <summary>
 /// Creates a new KeyStoreAccount.
 /// </summary>
 /// <param name="name">Name of account</param>
 /// <param name="id">identifier (public address)</param>
 /// <param name="key">private key</param>
 public KeyStoreProfile(string name, HoardID id, byte[] key)
     : base(name, id)
 {
     Random.NextBytes(localKey);
     encryptedKey = Encode(key);
 }
 /// <summary>
 /// Deletes profile
 /// </summary>
 /// <param name="id"></param>
 /// <param name="passwordNeeded"></param>
 /// <returns></returns>
 public async Task DeleteProfile(HoardID id, bool passwordNeeded = false)
 {
     await KeyStoreUtils.DeleteProfile(UserInputProvider, id, ProfilesDir, passwordNeeded);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="id"></param>
 /// <param name="oldPassword"></param>
 /// <param name="newPassword"></param>
 /// <returns></returns>
 public Task <string> ChangePassword(HoardID id, string oldPassword, string newPassword)
 {
     return(Task.FromResult <string>(KeyStoreUtils.ChangePassword(id, oldPassword, newPassword, ProfilesDir)));
 }
Beispiel #5
0
 /// <summary>
 /// Basic constructor of user profile
 /// </summary>
 /// <param name="name">Name</param>
 /// <param name="id">Identifier (public address)</param>
 public Profile(string name, HoardID id)
 {
     Name = name;
     ID   = id;
 }