Aggiornamento alla versione 3.0.0

- Rimosse funzionalità legacy legate a WebView2.
- Introdotto uno stile globale per i pulsanti.
- Semplificata l'interfaccia con gestione tramite griglia unica.
- Aggiunti comandi per avviare, mettere in pausa e fermare aste.
- Introdotta gestione manuale dei cookie tramite dialog.
- Aggiunti dialog per configurare sessione e aggiungere aste.
- Migliorata la persistenza con salvataggio sicuro (DPAPI).
- Rifattorizzate statistiche per utilizzare `BidHistory` e `BidderStats`.
- Ottimizzato il polling per ridurre il carico di sistema.
- Aggiornata esportazione CSV con dati più dettagliati.
- Introdotti nuovi modelli dati per utente e banner aste.
- Rimossi file di test manuale e codice obsoleto.
- Aggiornata documentazione per riflettere le modifiche.
- Aggiunta nuova icona dell'applicazione.
- Migliorata la sicurezza eliminando il salvataggio in chiaro dei cookie.
This commit is contained in:
Alberto Balbo
2025-10-28 12:45:08 +01:00
parent fef7b909e7
commit 717dc44b3b
32 changed files with 1039 additions and 1471 deletions

View File

@@ -1,10 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
namespace AutoBidder.Models
{
/// <summary>
/// Informazioni base di un'asta monitorata
/// Solo HTTP, nessuna modalità, browser o multi-click
/// </summary>
public class AuctionInfo
{
@@ -19,15 +22,14 @@ namespace AutoBidder.Models
public double MaxPrice { get; set; } = 0;
public int MinResets { get; set; } = 0; // Numero minimo reset prima di puntare
public int MaxResets { get; set; } = 0; // Numero massimo reset (0 = illimitati)
// Numero massimo di click/puntate che il bot può eseguire per questa asta (0 = illimitato)
public int MaxClicks { get; set; } = 0;
[JsonPropertyName("MaxClicks")]
public int MaxClicks { get; set; } = 0; // Numero massimo di puntate consentite (0 = illimitato)
// Stato asta
public bool IsActive { get; set; } = true;
public bool IsPaused { get; set; } = false;
// Contatori
public int MyClicks { get; set; } = 0;
public int ResetCount { get; set; } = 0;
// Timestamp
@@ -35,12 +37,10 @@ namespace AutoBidder.Models
public DateTime? LastClickAt { get; set; }
// Storico
public List<BidHistory> BidHistory { get; set; } = new();
public List<BidHistory> BidHistory { get; set; } = new List<BidHistory>();
public Dictionary<string, BidderInfo> BidderStats { get; set; } = new(StringComparer.OrdinalIgnoreCase);
// Legacy (deprecato, usa BidderStats)
[System.Text.Json.Serialization.JsonIgnore]
public Dictionary<string, int> Bidders { get; set; } = new(StringComparer.OrdinalIgnoreCase);
// Legacy (deprecato) - removed `Bidders` dictionary; use `BidderStats` instead
// Log per-asta (non serializzato)
[System.Text.Json.Serialization.JsonIgnore]
@@ -54,11 +54,13 @@ namespace AutoBidder.Models
var entry = $"{DateTime.Now:HH:mm:ss} - {message}";
AuctionLog.Add(entry);
// Mantieni solo ultimi 100 log
if (AuctionLog.Count > 100)
// Mantieni solo ultimi 500 log
if (AuctionLog.Count > 500)
{
AuctionLog.RemoveAt(0);
}
}
public int PollingLatencyMs { get; set; } = 0; // Ultima latenza polling ms
}
}

View File

@@ -61,10 +61,12 @@ namespace AutoBidder.Models
Name = auction.Name,
MonitoringStarted = auction.AddedAt,
MonitoringDuration = DateTime.UtcNow - auction.AddedAt,
MyBids = auction.MyClicks,
// MyBids calcolato dalle entry in BidHistory
MyBids = auction.BidHistory.Count(h => h.EventType == BidEventType.MyBid),
Resets = auction.ResetCount,
UniqueBidders = auction.Bidders.Count,
BidderRanking = auction.Bidders
UniqueBidders = auction.BidderStats?.Count ?? 0,
BidderRanking = (auction.BidderStats ?? new Dictionary<string, BidderInfo>())
.ToDictionary(k => k.Key, v => v.Value.BidCount)
};
if (auction.BidHistory.Any())
@@ -113,11 +115,11 @@ namespace AutoBidder.Models
}
}
if (auction.Bidders.Any())
if (auction.BidderStats != null && auction.BidderStats.Any())
{
var topBidder = auction.Bidders.OrderByDescending(b => b.Value).First();
stats.MostActiveBidder = topBidder.Key;
stats.MostActiveBidderCount = topBidder.Value;
var top = auction.BidderStats.OrderByDescending(b => b.Value.BidCount).First();
stats.MostActiveBidder = top.Key;
stats.MostActiveBidderCount = top.Value.BidCount;
}
return stats;

View File

@@ -0,0 +1,19 @@
using System.Collections.Generic;
namespace AutoBidder.Models
{
public class UserBannerInfo
{
public int nAsteConfermate { get; set; }
public int limiteAsteVinte { get; set; }
public int nAsteVinte { get; set; }
public int nPuntateRiscattate { get; set; }
public int nPuntateBonus { get; set; }
public int nPuntateDaRiscattare { get; set; }
public int nAstePerBonus { get; set; }
public long validUntil { get; set; }
public int percentualeBonus { get; set; }
public int viewSlot { get; set; }
public List<object> extraSlots { get; set; } = new();
}
}

View File

@@ -0,0 +1,10 @@
namespace AutoBidder.Models
{
public class UserData
{
public string? Username { get; set; }
public int RemainingBids { get; set; }
public double? CashBalance { get; set; }
public int? UserId { get; set; }
}
}