JeeX 38 Posted July 11, 2017 Share Posted July 11, 2017 Am 9.7.2017 um 21:54 schrieb Dimitar: How did you mean it? I just did these steps: https://pastebin.com/WFHspvrw , nothing else. Did you changed the packet.h on serversource & binary too? - so on both packet.h files? Because if you have in serversource packet.h 29 and in binary packet.h 30 -> you will get the "Unknown packet header" problem. Best regards. Link to comment Share on other sites More sharing options...
HaiosMotan 402 Posted July 13, 2017 Share Posted July 13, 2017 La 09.07.2017 la 10:09, flexio a spus: When a player write from channel 1 to 99(example) core drops. input_main.cpp else if (MessengerManager::instance().IsBlocked_Target(ch->GetName(), pkChr->GetName())) change to else if (pkChr && MessengerManager::instance().IsBlocked_Target(ch->GetName(), pkChr->GetName())) La 29.06.2017 la 15:12, Mali61 a spus: I know simple only 1 return if you do this, you can send/recive mesages to/from the person you blocked without any error. Link to comment Share on other sites More sharing options...
monarchis2 13 Posted July 13, 2017 Share Posted July 13, 2017 Works like a charm! But when you send a message from different channels (ch1 to ch2 for example), even if the player is block you can send the message. Link to comment Share on other sites More sharing options...
Reco 375 Posted July 27, 2017 Share Posted July 27, 2017 Hi guys i have a Problem with this System: Client Sysser 0727 19:16:33089 :: AttributeError 0727 19:16:33089 :: : 0727 19:16:33089 :: 'module' object has no attribute 'IsBlockByName' 0727 19:16:33089 :: I can`t remove blocked players. and when i click on a player i cant see the bar with Whisper, Exchange Friend Duel and with Gm account i see the bar i dont understand Where I should insert that -.- //In Server-Side: if (MessengerManager::instance().IsBlocked(player1name, player2name)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("BLOKLANDIN")); return; } if (MessengerManager::instance().IsFriend(player1name, player2name)) { ChatPacket(CHAT_TYPE_INFO, "This is your friend."); return; } //In Client: if messenger.IsBlockByName(player2name) or messenger.IsBlockByName(player1name): return //In Quest if pc.is_blocked(targetname) == true then say("This player blocked") if pc.is_friend(targetname) == true then say("This is your friend") Link to comment Share on other sites More sharing options...
HaiosMotan 402 Posted July 28, 2017 Share Posted July 28, 2017 Acum 18 ore, Reco a spus: Hi guys i have a Problem with this System: Client Sysser 0727 19:16:33089 :: AttributeError 0727 19:16:33089 :: : 0727 19:16:33089 :: 'module' object has no attribute 'IsBlockByName' 0727 19:16:33089 :: I can`t remove blocked players. and when i click on a player i cant see the bar with Whisper, Exchange Friend Duel and with Gm account i see the bar i dont understand Where I should insert that -.- //In Server-Side: if (MessengerManager::instance().IsBlocked(player1name, player2name)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("BLOKLANDIN")); return; } if (MessengerManager::instance().IsFriend(player1name, player2name)) { ChatPacket(CHAT_TYPE_INFO, "This is your friend."); return; } //In Client: if messenger.IsBlockByName(player2name) or messenger.IsBlockByName(player1name): return //In Quest if pc.is_blocked(targetname) == true then say("This player blocked") if pc.is_friend(targetname) == true then say("This is your friend") you can insert that if u want to do something by yourself. I mean if pc.is_blocked == true begin say("somebody hates you") .Function that you can use in client/server source /quest. Link to comment Share on other sites More sharing options...
ProblemsIn 70 Posted July 28, 2017 Share Posted July 28, 2017 Is little bit weird when u block someone, u can't see him but he can see u. If i block a guy is because i don't want to he know i'm there, i guess Link to comment Share on other sites More sharing options...
Honorable Member Mali 41875 Posted July 29, 2017 Author Honorable Member Share Posted July 29, 2017 On 28.07.2017 at 6:04 PM, ProblemsIn said: Is little bit weird when u block someone, u can't see him but he can see u. If i block a guy is because i don't want to he know i'm there, i guess That feature doesn't included this topic Link to comment Share on other sites More sharing options...
ProblemsIn 70 Posted July 29, 2017 Share Posted July 29, 2017 5 hours ago, Mali61 said: That feature doesn't included this topic U could add that feature on the system. The system itself would be much more appealing. If I block someone and that person keeps seeing me ... It does not make much sense, since I can not see her anymore and her can see me normally. It was much better if it were the other way round, I say. It's just an opinion. Link to comment Share on other sites More sharing options...
Honorable Member Mali 41875 Posted January 6, 2018 Author Honorable Member Share Posted January 6, 2018 Up Link to comment Share on other sites More sharing options...
HaiosMotan 402 Posted January 9, 2018 Share Posted January 9, 2018 La 06.01.2018 la 17:12, Mali61 a spus: Up can you resolve the problem with different channels? Link to comment Share on other sites More sharing options...
HaiosMotan 402 Posted January 10, 2018 Share Posted January 10, 2018 @Mali61 if you changed something in the system,something doesn't work in cmd_general cmd_general.cpp: In function 'void do_pvp(CHARACTER*, const char*, int, int)': cmd_general.cpp:802: error: 'tch' was not declared in this scope cmd_general.cpp:808: error: 'tch' was not declared in this scope Link to comment Share on other sites More sharing options...
Premium Speachless 759 Posted February 28, 2018 Premium Share Posted February 28, 2018 void MessengerManager::RemoveFromBlockList(MessengerManager::keyA account, MessengerManager::keyA companion) You have to escape it. Haven't you learned anything from the past sql exploit ? Link to comment Share on other sites More sharing options...
Honorable Member Mali 41875 Posted March 9, 2018 Author Honorable Member Share Posted March 9, 2018 On 28.02.2018 at 4:23 PM, Dobrescu Sebastian said: void MessengerManager::RemoveFromBlockList(MessengerManager::keyA account, MessengerManager::keyA companion) You have to escape it. Haven't you learned anything from the past sql exploit ? No, whatever You know that bug fixed, you can fix like the messenger Link to comment Share on other sites More sharing options...
Premium Speachless 759 Posted March 9, 2018 Premium Share Posted March 9, 2018 Just now, Mali61 said: No, whatever You know that bug fixed, you can fix like the messenger Yes, but i saw others using it without the fix. And i was like " what the hell man, people just don't want to learn from the past " Link to comment Share on other sites More sharing options...
Honorable Member Mali 41875 Posted March 9, 2018 Author Honorable Member Share Posted March 9, 2018 10 minutes ago, Dobrescu Sebastian said: Yes, but i saw others using it without the fix. And i was like " what the hell man, people just don't want to learn from the past " Yes bro I can't learn anything from the past sorry Link to comment Share on other sites More sharing options...
Premium Speachless 759 Posted March 9, 2018 Premium Share Posted March 9, 2018 1 hour ago, Mali61 said: Yes bro I can't learn anything from the past sorry I wasn't talking about you. I appreciate that there are people who post free systems. I am taking about owner of server who download a system, but don't look in code. Every code can be improved. I know people who used systems from internet and got their servers f.up. It's not about who created the system, it's about who use it. Please accept my apologies, I didn't mean to upset you. Link to comment Share on other sites More sharing options...
flexio 83 Posted December 7, 2018 Share Posted December 7, 2018 Whisper fix int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes) { const TPacketCGWhisper* pinfo = reinterpret_cast<const TPacketCGWhisper*>(data); if (uiBytes < pinfo->wSize) return -1; int iExtraLen = pinfo->wSize - sizeof(TPacketCGWhisper); if (iExtraLen < 0) { sys_err("invalid packet length (len %d size %u buffer %u)", iExtraLen, pinfo->wSize, uiBytes); ch->GetDesc()->SetPhase(PHASE_CLOSE); return -1; } if (ch->GetLastPMPulse() < thecore_pulse()) ch->ClearPMCounter(); if (ch->GetPMCounter() > 3 && ch->GetLastPMPulse() > thecore_pulse()) { ch->GetDesc()->SetPhase(PHASE_CLOSE); return -1; } if (ch->FindAffect(AFFECT_BLOCK_CHAT)) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("채팅 금지 상태입니다.")); return (iExtraLen); } LPCHARACTER pkChr = CHARACTER_MANAGER::instance().FindPC(pinfo->szNameTo); if (pkChr == ch) return (iExtraLen); ch->IncreasePMCounter(); ch->SetLastPMPulse(); LPDESC pkDesc = NULL; std::string targetname; BYTE bOpponentEmpire = 0; if (test_server) { if (!pkChr) sys_log(0, "Whisper to %s(%s) from %s", "Null", pinfo->szNameTo, ch->GetName()); else sys_log(0, "Whisper to %s(%s) from %s", pkChr->GetName(), pinfo->szNameTo, ch->GetName()); } if (ch->IsBlockMode(BLOCK_WHISPER)) { if (ch->GetDesc()) { TPacketGCWhisper pack; pack.bHeader = HEADER_GC_WHISPER; pack.bType = WHISPER_TYPE_SENDER_BLOCKED; pack.wSize = sizeof(TPacketGCWhisper); strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom)); ch->GetDesc()->Packet(&pack, sizeof(pack)); } return iExtraLen; } CCI * pkCCI; if (!pkChr) { pkCCI = P2P_MANAGER::instance().Find(pinfo->szNameTo); if (pkCCI) { pkDesc = pkCCI->pkDesc; pkDesc->SetRelay(pinfo->szNameTo); bOpponentEmpire = pkCCI->bEmpire; targetname = pkCCI->szName; if (test_server) sys_log(0, "Whisper to %s from %s (Channel %d Mapindex %d)", "Null", ch->GetName(), pkCCI->bChannel, pkCCI->lMapIndex); } } else { pkDesc = pkChr->GetDesc(); bOpponentEmpire = pkChr->GetEmpire(); targetname = pkChr->GetName(); } if (!pkDesc) { if (ch->GetDesc()) { TPacketGCWhisper pack; pack.bHeader = HEADER_GC_WHISPER; pack.bType = WHISPER_TYPE_NOT_EXIST; pack.wSize = sizeof(TPacketGCWhisper); strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom)); ch->GetDesc()->Packet(&pack, sizeof(TPacketGCWhisper)); sys_log(0, "WHISPER: no player"); } } else { if (ch->IsBlockMode(BLOCK_WHISPER)) { if (ch->GetDesc()) { TPacketGCWhisper pack; pack.bHeader = HEADER_GC_WHISPER; pack.bType = WHISPER_TYPE_SENDER_BLOCKED; pack.wSize = sizeof(TPacketGCWhisper); strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom)); ch->GetDesc()->Packet(&pack, sizeof(pack)); } } else if (pkChr && pkChr->IsBlockMode(BLOCK_WHISPER)) { if (ch->GetDesc()) { TPacketGCWhisper pack; pack.bHeader = HEADER_GC_WHISPER; pack.bType = WHISPER_TYPE_TARGET_BLOCKED; pack.wSize = sizeof(TPacketGCWhisper); strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom)); ch->GetDesc()->Packet(&pack, sizeof(pack)); } } #ifdef ENABLE_MESSENGER_BLOCK else if ((pkCCI != NULL || pkChr != NULL) && MessengerManager::instance().CheckMessengerList(ch->GetName(), targetname.c_str(), SYST_BLOCK)) { if (ch->GetDesc()) { TPacketGCWhisper pack; char msg_2[CHAT_MAX_LEN + 1]; snprintf(msg_2, sizeof(msg_2), LC_TEXT("%s'yi blokladim"), targetname.c_str()); int len = MIN(CHAT_MAX_LEN, strlen(msg_2) + 1); pack.bHeader = HEADER_GC_WHISPER; pack.wSize = sizeof(TPacketGCWhisper) + len; pack.bType = WHISPER_TYPE_SYSTEM; strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom)); TEMP_BUFFER buf; buf.write(&pack, sizeof(TPacketGCWhisper)); buf.write(msg_2, len); ch->GetDesc()->Packet(buf.read_peek(), buf.size()); } } #endif else Link to comment Share on other sites More sharing options...
Premium Galet 510 Posted March 9, 2019 Premium Share Posted March 9, 2019 I am thinking about something, what if you block someone and your guild fight against this guy? You won't be able to see him nor to pvp with him, which might be an exploit if for example, even more with the fact that you won't see him but he will see you, which is unfair during guild fight. Link to comment Share on other sites More sharing options...
Developer PACI 921 Posted March 9, 2019 Developer Share Posted March 9, 2019 That doesn't make any sense, this should be all about the messaging system. At least the title says it. 1 when you return 0 and server doesn't boot: Link to comment Share on other sites More sharing options...
alexghinet 11 Posted February 7, 2020 Share Posted February 7, 2020 Incomplete + exploit + bugs ! Link to comment Share on other sites More sharing options...
SorinSmon 494 Posted March 10, 2020 Share Posted March 10, 2020 (edited) On 2/7/2020 at 2:07 AM, alexghinet said: Incomplete + exploit + bugs ! can you explain please? btw guys any update for whisper block button? for players can block the player from the PM i mean? Edited March 11, 2020 by SorinSmon Link to comment Share on other sites More sharing options...
JeeX 38 Posted March 4, 2021 Share Posted March 4, 2021 (edited) -deleted- Edited March 4, 2021 by JeeX Link to comment Share on other sites More sharing options...
klynaTz 1 Posted April 26, 2021 Share Posted April 26, 2021 (edited) Here is how I made the whisper button using the block by name function, exactly how it works from the messenger window when you type the name yourself. uiwhisper.py Search: self.minimizeButton = GetObject("minimizebutton") Add below: self.blockPlayer = GetObject("blockplayer") Search: self.chatLine.SetEscapeEvent(ui.__mem_func__(self.Minimize)) Add below: self.blockPlayer.SetEvent(ui.__mem_func__(self.BlockPlayer)) Search: self.minimizeButton = None Add below: self.blockPlayer = None Search: Under def OpenWithTarget(self, targetName): function self.minimizeButton.Show() Add below: if app.ENABLE_MESSENGER_BLOCK: if not messenger.IsBlockByName(self.targetName): self.blockPlayer.Show() else: self.blockPlayer.Hide() Search: Under def OpenWithoutTarget(self, event): function self.minimizeButton.Hide() Add below: if app.ENABLE_MESSENGER_BLOCK: if not messenger.IsBlockByName(self.targetName): self.blockPlayer.Show() else: self.blockPlayer.Hide() Search: def ReportViolentWhisper(self): Add before: def BlockPlayer(self): net.SendMessengerAddBlockByNamePacket(self.targetName) uiscript/whisperdialog.py Search: { "name" : "reportviolentwhisperbutton", "type" : "button", "x" : 145, "y" : 10, "text" : uiScriptLocale.WHISPER_REPORT, "default_image" : "d:/ymir work/ui/public/large_button_01.sub", "over_image" : "d:/ymir work/ui/public/large_button_02.sub", "down_image" : "d:/ymir work/ui/public/large_button_03.sub", }, Add below: { "name" : "blockplayer", "type" : "button", "x" : 145, "y" : 10, "text" : uiScriptLocale.WHISPER_BLOCK, "default_image" : "d:/ymir work/ui/public/small_thin_button_01.sub", "over_image" : "d:/ymir work/ui/public/small_thin_button_02.sub", "down_image" : "d:/ymir work/ui/public/small_thin_button_03.sub", }, You may need to play with the button in the whisper window because I got more buttons and It might be arranged differently. Edit: Also this version of the system is not full, you might wanna try and take it from some serverfiles which fixed most things for it. The only problem I am having now is cross core, it does not block the players if they are on different cores. Edit 2: Cross core fix After I made this "fix", I totally removed the system from my sources. Fixing one problem gets you to 100 more. You might need to change MESSENGER_BLOCK with yours as I changed the functions and made more checks. Fixing this problem will get you to another core problem, when on different cores if the blocker removes the blocked, the blocked one is being disconnected and the blocker gets some errors and needs to relog in order to do anything. I know some servers that were using this system and removed it later on, but if properly fixed it might get your job done. Search: if (test_server) sys_log(0, "Whisper to %s from %s (Channel %d Mapindex %d)", "Null", ch->GetName(), pkCCI->bChannel, pkCCI->lMapIndex); Add below: #ifdef __MESSENGER_BLOCK_SYSTEM__ if (MessengerManager::instance().CheckMessengerList(ch->GetName(), pkCCI->szName, MESSENGER_BLOCK)) { if (ch->GetDesc()) { TPacketGCWhisper pack; char msg[CHAT_MAX_LEN + 1]; snprintf(msg, sizeof(msg), LC_TEXT("Unblock %s to continue."), pkCCI->szName); int len = MIN(CHAT_MAX_LEN, strlen(msg) + 1); pack.bHeader = HEADER_GC_WHISPER; pack.wSize = sizeof(TPacketGCWhisper) + len; pack.bType = WHISPER_TYPE_SYSTEM; strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom)); TEMP_BUFFER buf; buf.write(&pack, sizeof(TPacketGCWhisper)); buf.write(msg, len); ch->GetDesc()->Packet(buf.read_peek(), buf.size()); ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Unblock %s to continue."), pkCCI->szName); } return iExtraLen; } else if (MessengerManager::instance().CheckMessengerList(pkCCI->szName, ch->GetName(), MESSENGER_BLOCK)) { if (ch->GetDesc()) { TPacketGCWhisper pack; char msg[CHAT_MAX_LEN + 1]; snprintf(msg, sizeof(msg), LC_TEXT("%s has blocked you."), pkCCI->szName); int len = MIN(CHAT_MAX_LEN, strlen(msg) + 1); pack.bHeader = HEADER_GC_WHISPER; pack.wSize = sizeof(TPacketGCWhisper) + len; pack.bType = WHISPER_TYPE_SYSTEM; strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom)); TEMP_BUFFER buf; buf.write(&pack, sizeof(TPacketGCWhisper)); buf.write(msg, len); ch->GetDesc()->Packet(buf.read_peek(), buf.size()); ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s has blocked you."), pkCCI->szName); } return iExtraLen; } #endif Edited April 26, 2021 by klynaTz 1 Link to comment Share on other sites More sharing options...
TheBigBag 2 Posted May 16, 2021 Share Posted May 16, 2021 @klynaTz Missing to add at the beginning. uiwhisper.py import messenger Link to comment Share on other sites More sharing options...
narcisxb 26 Posted November 14, 2021 Share Posted November 14, 2021 (edited) Does anyone have the code updated for newer versions of C++? auto_ptr doesn t work, bind1st appears to be utterly removed from C++ after 2017 and mem_fun also does not work anymore. Edited November 14, 2021 by narcisxb Link to comment Share on other sites More sharing options...
Recommended Posts