aboutsummaryrefslogtreecommitdiff
path: root/source/WindowsFormsApplication1/Controls/Computer.cs
diff options
context:
space:
mode:
authorMichaelTheShifter <[email protected]>2016-06-25 21:22:46 -0400
committerMichaelTheShifter <[email protected]>2016-06-25 21:22:46 -0400
commit309f9fe361af7b0a508770951af7c548dfca78ad (patch)
treee4303c0d47e0daff6d61a6f934b1aa957e67f93d /source/WindowsFormsApplication1/Controls/Computer.cs
parent84f689b91a73e512b035df40bbcf556b008a3b81 (diff)
downloadshiftos-c-_theultimatehacker-309f9fe361af7b0a508770951af7c548dfca78ad.tar.gz
shiftos-c-_theultimatehacker-309f9fe361af7b0a508770951af7c548dfca78ad.tar.bz2
shiftos-c-_theultimatehacker-309f9fe361af7b0a508770951af7c548dfca78ad.zip
Added online Hacker Battles with matchmaking system
It's untested, but in theory it'll all work perfectly.
Diffstat (limited to 'source/WindowsFormsApplication1/Controls/Computer.cs')
-rw-r--r--source/WindowsFormsApplication1/Controls/Computer.cs5
1 files changed, 5 insertions, 0 deletions
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;