1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-15 22:56:30 +09:00

ManySample added

This commit is contained in:
lidgren
2010-11-03 10:39:14 +00:00
parent 6a30a00172
commit 6c3f5447a9
24 changed files with 1571 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using SamplesCommon;
namespace ManyClients
{
static class Program
{
public static List<Client> Clients;
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Clients = new List<Client>();
Application.Idle += new EventHandler(AppIdle);
Application.Run(new Form1());
foreach (var c in Clients)
c.Shutdown();
}
static void AppIdle(object sender, EventArgs e)
{
while (NativeMethods.AppStillIdle)
{
foreach (var c in Clients)
c.Heartbeat();
System.Threading.Thread.Sleep(1);
}
}
internal static void CreateClient()
{
Client client = new Client();
client.Show();
Clients.Add(client);
}
}
}