2017-04-25 21:01:41 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2017-08-22 20:59:41 +00:00
|
|
|
|
using System.Configuration;
|
2017-08-23 21:00:44 +00:00
|
|
|
|
using System.Data.Entity;
|
2017-04-25 21:01:41 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2017-06-05 12:20:39 +00:00
|
|
|
|
//using CircleScape.DAL;
|
2017-05-16 21:17:07 +00:00
|
|
|
|
using System.Numerics;
|
2017-07-22 19:27:41 +00:00
|
|
|
|
using Glove;
|
2017-06-06 21:13:25 +00:00
|
|
|
|
using System.Net;
|
2017-06-16 21:00:01 +00:00
|
|
|
|
using Kneesocks;
|
2017-08-23 21:00:44 +00:00
|
|
|
|
using MySql.Data.Entity;
|
2017-04-21 21:04:03 +00:00
|
|
|
|
|
2017-07-22 19:27:41 +00:00
|
|
|
|
namespace SockScape {
|
2017-04-21 21:04:03 +00:00
|
|
|
|
class Entrypoint {
|
|
|
|
|
static void Main(string[] args) {
|
2017-08-23 21:00:44 +00:00
|
|
|
|
DbConfiguration.SetConfiguration(new MySqlEFConfiguration());
|
2017-08-22 20:59:41 +00:00
|
|
|
|
var db = new DAL.ScapeDb();
|
|
|
|
|
var a = db.Users.ToList();
|
|
|
|
|
|
2017-06-08 21:01:34 +00:00
|
|
|
|
Dictionary<int, Server> servers
|
|
|
|
|
= new Dictionary<int, Server>();
|
|
|
|
|
Dictionary<int, Pool<PlayerConnection>> pools
|
|
|
|
|
= new Dictionary<int, Pool<PlayerConnection>>();
|
|
|
|
|
|
|
|
|
|
foreach(var server in Configuration.Servers) {
|
|
|
|
|
var pool = new Pool<PlayerConnection> {
|
|
|
|
|
InitialCount = 3,
|
|
|
|
|
InitialSize = 3,
|
|
|
|
|
SizeGrowth = 3,
|
2017-08-16 21:01:08 +00:00
|
|
|
|
MaxSize = 100,
|
|
|
|
|
MaxTotal = server["Max Users"] ?? Configuration.General["Max Users"]
|
2017-06-08 21:01:34 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
pools.Add(server["Id"], pool);
|
|
|
|
|
servers.Add(server["Id"], new Server<PlayerConnection>((ushort)server["Port"], pool, server));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//var server = new Server<PlayerConnection>(6770, PoolManager.Pending);
|
|
|
|
|
//server.Start();
|
2017-05-04 12:21:27 +00:00
|
|
|
|
|
2017-05-25 21:08:21 +00:00
|
|
|
|
/*while(true) {
|
2017-05-11 21:03:28 +00:00
|
|
|
|
var send = Console.ReadLine();
|
|
|
|
|
PoolManager.Pending.Broadcast(Encoding.UTF8.GetBytes(send));
|
|
|
|
|
|
2017-05-04 21:09:38 +00:00
|
|
|
|
// logic processing loop
|
2017-05-25 21:08:21 +00:00
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
Console.ReadLine();
|
2017-05-12 21:05:18 +00:00
|
|
|
|
|
2017-06-08 21:01:34 +00:00
|
|
|
|
//server.Stop();
|
2017-04-21 21:04:03 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|