r3jded Posted October 10, 2017 Share Posted October 10, 2017 I have a script for a gameserver that acts up a bit, or rather a piece of code that need some recoding. I most kindly ask for help from somone who could help me as i am not very good at PHP. From what i gather i need to transform this in to some kind of public static function but i dont know how to. The code is: //Output error if($umsg) { Core::getObject('messages')->add($message, true); //Line 71 } else { echo $message; } //Log the error if(!empty(Core::getObject('session')->server->login)) { $login = '_'.Core::getObject('session')->server->login; } else { $login = ''; } writeLog('errors'.$login, $message); Wich gives me the following error message: Strict Standards: Non-static method Core::getObject() should not be called statically in G:\xamp556\htdocs\rcp\includes\core.functions.php on line 71 Quote Link to comment https://forums.phpfreaks.com/topic/305325-gameserver-script-strict-standards-non-static-method-error/ Share on other sites More sharing options...
requinix Posted October 10, 2017 Share Posted October 10, 2017 The code is old. Any chance of finding something up to date? Written within the last, say, 5 years? Quote Link to comment https://forums.phpfreaks.com/topic/305325-gameserver-script-strict-standards-non-static-method-error/#findComment-1552603 Share on other sites More sharing options...
Solution requinix Posted October 10, 2017 Solution Share Posted October 10, 2017 I partially take that back: looks like the author made a mistake. Code's still old though. Go into class.core.php and make the getObject method be static. Quote Link to comment https://forums.phpfreaks.com/topic/305325-gameserver-script-strict-standards-non-static-method-error/#findComment-1552604 Share on other sites More sharing options...
r3jded Posted October 10, 2017 Author Share Posted October 10, 2017 (edited) Thank you. That works.And no, there is very little but more like no chance of finding a more updated version of the script as it is from 2009 and it is the latest version. i´ve spent a couple of days finding the right version PHP to run this on Edited October 10, 2017 by r3jded Quote Link to comment https://forums.phpfreaks.com/topic/305325-gameserver-script-strict-standards-non-static-method-error/#findComment-1552606 Share on other sites More sharing options...
gizmola Posted October 10, 2017 Share Posted October 10, 2017 We need a McDonald's counter: 123,759 obsolete scripts re-served. Quote Link to comment https://forums.phpfreaks.com/topic/305325-gameserver-script-strict-standards-non-static-method-error/#findComment-1552607 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.