aboutsummaryrefslogtreecommitdiff
path: root/source/WindowsFormsApplication1/Apps/NetworkBrowser.cs
diff options
context:
space:
mode:
authorMichaelTheShifter <[email protected]>2016-06-26 20:16:27 -0400
committerMichaelTheShifter <[email protected]>2016-06-26 20:16:27 -0400
commita067684f084c6fce5e7d7d8140a2d2f56953b579 (patch)
tree8c0ef62c61b1a3781a7713b55b30628385515abb /source/WindowsFormsApplication1/Apps/NetworkBrowser.cs
parent5916d35ac089542cbe03faa74838e62d2755faf5 (diff)
downloadshiftos-c-_theultimatehacker-a067684f084c6fce5e7d7d8140a2d2f56953b579.tar.gz
shiftos-c-_theultimatehacker-a067684f084c6fce5e7d7d8140a2d2f56953b579.tar.bz2
shiftos-c-_theultimatehacker-a067684f084c6fce5e7d7d8140a2d2f56953b579.zip
Minor server contact layer changes for online battles.
Diffstat (limited to 'source/WindowsFormsApplication1/Apps/NetworkBrowser.cs')
-rw-r--r--source/WindowsFormsApplication1/Apps/NetworkBrowser.cs27
1 files changed, 17 insertions, 10 deletions
diff --git a/source/WindowsFormsApplication1/Apps/NetworkBrowser.cs b/source/WindowsFormsApplication1/Apps/NetworkBrowser.cs
index 4662cb8..58dd811 100644
--- a/source/WindowsFormsApplication1/Apps/NetworkBrowser.cs
+++ b/source/WindowsFormsApplication1/Apps/NetworkBrowser.cs
@@ -387,25 +387,32 @@ Those above values only matter if the leader decides to become a friend. If they
{
lbonlineservers.Hide();
API.CurrentSave.MyOnlineNetwork.Codepoints = API.Codepoints;
- Package_Grabber.SendMessage(selected_server.IPAddress, "join_lobby", API.CurrentSave.MyOnlineNetwork);
+ Package_Grabber.SendMessage(selected_server.IPAddress, $"join_lobby {JsonConvert.SerializeObject(API.CurrentSave.MyOnlineNetwork)}");
Online.Hacking.Matchmaker.Matchmake(selected_server);
var t = new System.Windows.Forms.Timer();
t.Interval = 5000;
int sindex = 0;
t.Tick += (o, a) =>
{
- SetupSidePane(Online.Hacking.Matchmaker.Players[sindex]);
- if (Matchmaker.Players.Count > 1)
+ try
{
- if (sindex < Online.Hacking.Matchmaker.Players.Count - 1)
+ SetupSidePane(Online.Hacking.Matchmaker.Players[sindex]);
+ if (Matchmaker.Players.Count > 1)
{
- sindex = 0;
- }
- else
- {
- sindex += 1;
+ if (sindex < Online.Hacking.Matchmaker.Players.Count - 1)
+ {
+ sindex = 0;
+ }
+ else
+ {
+ sindex += 1;
+ }
}
}
+ catch
+ {
+
+ }
};
t.Start();
}
@@ -437,7 +444,7 @@ If you see this happen, it's a phantom client. The server won't pair you with it
{
if(selected_server != null)
{
- Package_Grabber.SendMessage(selected_server.IPAddress, $"leave_lobby", API.CurrentSave.MyOnlineNetwork);
+ Package_Grabber.SendMessage(selected_server.IPAddress, $"leave_lobby {JsonConvert.SerializeObject(API.CurrentSave.MyOnlineNetwork)}");
}
}