-
Posts
220 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by DrTurk
-
-
its not used, maybe they changed that after the source got leaked
-
new? that type of attacks in this scene arent new at all, just not many have known about it.
the attack is just flooding the sockets, so that no one can connect to the server, there are methods to fix this, but its not easy.
-
void CHARACTER::PointChange
SetHP(GetHP() + amount); val = GetHP(); BroadcastTargetPacket();
to
SetHP(GetHP() + amount); val = GetHP(); if (GetHP() < 0) { SetHP(0); val = 0; } BroadcastTargetPacket();
-
normal in marty files, you could debug it via visual studio. this bug doesnt appear in base leaked source
-
in germany they dont warn you, they knock on your door and take all your stuff
- 1
-
its better to run the server with visual studio, better for debugging.
-
there is no legal way
- 1
-
no/wrong folder in the mob_proto
wrong data folder for the mount
no accumulation in the msa
-
I just want to block it when your not the owner of the item, only hovering on the item will be very hard when the shoutbox is really active, but thanks anyway
-
Does someone know how to block copying posted hyperlinks from items?
-
6 hours ago, martysama0134 said:
There are far better solutions than using std::map or std::unordered_map (which still takes a lot of ram for no reason for each mob):
(I included the most important parts)
You also forgot the CubeItems, and we could probably fit the quickslot too.
With your changes -> 430MB
Without your changes -> 775MB
thats impressiv
Spoiler -
You can remove alot of dead code, i removed all of it years ago.
It takes time
-
1 hour ago, Kafa said:
Can i ask you what you did at start_position.cpp/,h ?
If you talking about that ->
char g_nation_name[4][32] = { "", "½Å¼ö±¹", "õÁ¶±¹", "Áø³ë±¹", };
I removed castle/monarch etc. on my source so i didnt had to translate that, but the same is for priv_empire function.
I send Sonitex my way how i have done this, but i think its better i keep that for me. I dont have alot knowledge about coding, so I dont really know if it works with alot of players. My way is a very dirty solution for the problem
- 1
-
ye better, the thing that i did was without checking if the string is empty
also created something for whisper because of duel:
pkVictim->LocaleWhisperPacket(WHISPER_TYPE_SYSTEM , pkChr, 503, "%s challenged you to a battle!", pkChr->GetName());
but the ugliest part that i did was for the priv_empire, no one wants to see what i did there
- 1
-
Ye didnt fix this yet, i'll fix that as soon as i have time for that.
ok just edit this in client src:
bool CPythonNetworkStream::RecvLocaleChatPacket() { TPacketGCLocaleChat kChat; if (!Recv(sizeof(kChat), &kChat)) return false; std::string localeString = ""; bool bSuccess = LocaleStringManager::Instance().FillLocaleString(kChat.format, localeString); if (!bSuccess) return false; if (CHAT_TYPE_NOTICE == kChat.type) { PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_SetTipMessage", Py_BuildValue("(s)", localeString.c_str())); } else if (CHAT_TYPE_BIG_NOTICE == kChat.type) { PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_SetBigMessage", Py_BuildValue("(s)", localeString.c_str())); } if (!localeString.empty()) CPythonChat::Instance().AppendChat(kChat.type, localeString.c_str()); return true; }
- 1
-
Just create another function like that:
void SendNoticeMapLocal(DWORD dwIndex, const char* c_pszBuf, int nMapIndex, bool bBigFont, ...) { BYTE type = 0; const DESC_MANAGER::DESC_SET& c_ref_set = DESC_MANAGER::instance().GetClientSet(); if (!c_pszBuf) return; DESC_MANAGER::DESC_SET::const_iterator it = c_ref_set.begin(); while (it != c_ref_set.end()) { LPDESC d = *(it++); if (d->GetCharacter()) { if (d->GetCharacter()->GetMapIndex() != nMapIndex) continue; bool isNotice = false; if (c_pszBuf == "%s") { char chatbuf[CHAT_MAX_LEN + 1]; va_list args; va_start(args, c_pszBuf); vsnprintf(chatbuf, sizeof(chatbuf), c_pszBuf, args); va_end(args); strlcpy(chatbuf, c_pszBuf, sizeof(chatbuf)); isNotice = true; } TEMP_BUFFER buf; if (bBigFont == true) { type = CHAT_TYPE_BIG_NOTICE; } else { type = CHAT_TYPE_NOTICE; } TPacketGCLocaleChat packet; packet.header = HEADER_GC_LOCALE_CHAT; packet.size = sizeof(TPacketGCLocaleChat); packet.type = type; packet.format = dwIndex; va_list args; va_start(args, bBigFont); FindFormatSpecifiers(c_pszBuf, args, &packet.size, &buf); va_end(args); d->Packet(&packet, sizeof(packet)); if (buf.size()) d->Packet(buf.read_peek(), buf.size()); } } }
then you can use it like that:
void WeddingMap::SetEnded(DWORD dwMapIndex) { if (m_pEndEvent) { sys_err("WeddingMap::SetEnded - ALREADY EndEvent(m_pEndEvent=%x)", get_pointer(m_pEndEvent)); return; } wedding_map_info* info = AllocEventInfo<wedding_map_info>(); info->pWeddingMap = this; m_pEndEvent = event_create(wedding_end_event, info, PASSES_PER_SEC(5)); SendNoticeMapLocal(889, " ", dwMapIndex, true); SendNoticeMapLocal(447, " ", dwMapIndex, true);
- 2
-
better use spoilers for each removed system
-
tested on windows with only map1 blue ->
with changed functions: 100,6MB
without changed functions: 114MB
nice release, thanks
-
just stop thinking about m2 and run away
its the best thing you can do
- 2
- 1
- 1
-
25 minutes ago, ReFresh said:
@DrTurk Thanks I'll try. But why did you remove that functions instead of calling Dead(); function? It should be the same thing as we call the Stun(); am I right? But mystery is why Stun(); function is able to remove these affects without editing something.
as i said i had this problem even before i modifyed the dead function, but only when you one shot someone with a poison skill.
i can redo my dead function modify and it will also bug when killed with one shot which has 100% poison rate
-
12 hours ago, ReFresh said:
I just tried your code edits and it has at least one bug with removing char affect like poison. Try to kill the player with ninja char skill Poisoned Arrow, player will die with poison affect on yourself.
I tried to call Dead(); function instead of your changes, but there is still the same bug with affects. Dead(); is not removing the poison, bleed, etc. affects. I couldn't find differences between why Stun(); function removing the affects correctly and Dead(); function not.
if (GetHP() <= 0) { Stun(); or Dead(); can be called but only Stun(); removing the affects before death correctly if (pAttacker && !pAttacker->IsNPC()) m_dwKillerPID = pAttacker->GetPlayerID(); else m_dwKillerPID = 0; } return false;
Would be really nice if someone can solve this problem.
Isnt that a normal m2 problem with bleed/poison/fire when you one shot someone with it?
I fixxed this before i did this change.
Just add
if (ch->IsDead()) { ch->RemovePoison(); }
like that:
EVENTFUNC(poison_event) { TPoisonEventInfo * info = dynamic_cast<TPoisonEventInfo *>( event->info ); if ( info == NULL ) { sys_err( "poison_event> <Factor> Null pointer" ); return 0; } LPCHARACTER ch = info->ch; if (ch == NULL) { return 0; } LPCHARACTER pkAttacker = CHARACTER_MANAGER::instance().FindByPID(info->attacker_pid); if (ch->IsDead()) { ch->RemovePoison(); } int dam = ch->GetMaxHP() * GetPoisonDamageRate(ch) / 1000; if (test_server) ch->ChatPacket(CHAT_TYPE_NOTICE, "Poison Damage %d", dam); if (ch->Damage(pkAttacker, dam, DAMAGE_TYPE_POISON)) { ch->m_pkPoisonEvent = NULL; return 0; } --info->count; if (info->count) return PASSES_PER_SEC(3); else { ch->m_pkPoisonEvent = NULL; return 0; } }
same thing with fire:
EVENTFUNC(fire_event) { TFireEventInfo * info = dynamic_cast<TFireEventInfo *>( event->info ); if ( info == NULL ) { sys_err( "fire_event> <Factor> Null pointer" ); return 0; } LPCHARACTER ch = info->ch; if (ch == NULL) { return 0; } LPCHARACTER pkAttacker = CHARACTER_MANAGER::instance().FindByPID(info->attacker_pid); if (ch->IsDead()) { ch->RemoveFire(); } int dam = info->amount; if (test_server) ch->ChatPacket(CHAT_TYPE_NOTICE, "Fire Damage %d", dam); if (ch->Damage(pkAttacker, dam, DAMAGE_TYPE_FIRE)) { ch->m_pkFireEvent = NULL; return 0; } --info->count; if (info->count) return PASSES_PER_SEC(3); else { ch->m_pkFireEvent = NULL; return 0; } }
-
Had two servers with that change, didnt experienced any bugs
- 1
-
char.cpp --> remove that:
m_dwKillerPID = 0;
char.h --> remove that:
DWORD m_dwKillerPID;
char_battle.cpp --> remove/change that:
if (!pkKiller && m_dwKillerPID) pkKiller = CHARACTER_MANAGER::instance().FindByPID(m_dwKillerPID); m_dwKillerPID = 0;
change that:
if (GetHP() <= 0) { Stun(); if (pAttacker && !pAttacker->IsNPC()) m_dwKillerPID = pAttacker->GetPlayerID(); else m_dwKillerPID = 0; }
to this:
if (GetHP() <= 0) { Dead(pAttacker); }
- 1
-
Change this:
if (iSizeBuffer > 0) { TEMP_BUFFER tempbuf; LPBUFFER lpBufferDecrypt = tempbuf.getptr(); buffer_adjust_size(lpBufferDecrypt, iSizeBuffer); int iSizeAfter = TEA_Decrypt((DWORD*)buffer_write_peek(lpBufferDecrypt), (DWORD*)buffer_read_peek(m_lpInputBuffer), GetDecryptionKey(),
to this:
if (iSizeBuffer > 0) { LPBUFFER lpBufferDecrypt = buffer_new(iSizeBuffer); int iSizeAfter = TEA_Decrypt((DWORD*)buffer_write_peek(lpBufferDecrypt), (DWORD*)buffer_read_peek(m_lpInputBuffer), GetDecryptionKey(), iSizeBuffer);
- 2
Client Locale String
in Features & Metin2 Systems
Posted
You have to code it