forked from metin2/server
Compare commits
12 Commits
0a907f41d2
...
cf66bb3310
Author | SHA1 | Date | |
---|---|---|---|
cf66bb3310 | |||
254f6f6664 | |||
0072bc5e14 | |||
62f3635b86 | |||
2c37b2009d | |||
e0701ed5bd | |||
21381a4e3a | |||
ba44269071 | |||
f5ccb17736 | |||
bb52a57ffc | |||
8360d6939f | |||
1e362d8507 |
@ -1097,8 +1097,3 @@ bool CArena::RegisterObserverPtr(LPCHARACTER pChar)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CArenaManager::IsLimitedItem( int lMapIndex, DWORD dwVnum )
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -131,8 +131,6 @@ class CArenaManager : public singleton<CArenaManager>
|
|||||||
|
|
||||||
bool IsArenaMap(DWORD dwMapIndex);
|
bool IsArenaMap(DWORD dwMapIndex);
|
||||||
MEMBER_IDENTITY IsMember(DWORD dwMapIndex, DWORD PID);
|
MEMBER_IDENTITY IsMember(DWORD dwMapIndex, DWORD PID);
|
||||||
|
|
||||||
bool IsLimitedItem( int lMapIndex, DWORD dwVnum );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*__CLASS_ARENA_MANAGER__*/
|
#endif /*__CLASS_ARENA_MANAGER__*/
|
||||||
|
@ -862,39 +862,19 @@ void CHARACTER::EncodeInsertPacket(LPENTITY entity)
|
|||||||
addPacket.dwLevel = GetLevel();
|
addPacket.dwLevel = GetLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: what is this doing here?
|
strlcpy(addPacket.name, GetName(), sizeof(addPacket.name));
|
||||||
if (false)
|
|
||||||
{
|
|
||||||
LPCHARACTER ch = (LPCHARACTER) entity;
|
|
||||||
|
|
||||||
if (GetEmpire() == ch->GetEmpire() || ch->GetGMLevel() > GM_PLAYER || m_bCharType == CHAR_TYPE_NPC)
|
if (GetGuild() != NULL)
|
||||||
{
|
{
|
||||||
goto show_all_info;
|
addPacket.dwGuildID = GetGuild()->GetID();
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
memset(addPacket.name, 0, CHARACTER_NAME_MAX_LEN);
|
|
||||||
addPacket.dwGuildID = 0;
|
|
||||||
addPacket.sAlignment = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
show_all_info:
|
addPacket.dwGuildID = 0;
|
||||||
strlcpy(addPacket.name, GetName(), sizeof(addPacket.name));
|
|
||||||
|
|
||||||
if (GetGuild() != NULL)
|
|
||||||
{
|
|
||||||
addPacket.dwGuildID = GetGuild()->GetID();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
addPacket.dwGuildID = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
addPacket.sAlignment = m_iAlignment / 10;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addPacket.sAlignment = m_iAlignment / 10;
|
||||||
|
|
||||||
d->Packet(&addPacket, sizeof(TPacketGCCharacterAdditionalInfo));
|
d->Packet(&addPacket, sizeof(TPacketGCCharacterAdditionalInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2040,16 +2040,7 @@ bool CHARACTER::Damage(LPCHARACTER pAttacker, int dam, EDamageType type) // retu
|
|||||||
// 다른 제국 사람인 경우 데미지 10% 감소
|
// 다른 제국 사람인 경우 데미지 10% 감소
|
||||||
if (iEmpire && iMapEmpire && iEmpire != iMapEmpire)
|
if (iEmpire && iMapEmpire && iEmpire != iMapEmpire)
|
||||||
{
|
{
|
||||||
int percent = 10;
|
const int percent = 9;
|
||||||
|
|
||||||
if (184 <= lMapIndex && lMapIndex <= 189)
|
|
||||||
{
|
|
||||||
percent = 9;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
percent = 9;
|
|
||||||
}
|
|
||||||
|
|
||||||
dam = dam * percent / 10;
|
dam = dam * percent / 10;
|
||||||
}
|
}
|
||||||
|
@ -1632,12 +1632,6 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
|||||||
|
|
||||||
SPDLOG_TRACE("USE_ITEM {}, Inven {}, Cell {}, ItemType {}, SubType {}", item->GetName(), bDestInven, wDestCell, item->GetType(), item->GetSubType());
|
SPDLOG_TRACE("USE_ITEM {}, Inven {}, Cell {}, ItemType {}, SubType {}", item->GetName(), bDestInven, wDestCell, item->GetType(), item->GetSubType());
|
||||||
|
|
||||||
if ( CArenaManager::instance().IsLimitedItem( GetMapIndex(), item->GetVnum() ) == true )
|
|
||||||
{
|
|
||||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot use this item in a duel."));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 아이템 최초 사용 이후부터는 사용하지 않아도 시간이 차감되는 방식 처리.
|
// 아이템 최초 사용 이후부터는 사용하지 않아도 시간이 차감되는 방식 처리.
|
||||||
if (-1 != iLimitRealtimeStartFirstUseFlagIndex)
|
if (-1 != iLimitRealtimeStartFirstUseFlagIndex)
|
||||||
{
|
{
|
||||||
@ -2455,7 +2449,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
|||||||
DWORD count;
|
DWORD count;
|
||||||
int prob;
|
int prob;
|
||||||
DWORD vnum;
|
DWORD vnum;
|
||||||
} b1[MAX_BAG_INFO] =
|
} bi[MAX_BAG_INFO] =
|
||||||
{
|
{
|
||||||
{ 1000, 302, 1 },
|
{ 1000, 302, 1 },
|
||||||
{ 10, 150, 27002 },
|
{ 10, 150, 27002 },
|
||||||
@ -2485,8 +2479,6 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
|||||||
{ 1, 1, 11882 },
|
{ 1, 1, 11882 },
|
||||||
};
|
};
|
||||||
|
|
||||||
LuckyBagInfo * bi = b1;
|
|
||||||
|
|
||||||
int pct = Random::get(1, 1000);
|
int pct = Random::get(1, 1000);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
@ -378,12 +378,6 @@ bool CHARACTER::LearnGrandMasterSkill(DWORD dwSkillVnum)
|
|||||||
}
|
}
|
||||||
// END_OF_ADD_GRANDMASTER_SKILL
|
// END_OF_ADD_GRANDMASTER_SKILL
|
||||||
|
|
||||||
static bool FN_should_check_exp(LPCHARACTER ch)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool CHARACTER::LearnSkillByBook(DWORD dwSkillVnum, BYTE bProb)
|
bool CHARACTER::LearnSkillByBook(DWORD dwSkillVnum, BYTE bProb)
|
||||||
{
|
{
|
||||||
const CSkillProto* pkSk = CSkillManager::instance().Get(dwSkillVnum);
|
const CSkillProto* pkSk = CSkillManager::instance().Get(dwSkillVnum);
|
||||||
@ -397,17 +391,12 @@ bool CHARACTER::LearnSkillByBook(DWORD dwSkillVnum, BYTE bProb)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD need_exp = 0;
|
DWORD need_exp = 20000;
|
||||||
|
|
||||||
if (FN_should_check_exp(this))
|
if ( GetExp() < need_exp )
|
||||||
{
|
{
|
||||||
need_exp = 20000;
|
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot read this due to your lack of experience."));
|
||||||
|
return false;
|
||||||
if ( GetExp() < need_exp )
|
|
||||||
{
|
|
||||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot read this due to your lack of experience."));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// bType이 0이면 처음부터 책으로 수련 가능
|
// bType이 0이면 처음부터 책으로 수련 가능
|
||||||
|
@ -387,6 +387,11 @@ int DetermineFish(LPCHARACTER ch)
|
|||||||
int * p = std::lower_bound(g_prob_accumulate[prob_idx], g_prob_accumulate[prob_idx] + MAX_FISH, rv);
|
int * p = std::lower_bound(g_prob_accumulate[prob_idx], g_prob_accumulate[prob_idx] + MAX_FISH, rv);
|
||||||
int fish_idx = p - g_prob_accumulate[prob_idx];
|
int fish_idx = p - g_prob_accumulate[prob_idx];
|
||||||
|
|
||||||
|
DWORD vnum = fish_info[fish_idx].vnum;
|
||||||
|
|
||||||
|
if (vnum == 50008 || vnum == 50009 || vnum == 80008)
|
||||||
|
return 0;
|
||||||
|
|
||||||
return (fish_idx);
|
return (fish_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -430,6 +430,9 @@ void CInputLogin::CharacterCreate(LPDESC d, const char * data)
|
|||||||
// 사용할 수 없는 이름이거나, 잘못된 평상복이면 생설 실패
|
// 사용할 수 없는 이름이거나, 잘못된 평상복이면 생설 실패
|
||||||
if (!check_name(pinfo->name) || pinfo->shape > 1)
|
if (!check_name(pinfo->name) || pinfo->shape > 1)
|
||||||
{
|
{
|
||||||
|
d->Packet(&packFailure, sizeof(packFailure));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const TAccountTable & c_rAccountTable = d->GetAccountTable();
|
const TAccountTable & c_rAccountTable = d->GetAccountTable();
|
||||||
|
|
||||||
@ -442,7 +445,6 @@ void CInputLogin::CharacterCreate(LPDESC d, const char * data)
|
|||||||
d->Packet(&pack, sizeof(pack));
|
d->Packet(&pack, sizeof(pack));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
memset(&player_create_packet, 0, sizeof(TPlayerCreatePacket));
|
memset(&player_create_packet, 0, sizeof(TPlayerCreatePacket));
|
||||||
|
|
||||||
@ -633,6 +635,10 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SPDLOG_WARN("VERSION : NO CHECK");
|
||||||
|
}
|
||||||
|
|
||||||
if (ch->IsGM() == true)
|
if (ch->IsGM() == true)
|
||||||
ch->ChatPacket(CHAT_TYPE_COMMAND, "ConsoleEnable");
|
ch->ChatPacket(CHAT_TYPE_COMMAND, "ConsoleEnable");
|
||||||
|
@ -26,7 +26,7 @@ const char * locale_find(const char *string)
|
|||||||
strlcpy(s_line + 5, string, sizeof(s_line) - 5);
|
strlcpy(s_line + 5, string, sizeof(s_line) - 5);
|
||||||
|
|
||||||
SPDLOG_ERROR("LOCALE_ERROR: \"{}\";", string);
|
SPDLOG_ERROR("LOCALE_ERROR: \"{}\";", string);
|
||||||
return string;
|
return s_line;
|
||||||
}
|
}
|
||||||
|
|
||||||
return iter->second.c_str();
|
return iter->second.c_str();
|
||||||
|
@ -676,6 +676,19 @@ int start(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
SPDLOG_INFO("MasterAuth {}", (int) LC_GetLocalType());
|
SPDLOG_INFO("MasterAuth {}", (int) LC_GetLocalType());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
/* game server to spam server */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
extern unsigned int g_uiSpamBlockDuration;
|
||||||
|
extern unsigned int g_uiSpamBlockScore;
|
||||||
|
extern unsigned int g_uiSpamReloadCycle;
|
||||||
|
|
||||||
|
SPDLOG_INFO("SPAM_CONFIG: duration {} score {} reload cycle {}",
|
||||||
|
g_uiSpamBlockDuration, g_uiSpamBlockScore, g_uiSpamReloadCycle);
|
||||||
|
|
||||||
|
extern void LoadSpamDB();
|
||||||
|
LoadSpamDB();
|
||||||
}
|
}
|
||||||
|
|
||||||
signal_timer_enable(30);
|
signal_timer_enable(30);
|
||||||
|
@ -1356,7 +1356,7 @@ void CParty::Update()
|
|||||||
bool bLongTimeExpBonusChanged = false;
|
bool bLongTimeExpBonusChanged = false;
|
||||||
|
|
||||||
// 파티 결성 후 충분한 시간이 지나면 경험치 보너스를 받는다.
|
// 파티 결성 후 충분한 시간이 지나면 경험치 보너스를 받는다.
|
||||||
if (!m_iLongTimeExpBonus && (get_dword_time() - m_dwPartyStartTime > PARTY_ENOUGH_MINUTE_FOR_EXP_BONUS * 60 * 1000 / 1))
|
if (!m_iLongTimeExpBonus && (get_dword_time() - m_dwPartyStartTime > PARTY_ENOUGH_MINUTE_FOR_EXP_BONUS * 60 * 1000))
|
||||||
{
|
{
|
||||||
bLongTimeExpBonusChanged = true;
|
bLongTimeExpBonusChanged = true;
|
||||||
m_iLongTimeExpBonus = 5;
|
m_iLongTimeExpBonus = 5;
|
||||||
|
@ -2063,7 +2063,64 @@ teleport_area:
|
|||||||
// 3: 이미 같은 이름이 사용중
|
// 3: 이미 같은 이름이 사용중
|
||||||
// 4: 성공
|
// 4: 성공
|
||||||
// 5: 해당 기능 지원하지 않음
|
// 5: 해당 기능 지원하지 않음
|
||||||
lua_pushnumber(L, 5);
|
|
||||||
|
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
|
||||||
|
|
||||||
|
if ( ch->GetNewName().size() != 0 )
|
||||||
|
{
|
||||||
|
lua_pushnumber(L, 0);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( lua_isstring(L, 1) != true )
|
||||||
|
{
|
||||||
|
lua_pushnumber(L, 1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char * szName = lua_tostring(L, 1);
|
||||||
|
|
||||||
|
if ( check_name(szName) == false )
|
||||||
|
{
|
||||||
|
lua_pushnumber(L, 2);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
char szQuery[1024];
|
||||||
|
snprintf(szQuery, sizeof(szQuery), "SELECT COUNT(*) FROM player%s WHERE name='%s'", get_table_postfix(), szName);
|
||||||
|
std::unique_ptr<SQLMsg> pmsg(DBManager::instance().DirectQuery(szQuery));
|
||||||
|
|
||||||
|
if ( pmsg->Get()->uiNumRows > 0 )
|
||||||
|
{
|
||||||
|
MYSQL_ROW row = mysql_fetch_row(pmsg->Get()->pSQLResult);
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
str_to_number(count, row[0]);
|
||||||
|
|
||||||
|
// 이미 해당 이름을 가진 캐릭터가 있음
|
||||||
|
if ( count != 0 )
|
||||||
|
{
|
||||||
|
lua_pushnumber(L, 3);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD pid = ch->GetPlayerID();
|
||||||
|
db_clientdesc->DBPacketHeader(HEADER_GD_FLUSH_CACHE, 0, sizeof(DWORD));
|
||||||
|
db_clientdesc->Packet(&pid, sizeof(DWORD));
|
||||||
|
|
||||||
|
/* delete messenger list */
|
||||||
|
MessengerManager::instance().RemoveAllList(ch->GetName());
|
||||||
|
|
||||||
|
/* change_name_log */
|
||||||
|
LogManager::instance().ChangeNameLog(pid, ch->GetName(), szName, ch->GetDesc()->GetHostName());
|
||||||
|
|
||||||
|
snprintf(szQuery, sizeof(szQuery), "UPDATE player%s SET name='%s' WHERE id=%u", get_table_postfix(), szName, pid);
|
||||||
|
SQLMsg * msg = DBManager::instance().DirectQuery(szQuery);
|
||||||
|
M2_DELETE(msg);
|
||||||
|
|
||||||
|
ch->SetNewName(szName);
|
||||||
|
lua_pushnumber(L, 4);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user