OnLevelShutdown and OnLevelInit

Please post any questions about developing your plugin here. Please use the search function before posting!
decompile
Senior Member
Posts: 418
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

OnLevelShutdown and OnLevelInit

Postby decompile » Fri Jul 08, 2016 7:31 pm

Hey, Is it just me or is OnLevelShutdown after OnLevelInit?

Im currently writing my own demo system,

but when I execute tv_record 'auto-20160708-211956-surf_ori_l' in OnLevelInit and tv_stoprecord in OnLevelShutdown, im getting

Code: Select all

Recording SourceTV demo to ./auto-20160708-211956-surf_ori_l.dem...
Executing dedicated server config file server.cfg
Set motd from file 'cfg/motd.txt'
Set motd_text from file 'cfg/motd_text.txt'
[SourceBans] Loading configs/sourcebans.cfg config file
[SourceComms] Loading configs/sourcebans/sourcebans.cfg config file
[SourceComms] Loading configs/sourcecomms.cfg config file
Completed SourceTV demo "./auto-20160708-211956-surf_ori_l.dem", recording time 0.0


So the demo files end with 0.0

Is it just a bug or how can I fix that?
User avatar
L'In20Cible
Project Leader
Posts: 1536
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: OnLevelShutdown and OnLevelInit

Postby L'In20Cible » Sat Jul 09, 2016 1:02 am

User avatar
L'In20Cible
Project Leader
Posts: 1536
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: OnLevelShutdown and OnLevelInit

Postby L'In20Cible » Sat Jul 09, 2016 1:42 am

I went ahead and added a OnMapEnd listener which will never gets called more than once per map change.
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: OnLevelShutdown and OnLevelInit

Postby iPlayer » Sat Jul 09, 2016 9:06 am

I might get it wrong, but does OnLevelShutdown fire at the same time with cs_win_panel_match event in CS:S/CS:GO?
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
L'In20Cible
Project Leader
Posts: 1536
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: OnLevelShutdown and OnLevelInit

Postby L'In20Cible » Sat Jul 09, 2016 9:37 am

iPlayer wrote:I might get it wrong, but does OnLevelShutdown fire at the same time with cs_win_panel_match event in CS:S/CS:GO?

No. That event is fired when the final scoreboard is sent to clients while that listener is called when it close (before Host_Changelevel gets called). And sometime is called again right before OnLevelInit into the map change process. The OnMapEnd listener makes sure it only get called before Host_Changelevel (by using a guard variable defined to True when a map has been initialized and False as soon as it got called once).

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 56 guests