private static void Main() { Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)); Console.Title = Title; log.Info("Initialising..."); ConfigurationManager <WorldServerConfiguration> .Initialise("WorldServer.json"); DatabaseManager.Initialise(ConfigurationManager <WorldServerConfiguration> .Config.Database); GameTableManager.Initialise(); MapManager.Initialise(); SearchManager.Initialise(); EntityManager.Initialise(); EntityCommandManager.Initialise(); GlobalMovementManager.Initialise(); AssetManager.Initialise(); GlobalSpellManager.Initialise(); ServerManager.Initialise(); ResidenceManager.Initialise(); // make sure the assigned realm id in the configuration file exists in the database RealmId = ConfigurationManager <WorldServerConfiguration> .Config.RealmId; if (ServerManager.Servers.All(s => s.Model.Id != RealmId)) { throw new ConfigurationException($"Realm id {RealmId} in configuration file doesn't exist in the database!"); } MessageManager.Initialise(); SocialManager.Initialise(); CommandManager.Initialise(); NetworkManager <WorldSession> .Initialise(ConfigurationManager <WorldServerConfiguration> .Config.Network); WorldManager.Initialise(lastTick => { NetworkManager <WorldSession> .Update(lastTick); MapManager.Update(lastTick); ResidenceManager.Update(lastTick); BuybackManager.Update(lastTick); }); using (WorldServerEmbeddedWebServer.Initialise()) { log.Info("Ready!"); while (true) { Console.Write(">> "); string line = Console.ReadLine(); if (!CommandManager.HandleCommand(new ConsoleCommandContext(), line, false)) { Console.WriteLine("Invalid command"); } } } }
/// <summary> /// Create a new single spline <see cref="SplinePath"/> with supplied <see cref="SplineMode"/> and speed. /// </summary> public SplinePath(ushort splineId, SplineMode mode, float speed) { Type = SplineType.CatmullRom; Mode = mode; Speed = speed; SplineTypeBase splineType = new SplineTypeCatmullRomTbl(); ISplineMode splineMode = GlobalMovementManager.NewSplineMode(mode); if (splineMode == null) { throw new ArgumentOutOfRangeException(); } spline = new Spline(); spline.Initialise(splineId, splineType, splineMode); direction = splineMode.InitialDirection; point = direction == SplineDirection.Forward ? splineType.BottomIndex : splineType.BottomReverseIndex; remaining = spline.GetNextLength(direction, point); }
/// <summary> /// Create a new custom spline <see cref="SplinePath"/> with supplied <see cref="SplineType"/>, <see cref="SplineMode"/> and speed. /// </summary> public SplinePath(List <Vector3> nodes, SplineType type, SplineMode mode, float speed) { Type = type; Mode = mode; Speed = speed; SplineTypeBase splineType; switch (type) { case SplineType.Linear: splineType = new SplineTypeLinear(); break; case SplineType.CatmullRom: splineType = new SplineTypeCatmullRom(); break; default: throw new ArgumentOutOfRangeException(); } ISplineMode splineMode = GlobalMovementManager.NewSplineMode(mode); if (splineMode == null) { throw new ArgumentException(); } spline = new Spline(); spline.Initialise(nodes, splineType, splineMode); direction = splineMode.InitialDirection; point = direction == SplineDirection.Forward ? splineType.BottomIndex : splineType.BottomReverseIndex; remaining = spline.GetNextLength(direction, point); }