Honorable Member Mali 41641 Posted July 15, 2019 Honorable Member Share Posted July 15, 2019 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) This is the hidden content, please Sign In or Sign Up ( GitHub ) Spoiler 134 1 1 2 2 1 35 2 89 Link to comment Share on other sites More sharing options...
PeaceMaker 121 Posted July 15, 2019 Share Posted July 15, 2019 There is no need to extend the packet. You can simply do it in python .... 1 1 Link to comment Share on other sites More sharing options...
Honorable Member Mali 41641 Posted July 15, 2019 Author Honorable Member Share Posted July 15, 2019 2 minutes ago, PeaceMaker said: There is no need to extend the packet. You can simply do it in python .... wtf? Where do you get times?? It's not same everytime. If you open exchange or anything it will change Link to comment Share on other sites More sharing options...
PeaceMaker 121 Posted July 15, 2019 Share Posted July 15, 2019 16 minutes ago, Mali61 said: wtf? Where do you get times?? It's not same everytime. If you open exchange or anything it will change I've looked again over your code and yes every calculation you did on CalculateDeadTime can be done client side. I know it would take more time to do that as you need to set the last time you traded or opened a shop then do the calculation ... But i just don't like using extra unnecessary packets that can be prevented. Link to comment Share on other sites More sharing options...
Honorable Member Mali 41641 Posted July 15, 2019 Author Honorable Member Share Posted July 15, 2019 27 minutes ago, PeaceMaker said: I've looked again over your code and yes every calculation you did on CalculateDeadTime can be done client side. I know it would take more time to do that as you need to set the last time you traded or opened a shop then do the calculation ... But i just don't like using extra unnecessary packets that can be prevented. Yes client side can make but this is the easiest way. Why do we do the hardest? You don't like packets but you like longest and weirds codes 3 Link to comment Share on other sites More sharing options...
avertuss 48 Posted July 20, 2019 Share Posted July 20, 2019 @Mali61 Does it need higher version c++? Because in client i always have 0s. Link to comment Share on other sites More sharing options...
Honorable Member Mali 41641 Posted July 20, 2019 Author Honorable Member Share Posted July 20, 2019 47 minutes ago, avertuss said: @Mali61 Does it need higher version c++? Because in client i always have 0s. No doesn't needed. Link to comment Share on other sites More sharing options...
avertuss 48 Posted July 20, 2019 Share Posted July 20, 2019 8 minut temu, Mali61 napisał: No doesn't needed. How can i add debug mode? I mean send chat packet when game should send packet to client? I have no idea why it doesn't work for me. Link to comment Share on other sites More sharing options...
Active Member ReFresh 2330 Posted July 20, 2019 Active Member Share Posted July 20, 2019 @Mali61 Maybe good improvement should be make the timers dissapear when they reach 0 time? I'll be always helpful! Link to comment Share on other sites More sharing options...
Honorable Member Mali 41641 Posted July 20, 2019 Author Honorable Member Share Posted July 20, 2019 18 hours ago, ReFresh said: @Mali61 Maybe good improvement should be make the timers dissapear when they reach 0 time? updated 1 Link to comment Share on other sites More sharing options...
Active Member ReFresh 2330 Posted July 21, 2019 Active Member Share Posted July 21, 2019 @Mali61 I just implemented your code and I got some problems. 1. If you die for the first time - you can see timers 2. If you die for the second time and you used restart here in the first death - you cannot see timers 3. After using restart in town - timers will start working but again only after first death (second, third etc. deaths won't show the timers) Only after restarting in town you can see timers everytime. Hope you will look into it and try to provide us some solution. Thanks! I'll be always helpful! Link to comment Share on other sites More sharing options...
Honorable Member Mali 41641 Posted July 21, 2019 Author Honorable Member Share Posted July 21, 2019 7 hours ago, ReFresh said: @Mali61 I just implemented your code and I got some problems. 1. If you die for the first time - you can see timers 2. If you die for the second time and you used restart here in the first death - you cannot see timers 3. After using restart in town - timers will start working but again only after first death (second, third etc. deaths won't show the timers) Only after restarting in town you can see timers everytime. Hope you will look into it and try to provide us some solution. Thanks! fixed 1 Link to comment Share on other sites More sharing options...
Honorable Member xP3NG3Rx 19638 Posted July 26, 2019 Honorable Member Share Posted July 26, 2019 (edited) Good idea, nice code, thanks. I did extend a bit. Spoiler Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal 4 Link to comment Share on other sites More sharing options...
Active Member ReFresh 2330 Posted July 26, 2019 Active Member Share Posted July 26, 2019 @xP3NG3Rx Nice extension! Can you share with us? I'll be always helpful! Link to comment Share on other sites More sharing options...
Honorable Member xP3NG3Rx 19638 Posted July 26, 2019 Honorable Member Share Posted July 26, 2019 This is the hidden content, please Sign In or Sign Up Spoiler //<srv&client:packet.h #ifdef ENABLE_REVIVE_BOARD_RENEWAL enum EReviveTypes { REVIVE_TYPE_HERE, REVIVE_TYPE_TOWN, REVIVE_TYPE_AUTO_TOWN, REVIVE_TYPE_MAX }; #endif typedef struct packet_dead { #ifdef ENABLE_REVIVE_BOARD_RENEWAL packet_dead() { memset(&reviveTime, 0, sizeof(reviveTime)); } #endif BYTE header; DWORD vid; #ifdef ENABLE_REVIVE_BOARD_RENEWAL BYTE reviveTime[REVIVE_TYPE_MAX]; #endif } TPacketGCDead; //> //<srv:char.h #ifdef ENABLE_REVIVE_BOARD_RENEWAL public: BYTE CalcReviveTimeDelay(uint8_t bType); #endif //> //<srv:char.cpp #ifdef ENABLE_REVIVE_BOARD_RENEWAL BYTE CHARACTER::CalcReviveTimeDelay(uint8_t bType) { if (!m_pkDeadEvent) return 0; BYTE bTimeToDead = BYTE(event_time(m_pkDeadEvent) / passes_per_sec); if (bType == REVIVE_TYPE_AUTO_TOWN) return bTimeToDead-7; if (!test_server && bType == REVIVE_TYPE_HERE && (!GetWarMap() || GetWarMap()->GetType() == GUILD_WAR_TYPE_FLAG)) { if (IsHack(false) && !CThreeWayWar::instance().IsSungZiMapIndex(GetMapIndex())) return bTimeToDead - (180 - g_nPortalLimitTime); if (bTimeToDead > 170) return bTimeToDead - 170; } if (IsHack(false) && ((!GetWarMap() || GetWarMap()->GetType() == GUILD_WAR_TYPE_FLAG) || !CThreeWayWar::instance().IsSungZiMapIndex(GetMapIndex()))) return bTimeToDead - (180 - g_nPortalLimitTime); if (bTimeToDead > 173) return bTimeToDead - 173; return 0; } #endif //> //<srv:char_battle.cpp #ifdef ENABLE_REVIVE_BOARD_RENEWAL TPacketGCDead pack; pack.header = HEADER_GC_DEAD; pack.vid = m_vid; pack.reviveTime[REVIVE_TYPE_HERE] = CalcReviveTimeDelay(REVIVE_TYPE_HERE); pack.reviveTime[REVIVE_TYPE_TOWN] = CalcReviveTimeDelay(REVIVE_TYPE_TOWN); pack.reviveTime[REVIVE_TYPE_AUTO_TOWN] = CalcReviveTimeDelay(REVIVE_TYPE_AUTO_TOWN); PacketAround(&pack, sizeof(pack)); #endif //> //<srv:char_horse.cpp // You can skip it. //> //<client:PythonNetworkStreamPhaseGame.cpp if (false == pkInstMain->GetDuelMode()) { #ifdef ENABLE_REVIVE_BOARD_RENEWAL PyObject *times = PyTuple_New(REVIVE_TYPE_MAX); PyTuple_SetItem(times, 0, PyInt_FromLong(DeadPacket.reviveTime[REVIVE_TYPE_HERE])); PyTuple_SetItem(times, 1, PyInt_FromLong(DeadPacket.reviveTime[REVIVE_TYPE_TOWN])); PyTuple_SetItem(times, 2, PyInt_FromLong(DeadPacket.reviveTime[REVIVE_TYPE_AUTO_TOWN])); PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnGameOver", Py_BuildValue("(O)", times)); #else PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnGameOver", Py_BuildValue("()")); #endif //> //<srv:PythonPlayerModule.cpp #ifdef ENABLE_REVIVE_BOARD_RENEWAL PyModule_AddIntConstant(poModule, "REVIVE_TYPE_HERE", REVIVE_TYPE_HERE); PyModule_AddIntConstant(poModule, "REVIVE_TYPE_TOWN", REVIVE_TYPE_TOWN); PyModule_AddIntConstant(poModule, "REVIVE_TYPE_AUTO_TOWN", REVIVE_TYPE_AUTO_TOWN); PyModule_AddIntConstant(poModule, "REVIVE_TYPE_MAX", REVIVE_TYPE_MAX); #endif //> //<root:game.py if app.ENABLE_REVIVE_BOARD_RENEWAL: def OnGameOver(self, times): self.CloseTargetBoard() self.OpenRestartDialog(times) def OpenRestartDialog(self, times): self.interface.OpenRestartDialog(times) else: def OnGameOver(self): self.CloseTargetBoard() self.OpenRestartDialog() def OpenRestartDialog(self): self.interface.OpenRestartDialog() //> //<root:interfaceModule.py if app.ENABLE_REVIVE_BOARD_RENEWAL: def OpenRestartDialog(self, times): self.dlgRestart.OpenDialog(times) self.dlgRestart.SetTop() else: def OpenRestartDialog(self): self.dlgRestart.OpenDialog() self.dlgRestart.SetTop() //> //<root:localeInfo.py def SecondToMS(time): if time < 60: return "%d%s" % (time, SECOND) second = int(time % 60) minute = int((time / 60) % 60) text = "" if minute > 0: text += str(minute) + MINUTE if minute > 0: text += " " if second > 0: text += str(second) + SECOND return text //> //<locale/locale_game.txt REVIVE_AUTO_TOWN_MESSAGE Autorestart at town in: {} //> You can follow the tutorial from the original post, I have changed some names, you can compare them. 9 2 19 Link to comment Share on other sites More sharing options...
Honorable Member Mali 41641 Posted July 27, 2019 Author Honorable Member Share Posted July 27, 2019 Thanks penger. I am not at home. Topic will be updated in few days Edit:Updated 1 Link to comment Share on other sites More sharing options...
Active Member Helia01 2122 Posted July 28, 2019 Active Member Share Posted July 28, 2019 THX :3 Nice system Link to comment Share on other sites More sharing options...
Premium ragem0re 155 Posted August 2, 2019 Premium Share Posted August 2, 2019 On 7/28/2019 at 7:28 PM, Helia01 said: THX :3 Nice system I'm facing the same issue, did you get it fixed? Link to comment Share on other sites More sharing options...
Active Member Koray 1993 Posted August 2, 2019 Active Member Share Posted August 2, 2019 if 0. < endtime <= .1: change with if endtime < 0: Link to comment Share on other sites More sharing options...
JeeX 38 Posted August 2, 2019 Share Posted August 2, 2019 Is there any possibility @p3ng3r bis Version to ignore at gamemaster? Because i changed some Line at cmd_general.cpp that gamemaster are possible to start here/start in City without waiting But now i have to wait... I tested with return 0 but i will get the negative time I hope, someone know a solution. Best regards Link to comment Share on other sites More sharing options...
Honorable Member Mali 41641 Posted August 2, 2019 Author Honorable Member Share Posted August 2, 2019 Sorry for waiting i am little bit busy. Fixed and added mini codes for Close GM wait time Link to comment Share on other sites More sharing options...
JeeX 38 Posted August 2, 2019 Share Posted August 2, 2019 (edited) vor 3 Stunden schrieb Koray: if 0. < endtime <= .1: change with if endtime < 0: dont work -> cant click on buttons. (No syserr) https://metin2.download/picture/oQ1pbK3R4lKPk78yNRO4C9woo7PuwUSK/.gif Edited August 27, 2022 by Metin2 Dev Core X - External 2 Internal 2 Link to comment Share on other sites More sharing options...
JeeX 38 Posted August 6, 2019 Share Posted August 6, 2019 (edited) Am 2.8.2019 um 16:40 schrieb JeeX: dont work -> cant click on buttons. (No syserr) https://metin2.download/picture/oQ1pbK3R4lKPk78yNRO4C9woo7PuwUSK/.gif Am 28.7.2019 um 19:28 schrieb Helia01: THX :3 Nice system No Solution? hope anyone knows best regards. Edited August 27, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Honorable Member Mali 41641 Posted August 12, 2019 Author Honorable Member Share Posted August 12, 2019 On 8/6/2019 at 6:22 PM, JeeX said: No Solution? hope anyone knows best regards. I checked all codes but I did not find any error in py codes. Then I checked ui enable/disable command at client src(PythonWindow.cpp) and I found little mistake. Now I fixed that code and bug solved. ->Update EterPythonLib/PythonWindow.cpp Link to comment Share on other sites More sharing options...
Barissa 2 Posted May 19, 2020 Share Posted May 19, 2020 (edited) On 7/15/2019 at 6:27 PM, Mali61 said: This is the hidden content, please Sign In or Sign Up hi i found a little "bug" on the system: in guildwar you have a timer from 7 seconds but normally it's 0 seconds Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
Recommended Posts