From 309f9fe361af7b0a508770951af7c548dfca78ad Mon Sep 17 00:00:00 2001 From: MichaelTheShifter Date: Sat, 25 Jun 2016 21:22:46 -0400 Subject: Added online Hacker Battles with matchmaking system It's untested, but in theory it'll all work perfectly. --- source/WindowsFormsApplication1/Controls/Computer.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/WindowsFormsApplication1/Controls') diff --git a/source/WindowsFormsApplication1/Controls/Computer.cs b/source/WindowsFormsApplication1/Controls/Computer.cs index 8f849d3..1d287f8 100644 --- a/source/WindowsFormsApplication1/Controls/Computer.cs +++ b/source/WindowsFormsApplication1/Controls/Computer.cs @@ -14,6 +14,8 @@ namespace ShiftOS { public int TotalHP = 100; + public Online.Hacking.NetTransmitter Transmitter = null; + public Computer() { InitializeComponent(); @@ -24,6 +26,7 @@ namespace ShiftOS public void Repair(int hp) { this._HP += hp; + Transmitter?.send_message(Online.Hacking.NetTransmitter.Messages.SetHealth, $"{Hostname} {_HP}"); var h = OnRepair; if(h != null) { @@ -175,6 +178,7 @@ namespace ShiftOS } else { this._HP -= amount / DamageDefector; + Transmitter?.send_message(Online.Hacking.NetTransmitter.Messages.SetHealth, $"{Hostname} {_HP}"); EventHandler handler = HP_Decreased; if (handler != null) { @@ -187,6 +191,7 @@ namespace ShiftOS public void Disable() { + Transmitter?.send_message(Online.Hacking.NetTransmitter.Messages.Disabled, $"{Hostname}"); var t = new Timer(); t.Interval = 1000; int i = 0; -- cgit v1.2.3