#Server crashes sometimes during map change

1 messages · Page 1 of 1 (latest)

zinc lynx
#

Recently my server sometimes crashes during map change. Most likely a mod issue.

Error message in logs is:
ERROR: CModuleHookManager::RegisterHook: Function '::MapChange' is incompatible with hook 'MapChangeHook'!

Not sure how to fix this one.
It does not always crash, just sometimes. The maps it crashes on are pretty much random. So it is not reliably reproducable.
Maybe somebody encountered this before?

acoustic ledge
#

search for every instance of the MapChange hook in your plugins/map scripts,
they should look like this: HookReturnCode MapChange()
change them so they look like this instead: HookReturnCode MapChange( const string& in szNextMap )

trim crater
#

i have got a random crash on mapchange for years. i know that wootguys mapchange message uses this hook and so does afkmanager. Not sure what else.

acoustic ledge
#

a lot

GitHub

GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.

zinc lynx
#

I might try to create some issues/pull requests at the plugins githubs

#

Thanks!

trim crater
#

@zinc lynxwhich ones did you change?

zinc lynx
# trim crater <@314091168038256651>which ones did you change?

@trim crater way too many.
If you are on linux best use grep to find the plugins affected and then change it one by one or use sed combined with **grep ** to replace the function and add the string reference parameter@acoustic ledge pointed out.

You could do something like this:

grep -rl matchstring <yourdirectory>/ | xargs sed -i 's/HookReturnCode MapChange()/HookReturnCode MapChange( const string& in szNextMap )/g'

or just grep "HookReturnCode MapChange()" -R in your script directory and change every MapChange method in every file manually.

#

Why is Boderbot bullying my answer? dogthink

acoustic ledge
trim crater
acoustic ledge
radiant skiff
#

Is all of this required?
( const string& in szNextMap )
I just did:
(string szNextMap)

#

Not a complaint. Just a question. 🙂

acoustic ledge
#

the map change hook in code mentions const string& in

#

so I assume thats what you need to pass

vital pier
#

I did string the first day the hook was updated to the RC and it was incorrect

#

it wasn't having it

#

Let me see if I can find the message

#

blast, can't find it

#

anyway

#

I think I was told by somebody on the team that it was supposed to be const string& in