never ending staircase in mario 46

o
This commit is contained in:
Malloc of Kuzkycyziklistan 2017-08-29 15:14:44 -05:00
parent adb6c87a83
commit f548bbbfd0
5 changed files with 23 additions and 6 deletions

View file

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>CircleScape</title> <title>SockScape</title>
<link rel="stylesheet" type="text/css" href="style.css" /> <link rel="stylesheet" type="text/css" href="style.css" />
<meta charset="UTF-8" /> <meta charset="UTF-8" />

View file

@ -31,8 +31,11 @@ namespace SockScape {
MaxTotal = server["Max Users"] ?? Configuration.General["Max Users"] MaxTotal = server["Max Users"] ?? Configuration.General["Max Users"]
}; };
var serverHandle = new Server<PlayerConnection>((ushort)server["Port"], pool, server);
pools.Add(server["Id"], pool); pools.Add(server["Id"], pool);
servers.Add(server["Id"], new Server<PlayerConnection>((ushort)server["Port"], pool, server)); servers.Add(server["Id"], serverHandle);
serverHandle.Start();
} }
//var server = new Server<PlayerConnection>(6770, PoolManager.Pending); //var server = new Server<PlayerConnection>(6770, PoolManager.Pending);

View file

@ -119,6 +119,7 @@
</None> </None>
<None Include="connectionStrings.config"> <None Include="connectionStrings.config">
<DependentUpon>App.config</DependentUpon> <DependentUpon>App.config</DependentUpon>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="packages.config"> <None Include="packages.config">
<SubType>Designer</SubType> <SubType>Designer</SubType>

View file

@ -3,11 +3,13 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net.Sockets; using System.Net.Sockets;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace SockScape.Socks { namespace SockScape {
class MasterUdpClient { class MasterUdpClient {
private static UdpClient Sock; private static UdpClient Sock;
private static Thread ListeningThread;
private static bool IsOpen; private static bool IsOpen;
public static void Initialize() { public static void Initialize() {
@ -15,9 +17,19 @@ namespace SockScape.Socks {
return; return;
short port = (short) Configuration.General["Master Port"]; short port = (short) Configuration.General["Master Port"];
Sock = new UdpClient(port); Sock = new UdpClient(Configuration.General["Master Addr"], port);
IsOpen = true; IsOpen = true;
} }
public static void Listener() {
}
public static void Close() {
IsOpen = false;
ListeningThread.Join();
ListeningThread = null;
}
} }
} }

View file

@ -7,7 +7,7 @@ using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace SockScape.Socks { namespace SockScape {
static class MasterUdpServer { static class MasterUdpServer {
private static UdpClient Sock; private static UdpClient Sock;
private static Thread ListeningThread; private static Thread ListeningThread;
@ -18,7 +18,7 @@ namespace SockScape.Socks {
return; return;
short port = (short)Configuration.General["Master Port"]; short port = (short)Configuration.General["Master Port"];
Sock = new UdpClient(port); Sock = new UdpClient(new IPEndPoint(IPAddress.Any, port));
IsOpen = true; IsOpen = true;
ListeningThread = new Thread(Listener); ListeningThread = new Thread(Listener);
@ -39,6 +39,7 @@ namespace SockScape.Socks {
IsOpen = false; IsOpen = false;
ListeningThread.Join(); ListeningThread.Join();
ListeningThread = null; ListeningThread = null;
Sock.Dispose();
} }
} }
} }