예제 #1
0
    void Start()
    {
        actualPhase  = (int)Phase.Event;
        cameraPos    = Camera.main.transform;
        eventManager = GetComponent <Events>();
        BoothInfo    = GetComponent <Booths>();
        Debug.Log(BoothInfo);
        diceFinished = true;
        firstTurn    = true;
        isFinish     = false;
        park         = (GameObject)Resources.Load("Joueur");
        panelFound   = false;
        board        = GameObject.Find("Board");
        tempList     = board.GetComponentsInChildren <ParcManager>();
        faceUpBooths = BoothInfo.getFaceUpBooths(3);


        for (int i = 0; i < playerNumber; i++)
        {
            Debug.Log("Player created! :D");

            instanciatedObject = (GameObject)Instantiate(park, new Vector3(cameraPos.position.x + 2, cameraPos.position.y - 6, cameraPos.position.z - 2), Quaternion.identity);
            instanciatedObject.transform.parent = board.transform;
            instanciatedObject.name             = "Player_" + i;

            playerList.Add(instanciatedObject.GetComponent <ParcManager>());
            playerList[i].setID(i + 1);
        }

        StartCoroutine(gameTurn());
    }
예제 #2
0
        void SeedParties()
        {
            var party1 = new Booths(2, 10, 1, 5, 8, new DateTime(2020, 5, 8));
            var party2 = new Booths(9, 2, 3, 2, 4, new DateTime(2018, 10, 8));
            var party3 = new Booths(1, 5, 8, 2, 9, new DateTime(2019, 12, 13));
            var party4 = new Booths(2, 3, 2, 4, 2, new DateTime(2018, 12, 8));

            _parties.AddParty(party1);
            _parties.AddParty(party2);
            _parties.AddParty(party3);
            _parties.AddParty(party4);
        }
예제 #3
0
        void NewParty()
        {
            Console.Clear();
            bool addParty             = false;
            bool choosePartyDate      = false;
            bool howManyHotDogs       = false;
            bool howManyHamburgers    = false;
            bool howManyVeggieburgers = false;
            bool howManyPopCorn       = false;
            bool howManyIcecream      = false;
            bool chooseChanges        = false;
            bool makeChanges          = false;
            var  newParty             = new Booths();

            while (addParty == false)
            {
                chooseChanges = false;
                while (choosePartyDate == false)
                {
                    choosePartyDate = true;
                    Console.WriteLine("Please enter the date of the party (mm/dd/yyyy)");
                    try
                    {
                        newParty.DateOfParty = DateTime.Parse(Console.ReadLine());
                        Console.Clear();
                    }
                    catch (Exception)
                    {
                        Console.Clear();
                        Console.WriteLine("Please enter a valid date. (mm/dd/yyyy)\n" +
                                          "Press any key to continue...");
                        Console.ReadKey();
                        Console.Clear();
                        choosePartyDate = false;
                    }
                }
                while (howManyHotDogs == false)
                {
                    howManyHotDogs = true;
                    Console.WriteLine("How many hotdog tickets did you collect?");
                    try
                    {
                        newParty.HowManyHotDogs = int.Parse(Console.ReadLine());
                        Console.Clear();
                    }
                    catch (Exception)
                    {
                        Console.Clear();
                        Console.WriteLine("Please enter a valid number.\n" +
                                          "Press any key to continue...");
                        Console.ReadKey();
                        Console.Clear();
                        howManyHotDogs = false;
                    }
                }
                while (howManyHamburgers == false)
                {
                    howManyHamburgers = true;
                    Console.WriteLine("How many hamburger tickets did you collect?");
                    try
                    {
                        newParty.HowManyHamburgers = int.Parse(Console.ReadLine());
                        Console.Clear();
                    }
                    catch (Exception)
                    {
                        Console.Clear();
                        Console.WriteLine("Please enter a valid number.\n" +
                                          "Press any key to continue...");
                        Console.ReadKey();
                        Console.Clear();
                        howManyVeggieburgers = false;
                    }
                }
                while (howManyVeggieburgers == false)
                {
                    howManyVeggieburgers = true;
                    Console.WriteLine("How many veggieburger tickets did you collect?");
                    try
                    {
                        newParty.HowManyVeggieburgers = int.Parse(Console.ReadLine());
                        Console.Clear();
                    }
                    catch (Exception)
                    {
                        Console.Clear();
                        Console.WriteLine("Please enter a valid number.\n" +
                                          "Press any key to continue...");
                        Console.ReadKey();
                        Console.Clear();
                        howManyVeggieburgers = false;
                    }
                }
                while (howManyPopCorn == false)
                {
                    howManyPopCorn = true;
                    Console.WriteLine("How many popcorn tickets did you collect?");
                    try
                    {
                        newParty.HowManyPopcorns = int.Parse(Console.ReadLine());
                        Console.Clear();
                    }
                    catch (Exception)
                    {
                        Console.Clear();
                        Console.WriteLine("Please enter a valid number.\n" +
                                          "Press any key to continue...");
                        Console.ReadKey();
                        Console.Clear();
                        howManyPopCorn = false;
                    }
                }
                while (howManyIcecream == false)
                {
                    howManyIcecream = true;
                    Console.WriteLine("How many icecream tickets did you collect?");
                    try
                    {
                        newParty.HowManyIcecream = int.Parse(Console.ReadLine());
                        Console.Clear();
                    }
                    catch (Exception)
                    {
                        Console.Clear();
                        Console.WriteLine("Please enter a valid number.\n" +
                                          "Press any key to continue...");
                        Console.ReadKey();
                        Console.Clear();
                        howManyIcecream = false;
                    }
                }
                while (chooseChanges == false)
                {
                    chooseChanges = true;

                    Console.WriteLine("Please review the information for the new customer\n");
                    newParty.PrintProps();
                    Console.WriteLine();
                    Console.WriteLine("Would you like to make any changes?(y/n)");
                    string changesAnswer = Console.ReadLine().ToLower();
                    switch (changesAnswer)
                    {
                    case "y":
                        makeChanges = true;
                        break;

                    case "n":
                        addParty = true;
                        break;

                    default:
                        Console.Clear();
                        Console.WriteLine("Invalid selection. \nPress any key to continue...");
                        Console.ReadKey();
                        Console.Clear();
                        chooseChanges = false;
                        break;
                    }
                }
                Console.Clear();
                while (makeChanges == true)
                {
                    makeChanges = false;
                    Console.WriteLine($"What property would you like to change? Or select 7 to add the new party.\n");
                    newParty.PrintProps();
                    Console.WriteLine("7. Continue");
                    string propertyAnswer = Console.ReadLine().ToLower();
                    switch (propertyAnswer)
                    {
                    case "1":
                        choosePartyDate = false;
                        Console.Clear();
                        break;

                    case "2":
                        howManyHotDogs = false;
                        Console.Clear();
                        break;

                    case "3":
                        howManyHamburgers = false;
                        Console.Clear();
                        break;

                    case "4":
                        howManyVeggieburgers = false;
                        Console.Clear();
                        break;

                    case "5":
                        howManyPopCorn = false;
                        Console.Clear();
                        break;

                    case "6":
                        howManyIcecream = false;
                        Console.Clear();
                        break;

                    case "7":
                        addParty = true;
                        Console.Clear();
                        break;

                    default:
                        Console.Clear();
                        Console.WriteLine("Invalid selection. \nPress any key to continue...");
                        Console.ReadKey();
                        Console.Clear();
                        makeChanges = true;
                        break;
                    }
                }
            }
            if (addParty == true)
            {
                _parties.AddParty(newParty);
                Console.Clear();
                Console.WriteLine($"You have successfully added the party.");
                Console.WriteLine("Press any key to return to menu...");
                Console.ReadKey();
                Console.Clear();
            }
        }
예제 #4
0
        void PartyStats()
        {
            ListParties();
            Console.WriteLine();
            Console.WriteLine("Type the date of the party you would like to see more stats for (mm/dd/yyyy)");
            DateTime partyDate = new DateTime();

            try
            {
                partyDate = DateTime.Parse(Console.ReadLine());
                Console.Clear();
            }
            catch { }
            var party = new Booths();

            party = _parties.GetPartyByDate(partyDate);
            bool viewCalcs = true;

            while (viewCalcs == true && party != null)
            {
                viewCalcs = false;
                Console.WriteLine("What kind of stat would you like to see?");
                Console.WriteLine("1. Costs");
                Console.WriteLine("2. Tickets");
                Console.WriteLine("3. Main Menu ");
                string calcChoice = Console.ReadLine();
                Console.Clear();
                switch (calcChoice)
                {
                case "1":
                    Console.WriteLine("Costs:");
                    Console.WriteLine($"Total:             ${party.TotalCost}\n");
                    Console.WriteLine($"Burger Booth:      ${party.BurgerBoothCost}");
                    Console.WriteLine($"Hotdogs:           ${party.HotDogCost}");
                    Console.WriteLine($"Hamburgers:        ${party.HamburgerCost}");
                    Console.WriteLine($"Veggieburger:      ${party.VeggieburgerCost}");
                    Console.WriteLine($"Misc Burger Costs: ${party.MiscBurgerCost}\n");
                    Console.WriteLine($"Treat Booth:       ${party.TreatBoothCost}");
                    Console.WriteLine($"Popcorn:           ${party.PopCornCost}");
                    Console.WriteLine($"Icecream:          ${party.IceCreamCost}");
                    Console.WriteLine($"Misc Treat Costs:  ${party.MiscTreatCost}\n");
                    Console.WriteLine("Press any key to continue...");
                    Console.ReadKey();
                    viewCalcs = true;
                    Console.Clear();

                    break;

                case "2":
                    Console.WriteLine("Tickets:");
                    Console.WriteLine($"Total:        {party.TotalTickets}\n");
                    Console.WriteLine($"Burger Booth: {party.HowManyBurgerBoothTickets}");
                    Console.WriteLine($"Hotdogs:      {party.HowManyHotDogs}");
                    Console.WriteLine($"Hamburgers:   {party.HowManyHamburgers}");
                    Console.WriteLine($"Veggieburger: {party.HowManyVeggieburgers}\n");
                    Console.WriteLine($"Treat Booth:  {party.HowManyTreatBoothTickets}");
                    Console.WriteLine($"Popcorn:      {party.HowManyPopcorns}");
                    Console.WriteLine($"Icecream:     {party.HowManyIcecream}");
                    Console.WriteLine("Press any key to continue...");
                    Console.ReadKey();
                    viewCalcs = true;
                    Console.Clear();
                    break;

                case "3":
                    break;

                default:
                    Console.Clear();
                    Console.WriteLine("Invalid selection. \nPress any key to continue...");
                    Console.ReadKey();
                    Console.Clear();
                    viewCalcs = true;
                    break;
                }
            }
            if (party == null)
            {
                Console.Clear();
                Console.WriteLine("Cannot find that party");
                Console.WriteLine("Press any key to return to menu...");
                Console.ReadKey();
                Console.Clear();
            }
        }
예제 #5
0
파일: Mains.cs 프로젝트: iodz37/Iodz
        public static void LoadServer(bool KnowConfig)
        {
            Time32 Start = Time32.Now;

            RandomSeed    = Convert.ToInt32(DateTime.Now.Ticks.ToString().Remove(DateTime.Now.Ticks.ToString().Length / 2));
            Console.Title = "Conquord Is Loading...";
            Kernel.Random = new FastRandom(RandomSeed);
            if (!KnowConfig)
            {
                ConquordDBName = "test";
                ConquordDBPass = "******";
                ConquordIP     = "149.202.128.35";
            }
            System.Console.ForegroundColor = ConsoleColor.DarkGray;
            IntPtr hWnd = FindWindow(null, Console.Title);

            System.Console.WriteLine(@"      `       ______                                       __   `     `      ");
            System.Console.WriteLine(@"             / ____/___  ____  ____ ___  ______  _________/ /                ");
            System.Console.WriteLine(@"        `   / /   / __ \/ __ \/ __ `/ / / / __ \/ ___/ __  /  `      `    _  ");
            System.Console.WriteLine(@"          _/ /___/ /_/ / / / / /_/ / /_/ / /_/ / /  / /_/ /              | | ");
            System.Console.WriteLine(@"   `       \____/\____/_/ /_/\__, /\__,_/\____/_/   \__,_/        `   ___| | ");
            System.Console.WriteLine(@"         `                     /_/            `               `      (    .' ");
            System.Console.WriteLine(@" __        ...       _____ Michael Nashaat _____        ...       __  )  (   ");
            System.Console.WriteLine();
            System.Console.WriteLine(@"                  Copyright (c) Conquord Project 2015-2016.                  ");
            Console.BackgroundColor        = ConsoleColor.Black;
            System.Console.ForegroundColor = ConsoleColor.DarkGray;
            Database.DataHolder.CreateConnection(ConquordDBName, ConquordDBPass);
            Database.EntityTable.EntityUID = new Counter(0);
            new MySqlCommand(MySqlCommandType.UPDATE).Update("entities").Set("Online", 0).Execute();
            using (MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT))
            {
                cmd.Select("configuration");
                using (MySqlReader r = new MySqlReader(cmd))
                {
                    if (r.Read())
                    {
                        if (!KnowConfig)
                        {
                            ConquordIP = r.ReadString("ConquordIP");
                            GamePort   = 5816;
                            AuthPort   = r.ReadUInt16("ConquordPort");
                        }
                        Database.EntityTable.EntityUID = new Counter(r.ReadUInt32("EntityID"));
                        if (Database.EntityTable.EntityUID.Now == 0)
                        {
                            Database.EntityTable.EntityUID.Now = 1;
                        }
                        Union.UnionCounter   = new Counter(r.ReadUInt32("UnionID"));
                        Kernel.ServerKingdom = (r.ReadUInt32("ServerKingdom"));
                        if (r.ReadByte("LastDailySignReset") != DateTime.Now.Month)
                        {
                            MsgSignIn.Reset();
                        }
                        Game.ConquerStructures.Society.Guild.GuildCounter = new Conquord.Counter(r.ReadUInt32("GuildID"));
                        Network.GamePackets.ConquerItem.ItemUID           = new Conquord.Counter(r.ReadUInt32("ItemUID"));
                        Constants.ExtraExperienceRate   = r.ReadUInt32("ExperienceRate");
                        Constants.ExtraSpellRate        = r.ReadUInt32("SpellExperienceRate");
                        Constants.ExtraProficiencyRate  = r.ReadUInt32("ProficiencyExperienceRate");
                        Constants.MoneyDropRate         = r.ReadUInt32("MoneyDropRate");
                        Constants.ConquerPointsDropRate = r.ReadUInt32("ConquerPointsDropRate");
                        Constants.ItemDropRate          = r.ReadUInt32("ItemDropRate");
                        Constants.ItemDropQualityRates  = r.ReadString("ItemDropQualityString").Split('~');
                        Database.EntityVariableTable.Load(0, out Vars);
                    }
                }
            }
            using (var cmd = new MySqlCommand(MySqlCommandType.UPDATE).Update("configuration"))
                cmd.Set("LastDailySignReset", DateTime.Now.Month).Execute();
            Database.JiangHu.LoadStatus();
            Database.JiangHu.LoadJiangHu();
            Console.WriteLine("JiangHu Loaded.");
            Way2Heroes.Load();
            QuestInfo.Load();
            AuctionBase.Load();
            Database.DataHolder.ReadStats();
            Conquord.Soul.SoulProtection.Load();
            Database.PerfectionTable.Load();
            Console.WriteLine("Perfection Loaded.");
            Database.LotteryTable.Load();
            Database.ConquerItemTable.ClearNulledItems();
            Database.ConquerItemInformation.Load();
            Console.WriteLine("Items Loaded.");
            Database.GameUpdetess.LoadRates();
            Database.MonsterInformation.Load();
            Database.IPBan.Load();
            Database.SpellTable.Load();
            Database.ShopFile.Load();
            Database.HonorShop.Load();
            Database.RacePointShop.Load();
            Database.ChampionShop.Load();
            Database.EShopFile.Load();
            Database.EShopV2File.Load();
            Console.WriteLine("Shops Loaded.");
            Database.MapsTable.Load();
            Database.Flowers.LoadFlowers();
            Database.Flowers.SaveFlowers();
            Console.WriteLine("Flowers Systems Loaded.");
            Database.NobilityTable.Load();
            Database.ArenaTable.Load();
            Database.TeamArenaTable.Load();
            Database.GuildTable.Load();
            Database.ChiTable.LoadAllChi();
            Console.WriteLine("Social Systems Loaded.");
            Refinery.LoadItems();
            StorageManager.Load();
            UnionTable.Load();
            Console.WriteLine("Union Loaded.");
            World = new World();
            World.Init();
            Database.Statue.Load();
            Console.WriteLine("Tops And Quests Loaded.");
            Database.PoketTables.LoadTables();
            Database.InnerPowerTable.LoadDBInformation();
            Database.InnerPowerTable.Load();
            Console.WriteLine("InnerPower Loaded.");
            Map.CreateTimerFactories();
            Database.SignInTable.Load();
            Database.DMaps.Load();
            Console.WriteLine("Maps Loaded.");
            Game.Screen.CreateTimerFactories();
            World.CreateTournaments();
            Game.GuildWar.Initiate();
            Game.ClanWar.Initiate();
            Game.Tournaments.SkillTournament.LoadSkillTop8();
            Game.Tournaments.TeamTournament.LoadTeamTop8();
            Clan.LoadClans();
            Game.EliteGuildWar.EliteGwint();
            Console.WriteLine("Guilds and Clans loaded.");
            Booths.Load();
            Console.WriteLine("Booths Loaded.");

            Database.FloorItemTable.Load();
            Database.ReincarnationTable.Load();
            new MsgUserAbilityScore().GetRankingList();
            new MsgEquipRefineRank().UpdateRanking();
            PrestigeRank.LoadRanking();
            Console.WriteLine("Ranks Loaded.");
            BruteForceProtection.CreatePoll();
            Console.WriteLine("Protection System On.");
            {
                Client.GameClient gc = new Client.GameClient(new ClientWrapper());
                gc.Account      = new AccountTable("NONE");
                gc.Socket.Alive = false;
                gc.Entity       = new Entity(EntityFlag.Player, false)
                {
                    Name = "NONE"
                };
                Npcs.GetDialog(new NpcRequest(), gc, true);
            }
            #region OpenSocket
            Network.Cryptography.AuthCryptography.PrepareAuthCryptography();
            AuthServer = new ServerSocket();
            AuthServer.OnClientConnect    += AuthServer_OnClientConnect;
            AuthServer.OnClientReceive    += AuthServer_OnClientReceive;
            AuthServer.OnClientDisconnect += AuthServer_OnClientDisconnect;
            AuthServer.Enable(AuthPort, "0.0.0.0");
            GameServer = new ServerSocket();
            GameServer.OnClientConnect    += GameServer_OnClientConnect;
            GameServer.OnClientReceive    += GameServer_OnClientReceive;
            GameServer.OnClientDisconnect += GameServer_OnClientDisconnect;
            GameServer.Enable(GamePort, "0.0.0.0");
            #endregion
            Console.WriteLine("Server loaded iN : " + (Time32.Now - Start) + " MilliSeconds.");
            ConquordHandler += ConquordConsole_CloseEvent;
            Native.SetConsoleCtrlHandler(ConquordHandler, true);
            GC.Collect();
            WorkConsole();
        }