Ejemplo n.º 1
0
        void OnBuildDone(object sender, EventArgs ea)
        {
            bool bSuccess = (bool)sender;

            mBSPForm.SetSaveEnabled(true);
            mBSPForm.SetBuildEnabled(false);
            mZoneForm.EnableFileIO(true);
            mBSPForm.EnableFileIO(true);
            mVisForm.EnableFileIO(true);
            mbWorking = false;

            if (bSuccess)
            {
                if (mbFullBuilding)
                {
                    OnSaveGBSP(mFullBuildFileName + ".gbsp", null);
                }
                else
                {
                }
            }
            else
            {
                CoreEvents.Print("Halting full build due to a bsp build failure.\n");
                mbFullBuilding = false;
            }
        }
Ejemplo n.º 2
0
        void OnLightDone(object sender, EventArgs ea)
        {
            bool bSuccess = (bool)sender;

            mZoneForm.EnableFileIO(true);
            mBSPForm.EnableFileIO(true);
            mVisForm.EnableFileIO(true);
            mbWorking = false;

            if (bSuccess)
            {
                if (mbFullBuilding)
                {
                    mbWorking = true;
                    OnMaterialVis(mFullBuildFileName + ".gbsp", null);

                    OnZoneGBSP(mFullBuildFileName + ".gbsp", null);
                    mbFullBuilding = false;
                    mbWorking      = false;
                }
            }
            else
            {
                CoreEvents.Print("Halting full build due to a light failure.\n");
                mbFullBuilding = false;
            }
        }
Ejemplo n.º 3
0
        public ClientPacketSafe ProcessOnly(BaseClientPacketMock expected)
        {
            ClientPacketSafe result = ClientPacket.Instantiate((byte *)Socket, Socket->Data[0], expected.Length, expected.Dynamic);

            CoreEvents.OnPacketReceived((byte *)Socket, expected.PacketID, expected.Length, expected.Dynamic);
            return(result);
        }
Ejemplo n.º 4
0
 void OnVerbose(object sender, EventArgs e)
 {
     if (VerboseBSP.Checked)
     {
         CoreEvents.Print("Note that verbosity can adversely affect performance, especially in vis.\n");
     }
 }
Ejemplo n.º 5
0
        void OnGBSPSaveDone(object sender, EventArgs ea)
        {
            bool bSuccess = (bool)sender;

            mZoneForm.EnableFileIO(true);
            mBSPForm.EnableFileIO(true);
            mVisForm.EnableFileIO(true);
            mbWorking = false;

            if (bSuccess)
            {
                if (mbFullBuilding)
                {
                    if (mBSPForm.BSPParameters.mbBuildAsBModel)
                    {
                        OnLight(mFullBuildFileName + ".gbsp", null);
                    }
                    else
                    {
                        OnVis(mFullBuildFileName + ".gbsp", null);
                    }
                }
            }
            else
            {
                CoreEvents.Print("Halting full build due to a gbsp save failure.\n");
                mbFullBuilding = false;
            }
        }
Ejemplo n.º 6
0
 void OnDumpTextures(object sender, EventArgs e)
 {
     mAllTextures.Sort();
     foreach (string tex in mAllTextures)
     {
         CoreEvents.Print("\t" + tex + "\n");
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Creates an instance of the class
 /// </summary>
 public Core()
 {
     CoreDomain              = new CurrentAppDomain(this);
     InternalObjectRegister  = new CoreManagement(this);
     InternalObjectActivator = new CoreActivator(this);
     InternalObjectResolver  = new CoreResolver(this);
     InternalObjectEvents    = new CoreEvents(this);
     InternalFactories       = new CoreFactories(this);
     InternalCache           = new CoreCache(this);
     Console  = OnCreateConsole();
     Settings = OnCreateSettings();
     Invoker  = OnCreateInvoker();
     OnCreate();
 }
Ejemplo n.º 8
0
        public void FirstPulseTest()
        {
            int InitialPulses = Server.TimeManager.PulseNum;

            Assert.AreEqual(InitialPulses, 0);
            Assert.IsFalse(Sharpkick.Main.Initialized);

            CoreEvents.OnPulse();
            int ResultPulses = Server.TimeManager.PulseNum;
            int Expected     = InitialPulses + 1;

            Assert.IsTrue(Sharpkick.Main.Initialized);

            Assert.AreEqual(ResultPulses, Expected);
        }
Ejemplo n.º 9
0
        void OnSaveGBSP(object sender, EventArgs e)
        {
            mSFD.DefaultExt = "*.gbsp";
            mSFD.Filter     = "GBSP files (*.gbsp)|*.gbsp|All files (*.*)|*.*";

            DialogResult dr = mSFD.ShowDialog();

            if (dr == DialogResult.Cancel)
            {
                return;
            }

            CoreEvents.Print("Saving gbsp " + mSFD.FileName + "\n");

            Misc.SafeInvoke(eSave, mSFD.FileName);
        }
Ejemplo n.º 10
0
        void OnOpenMap(object sender, EventArgs e)
        {
            mOFD.DefaultExt = "*.map";
            mOFD.Filter     = "QuArK map files (*.map)|*.map|All files (*.*)|*.*";

            DialogResult dr = mOFD.ShowDialog();

            if (dr == DialogResult.Cancel)
            {
                return;
            }

            CoreEvents.Print("Opening map " + mOFD.FileName + "\n");
            CoreEvents.Print("Map is a " + BSPParameters.mMapType + " map.\n");

            Misc.SafeInvoke(eOpenMap, mOFD.FileName);
        }
Ejemplo n.º 11
0
        void OnOpenGBSP(object sender, EventArgs e)
        {
            mOFD.DefaultExt = "*.gbsp";
            mOFD.Filter     = "GBSP files (*.gbsp)|*.gbsp|All files (*.*)|*.*";

            DialogResult dr = mOFD.ShowDialog();

            if (dr == DialogResult.Cancel)
            {
                return;
            }

            CoreEvents.Print("Exploring gbsp " + mOFD.FileName + "\n");

            Misc.SafeInvoke(eOpenGBSP, mOFD.FileName);

            GBSPFileName.Text = FileUtil.StripPath(mOFD.FileName);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Initializes this instance.
        /// </summary>
        public static void Initialize()
        {
            if (Instance == null)
            {
                CoreEvents.Initialize();
                Instance = GetSynchronousCodeGeneratedInstance <LevelUpEvents>();

                SoomlaUtils.LogDebug(TAG, "Initialize");
#if UNITY_ANDROID && !UNITY_EDITOR
                AndroidJNI.PushLocalFrame(100);
                using (AndroidJavaClass jniEventHandler = new AndroidJavaClass("com.soomla.unity.LevelUpEventHandler")) {
                    jniEventHandler.CallStatic("initialize");
                }
                AndroidJNI.PopLocalFrame(IntPtr.Zero);
#elif UNITY_IOS && !UNITY_EDITOR
                soomlaLevelup_Init();
#endif
            }
        }
Ejemplo n.º 13
0
                #pragma warning restore 414


        public static void Initialize()
        {
            if (Instance == null)
            {
                CoreEvents.Initialize();
                Instance = GetSynchronousCodeGeneratedInstance <ProfileEvents>();

                SoomlaUtils.LogDebug(TAG, "Initializing ProfileEvents ...");
#if UNITY_ANDROID && !UNITY_EDITOR
                AndroidJNI.PushLocalFrame(100);
                //init ProfileEventHandler
                using (AndroidJavaClass jniEventHandler = new AndroidJavaClass("com.soomla.profile.unity.ProfileEventHandler")) {
                    jniEventHandler.CallStatic("initialize");
                }
                AndroidJNI.PopLocalFrame(IntPtr.Zero);
#elif UNITY_IOS && !UNITY_EDITOR
                // On iOS, this is initialized inside the bridge library when we call "soomlaProfile_Initialize" in SoomlaProfileIOS
#endif
            }
        }
Ejemplo n.º 14
0
        void OnVisDone(object sender, EventArgs ea)
        {
            bool bSuccess = (bool)sender;

            mOutForm.UpdateProgress(0, 0, 0);
            mbWorking = false;
            mZoneForm.EnableFileIO(true);
            mBSPForm.EnableFileIO(true);
            mVisForm.EnableFileIO(true);

            if (bSuccess)
            {
                if (mbFullBuilding)
                {
                    OnLight(mFullBuildFileName + ".gbsp", null);
                }
            }
            else
            {
                CoreEvents.Print("Halting full build due to a vis failure.\n");
                mbFullBuilding = false;
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Initializes the different native event handlers in Android / iOS
        /// </summary>
        public static void Initialize()
        {
            if (Instance == null)
            {
                CoreEvents.Initialize();
                Instance = GetSynchronousCodeGeneratedInstance <StoreEvents>();
                SoomlaUtils.LogDebug(TAG, "Initializing StoreEvents ...");
#if UNITY_ANDROID && !UNITY_EDITOR
                AndroidJNI.PushLocalFrame(100);
                using (AndroidJavaClass jniEventHandler = new AndroidJavaClass("com.soomla.unity.StoreEventHandler")) {
                    jniEventHandler.CallStatic("initialize");
                }
                AndroidJNI.PopLocalFrame(IntPtr.Zero);

                sep = new StoreEventPusherAndroid();
#elif UNITY_IOS && !UNITY_EDITOR
                eventDispatcher_Init();
                sep = new StoreEventPusherIOS();
#elif UNITY_WP8 && !UNITY_EDITOR
                BusProvider.Instance.Register(StoreEvents.Instance);
                sep = new StoreEventPusherWP();
#endif
            }
        }
Ejemplo n.º 16
0
        void OnZoneGBSP(object sender, EventArgs ea)
        {
            string fileName = sender as string;

            if (fileName != null)
            {
                Action <System.Windows.Forms.Form> setText = frm => frm.Text = fileName;
                SharedForms.FormExtensions.Invoke(mZoneForm, setText);
                mZoneForm.EnableFileIO(false);
                mBSPForm.EnableFileIO(false);
                mVisForm.EnableFileIO(false);
                mMap = new Map();

                GFXHeader hdr = mMap.LoadGBSPFile(fileName);

                if (hdr == null)
                {
                    CoreEvents.Print("Load failed\n");
                }
                else
                {
                    mVisMap = new VisMap();
                    mVisMap.SetMap(mMap);
                    mVisMap.LoadVisData(fileName);

                    mMatLib.NukeAllMaterials();

                    mMap.MakeMaterials(mGD, mMatLib, fileName);

                    bool bPerPlaneAlpha = false;

                    mZoneDraw.BuildLM(mGD, mSKeeper, mZoneForm.GetLightAtlasSize(), mMap.BuildLMRenderData, mMap.GetPlanes(), bPerPlaneAlpha);
                    mZoneDraw.BuildVLit(mGD, mSKeeper, mMap.BuildVLitRenderData, mMap.GetPlanes());
                    mZoneDraw.BuildAlpha(mGD, mSKeeper, mMap.BuildAlphaRenderData, mMap.GetPlanes());
                    mZoneDraw.BuildFullBright(mGD, mSKeeper, mMap.BuildFullBrightRenderData, mMap.GetPlanes());
                    mZoneDraw.BuildMirror(mGD, mSKeeper, mMap.BuildMirrorRenderData, mMap.GetPlanes());
                    mZoneDraw.BuildSky(mGD, mSKeeper, mMap.BuildSkyRenderData, mMap.GetPlanes());

                    mZoneDraw.FinishAtlas(mGD, mSKeeper);
                    mZoneDraw.FixAlphaDrawCalls();

                    mModelMats = mMap.GetModelTransforms();

                    mMatForm.RefreshMaterials();

                    HideParametersByMaterial();

                    mVisMap.SetMaterialVisBytes(mMatLib.GetMaterialNames().Count);

                    mMatLib.SetLightMapsToAtlas();
                }
                mZoneForm.EnableFileIO(true);
                mBSPForm.EnableFileIO(true);
                mVisForm.EnableFileIO(true);
                mZoneForm.SetZoneSaveEnabled(true);

                mOutForm.Print("Zoning complete.\n");

//				BuildDebugDraw(Map.DebugDrawChoice.GFXFaces);
            }
        }
Ejemplo n.º 17
0
 public PlayerService(ILoggerFactory loggerFactory, MusicService musicService, CoreEvents events)
 {
     this.loggerFactory      = loggerFactory;
     this.musicService       = musicService;
     logger                  = loggerFactory.CreateLogger <PlayerService>();
     events.BotShuttingDown += () =>
     {
         this.Dispose();
         return(Task.CompletedTask);
     };
 }
Ejemplo n.º 18
0
 public MusicService(LiteDBStore dataStore, CoreEvents events)
 {
     songCollection             = dataStore.SongCollection;
     events.DailyEvent         += CleanOldSongs;
     events.InitializationDone += CleanOldSongs;
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Initializes the <see cref="ApiContext" /> class.
 /// </summary>
 static ApiContext()
 {
     events = new CoreEvents();
 }