Raised This Month: $32 Target: $400
 8% 

ServerCommand to early ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 11-05-2005 , 13:21   ServerCommand to early ?
Reply With Quote #1

Hey all.

When debugging an error in one of my plugins, I discovered the problem to be using Engine->ServerCommand in ServerActivate.

I have now started executing my plugins config file at the first round start so as to avoid the crash but it doesnt seem logical that it is too early.

It crashes with a "pure virtual function" call error.
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
BAILOPAN
Join Date: Jan 2004
Old 11-05-2005 , 23:13  
Reply With Quote #2

Very odd, that shouldn't be happening. Any more information? Are you calling it from a callclass?
__________________
egg
BAILOPAN is offline
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 11-07-2005 , 07:16  
Reply With Quote #3

No, calling it from the interface the engine gives me.

IVEngine->ServerExecute(), anywhere in ServerActivate in any plugin crashes on map CHANGE not on first load, and only if you have add_bot in autoexec.cfg or server.cfg.

I havent seen an error message other than "Pure Virtual Function Call" but someone else showed me their log and the error message was.

Unknown command ";;exec goremod/goremod.cfg"

The thing is, they couldnt be prepended to my string because I call it exactly like this...

Code:
m_Engine->ServerExecute( "exec goremod/goremod.cfg\n" );
So its something to do with the engine and not me....
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
BAILOPAN
Join Date: Jan 2004
Old 11-07-2005 , 07:53  
Reply With Quote #4

This is probably because there are special rules for server commands during mapchange. Similar oddities happen on HL1.
__________________
egg
BAILOPAN is offline
Mani
Veteran Member
Join Date: Dec 2004
Location: UK
Old 11-07-2005 , 08:11  
Reply With Quote #5

IIRC the server.cfg file is executed after the LevelInit() callback has been run which is a real pain in the arse if you are checking cvars during LevelInit() because they potentially get setup directly after.

I have some custom .cfg files that can be run on a per map basis (Valve also do this now I think). I run these on the joining of the first player for the map.

I did play around with using ServerExecute() during LevelInit() but it was pain and misery

Mani
__________________
Installation files, documentation and help can be found at: -

www.mani-admin-plugin.com
Mani is offline
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 11-07-2005 , 09:51  
Reply With Quote #6

Ya I just load the cfg's at first round_start now, just because of that annoyance.
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
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 00:20.


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