public static void Init()
        {
            // waitingParties = new ConcurrentQueue<Party>();
            // simulationThreads = new List<Thread>();
            random = new Random((int)Stopwatch.GetTimestamp());

            // 전투 로직 초기화
            ContentsPrepare.Init();

            Debug.WriteLine("simulation manager is started");
        }
Exemplo n.º 2
0
        public TestModule(ITokenizer tokenizer)
            : base("/test")
        {
            Post["/"] = parameters =>
            {
                return("default");
            };

            Get["/simulation"] = parameters =>
            {
                ContentsPrepare.Init();

                Player[] player = { new Player(), new Player(), new Player() };

                var data = PlayerDataDatabase.GetPlayerData("102");
                if (data != null)
                {
                    player[0].LoadPlayer(data);
                }

                data = PlayerDataDatabase.GetPlayerData("103");
                if (data != null)
                {
                    player[1].LoadPlayer(data);
                }

                data = PlayerDataDatabase.GetPlayerData("104");
                if (data != null)
                {
                    player[2].LoadPlayer(data);
                }

                Party users = new Party(PartyType.PLAYER, 10);
                foreach (Player p in player)
                {
                    users.AddCharacter(p);
                }

                DungeonMaster newMaster = new DungeonMaster();
                newMaster.Init(60, 4, users);

                return("turn : " + newMaster.Start());
            };
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            ContentsPrepare.Init();

            var uri =
                new Uri("http://localhost:3579");

            HostConfiguration config = new HostConfiguration();

            config.UrlReservations.CreateAutomatically = true;

            using (var host = new NancyHost(config, uri))
            {
                host.Start();

                Console.WriteLine("Your application is running on " + uri);
                Console.WriteLine("Press any [Enter] to close the host.");

                // RedisManager.Test();
                Console.ReadLine();
            }
        }