Staredit Network > Forums > Modding Assistance > Topic: [GPTP] TerminatePlugin()?
[GPTP] TerminatePlugin()?
Aug 13 2012, 10:11 am
By: Sand Wraith  

Aug 13 2012, 10:11 am Sand Wraith Post #1

she/her

Does anyone know if this function actually works or anything?

EDIT:

(Actually, I'm fairly certain this function /is/ called and /does/ work. I can write code to crash SC as it exits, but see below.)

I've also tried writing a test file in this function, but it either does not work or it is appearing somewhere I do not expect it to. (Not in any of my StarCraft directories - maybe a system one?)

qdp.cpp
Code
 BOOL WINAPI TerminatePlugin() {
   //Called when starcraft closes

     // BROKEN AS FUCK, I DON'T EVEN KNOW IF IT IS CALLED

    std::ofstream musicCheckEnd("music", ios::in);
    if(musicCheckEnd.is_open()) // music was enabled
    {
        // perform cleanup
        std::ofstream musicExit("exit", ios::out);
        musicExit.close();
    }
    musicCheckEnd.close();

   return true;
 }


EDIT2:

Clarification. If I place the file "music" in either my SCBW main directory where the SC EXE is or where the mod's EXE is, it doesn't work. I don't know where else it could be reading/writing to, though.

Post has been edited 1 time(s), last time on Aug 13 2012, 10:44 am by Sand Wraith.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:34 am]
NudeRaider -- SEN doesn't rely on spammers initiate its sleep cycle. It hat fully automated rest and clean-up phases. Please understand that this is necessary for the smooth operation of the site. Thank you.
[03:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[2024-5-17. : 6:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[2024-5-17. : 5:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
[2024-5-16. : 10:07 pm]
lil-Inferno -- nah
[2024-5-16. : 8:36 pm]
Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
[2024-5-16. : 5:25 pm]
NudeRaider -- there he is, right on time! Go UV! :D
[2024-5-16. : 5:24 pm]
lil-Inferno -- poopoo
Please log in to shout.


Members Online: 1jasminee783yM9, 9avae742yg7, 4jasminec852gN3