mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 09:18:27 -04:00
Fixed .clubleave, cleanup
This commit is contained in:
@@ -25,7 +25,7 @@ public sealed class NewGamblingService : IGamblingService, INService
|
|||||||
|
|
||||||
if (amount > 0)
|
if (amount > 0)
|
||||||
{
|
{
|
||||||
var isTakeSuccess = await _cs.RemoveAsync(userId, amount, new("wof", "bet"));
|
var isTakeSuccess = await _cs.RemoveAsync(userId, amount, new("lula", "bet"));
|
||||||
|
|
||||||
if (!isTakeSuccess)
|
if (!isTakeSuccess)
|
||||||
{
|
{
|
||||||
@@ -39,7 +39,7 @@ public sealed class NewGamblingService : IGamblingService, INService
|
|||||||
var won = (long)result.Won;
|
var won = (long)result.Won;
|
||||||
if (won > 0)
|
if (won > 0)
|
||||||
{
|
{
|
||||||
await _cs.AddAsync(userId, won, new("wof", "win"));
|
await _cs.AddAsync(userId, won, new("lula", "win"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -121,7 +121,7 @@ public sealed class NewGamblingService : IGamblingService, INService
|
|||||||
|
|
||||||
if (amount > 0)
|
if (amount > 0)
|
||||||
{
|
{
|
||||||
var isTakeSuccess = await _cs.RemoveAsync(userId, amount, new("betflip", "bet"));
|
var isTakeSuccess = await _cs.RemoveAsync(userId, amount, new("betdraw", "bet"));
|
||||||
|
|
||||||
if (!isTakeSuccess)
|
if (!isTakeSuccess)
|
||||||
{
|
{
|
||||||
@@ -135,7 +135,7 @@ public sealed class NewGamblingService : IGamblingService, INService
|
|||||||
var won = (long)result.Won;
|
var won = (long)result.Won;
|
||||||
if (won > 0)
|
if (won > 0)
|
||||||
{
|
{
|
||||||
await _cs.AddAsync(userId, won, new("betflip", "win"));
|
await _cs.AddAsync(userId, won, new("betdraw", "win"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -187,7 +187,6 @@ public sealed class NewGamblingService : IGamblingService, INService
|
|||||||
return Task.FromResult(results);
|
return Task.FromResult(results);
|
||||||
}
|
}
|
||||||
|
|
||||||
// // todo deck draw black/white?
|
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// private readonly ConcurrentDictionary<ulong, Deck> _decks = new ConcurrentDictionary<ulong, Deck>();
|
// private readonly ConcurrentDictionary<ulong, Deck> _decks = new ConcurrentDictionary<ulong, Deck>();
|
||||||
@@ -226,7 +225,6 @@ public sealed class NewGamblingService : IGamblingService, INService
|
|||||||
// list.Add(card);
|
// list.Add(card);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // todo 3.2 should replace all "placeholder" words in command strings with a link to the placeholder list explanation
|
|
||||||
// var cards = list
|
// var cards = list
|
||||||
// .Select(x => new Card
|
// .Select(x => new Card
|
||||||
// {
|
// {
|
||||||
|
@@ -178,7 +178,7 @@ public class ClubService : INService, IClubService
|
|||||||
public bool LeaveClub(IUser user)
|
public bool LeaveClub(IUser user)
|
||||||
{
|
{
|
||||||
using var uow = _db.GetDbContext();
|
using var uow = _db.GetDbContext();
|
||||||
var du = uow.GetOrCreateUser(user);
|
var du = uow.GetOrCreateUser(user, x => x.Include(u => u.Club));
|
||||||
if (du.Club is null || du.Club.OwnerId == du.Id)
|
if (du.Club is null || du.Club.OwnerId == du.Id)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user