コード例 #1
0
        public static void ServerStart(string str)
        {
            Console.WriteLine("Loading Data Access Objects.\n"
                              + "-------------------------------------------");

            DAOManager.Initialize(str);

            Console.WriteLine("Loading Data Files.\n"
                              + "-------------------------------------------");

            Data.Data.LoadAll();
            Data.Cache.LoadData();

            StatsService.Init();
            GeoService.Init();
            MapService.Init();
            QuestEngine.Init();
            SkillEngine.Init();
            ActionEngine.Init();
            SkillsLearnService.Init();
            AreaService.Init();
            GuildService.Init();

            InitMainLoop();
        }
コード例 #2
0
        public static void BuySkill(Player player, int skillId, bool isActive)
        {
            if (player == null)
            {
                return;
            }

            SkillsLearnService.BuySkill(player, skillId, isActive);
        }
コード例 #3
0
ファイル: PlayerLogic.cs プロジェクト: wgq4812/revcore
        public static void CreateCharacter(IConnection connection, PlayerData playerData)
        {
            if (connection.Account.Players.Count >= 5)
            {
                FeedbackService.SendCreateCharacterResult(connection, false);
            }

            Player player = PlayerService.CreateCharacter(connection, playerData);

            StorageService.AddStartItemsToPlayer(player);
            SkillsLearnService.AddStartPlayerAbility(player);

            FeedbackService.SendCreateCharacterResult(connection, true);
        }
コード例 #4
0
        public static void ServerStart()
        {
            Data.Data.LoadAll();
            Data.Cache.LoadData();

            StatsService.Init();
            GeoService.Init();
            MapService.Init();
            QuestEngine.Init();
            SkillEngine.Init();
            ActionEngine.Init();
            SkillsLearnService.Init();
            AreaService.Init();
            GuildService.Init();

            InitMainLoop();
        }
コード例 #5
0
        private static void RunServer()
        {
            Data.Data.DataPath = "data/";

            Stopwatch sw = Stopwatch.StartNew();

            AppDomain.CurrentDomain.UnhandledException += UnhandledException;

            Console.WriteLine("----===== Tera-Project C# GameServer Emulator =====----\n\n");
            Console.WriteLine("Starting Game Server!\n"
                              + "-------------------------------------------");

            TcpServer = new TcpServer("*", Config.GetServerPort(), Config.GetServerMaxCon());
            Connection.SendAllThread.Start();

            OpCodes.Init();
            Console.WriteLine("OpCodes - Revision 1725 initialized!\n"
                              + "-------------------------------------------\n");

            #region global_components

            //services
            FeedbackService    = new FeedbackService();
            AccountService     = new AccountService();
            PlayerService      = new PlayerService();
            MapService         = new MapService();
            ChatService        = new ChatService();
            VisibleService     = new VisibleService();
            ControllerService  = new ControllerService();
            CraftService       = new CraftService();
            ItemService        = new ItemService();
            AiService          = new AiService();
            GeoService         = new GeoService();
            StatsService       = new StatsService();
            ObserverService    = new ObserverService();
            AreaService        = new AreaService();
            InformerService    = new InformerService();
            TeleportService    = new TeleportService();
            PartyService       = new PartyService();
            SkillsLearnService = new SkillsLearnService();
            CraftLearnService  = new CraftLearnService();
            GuildService       = new GuildService();
            EmotionService     = new EmotionService();
            RelationService    = new RelationService();
            DuelService        = new DuelService();
            StorageService     = new StorageService();
            TradeService       = new TradeService();
            MountService       = new MountService();

            //engines
            ActionEngine = new ActionEngine.ActionEngine();
            AdminEngine  = new AdminEngine.AdminEngine();
            SkillEngine  = new SkillEngine.SkillEngine();
            QuestEngine  = new QuestEngine.QuestEngine();

            #endregion

            GlobalLogic.ServerStart("SERVER=" + Config.GetDatabaseHost() + ";DATABASE=" + Config.GetDatabaseName() + ";UID=" + Config.GetDatabaseUser() + ";PASSWORD="******";PORT=" + Config.GetDatabasePort() + ";charset=utf8");

            Console.WriteLine("-------------------------------------------\n"
                              + "Loading Tcp Service.\n"
                              + "-------------------------------------------");
            TcpServer.BeginListening();

            try
            {
                ServiceApplication = ScsServiceBuilder.CreateService(new ScsTcpEndPoint(23232));
                ServiceApplication.AddService <IInformerService, InformerService>((InformerService)InformerService);
                ServiceApplication.Start();
                Log.Info("InformerService started at *:23232.");

                var webservices = new ServiceManager();
                webservices.Run();
            }
            catch (Exception ex)
            {
                Log.ErrorException("InformerService can not be started.", ex);
            }

            sw.Stop();
            Console.WriteLine("-------------------------------------------");
            Console.WriteLine("           Server start in {0}", (sw.ElapsedMilliseconds / 1000.0).ToString("0.00s"));
            Console.WriteLine("-------------------------------------------");
        }
コード例 #6
0
ファイル: GameServer.cs プロジェクト: uvbs/TeraEmulator_1725
        private static void RunServer()
        {
            //Start ServerStartTime
            Stopwatch serverStartStopwatch = Stopwatch.StartNew();

            AppDomain.CurrentDomain.UnhandledException += UnhandledException;

            //CheckServerMode
            CheckServerMode();

            //ConsoleOutput-Infos
            PrintServerLicence();
            PrintServerInfo();

            //Initialize TcpServer
            TcpServer = new TcpServer("*", Configuration.Network.GetServerPort(), Configuration.Network.GetServerMaxCon());
            Connection.SendAllThread.Start();

            //Initialize Server OpCodes
            OpCodes.Init();
            Console.WriteLine("----------------------------------------------------------------------------\n"
                              + "---===== OpCodes - Revision: " + OpCodes.Version + " EU initialized!");

            //Global Services
            #region global_components
            //Services
            FeedbackService    = new FeedbackService();
            AccountService     = new AccountService();
            PlayerService      = new PlayerService();
            MapService         = new MapService();
            ChatService        = new ChatService();
            VisibleService     = new VisibleService();
            ControllerService  = new ControllerService();
            CraftService       = new CraftService();
            ItemService        = new ItemService();
            AiService          = new AiService();
            GeoService         = new GeoService();
            StatsService       = new StatsService();
            ObserverService    = new ObserverService();
            AreaService        = new AreaService();
            TeleportService    = new TeleportService();
            PartyService       = new PartyService();
            SkillsLearnService = new SkillsLearnService();
            CraftLearnService  = new CraftLearnService();
            GuildService       = new GuildService();
            EmotionService     = new EmotionService();
            RelationService    = new RelationService();
            DuelService        = new DuelService();
            StorageService     = new StorageService();
            TradeService       = new TradeService();
            MountService       = new MountService();

            //Engines
            ActionEngine = new ActionEngine.ActionEngine();
            AdminEngine  = new AdminEngine.AdminEngine();
            SkillEngine  = new SkillEngine.SkillEngine();
            QuestEngine  = new QuestEngine.QuestEngine();
            #endregion

            //Set SqlDatabase Connection
            GlobalLogic.ServerStart("SERVER=" + DAOManager.MySql_Host + ";DATABASE=" + DAOManager.MySql_Database + ";UID=" + DAOManager.MySql_User + ";PASSWORD="******";PORT=" + DAOManager.MySql_Port + ";charset=utf8");
            Console.ForegroundColor = ConsoleColor.Gray;

            //Start Tcp-Server Listening
            Console.WriteLine("----------------------------------------------------------------------------\n"
                              + "---===== Loading GameServer Service.\n"
                              + "----------------------------------------------------------------------------");
            TcpServer.BeginListening();

            //Stop ServerStartTime
            serverStartStopwatch.Stop();
            Console.WriteLine("----------------------------------------------------------------------------");
            Console.WriteLine("---===== GameServer start in {0}", (serverStartStopwatch.ElapsedMilliseconds / 1000.0).ToString("0.00s"));
            Console.WriteLine("----------------------------------------------------------------------------");
        }
コード例 #7
0
        private static void RunServer()
        {
            Stopwatch sw = Stopwatch.StartNew();

            AppDomain.CurrentDomain.UnhandledException += UnhandledException;

            Console.WriteLine("----===== Revolution WorldServer =====----\n\n"
                              + "Copyright (C) 2013 Revolution Team\n\n"
                              + "This program is CLOSE SOURCE project.\n"
                              + "You DON'T have any right's, if you are NOT autor\n"
                              + "or authorized representative of him.\n"
                              + "Using that program without any right's is ILLEGAL\n\n"
                              + "Authors: Jenose, IMaster\n"
                              + "Authorized representative: netgame.in.th\n\n"
                              + "-------------------------------------------");

            Log.Info("Init Services...");
            AccountService     = new AccountService();
            AiService          = new AiService();
            ChatService        = new ChatService();
            ControllerService  = new ControllerService();
            FeedbackService    = new FeedbackService();
            MapService         = new MapService();
            ObserverService    = new ObserverService();
            PlayerService      = new PlayerService();
            TeamService        = new TeamService();
            SkillsLearnService = new SkillsLearnService();
            StatsService       = new StatsService();
            ShopService        = new ShopService();
            StorageService     = new StorageService();
            TeleportService    = new TeleportService();
            VisibleService     = new VisibleService();

            Log.Info("Init Engines...");
            ScriptEngine = new ScriptEngine.ScriptEngine();
            AdminEngine  = new AdminEngine.AdminEngine();
            SkillEngine  = new SkillEngine.SkillEngine();
            QuestEngine  = new QuestEngine.QuestEngine();
            Console.WriteLine("\n-------------------------------------------\n");

            GlobalLogic.ServerStart();
            Console.WriteLine("\n-------------------------------------------\n");

            CountryCode = (CountryCode)Enum.Parse(typeof(CountryCode), Settings.Default.COUNTRY_CODE);

            InnerNetworkOpcode.Init();
            OuterNetworkOpcode.Init();

            InnerClient = new InnerNetworkClient("127.0.0.1", 22323);
            InnerClient.BeginConnect();

            foreach (var channel in DataBaseServer.GetServerChannel(Settings.Default.SERVER_ID))
            {
                var OuterNetwork = new OuterNetworkListener("*", channel.port, channel.max_user);
                OuterNetwork.BeginListening();
                OuterNetworks.Add(OuterNetwork);
            }

            InnerNetworkClient.SendAllThread.Start();
            OuterNetworkConnection.SendAllThread.Start();

            sw.Stop();
            Console.WriteLine("-------------------------------------------");
            Console.WriteLine("           Server start in {0}", (sw.ElapsedMilliseconds / 1000.0).ToString("0.00s"));
            Console.WriteLine("-------------------------------------------");
        }
コード例 #8
0
        private static void RunServer()
        {
            Data.Data.DataPath = "data/";

            Stopwatch sw = Stopwatch.StartNew();

            AppDomain.CurrentDomain.UnhandledException += UnhandledException;

            Console.WriteLine("----===== GameServer =====----\n\n"
                              + "Starting game server\n\n"
                              + "Loading data files.\n"
                              + "-------------------------------------------");

            TcpServer = new TcpServer("*", 11101, 1000);
            Connection.SendAllThread.Start();

            OpCodes.Init();

            #region global_components

            //services
            FeedbackService    = new FeedbackService();
            AccountService     = new AccountService();
            PlayerService      = new PlayerService();
            MapService         = new MapService();
            ChatService        = new ChatService();
            VisibleService     = new VisibleService();
            ControllerService  = new ControllerService();
            CraftService       = new CraftService();
            ItemService        = new ItemService();
            AiService          = new AiService();
            GeoService         = new GeoService();
            StatsService       = new StatsService();
            ObserverService    = new ObserverService();
            AreaService        = new AreaService();
            InformerService    = new InformerService();
            TeleportService    = new TeleportService();
            PartyService       = new PartyService();
            SkillsLearnService = new SkillsLearnService();
            CraftLearnService  = new CraftLearnService();
            GuildService       = new GuildService();
            EmotionService     = new EmotionService();
            RelationService    = new RelationService();
            DuelService        = new DuelService();
            StorageService     = new StorageService();
            TradeService       = new TradeService();
            MountService       = new MountService();

            //engines
            ActionEngine = new ActionEngine.ActionEngine();
            AdminEngine  = new AdminEngine.AdminEngine();
            SkillEngine  = new SkillEngine.SkillEngine();
            QuestEngine  = new QuestEngine.QuestEngine();

            #endregion

            GlobalLogic.ServerStart();

            TcpServer.BeginListening();

            try
            {
                ServiceApplication = ScsServiceBuilder.CreateService(new ScsTcpEndPoint(23232));
                ServiceApplication.AddService <IInformerService, InformerService>((InformerService)InformerService);
                ServiceApplication.Start();
                Log.Info("InformerService started at *:23232.");
            }
            catch (Exception ex)
            {
                Log.ErrorException("InformerService can not be started.", ex);
            }

            sw.Stop();
            Console.WriteLine("-------------------------------------------");
            Console.WriteLine("           Server start in {0}", (sw.ElapsedMilliseconds / 1000.0).ToString("0.00s"));
            Console.WriteLine("-------------------------------------------");
        }
コード例 #9
0
ファイル: PlayerLogic.cs プロジェクト: wgq4812/revcore
 public static void PlayerLearnSkill(Player player, int skillid)
 {
     SkillsLearnService.LearnSkill(player, skillid);
     StatsService.UpdateStats(player);
     FeedbackService.PlayerLearnSkill(player);
 }
コード例 #10
0
ファイル: PlayerLogic.cs プロジェクト: wgq4812/revcore
 public static void LevelUpAbility(Player player, Dictionary <int, KeyValuePair <int, int> > AbilityList, int AbilityId, int AbilityPoint)
 {
     SkillsLearnService.LevelUpAbility(player, AbilityId, AbilityPoint);
 }