private void PlaceBet_Load(object sender, DataGridViewCellEventArgs e) { PlaceBetForm form = new PlaceBetForm(); form.numericUpDown1.Maximum = decimal.Parse(this.Cash.ToString()); form.numericUpDown1.Minimum = 1M; form.btnPlaceBet.Click += ((obj, ea) => { PlaceBet?.Invoke(this.Teams, this.gridCoeffs.SelectedCells[0].Value.ToString(), double.Parse(this.gridCoeffs.SelectedCells[1].Value.ToString()), double.Parse(form.numericUpDown1.Value.ToString())); }); form.Show(); }
public override int _TimeToBet(PlaceBet BetDetails) { if (BetDetails is PlaceDiceBet) { decimal weight = 1; if (Currency == 0) { switch (CurrencyMap[Currency].ToLower()) { case "bitcoins": weight = decimal.Parse(Weights.BTC, System.Globalization.NumberFormatInfo.InvariantInfo); break; case "tokens": weight = decimal.Parse(Weights.TOK, System.Globalization.NumberFormatInfo.InvariantInfo); break; case "litecoins": weight = decimal.Parse(Weights.LTC, System.Globalization.NumberFormatInfo.InvariantInfo); break; case "ethers": weight = decimal.Parse(Weights.ETH, System.Globalization.NumberFormatInfo.InvariantInfo); break; case "dogecoins": weight = decimal.Parse(Weights.DOGE, System.Globalization.NumberFormatInfo.InvariantInfo); break; case "bcash": weight = decimal.Parse(Weights.BCH, System.Globalization.NumberFormatInfo.InvariantInfo); break; default: weight = decimal.Parse(Weights.BTC, System.Globalization.NumberFormatInfo.InvariantInfo); break; } } for (int i = Limits.Length - 1; i >= 0; i--) { if (i == Limits.Length - 1 && ((decimal)(BetDetails as PlaceDiceBet).Amount * weight) >= (decimal)Limits[i] * 0.00000001m) { return(0); } else if (((decimal)(decimal)(BetDetails as PlaceDiceBet).Amount * weight) >= (decimal)Limits[i] * 0.00000001m) { int timeleft = (int)(((decimal)(DateTime.Now - Lastbet).TotalSeconds - (1.0m / ((decimal)i + 1.0m))) * 1000m); return(-timeleft); } } } return(0); }
public async Task <PlaceBetResponse> Post(PlaceBet request) { return(await GameActions.PlaceBetAsync(request)); }
public PlaceBetEventArgs(PlaceBet NewBet) { this.NewBet = NewBet; }
async Task <PlaceBetResponse> ICommonGameActionsProvider.PlaceBetAsync(PlaceBet request) { return(await DoBetCommandTransactions <PlaceBet, PlaceBetResponse>(request, async (playerId, transaction) => await PlaceBet(playerId, transaction))); }
public int TimeToBet(PlaceBet BetDetails) { return(_TimeToBet(BetDetails)); }
public override int _TimeToBet(PlaceBet BetDetails) { return(100 - (int)(DateTime.Now - Lastbet).TotalMilliseconds); }
public virtual int _TimeToBet(PlaceBet BetDetails) { return(-1); }
public void PlaceBet(PlaceBet BetDetails) { new Thread(new ParameterizedThreadStart(PlaceBetThread)).Start(BetDetails); }
public override int _TimeToBet(PlaceBet BetDetails) { //return true; decimal amount = BetDetails.TotalAmount; int type_delay = 0; if (Currencies[Currency].ToLower() == "btc") { if (LastBetAmount <= 0.00000005 || (double)amount <= 0.00000005) { type_delay = 1; } else { type_delay = 2; } } else if (Currencies[Currency].ToLower() == "eth") { if (LastBetAmount <= 0.00000250 || (double)amount <= 0.00000250) { type_delay = 1; } else { type_delay = 2; } } else if (Currencies[Currency].ToLower() == "ltc") { if (LastBetAmount <= 0.00001000 || (double)amount <= 0.00001000) { type_delay = 1; } else { type_delay = 2; } } else if (Currencies[Currency].ToLower() == "doge") { if (LastBetAmount <= 5.00000000 || (double)amount <= 5.00000000) { type_delay = 1; } else { type_delay = 2; } } else if (Currencies[Currency].ToLower() == "burst") { if (LastBetAmount <= 5.00000000 || (double)amount <= 5.00000000) { type_delay = 1; } else { type_delay = 2; } } else if (Currencies[Currency].ToLower() == "bch") { if (LastBetAmount <= 0.00000025 || (double)amount <= 0.00000025) { type_delay = 1; } else { type_delay = 2; } } else if (Currencies[Currency].ToLower() == "dash") { if (LastBetAmount <= 0.00000025 || (double)amount <= 0.00000025) { type_delay = 1; } else { type_delay = 2; } } else if (Currencies[Currency].ToLower() == "zec") { if (LastBetAmount <= 0.00000025 || (double)amount <= 0.00000025) { type_delay = 1; } else { type_delay = 2; } } else if (Currencies[Currency].ToLower() == "xmr") { if (LastBetAmount <= 0.00000025 || (double)amount <= 0.00000025) { type_delay = 1; } else { type_delay = 2; } } else if (Currencies[Currency].ToLower() == "etc") { if (LastBetAmount <= 0.00000025 || (double)amount <= 0.00000025) { type_delay = 1; } else { type_delay = 2; } } else if (Currencies[Currency].ToLower() == "neo") { if (LastBetAmount <= 0.00000025 || (double)amount <= 0.00000025) { type_delay = 1; } else { type_delay = 2; } } else if (Currencies[Currency].ToLower() == "strat") { if (LastBetAmount <= 0.00000025 || (double)amount <= 0.00000025) { type_delay = 1; } else { type_delay = 2; } } else if (Currencies[Currency].ToLower() == "kmd") { if (LastBetAmount <= 0.00000025 || (double)amount <= 0.00000025) { type_delay = 1; } else { type_delay = 2; } } else if (Currencies[Currency].ToLower() == "xrp") { if (LastBetAmount <= 0.00000025 || (double)amount <= 0.00000025) { type_delay = 1; } else { type_delay = 2; } } int delay = 0; if (type_delay == 1) { delay = 300; } else if (type_delay == 2) { delay = 200; } else { delay = 200; } return(delay - (int)((DateTime.Now - LastBet).TotalMilliseconds)); }
private void SimpleButton_Click(object sender, RoutedEventArgs e) { PlaceBet?.Invoke(this, new PlaceBetEventArgs(new PlaceDiceBet(Amount, true, Chance))); }
public async Task <PlaceBetResponse> Post(PlaceBet request) { await ValidateTokenData(request); return(await GameActions.PlaceBetAsync(request)); }