Exemplo n.º 1
0
        /// <summary>
        /// Get deck for mock hand
        /// </summary>
        /// <param name="tableId"></param>
        /// <param name="handId"></param>
        /// <returns></returns>
        public BitPoker.Models.Messages.DeckResponse Get(Guid handId)
        {
            //As its heads up, create the first hand and deck
            BitPoker.Models.Hand hand = repo.Find(handId);

            //Assume alice
            const String alice_wif = "93Loqe8T3Qn3fCc87AiJHYHJfFFMLy6YuMpXzffyFsiodmAMCZS";

            NBitcoin.BitcoinSecret  alice_secret  = new NBitcoin.BitcoinSecret(alice_wif, NBitcoin.Network.TestNet);
            NBitcoin.BitcoinAddress alice_address = alice_secret.GetAddress();

            BitPoker.Models.Messages.DeckResponse response = new BitPoker.Models.Messages.DeckResponse()
            {
                HandId = handId,
                //BitcoinAddress = alice_address.ToString(),
                Deck = hand.Deck
            };

            String message = response.ToString();

            //response.Signature = alice_secret.PrivateKey.SignMessage(message);

            return(response);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Get a specific hand via id
 /// </summary>
 /// <param name="id"></param>
 /// <param name="index"></param>
 /// <returns></returns>
 public BitPoker.Models.Hand Get(Guid id, Int32 index = 0)
 {
     BitPoker.Models.Hand hand = _repo.Find(id);
     return(hand);
 }