1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-16 23:26:32 +09:00

ManySample added, for now

This commit is contained in:
lidgren
2010-06-26 21:11:07 +00:00
parent 5857f9b92d
commit 80c8fa61ec
23 changed files with 1544 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);
}
}
}