コード例 #1
0
ファイル: Program.cs プロジェクト: duelqiuqiu/ygosharp
        public static void Main(string[] args)
        {
            #if !DEBUG
            try
            {
            #endif

                CoreConfig config = new CoreConfig();
                if (args.Length != 2 || !config.Load(args[0], args[1]))
                    return;

                BanlistManager.Init("lflist.conf");
                Api.Init();

                CoreServer server = new CoreServer(config);
                server.Start();
                while (server.IsRunning)
                {
                    server.Tick();
                    Thread.Sleep(1);
                }
            #if !DEBUG
            }
            catch (Exception ex)
            {
                File.WriteAllText("crash_" + DateTime.UtcNow.ToString("yyyy-MM-dd_HH-mm-ss") + ".txt", ex.ToString());
            }
            #endif
        }
コード例 #2
0
ファイル: Game.cs プロジェクト: Ygocore/ygosharp_v0.1.1
 public Game(CoreServer server, CoreConfig config) {
     Config = config;
     State = GameState.Lobby;
     IsMatch = config.Mode == 1;
     IsTag = config.Mode == 2;
     CurrentPlayer = 0;
     LifePoints = new int[2];
     Players = new Player[IsTag ? 4 : 2];
     CurPlayers = new Player[2];
     IsReady = new bool[IsTag ? 4 : 2];
     _handResult = new int[2];
     _timelimit = new int[2];
     _matchResult = new int[3];
     Observers = new List<Player>();
     if (config.LfList >= 0 && config.LfList < BanlistManager.Banlists.Count)
         Banlist = BanlistManager.Banlists[config.LfList];
     _server = server;
     _analyser = new GameAnalyser(this);
     ReloadGameConfig();
 }
コード例 #3
0
ファイル: CoreServer.cs プロジェクト: duelqiuqiu/ygosharp
 public CoreServer(CoreConfig config)
 {
     _clients = new List<CoreClient>();
     _removedClients = new List<CoreClient>();
     Config = config;
 }
コード例 #4
0
 public CoreServer(CoreConfig config)
 {
     _clients        = new List <CoreClient>();
     _removedClients = new List <CoreClient>();
     Config          = config;
 }