Esempio n. 1
0
        public void InitCore(CallBackEvent e)
        {
            // Can't run this more than once
            if (inited) return;

            // We need to be able to Log stuff
            //if (l == null) return;
            if (e == null) return;

            //Log = l;
            Event = e;

            Log.WriteLine(netLogic.Shared.LogType.Debug, "netLogic.dll Initializing...");

            // Initialize everything
            try
            {
                if (!File.Exists(Environment.CurrentDirectory + "/" + BoogieBotConfigFileName))
                    throw new FileNotFoundException("Configuration file not found.", BoogieBotConfigFileName);

                configFile = new IniReader(Environment.CurrentDirectory + "/netLogic.ini");

                // NOTE: Set any OS specific variables so things can be done differently later, ie. Windows or Linux, etc.
                OperatingSystem os = Environment.OSVersion;
                switch (os.Platform)
                {
                    case PlatformID.Win32Windows:
                        Log.WriteLine(netLogic.Shared.LogType.Debug, "> Operating System: Windows");
                        break;
                    case PlatformID.Win32NT:
                        Log.WriteLine(netLogic.Shared.LogType.Debug, "> Operating System: Windows NT");
                        break;
                    case PlatformID.Unix:
                        Log.WriteLine(netLogic.Shared.LogType.Debug, "> Operating System: Unix");
                        break;
                }
                Log.WriteLine(netLogic.Shared.LogType.Debug, "> OS Version: {0}.{1}  (Build: {2})  ({3})", os.Version.Major, os.Version.Minor, os.Version.Build, os.ServicePack);

                // Find WoW's Folder
                wowPath = getWowPath();
                Log.WriteLine(netLogic.Shared.LogType.Debug, "> WowPath: {0}", wowPath);

                // Find WoW's Version
                wowVersion = getWoWVersion();
                Log.WriteLine(netLogic.Shared.LogType.Debug, "> WoW Version: World of Warcraft {0}.{1}.{2}.{3} ({4}) Found!  Emulating this version.", wowVersion.major, wowVersion.minor, wowVersion.update, wowVersion.build, netInstance.WowTypeString);

                //objectMgr = new ObjectMgr();
                GameObject _objects = new GameObject("objMgr");
                _objects.AddComponent<ObjMgr>();
                objMgr = _objects.GetComponent<ObjMgr>();
                DontDestroyOnLoad(objMgr);

                //movementMgr = new MovementMgr(netLogicCore.ObjectMgr);
                //combatMgr = new CombatMgr(ObjectMgr,MovementMgr);
                //terrainMgr = new TerrainMgr();
            //
                UpdateFieldsLoader.LoadUpdateFields(wowVersion.build);

                //areaTable = new AreaTable();
                //mapTable = new MapTable();
            }
            catch (Exception ex)
            {
                // Bot Start up Failed. Log why, and rethrow the exception.
                Log.WriteLine(netLogic.Shared.LogType.Debug, ex.Message);
                Log.WriteLine(netLogic.Shared.LogType.Debug, ex.StackTrace);

                throw new Exception("BoogieBot.dll Init Failure.", ex);
            }

            inited = true;
            Log.WriteLine(netLogic.Shared.LogType.Debug, "BoogieBot.dll Initialized.");
        }
Esempio n. 2
0
 public MovementMgr(ObjMgr _objectMgr)
 {
     objectMgr = _objectMgr;
     //terrainMgr = Client.terrainMgr;
 }
Esempio n. 3
0
 public CombatMgr(ObjMgr _objectMgr, MovementMgr _movementMgr,WorldSession _session)
 {
     objectMgr = _objectMgr;
     movementMgr = _movementMgr;
     client = _session;
 }