Added taper counts, vitals streaming and tentacle porn
This commit is contained in:
parent
ecea5af243
commit
f9644baf1e
5 changed files with 80 additions and 12 deletions
|
|
@ -30,6 +30,7 @@ namespace MosswartMassacre
|
|||
internal static double killsPerHour = 0;
|
||||
internal static DateTime statsStartTime = DateTime.Now;
|
||||
internal static Timer updateTimer;
|
||||
private static Timer vitalsTimer;
|
||||
public static bool RareMetaEnabled { get; set; } = true;
|
||||
|
||||
// VVS View Management
|
||||
|
|
@ -108,6 +109,11 @@ namespace MosswartMassacre
|
|||
updateTimer.Elapsed += UpdateStats;
|
||||
updateTimer.Start();
|
||||
|
||||
// Initialize vitals streaming timer
|
||||
vitalsTimer = new Timer(5000); // Send vitals every 5 seconds
|
||||
vitalsTimer.Elapsed += SendVitalsUpdate;
|
||||
vitalsTimer.Start();
|
||||
|
||||
// Note: View initialization moved to LoginComplete for VVS compatibility
|
||||
|
||||
// Enable TLS1.2
|
||||
|
|
@ -151,7 +157,7 @@ namespace MosswartMassacre
|
|||
CoreManager.Current.WorldFilter.ReleaseObject -= OnDespawn;
|
||||
|
||||
|
||||
// Stop and dispose of the timer
|
||||
// Stop and dispose of the timers
|
||||
if (updateTimer != null)
|
||||
{
|
||||
updateTimer.Stop();
|
||||
|
|
@ -159,6 +165,13 @@ namespace MosswartMassacre
|
|||
updateTimer = null;
|
||||
}
|
||||
|
||||
if (vitalsTimer != null)
|
||||
{
|
||||
vitalsTimer.Stop();
|
||||
vitalsTimer.Dispose();
|
||||
vitalsTimer = null;
|
||||
}
|
||||
|
||||
// Clean up the view
|
||||
ViewManager.ViewDestroy();
|
||||
//Disable vtank interface
|
||||
|
|
@ -419,6 +432,52 @@ namespace MosswartMassacre
|
|||
}
|
||||
}
|
||||
|
||||
private static void SendVitalsUpdate(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Only send if WebSocket is enabled
|
||||
if (!WebSocketEnabled)
|
||||
return;
|
||||
|
||||
// Collect vitals data
|
||||
int currentHealth = CoreManager.Current.Actions.Vital[VitalType.CurrentHealth];
|
||||
int currentStamina = CoreManager.Current.Actions.Vital[VitalType.CurrentStamina];
|
||||
int currentMana = CoreManager.Current.Actions.Vital[VitalType.CurrentMana];
|
||||
|
||||
int maxHealth = CoreManager.Current.Actions.Vital[VitalType.MaximumHealth];
|
||||
int maxStamina = CoreManager.Current.Actions.Vital[VitalType.MaximumStamina];
|
||||
int maxMana = CoreManager.Current.Actions.Vital[VitalType.MaximumMana];
|
||||
|
||||
int vitae = CoreManager.Current.CharacterFilter.Vitae;
|
||||
|
||||
// Create vitals data structure
|
||||
var vitalsData = new
|
||||
{
|
||||
type = "vitals",
|
||||
timestamp = DateTime.UtcNow.ToString("o"),
|
||||
character_name = CoreManager.Current.CharacterFilter.Name,
|
||||
health_current = currentHealth,
|
||||
health_max = maxHealth,
|
||||
health_percentage = maxHealth > 0 ? Math.Round((double)currentHealth / maxHealth * 100, 1) : 0,
|
||||
stamina_current = currentStamina,
|
||||
stamina_max = maxStamina,
|
||||
stamina_percentage = maxStamina > 0 ? Math.Round((double)currentStamina / maxStamina * 100, 1) : 0,
|
||||
mana_current = currentMana,
|
||||
mana_max = maxMana,
|
||||
mana_percentage = maxMana > 0 ? Math.Round((double)currentMana / maxMana * 100, 1) : 0,
|
||||
vitae = vitae
|
||||
};
|
||||
|
||||
// Send via WebSocket
|
||||
_ = WebSocket.SendVitalsAsync(vitalsData);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
WriteToChat($"Error sending vitals: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void CalculateKillsPerInterval()
|
||||
{
|
||||
double minutesElapsed = (DateTime.Now - statsStartTime).TotalMinutes;
|
||||
|
|
@ -969,6 +1028,7 @@ namespace MosswartMassacre
|
|||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
WriteToChat($"Unknown /mm command: {subCommand}. Try /mm help");
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue