This problem resolved added in .cpp DWORD InstanceBase::GetLevel and okey.
Next problem my friends in character has active Premium
When I writed in chat have:
Bitte melden Sie sich an, um diesen Anhang zu sehen.
When using glass:
Bitte melden Sie sich an, um diesen Anhang zu sehen.
in input_main.cpp
Code
- int nPrismCount = ch->CountSpecifyItem(ITEM_PRISM);
- if (nPrismCount < hyperlinks)
- return 0;
- input_main.cpp
- int CInputMain::Chat(LPCHARACTER ch, const char * data, size_t uiBytes)
- {
- const TPacketCGChat* pinfo = reinterpret_cast<const TPacketCGChat*>(data);
- if (uiBytes < pinfo->size)
- return -1;
- const int iExtraLen = pinfo->size - sizeof(TPacketCGChat);
- if (iExtraLen < 0)
- {
- sys_err("invalid packet length (len %d size %u buffer %u)", iExtraLen, pinfo->size, uiBytes);
- ch->GetDesc()->SetPhase(PHASE_CLOSE);
- return -1;
- }
- #if (defined ENABLE_PREMIUM_SYSTEM && defined ENABLE_PREMIUM_PREFIX_IN_CHAT)
- char buf[CHAT_MAX_LEN - strlen(premium_prefix) - (CHARACTER_NAME_MAX_LEN + 3) + 1];
- #else
- char buf[CHAT_MAX_LEN - (CHARACTER_NAME_MAX_LEN + 3) + 1];
- #endif
- strlcpy(buf, data + sizeof(TPacketCGChat), MIN(iExtraLen + 1, sizeof(buf)));
- const size_t buflen = strlen(buf);
- if (buflen > 1 && *buf == '/')
- {
- interpret_command(ch, buf + 1, buflen - 1);
- return iExtraLen;
- }
- if (ch->IncreaseChatCounter() >= 10)
- {
- if (ch->GetChatCounter() == 10)
- {
- sys_log(0, "CHAT_HACK: %s", ch->GetName());
- ch->GetDesc()->DelayedDisconnect(5);
- }
- return iExtraLen;
- }
- // äĆĂ ±ÝÁö Affect Ăł¸®
- const CAffect* pAffect = ch->FindAffect(AFFECT_BLOCK_CHAT);
- if (pAffect != NULL)
- {
- SendBlockChatInfo(ch, pAffect->lDuration);
- return iExtraLen;
- }
- if (true == SpamBlockCheck(ch, buf, buflen))
- {
- return iExtraLen;
- }
- char chatbuf[CHAT_MAX_LEN + 1];
- int len;
- #if (defined ENABLE_PREMIUM_SYSTEM && defined ENABLE_PREMIUM_PREFIX_IN_CHAT)
- if(CPremiumSystem::instance().IsPremium2(ch))
- len = snprintf(chatbuf, sizeof(chatbuf), "%s %s : %s", premium_prefix, ch->GetName(), buf);
- else
- len = snprintf(chatbuf, sizeof(chatbuf), "%s : %s", ch->GetName(), buf);
- #else
- len = snprintf(chatbuf, sizeof(chatbuf), "%s : %s", ch->GetName(), buf);
- #endif
- if (CHAT_TYPE_SHOUT == pinfo->type)
- {
- LogManager::instance().ShoutLog(g_bChannel, ch->GetEmpire(), chatbuf);
- }
- if (LC_IsCanada() == false)
- {
- CBanwordManager::instance().ConvertString(buf, buflen);
- }
- if (len < 0 || len >= (int) sizeof(chatbuf))
- len = sizeof(chatbuf) - 1;
- int processReturn = ProcessTextTag(ch, chatbuf, len);
- if (0!=processReturn)
- {
- const TItemTable* pTable = ITEM_MANAGER::instance().GetTable(ITEM_PRISM);
- if (NULL != pTable)
- {
- if (3==processReturn) //±łČŻÁß
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´Ů¸Ą °Ĺ·ˇÁß(â°í,±łČŻ,»óÁˇ)żˇ´Â °łŔλóÁˇŔ» »çżëÇŇ Ľö ľř˝Ŕ´Ď´Ů."), pTable->szLocaleName);
- else
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%sŔĚ ÇĘżäÇŐ´Ď´Ů."), pTable->szLocaleName);
- }
- return iExtraLen;
- }
- if (pinfo->type == CHAT_TYPE_SHOUT)
- {
- const int SHOUT_LIMIT_LEVEL = g_iUseLocale ? 15 : 3;
- if (ch->GetLevel() < SHOUT_LIMIT_LEVEL)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("żÜġ±â´Â ·ąş§ %d ŔĚ»ó¸¸ »çżë °ˇ´É ÇŐ´Ď´Ů."), SHOUT_LIMIT_LEVEL);
- return (iExtraLen);
- }
- if (thecore_heart->pulse - (int) ch->GetLastShoutPulse() < passes_per_sec * 15)
- return (iExtraLen);
- ch->SetLastShoutPulse(thecore_heart->pulse);
- TPacketGGShout p;
- p.bHeader = HEADER_GG_SHOUT;
- p.bEmpire = ch->GetEmpire();
- strlcpy(p.szText, chatbuf, sizeof(p.szText));
- P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout));
- SendShout(chatbuf, ch->GetEmpire());
- return (iExtraLen);
- }
- TPacketGCChat pack_chat;
- pack_chat.header = HEADER_GC_CHAT;
- pack_chat.size = sizeof(TPacketGCChat) + len;
- pack_chat.type = pinfo->type;
- pack_chat.id = ch->GetVID();
- switch (pinfo->type)
- {
- case CHAT_TYPE_TALKING:
- {
- const DESC_MANAGER::DESC_SET & c_ref_set = DESC_MANAGER::instance().GetClientSet();
- if (false)
- {
- std::for_each(c_ref_set.begin(), c_ref_set.end(),
- FYmirChatPacket(pack_chat,
- buf,
- strlen(buf),
- ch->GetName(),
- strlen(ch->GetName()),
- ch->GetMapIndex(),
- ch->GetEmpire(),
- ch->IsEquipUniqueGroup(UNIQUE_GROUP_RING_OF_LANGUAGE)));
- }
- else
- {
- std::for_each(c_ref_set.begin(), c_ref_set.end(),
- FEmpireChatPacket(pack_chat,
- chatbuf,
- len,
- (ch->GetGMLevel() > GM_PLAYER ||
- ch->IsEquipUniqueGroup(UNIQUE_GROUP_RING_OF_LANGUAGE)) ? 0 : ch->GetEmpire(),
- ch->GetMapIndex(), strlen(ch->GetName())));
- }
- }
- break;
- case CHAT_TYPE_PARTY:
- {
- if (!ch->GetParty())
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ĆÄĆĽ ÁßŔĚ ľĆ´Ő´Ď´Ů."));
- else
- {
- TEMP_BUFFER tbuf;
- tbuf.write(&pack_chat, sizeof(pack_chat));
- tbuf.write(chatbuf, len);
- RawPacketToCharacterFunc f(tbuf.read_peek(), tbuf.size());
- ch->GetParty()->ForEachOnlineMember(f);
- }
- }
- break;
- case CHAT_TYPE_GUILD:
- {
- if (!ch->GetGuild())
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("±ćµĺżˇ °ˇŔÔÇĎÁö ľĘľŇ˝Ŕ´Ď´Ů."));
- else
- ch->GetGuild()->Chat(chatbuf);
- }
- break;
- default:
- sys_err("Unknown chat type %d", pinfo->type);
- break;
- }
- return (iExtraLen);
- }
Thanks for answer