Raised This Month: $ Target: $400
 0% 

registered directory server.cfg not called on first map


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ajax
Veteran Member
Join Date: Jan 2005
Old 05-04-2005 , 14:04  
Reply With Quote #1

so i gave registered directories a try and ran across a slight problem. but since i typically run a listen server it took me this long to confirm it on dedicated servers as well.

the server.cfg in a registered directory doesn't run for the first map of a server start. i tested it with a registered directory named "test" which contained the following files and code...

server.cfg
Code:
setinfo reg_test "is_working"
round_start.cfg
Code:
setinfo reg_test2 "is_working2"
i started a dedicated server, started a round and got the following results in console...
Quote:
] eventscripts_register
EventScripts Script packs:
------------------------------------------
00: [on] "test"
------------------------------------------
] reg_test
Unknown command "reg_test"
] reg_test2
"reg_test2" = "is_working2" ( def. "" )
- Custom user info value
then after a map change...
Quote:
] reg_test
"reg_test" = "is_working" ( def. "" )
- Custom user info value
i also had echo commands to let me know when these files executed, but they just supported what i provided above.
ajax is offline
Mattie
Veteran Member
Join Date: Jan 2005
Old 05-04-2005 , 15:31  
Reply With Quote #2

Quote:
Originally Posted by ajax
so i gave registered directories a try and ran across a slight problem. but since i typically run a listen server it took me this long to confirm it on dedicated servers as well.

the server.cfg in a registered directory doesn't run for the first map of a server start. i tested it with a registered directory named "test" which contained the following files and code...

server.cfg
Code:
setinfo reg_test "is_working"
round_start.cfg
Code:
setinfo reg_test2 "is_working2"
i started a dedicated server, started a round and got the following results in console...
Quote:
] eventscripts_register
EventScripts Script packs:
------------------------------------------
00: [on] "test"
------------------------------------------
] reg_test
Unknown command "reg_test"
] reg_test2
"reg_test2" = "is_working2" ( def. "" )
- Custom user info value
then after a map change...
Quote:
] reg_test
"reg_test" = "is_working" ( def. "" )
- Custom user info value
i also had echo commands to let me know when these files executed, but they just supported what i provided above.
Ah, this might explain a handful of problems I've seen like this in the past. I'm somewhat surprised, but this is probably due to Valve not calling LevelInit() when I'd expect them to on the first server start.

I'll look into fixing it for my next release (unscheduled). If this blocks you, it's not hard to envision a workaround and I can post that here if needed.

-Mattie
Mattie is offline
ichthys
Veteran Member
Join Date: Dec 2004
Location: []*[]
Old 05-05-2005 , 18:46  
Reply With Quote #3

As usual, blame it on valve. lol jk!
ichthys is offline
ichthys
Veteran Member
Join Date: Dec 2004
Location: []*[]
Old 05-11-2005 , 19:06  
Reply With Quote #4

Hope this gets released soon.
ichthys is offline
ajax
Veteran Member
Join Date: Jan 2005
Old 05-11-2005 , 19:20  
Reply With Quote #5

the temporary workaround is to execute the registered server.cfg in your main server.cfg

so for any registered directory, just put something like this in your main server.cfg...
Code:
eventscripts_register COOLSCRIPT
exec COOLSCRIPT\server.cfg
or if you are using an "events" subdirectory
Code:
eventscripts_register COOLSCRIPT
exec events\COOLSCRIPT\server.cfg
(i know you probably know this ichthys, but i'm posting it for anyone else looking for a temporary fix)
ajax is offline
ichthys
Veteran Member
Join Date: Dec 2004
Location: []*[]
Old 05-11-2005 , 20:06  
Reply With Quote #6

Yeah, but I'd rather have less crap in the main server.cfg other than
es_reg
ichthys is offline
ajax
Veteran Member
Join Date: Jan 2005
Old 05-11-2005 , 21:36  
Reply With Quote #7

i understand, but it's just one extra line in the main server.cfg that can be deleted once the update happens -- technically you really wouldn't ever need to delete it. looking at your HS script installation instructions, you've got actual code that would need to be moved to the registered directory file in order for it to work as a proper script pack the way they were intended.

my point is you didn't want to add one line, so you added 3 instead. see what i'm saying?

having said that, i have yet to get a script pack working.
ajax is offline
ichthys
Veteran Member
Join Date: Dec 2004
Location: []*[]
Old 05-12-2005 , 00:00  
Reply With Quote #8

I use 3 lines incase someone has their "events" directory set to something else.
ichthys is offline
Mattie
Veteran Member
Join Date: Jan 2005
Old 05-13-2005 , 09:46  
Reply With Quote #9

Guys, I tried this today on my dedicated server and saw 0 problem with it calling a server.cfg for a script pack on the first load of the server.

What dedicated servers is this problem happening for you? Perhaps the problem only happens on listen servers?

EventScripts should always output a line like this whenever a new level is loaded:
Quote:
[EventScripts] Executing all registered server.cfgs.
A while back I made the c4timer script into a script pack. I just placed echo lines in the server.cfg for that fellow and restarted my dedicated server. I saw:

Quote:
[EventScripts] Executing all registered server.cfgs.
[EventScripts] Resetting delayed counters.
Level "de_chateau" has been loaded
Level "de_chateau" has been loaded
Level "de_chateau" has been loaded
******* C4TIMER SERVER.CFG EXECUTED ********
******* C4TIMER SERVER.CFG STILL EXECUTING ********
******* C4TIMER SERVER.CFG DONE EXECUTING ********
Do you have some way for me to reproduce this problem?

Thanks,
-Mattie
Mattie is offline
Mattie
Veteran Member
Join Date: Jan 2005
Old 05-13-2005 , 09:53  
Reply With Quote #10

Hmmm.. I just thought of what might be happening. Are you doing your eventscripts_register inside server.cfg? That might cause this problem, as I can't guarantee I'm going to call registered script server.cfg *after* Valve's server.cfg.

I place all of my "eventscripts_register" lines in my autoexec.cfg, and recommend other people place them there as well.

If you had a script pack that would *really* like to be re-registered every map, you could either (a) have them add a line to their server.cfg, or (b) I could add a hack that calls the registered server.cfg 1 second after I get a signal that the map is loaded.

Actually, what we probably want is a .cfg file that runs whenever the plugin is loaded for the first time. We could make this be a <NameOfPack>.cfg file that loads whenever the plugin is registered.

Or maybe they could be called "eventscripts_register.cfg" and "eventscripts_unregister.cfg" so that script writers can provide a script to clean up, too.

What do you think?
-Mattie
Mattie is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode