コード例 #1
0
 public async Task InstanceCreateAsync(uint MapID)
 {
     if (!WorldServiceLocator._WS_Maps.Maps.ContainsKey(MapID))
     {
         WS_Maps.TMap Map = new(checked ((int)MapID), await dataStoreProvider.GetDataStoreAsync("Map.dbc"));
     }
 }
コード例 #2
0
ファイル: WS_Maps.cs プロジェクト: DeKaDeNcE/MangosSharp
        public async Task InitializeMapsAsync()
        {
            IEnumerator e = WorldServiceLocator._ConfigurationProvider.GetConfiguration().Maps.GetEnumerator();

            e.Reset();
            if (e.MoveNext())
            {
                MapList = Conversions.ToString(e.Current);
                while (e.MoveNext())
                {
                    MapList = Conversions.ToString(Operators.AddObject(MapList, Operators.ConcatenateObject(", ", e.Current)));
                }
            }
            foreach (string map2 in WorldServiceLocator._ConfigurationProvider.GetConfiguration().Maps)
            {
                uint id  = Conversions.ToUInteger(map2);
                TMap map = new(checked ((int)id), await dataStoreProvider.GetDataStoreAsync("Map.dbc"));
            }
            WorldServiceLocator._WorldServer.Log.WriteLine(LogType.INFORMATION, "Initalizing: {0} Maps initialized.", Maps.Count);
        }
コード例 #3
0
        public async Task InitializeGraveyardsAsync()
        {
            checked
            {
                try
                {
                    Graveyards.Clear();
                    var tmpDBC = await dataStoreProvider.GetDataStoreAsync("WorldSafeLocs.dbc");

                    WorldServiceLocator._WorldServer.Log.WriteLine(LogType.INFORMATION, "Loading.... {0} Graveyard Locations", tmpDBC.Rows - 1);
                    int num = tmpDBC.Rows - 1;
                    for (int i = 0; i <= num; i++)
                    {
                        int   locationIndex = tmpDBC.ReadInt(i, 0);
                        int   locationMapID = tmpDBC.ReadInt(i, 1);
                        float locationPosX  = tmpDBC.ReadFloat(i, 2);
                        float locationPosY  = tmpDBC.ReadFloat(i, 3);
                        float locationPosZ  = tmpDBC.ReadFloat(i, 4);
                        if (WorldServiceLocator._ConfigurationProvider.GetConfiguration().Maps.Contains(locationMapID.ToString()))
                        {
                            Graveyards.Add(locationIndex, new TGraveyard(locationPosX, locationPosY, locationPosZ, locationMapID));
                            WorldServiceLocator._WorldServer.Log.WriteLine(LogType.DEBUG, "         : Map: {0}  X: {1}  Y: {2}  Z: {3}", locationMapID, locationPosX, locationPosY, locationPosZ);
                        }
                    }
                    WorldServiceLocator._WorldServer.Log.WriteLine(LogType.INFORMATION, "Finished loading Graveyard Locations", tmpDBC.Rows - 1);
                    WorldServiceLocator._WorldServer.Log.WriteLine(LogType.INFORMATION, "DBC: {0} Graveyards initialized.", tmpDBC.Rows - 1);
                }
                catch (DirectoryNotFoundException ex)
                {
                    ProjectData.SetProjectError(ex);
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("DBC File : WorldSafeLocs missing.");
                    Console.ForegroundColor = ConsoleColor.Gray;
                    ProjectData.ClearProjectError();
                }
            }
        }