Ken 904 Posted July 11, 2014 Share Posted July 11, 2014 (edited) I think someone still haven't seen this error in game source file or someone fix it but not share on metin2dev.org. What's ever Open your cmd_general.cpp and search this ACMD(do_shutdown) change with this ; ACMD(do_shutdown) { if (!ch->IsGM()) return; if (NULL == ch) { sys_err("Accept shutdown command from %s.", ch->GetName()); } TPacketGGShutdown p; p.bHeader = HEADER_GG_SHUTDOWN; P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShutdown)); Shutdown(10); } Best Regards Ellie Edited February 6, 2015 by Ken 7 Do not be sorry, be better. Link to comment Share on other sites More sharing options...
Active Member ATAG 310 Posted July 11, 2014 Active Member Share Posted July 11, 2014 Or change { "shutdown", do_shutdown, 0, POS_DEAD, GM_HIGH_WIZARD }, to { "shutdown", do_shutdown, 0, POS_DEAD, GM_IMPLEMENTOR }, 1 Link to comment Share on other sites More sharing options...
Ken 904 Posted July 11, 2014 Author Share Posted July 11, 2014 I think so two solution result same but i choose my way Thanks for comment. Best Regards Ellie Do not be sorry, be better. Link to comment Share on other sites More sharing options...
Night 366 Posted July 11, 2014 Share Posted July 11, 2014 yes you are right but i do belive that ATAG solution is an easy one dont you think so Link to comment Share on other sites More sharing options...
UserForum 4 Posted February 6, 2015 Share Posted February 6, 2015 Thanks you : ) 1 Link to comment Share on other sites More sharing options...
Former Staff flygun 304 Posted February 6, 2015 Former Staff Share Posted February 6, 2015 change this if (ch->GetGMLevel() <= GM_IMPLEMENTOR) return; to this if (ch->GetGMLevel() < GM_IMPLEMENTOR) return; 1 Link to comment Share on other sites More sharing options...
Ken 904 Posted February 6, 2015 Author Share Posted February 6, 2015 change this if (ch->GetGMLevel() <= GM_IMPLEMENTOR) return; to this if (ch->GetGMLevel() < GM_IMPLEMENTOR) return; Thanks for answer. But i think is enough if (!ch->IsGM()) return; Kind Regards Ken ~ TA 1 Do not be sorry, be better. Link to comment Share on other sites More sharing options...
Former Staff flygun 304 Posted February 6, 2015 Former Staff Share Posted February 6, 2015 change this if (ch->GetGMLevel() <= GM_IMPLEMENTOR) return; to this if (ch->GetGMLevel() < GM_IMPLEMENTOR) return; Thanks for answer. But i think is enough if (!ch->IsGM()) return; Kind Regards Ken ~ TA yup it is enough 1 Link to comment Share on other sites More sharing options...
Premium Sanchez 2468 Posted February 7, 2015 Premium Share Posted February 7, 2015 Maybe I'm too tired, but this will throw an exception if the character does not exist. 1. You're using the IsGM() function on the CHARACTER class, before the NULL check. 2. If the character does not exist you're trying to use the GetName() function on the NULL class, which will also throw an exception. 1 Link to comment Share on other sites More sharing options...
Sober 37 Posted February 7, 2015 Share Posted February 7, 2015 I see so many people trying to eliminate this condition e.g if(!ch)... but i don't get it.How can someone use a command without having a character??? Link to comment Share on other sites More sharing options...
Former Staff flygun 304 Posted February 7, 2015 Former Staff Share Posted February 7, 2015 Maybe I'm too tired, but this will throw an exception if the character does not exist. 1. You're using the IsGM() function on the CHARACTER class, before the NULL check. 2. If the character does not exist you're trying to use the GetName() function on the NULL class, which will also throw an exception. how can a player be not existed ? O.o Link to comment Share on other sites More sharing options...
Ken 904 Posted February 7, 2015 Author Share Posted February 7, 2015 Maybe I'm too tired, but this will throw an exception if the character does not exist. 1. You're using the IsGM() function on the CHARACTER class, before the NULL check. 2. If the character does not exist you're trying to use the GetName() function on the NULL class, which will also throw an exception. void interpret_command(LPCHARACTER ch, const char * argument, size_t len) System already sent this. cmd.cpp -> cmd_gm.cpp or cmd_general.cpp or cmd_emotion.cpp Kind Regards Ken ~ TA 1 Do not be sorry, be better. Link to comment Share on other sites More sharing options...
A4Tech 1 Posted January 22, 2017 Share Posted January 22, 2017 and for the people aren't using source how can they fix the command ? Link to comment Share on other sites More sharing options...
bluedrago 28 Posted December 15, 2019 Share Posted December 15, 2019 my server say that command no exist....how fix...???? i add ACMD(do_shutdown) { if (!ch->IsGM()) return; if (NULL == ch) { sys_err("Accept shutdown command from %s.", ch->GetName()); } TPacketGGShutdown p; p.bHeader = HEADER_GG_SHUTDOWN; P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShutdown)); Shutdown(10); } and nothing say that command no exist... and in cmd in CMD is shutdowm implementor... Link to comment Share on other sites More sharing options...
Developer Deliris 405 Posted December 16, 2019 Developer Share Posted December 16, 2019 Show us cmd.cpp from game/src. r Link to comment Share on other sites More sharing options...
Premium WeedHex 635 Posted December 17, 2019 Premium Share Posted December 17, 2019 Thread 2014... Refresh: ACMD(do_shutdown) change with this ; ACMD(do_shutdown) { if (!ch) return; if (!ch->IsGM()) return; TPacketGGShutdown p; p.bHeader = HEADER_GG_SHUTDOWN; P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShutdown)); sys_err("Accept shutdown command from %s.", ch->GetName()); Shutdown(10); } 1 1 Link to comment Share on other sites More sharing options...
Recommended Posts