forked from metin2/server
1
0
Fork 0

Database now runs on linux

This commit is contained in:
Exynox 2022-03-05 19:59:39 +02:00
parent f4f90b2533
commit 90ef09c331
131 changed files with 467 additions and 446 deletions

5
.gitignore vendored
View File

@ -360,4 +360,7 @@ MigrationBackup/
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd
# Debug folder
test/

View File

@ -5,7 +5,7 @@
#include <boost/unordered_map.hpp>
#include "Cache.h"
#include "../../common/auction_table.h"
#include <common/auction_table.h>
class CItemCache;
class CAuctionItemInfoCache;

View File

@ -61,7 +61,7 @@ bool CBlockCountry::Load()
BLOCK_IP *block_ip = new BLOCK_IP;
block_ip->ip_from = strtoul(row[0], NULL, 10);
block_ip->ip_to = strtoul(row[1], NULL, 10);
strlcpy(block_ip->country, row[2], sizeof(block_ip->country));
strncpy(block_ip->country, row[2], sizeof(block_ip->country));
m_block_ip.push_back(block_ip);
sys_log(0, "BLOCKED_IP : %u - %u", block_ip->ip_from, block_ip->ip_to);
@ -174,7 +174,7 @@ void CBlockCountry::SendBlockExceptionOne(CPeer *peer, const char *login, BYTE c
TPacketBlockException packet;
packet.cmd = cmd;
strlcpy(packet.login, login, sizeof(packet.login));
strncpy(packet.login, login, sizeof(packet.login));
peer->EncodeHeader(HEADER_DG_BLOCK_EXCEPTION, 0, sizeof(TPacketBlockException));
peer->Encode(&packet, sizeof(packet));

View File

@ -2,8 +2,8 @@
#ifndef __INC_DB_CACHE_H__
#define __INC_DB_CACHE_H__
#include "../../common/cache.h"
#include "../../common/auction_table.h"
#include <common/cache.h>
#include <common/auction_table.h>
class CItemCache : public cache<TPlayerItem>
{

View File

@ -1,9 +1,9 @@
#include "stdafx.h"
#include "../../common/billing.h"
#include "../../common/building.h"
#include "../../common/VnumHelper.h"
#include <common/billing.h>
#include <common/building.h>
#include <common/VnumHelper.h>
#include "../../libgame/include/grid.h"
#include "ClientManager.h"
@ -122,7 +122,7 @@ bool CClientManager::Initialize()
char szBindIP[128];
if (!CConfig::instance().GetValue("BIND_IP", szBindIP, 128))
strlcpy(szBindIP, "0", sizeof(szBindIP));
strncpy(szBindIP, "0", sizeof(szBindIP));
m_fdAccept = socket_tcp_bind(szBindIP, tmpValue);
@ -483,11 +483,11 @@ void CClientManager::QUERY_QUEST_SAVE(CPeer * pkPeer, TQuestTable * pTable, DWOR
void CClientManager::QUERY_SAFEBOX_LOAD(CPeer * pkPeer, DWORD dwHandle, TSafeboxLoadPacket * packet, bool bMall)
{
ClientHandleInfo * pi = new ClientHandleInfo(dwHandle);
strlcpy(pi->safebox_password, packet->szPassword, sizeof(pi->safebox_password));
strncpy(pi->safebox_password, packet->szPassword, sizeof(pi->safebox_password));
pi->account_id = packet->dwID;
pi->account_index = 0;
pi->ip[0] = bMall ? 1 : 0;
strlcpy(pi->login, packet->szLogin, sizeof(pi->login));
strncpy(pi->login, packet->szLogin, sizeof(pi->login));
char szQuery[QUERY_MAX_LEN];
snprintf(szQuery, sizeof(szQuery),
@ -513,7 +513,7 @@ void CClientManager::RESULT_SAFEBOX_LOAD(CPeer * pkPeer, SQLMsg * msg)
if (pi->account_index == 0)
{
char szSafeboxPassword[SAFEBOX_PASSWORD_MAX_LEN + 1];
strlcpy(szSafeboxPassword, pi->safebox_password, sizeof(szSafeboxPassword));
strncpy(szSafeboxPassword, pi->safebox_password, sizeof(szSafeboxPassword));
TSafeboxTable * pSafebox = new TSafeboxTable;
memset(pSafebox, 0, sizeof(TSafeboxTable));
@ -853,8 +853,8 @@ void CClientManager::RESULT_SAFEBOX_CHANGE_SIZE(CPeer * pkPeer, SQLMsg * msg)
void CClientManager::QUERY_SAFEBOX_CHANGE_PASSWORD(CPeer * pkPeer, DWORD dwHandle, TSafeboxChangePasswordPacket * p)
{
ClientHandleInfo * pi = new ClientHandleInfo(dwHandle);
strlcpy(pi->safebox_password, p->szNewPassword, sizeof(pi->safebox_password));
strlcpy(pi->login, p->szOldPassword, sizeof(pi->login));
strncpy(pi->safebox_password, p->szNewPassword, sizeof(pi->safebox_password));
strncpy(pi->login, p->szOldPassword, sizeof(pi->login));
pi->account_id = p->dwID;
char szQuery[QUERY_MAX_LEN];
@ -1081,7 +1081,7 @@ void CClientManager::QUERY_SETUP(CPeer * peer, DWORD dwHandle, const char * c_pD
//
TMapLocation kMapLocations;
strlcpy(kMapLocations.szHost, peer->GetPublicIP(), sizeof(kMapLocations.szHost));
strncpy(kMapLocations.szHost, peer->GetPublicIP(), sizeof(kMapLocations.szHost));
kMapLocations.wPort = peer->GetListenPort();
thecore_memcpy(kMapLocations.alMaps, peer->GetMaps(), sizeof(kMapLocations.alMaps));
@ -1104,7 +1104,7 @@ void CClientManager::QUERY_SETUP(CPeer * peer, DWORD dwHandle, const char * c_pD
if (tmp->GetChannel() == GUILD_WARP_WAR_CHANNEL || tmp->GetChannel() == peer->GetChannel())
{
TMapLocation kMapLocation2;
strlcpy(kMapLocation2.szHost, tmp->GetPublicIP(), sizeof(kMapLocation2.szHost));
strncpy(kMapLocation2.szHost, tmp->GetPublicIP(), sizeof(kMapLocation2.szHost));
kMapLocation2.wPort = tmp->GetListenPort();
thecore_memcpy(kMapLocation2.alMaps, tmp->GetMaps(), sizeof(kMapLocation2.alMaps));
vec_kMapLocations.push_back(kMapLocation2);
@ -1131,7 +1131,7 @@ void CClientManager::QUERY_SETUP(CPeer * peer, DWORD dwHandle, const char * c_pD
if (tmp->GetChannel() == 1 || tmp->GetChannel() == peer->GetChannel())
{
TMapLocation kMapLocation2;
strlcpy(kMapLocation2.szHost, tmp->GetPublicIP(), sizeof(kMapLocation2.szHost));
strncpy(kMapLocation2.szHost, tmp->GetPublicIP(), sizeof(kMapLocation2.szHost));
kMapLocation2.wPort = tmp->GetListenPort();
thecore_memcpy(kMapLocation2.alMaps, tmp->GetMaps(), sizeof(kMapLocation2.alMaps));
vec_kMapLocations.push_back(kMapLocation2);
@ -1159,7 +1159,7 @@ void CClientManager::QUERY_SETUP(CPeer * peer, DWORD dwHandle, const char * c_pD
{
TMapLocation kMapLocation2;
strlcpy(kMapLocation2.szHost, tmp->GetPublicIP(), sizeof(kMapLocation2.szHost));
strncpy(kMapLocation2.szHost, tmp->GetPublicIP(), sizeof(kMapLocation2.szHost));
kMapLocation2.wPort = tmp->GetListenPort();
thecore_memcpy(kMapLocation2.alMaps, tmp->GetMaps(), sizeof(kMapLocation2.alMaps));
@ -1191,7 +1191,7 @@ void CClientManager::QUERY_SETUP(CPeer * peer, DWORD dwHandle, const char * c_pD
TPacketDGP2P p2pSetupPacket;
p2pSetupPacket.wPort = peer->GetP2PPort();
p2pSetupPacket.bChannel = peer->GetChannel();
strlcpy(p2pSetupPacket.szHost, peer->GetPublicIP(), sizeof(p2pSetupPacket.szHost));
strncpy(p2pSetupPacket.szHost, peer->GetPublicIP(), sizeof(p2pSetupPacket.szHost));
for (itertype(m_peerList) i = m_peerList.begin(); i != m_peerList.end();++i)
{
@ -1226,8 +1226,8 @@ void CClientManager::QUERY_SETUP(CPeer * peer, DWORD dwHandle, const char * c_pD
r.id = pck->dwID;
trim_and_lower(pck->szLogin, r.login, sizeof(r.login));
strlcpy(r.social_id, pck->szSocialID, sizeof(r.social_id));
strlcpy(r.passwd, "TEMP", sizeof(r.passwd));
strncpy(r.social_id, pck->szSocialID, sizeof(r.social_id));
strncpy(r.passwd, "TEMP", sizeof(r.passwd));
InsertLoginData(pkLD);
@ -1240,8 +1240,8 @@ void CClientManager::QUERY_SETUP(CPeer * peer, DWORD dwHandle, const char * c_pD
{
TPacketBillingRepair pck_repair;
pck_repair.dwLoginKey = pkLD->GetKey();
strlcpy(pck_repair.szLogin, pck->szLogin, sizeof(pck_repair.szLogin));
strlcpy(pck_repair.szHost, pck->szHost, sizeof(pck_repair.szHost));
strncpy(pck_repair.szLogin, pck->szLogin, sizeof(pck_repair.szLogin));
strncpy(pck_repair.szHost, pck->szHost, sizeof(pck_repair.szHost));
vec_repair.push_back(pck_repair);
}
}
@ -1791,8 +1791,8 @@ void CClientManager::QUERY_AUTH_LOGIN(CPeer * pkPeer, DWORD dwHandle, TPacketGDA
r.id = p->dwID;
trim_and_lower(p->szLogin, r.login, sizeof(r.login));
strlcpy(r.social_id, p->szSocialID, sizeof(r.social_id));
strlcpy(r.passwd, "TEMP", sizeof(r.passwd));
strncpy(r.social_id, p->szSocialID, sizeof(r.social_id));
strncpy(r.passwd, "TEMP", sizeof(r.passwd));
sys_log(0, "AUTH_LOGIN id(%u) login(%s) social_id(%s) login_key(%u), client_key(%u %u %u %u)",
p->dwID, p->szLogin, p->szSocialID, p->dwLoginKey,
@ -1832,7 +1832,7 @@ void CClientManager::BillingExpire(TPacketBillingExpire * p)
if (pkPeer)
{
strlcpy(p->szLogin, pkLD->GetAccountRef().login, sizeof(p->szLogin));
strncpy(p->szLogin, pkLD->GetAccountRef().login, sizeof(p->szLogin));
pkPeer->EncodeHeader(HEADER_DG_BILLING_EXPIRE, 0, sizeof(TPacketBillingExpire));
pkPeer->Encode(p, sizeof(TPacketBillingExpire));
}
@ -1945,8 +1945,8 @@ void CClientManager::SendAllLoginToBilling()
CLoginData * pkLD = (it++)->second;
p.dwLoginKey = pkLD->GetKey();
strlcpy(p.szLogin, pkLD->GetAccountRef().login, sizeof(p.szLogin));
strlcpy(p.szHost, pkLD->GetIP(), sizeof(p.szHost));
strncpy(p.szLogin, pkLD->GetAccountRef().login, sizeof(p.szLogin));
strncpy(p.szHost, pkLD->GetIP(), sizeof(p.szHost));
sys_log(0, "SendAllLoginToBilling %s %s", pkLD->GetAccountRef().login, pkLD->GetIP());
vec.push_back(p);
}
@ -3332,8 +3332,8 @@ bool CClientManager::InitializeLocalization()
int col = 0;
tLocale locale;
strlcpy(locale.szValue, row[col++], sizeof(locale.szValue));
strlcpy(locale.szKey, row[col++], sizeof(locale.szKey));
strncpy(locale.szValue, row[col++], sizeof(locale.szValue));
strncpy(locale.szKey, row[col++], sizeof(locale.szKey));
//DB_NAME_COLUMN Setting
if (strcmp(locale.szKey, "LOCALE") == 0)
@ -3731,9 +3731,9 @@ bool CClientManager::__GetAdminInfo(const char *szIP, std::vector<tAdminInfo> &
str_to_number(Info.m_ID, row[idx++]);
trim_and_lower(row[idx++], Info.m_szAccount, sizeof(Info.m_szAccount));
strlcpy(Info.m_szName, row[idx++], sizeof(Info.m_szName));
strlcpy(Info.m_szContactIP, row[idx++], sizeof(Info.m_szContactIP));
strlcpy(Info.m_szServerIP, row[idx++], sizeof(Info.m_szServerIP));
strncpy(Info.m_szName, row[idx++], sizeof(Info.m_szName));
strncpy(Info.m_szContactIP, row[idx++], sizeof(Info.m_szContactIP));
strncpy(Info.m_szServerIP, row[idx++], sizeof(Info.m_szServerIP));
std::string stAuth = row[idx++];
if (!stAuth.compare("IMPLEMENTOR"))
@ -4054,7 +4054,7 @@ void CClientManager::RMCandidacy(CPeer * peer, DWORD dwHandle, const char * data
{
char szName[32];
strlcpy(szName, data, sizeof(szName));
strncpy(szName, data, sizeof(szName));
sys_log(0, "[MONARCH_GM] Remove candidacy name(%s)", szName);
int iRet = CMonarch::instance().DelCandidacy(szName) ? 1 : 0;
@ -4095,7 +4095,7 @@ void CClientManager::SetMonarch(CPeer * peer, DWORD dwHandle, const char * data)
{
char szName[32];
strlcpy(szName, data, sizeof(szName));
strncpy(szName, data, sizeof(szName));
if (g_test_server)
sys_log(0, "[MONARCH_GM] Set Monarch name(%s)", szName);
@ -4138,7 +4138,7 @@ void CClientManager::RMMonarch(CPeer * peer, DWORD dwHandle, const char * data)
{
char szName[32];
strlcpy(szName, data, sizeof(szName));
strncpy(szName, data, sizeof(szName));
if (g_test_server)
sys_log(0, "[MONARCH_GM] Remove Monarch name(%s)", szName);
@ -4197,8 +4197,8 @@ void CClientManager::ChangeMonarchLord(CPeer * peer, DWORD dwHandle, TPacketChan
ack.dwPID = info->dwPID;
MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);
strlcpy(ack.szName, row[0], sizeof(ack.szName));
strlcpy(ack.szDate, row[1], sizeof(ack.szDate));
strncpy(ack.szName, row[0], sizeof(ack.szName));
strncpy(ack.szDate, row[1], sizeof(ack.szDate));
snprintf(szQuery, sizeof(szQuery), "UPDATE monarch SET pid=%u, windate=NOW() WHERE empire=%d", ack.dwPID, ack.bEmpire);
SQLMsg* pMsg2 = CDBManager::instance().DirectQuery(szQuery, SQL_PLAYER);

View File

@ -5,9 +5,9 @@
#include <boost/unordered_map.hpp>
#include <boost/unordered_set.hpp>
#include "../../common/stl.h"
#include "../../common/building.h"
#include "../../common/auction_table.h"
#include <common/stl.h>
#include <common/building.h>
#include <common/auction_table.h>
#include "Peer.h"
#include "DBManager.h"

View File

@ -312,8 +312,8 @@ bool CClientManager::InitializeMobTable()
TMobTable *tempTable = it_map_mobTable->second;
mob_table->dwVnum = tempTable->dwVnum;
strlcpy(mob_table->szName, tempTable->szName, sizeof(tempTable->szName));
strlcpy(mob_table->szLocaleName, tempTable->szLocaleName, sizeof(tempTable->szName));
strncpy(mob_table->szName, tempTable->szName, sizeof(tempTable->szName));
strncpy(mob_table->szLocaleName, tempTable->szLocaleName, sizeof(tempTable->szName));
mob_table->bRank = tempTable->bRank;
mob_table->bType = tempTable->bType;
mob_table->bBattleType = tempTable->bBattleType;
@ -323,7 +323,7 @@ bool CClientManager::InitializeMobTable()
mob_table->dwRaceFlag = tempTable->dwRaceFlag;
mob_table->dwImmuneFlag = tempTable->dwImmuneFlag;
mob_table->bEmpire = tempTable->bEmpire;
strlcpy(mob_table->szFolder, tempTable->szFolder, sizeof(tempTable->szName));
strncpy(mob_table->szFolder, tempTable->szFolder, sizeof(tempTable->szName));
mob_table->bOnClickType = tempTable->bOnClickType;
mob_table->bStr = tempTable->bStr;
mob_table->bDex = tempTable->bDex;
@ -545,12 +545,12 @@ bool CClientManager::InitializeQuestItemTable()
str_to_number(tbl.dwVnum, row[col++]);
if (row[col])
strlcpy(tbl.szName, row[col], sizeof(tbl.szName));
strncpy(tbl.szName, row[col], sizeof(tbl.szName));
col++;
if (row[col])
strlcpy(tbl.szLocaleName, row[col], sizeof(tbl.szLocaleName));
strncpy(tbl.szLocaleName, row[col], sizeof(tbl.szLocaleName));
col++;
@ -724,8 +724,8 @@ bool CClientManager::InitializeItemTable()
TItemTable *tempTable = it_map_itemTable->second;
item_table->dwVnum = tempTable->dwVnum;
strlcpy(item_table->szName, tempTable->szName, sizeof(item_table->szName));
strlcpy(item_table->szLocaleName, tempTable->szLocaleName, sizeof(item_table->szLocaleName));
strncpy(item_table->szName, tempTable->szName, sizeof(item_table->szName));
strncpy(item_table->szLocaleName, tempTable->szLocaleName, sizeof(item_table->szLocaleName));
item_table->bType = tempTable->bType;
item_table->bSubType = tempTable->bSubType;
item_table->bSize = tempTable->bSize;
@ -888,33 +888,33 @@ bool CClientManager::InitializeSkillTable()
col = 0;
str_to_number(t.dwVnum, data[col++]);
strlcpy(t.szName, data[col++], sizeof(t.szName));
strncpy(t.szName, data[col++], sizeof(t.szName));
str_to_number(t.bType, data[col++]);
str_to_number(t.bMaxLevel, data[col++]);
str_to_number(t.dwSplashRange, data[col++]);
strlcpy(t.szPointOn, data[col++], sizeof(t.szPointOn));
strlcpy(t.szPointPoly, data[col++], sizeof(t.szPointPoly));
strlcpy(t.szSPCostPoly, data[col++], sizeof(t.szSPCostPoly));
strlcpy(t.szDurationPoly, data[col++], sizeof(t.szDurationPoly));
strlcpy(t.szDurationSPCostPoly, data[col++], sizeof(t.szDurationSPCostPoly));
strlcpy(t.szCooldownPoly, data[col++], sizeof(t.szCooldownPoly));
strlcpy(t.szMasterBonusPoly, data[col++], sizeof(t.szMasterBonusPoly));
strncpy(t.szPointOn, data[col++], sizeof(t.szPointOn));
strncpy(t.szPointPoly, data[col++], sizeof(t.szPointPoly));
strncpy(t.szSPCostPoly, data[col++], sizeof(t.szSPCostPoly));
strncpy(t.szDurationPoly, data[col++], sizeof(t.szDurationPoly));
strncpy(t.szDurationSPCostPoly, data[col++], sizeof(t.szDurationSPCostPoly));
strncpy(t.szCooldownPoly, data[col++], sizeof(t.szCooldownPoly));
strncpy(t.szMasterBonusPoly, data[col++], sizeof(t.szMasterBonusPoly));
str_to_number(t.dwFlag, data[col++]);
str_to_number(t.dwAffectFlag, data[col++]);
strlcpy(t.szPointOn2, data[col++], sizeof(t.szPointOn2));
strlcpy(t.szPointPoly2, data[col++], sizeof(t.szPointPoly2));
strlcpy(t.szDurationPoly2, data[col++], sizeof(t.szDurationPoly2));
strncpy(t.szPointOn2, data[col++], sizeof(t.szPointOn2));
strncpy(t.szPointPoly2, data[col++], sizeof(t.szPointPoly2));
strncpy(t.szDurationPoly2, data[col++], sizeof(t.szDurationPoly2));
str_to_number(t.dwAffectFlag2, data[col++]);
// ADD_GRANDMASTER_SKILL
strlcpy(t.szPointOn3, data[col++], sizeof(t.szPointOn3));
strlcpy(t.szPointPoly3, data[col++], sizeof(t.szPointPoly3));
strlcpy(t.szDurationPoly3, data[col++], sizeof(t.szDurationPoly3));
strncpy(t.szPointOn3, data[col++], sizeof(t.szPointOn3));
strncpy(t.szPointPoly3, data[col++], sizeof(t.szPointPoly3));
strncpy(t.szDurationPoly3, data[col++], sizeof(t.szDurationPoly3));
strlcpy(t.szGrandMasterAddSPCostPoly, data[col++], sizeof(t.szGrandMasterAddSPCostPoly));
strncpy(t.szGrandMasterAddSPCostPoly, data[col++], sizeof(t.szGrandMasterAddSPCostPoly));
// END_OF_ADD_GRANDMASTER_SKILL
str_to_number(t.bLevelStep, data[col++]);
@ -924,7 +924,7 @@ bool CClientManager::InitializeSkillTable()
str_to_number(t.lMaxHit, data[col++]);
strlcpy(t.szSplashAroundDamageAdjustPoly, data[col++], sizeof(t.szSplashAroundDamageAdjustPoly));
strncpy(t.szSplashAroundDamageAdjustPoly, data[col++], sizeof(t.szSplashAroundDamageAdjustPoly));
str_to_number(t.bSkillAttrType, data[col++]);
str_to_number(t.dwTargetRange, data[col++]);
@ -956,7 +956,7 @@ bool CClientManager::InitializeBanwordTable()
if (data[0])
{
strlcpy(t.szWord, data[0], sizeof(t.szWord));
strncpy(t.szWord, data[0], sizeof(t.szWord));
m_vec_banwordTable.push_back(t);
}
}
@ -999,7 +999,7 @@ bool CClientManager::InitializeItemAttrTable()
int col = 0;
strlcpy(t.szApply, data[col++], sizeof(t.szApply));
strncpy(t.szApply, data[col++], sizeof(t.szApply));
str_to_number(t.dwApplyIndex, data[col++]);
str_to_number(t.dwProb, data[col++]);
str_to_number(t.lValues[0], data[col++]);
@ -1073,7 +1073,7 @@ bool CClientManager::InitializeItemRareTable()
int col = 0;
strlcpy(t.szApply, data[col++], sizeof(t.szApply));
strncpy(t.szApply, data[col++], sizeof(t.szApply));
str_to_number(t.dwApplyIndex, data[col++]);
str_to_number(t.dwProb, data[col++]);
str_to_number(t.lValues[0], data[col++]);
@ -1178,7 +1178,7 @@ void parse_pair_number_string(const char * c_pszString, std::vector<std::pair<in
{
if (isnhdigit(*t))
{
strlcpy(szNum, t, MIN(sizeof(szNum), (p-t)+1));
strncpy(szNum, t, MIN(sizeof(szNum), (p-t)+1));
comma = strchr(szNum, ',');
@ -1200,7 +1200,7 @@ void parse_pair_number_string(const char * c_pszString, std::vector<std::pair<in
if (isnhdigit(*t))
{
strlcpy(szNum, t, sizeof(szNum));
strncpy(szNum, t, sizeof(szNum));
comma = strchr(const_cast<char*>(t), ',');

View File

@ -19,7 +19,7 @@ void CClientManager::LoadEventFlag()
while ((row = mysql_fetch_row(pRes->pSQLResult)))
{
TPacketSetEventFlag p;
strlcpy(p.szFlagName, row[0], sizeof(p.szFlagName));
strncpy(p.szFlagName, row[0], sizeof(p.szFlagName));
str_to_number(p.lValue, row[1]);
sys_log(0, "EventFlag Load %s %d", p.szFlagName, p.lValue);
m_map_lEventFlag.insert(std::make_pair(std::string(p.szFlagName), p.lValue));
@ -68,7 +68,7 @@ void CClientManager::SendEventFlagsOnSetup(CPeer* peer)
for (it = m_map_lEventFlag.begin(); it != m_map_lEventFlag.end(); ++it)
{
TPacketSetEventFlag p;
strlcpy(p.szFlagName, it->first.c_str(), sizeof(p.szFlagName));
strncpy(p.szFlagName, it->first.c_str(), sizeof(p.szFlagName));
p.lValue = it->second;
peer->EncodeHeader(HEADER_DG_SET_EVENT_FLAG, 0, sizeof(TPacketSetEventFlag));
peer->Encode(&p, sizeof(TPacketSetEventFlag));

View File

@ -60,7 +60,7 @@ void CClientManager::GuildAddMember(CPeer* peer, TPacketGDGuildAddMember * p)
str_to_number(dg.dwOffer, row[3]);
str_to_number(dg.bLevel, row[4]);
str_to_number(dg.bJob, row[5]);
strlcpy(dg.szName, row[6], sizeof(dg.szName));
strncpy(dg.szName, row[6], sizeof(dg.szName));
ForwardPacket(HEADER_DG_GUILD_ADD_MEMBER, &dg, sizeof(TPacketDGGuildMember));
}

View File

@ -31,7 +31,7 @@ void CClientManager::AckHorseName(DWORD dwPID, CPeer* peer)
else
{
MYSQL_ROW row = mysql_fetch_row(pmsg->Get()->pSQLResult);
strlcpy(packet.szHorseName, row[0], sizeof(packet.szHorseName));
strncpy(packet.szHorseName, row[0], sizeof(packet.szHorseName));
}
peer->EncodeHeader(HEADER_DG_ACK_HORSE_NAME, 0, sizeof(TPacketUpdateHorseName));

View File

@ -116,7 +116,7 @@ void CClientManager::QUERY_LOGIN_BY_KEY(CPeer * pkPeer, DWORD dwHandle, TPacketG
{
sys_log(0, "LOGIN_BY_KEY already login %s %lu", r.login, p->dwLoginKey);
TPacketDGLoginAlready ptog;
strlcpy(ptog.szLogin, szLogin, sizeof(ptog.szLogin));
strncpy(ptog.szLogin, szLogin, sizeof(ptog.szLogin));
pkPeer->EncodeHeader(HEADER_DG_LOGIN_ALREADY, dwHandle, sizeof(TPacketDGLoginAlready));
pkPeer->Encode(&ptog, sizeof(TPacketDGLoginAlready));
return;
@ -147,13 +147,13 @@ void CClientManager::QUERY_LOGIN_BY_KEY(CPeer * pkPeer, DWORD dwHandle, TPacketG
pkTab->id = r.id;
trim_and_lower(r.login, pkTab->login, sizeof(pkTab->login));
strlcpy(pkTab->passwd, r.passwd, sizeof(pkTab->passwd));
strlcpy(pkTab->social_id, r.social_id, sizeof(pkTab->social_id));
strlcpy(pkTab->status, "OK", sizeof(pkTab->status));
strncpy(pkTab->passwd, r.passwd, sizeof(pkTab->passwd));
strncpy(pkTab->social_id, r.social_id, sizeof(pkTab->social_id));
strncpy(pkTab->status, "OK", sizeof(pkTab->status));
ClientHandleInfo * info = new ClientHandleInfo(dwHandle);
info->pAccountTable = pkTab;
strlcpy(info->ip, p->szIP, sizeof(info->ip));
strncpy(info->ip, p->szIP, sizeof(info->ip));
sys_log(0, "LOGIN_BY_KEY success %s %lu %s", r.login, p->dwLoginKey, info->ip);
char szQuery[QUERY_MAX_LEN];
@ -250,17 +250,17 @@ TAccountTable * CreateAccountTableFromRes(MYSQL_RES * res)
memset(pkTab, 0, sizeof(TAccountTable));
// 첫번째 컬럼 것만 참고 한다 (JOIN QUERY를 위한 것 임)
strlcpy(input_pwd, row[col++], sizeof(input_pwd));
strncpy(input_pwd, row[col++], sizeof(input_pwd));
str_to_number(pkTab->id, row[col++]);
strlcpy(pkTab->login, row[col++], sizeof(pkTab->login));
strlcpy(pkTab->passwd, row[col++], sizeof(pkTab->passwd));
strlcpy(pkTab->social_id, row[col++], sizeof(pkTab->social_id));
strncpy(pkTab->login, row[col++], sizeof(pkTab->login));
strncpy(pkTab->passwd, row[col++], sizeof(pkTab->passwd));
strncpy(pkTab->social_id, row[col++], sizeof(pkTab->social_id));
str_to_number(pkTab->bEmpire, row[col++]);
for (int j = 0; j < PLAYER_PER_ACCOUNT; ++j)
str_to_number(pkTab->players[j].dwID, row[col++]);
strlcpy(pkTab->status, row[col++], sizeof(pkTab->status));
strncpy(pkTab->status, row[col++], sizeof(pkTab->status));
if (strcmp(pkTab->passwd, input_pwd))
{
@ -298,7 +298,7 @@ void CreateAccountPlayerDataFromRes(MYSQL_RES * pRes, TAccountTable * pkTab)
if (pt)
{
strlcpy(pkTab->players[j].szName, pt->name, sizeof(pkTab->players[j].szName));
strncpy(pkTab->players[j].szName, pt->name, sizeof(pkTab->players[j].szName));
pkTab->players[j].byJob = pt->job;
pkTab->players[j].byLevel = pt->level;
@ -319,7 +319,7 @@ void CreateAccountPlayerDataFromRes(MYSQL_RES * pRes, TAccountTable * pkTab)
if (!row[col++])
*pkTab->players[j].szName = '\0';
else
strlcpy(pkTab->players[j].szName, row[col - 1], sizeof(pkTab->players[j].szName));
strncpy(pkTab->players[j].szName, row[col - 1], sizeof(pkTab->players[j].szName));
pkTab->players[j].byJob = 0;
pkTab->players[j].byLevel = 0;
@ -428,7 +428,7 @@ void CClientManager::RESULT_LOGIN(CPeer * peer, SQLMsg * msg)
sys_log(0, "RESULT_LOGIN: already logon %s", info->pAccountTable->login);
TPacketDGLoginAlready p;
strlcpy(p.szLogin, info->pAccountTable->login, sizeof(p.szLogin));
strncpy(p.szLogin, info->pAccountTable->login, sizeof(p.szLogin));
peer->EncodeHeader(HEADER_DG_LOGIN_ALREADY, info->dwHandle, sizeof(TPacketDGLoginAlready));
peer->Encode(&p, sizeof(p));
@ -538,7 +538,7 @@ void CClientManager::QUERY_CHANGE_NAME(CPeer * peer, DWORD dwHandle, TPacketGDCh
TPacketDGChangeName pdg;
peer->EncodeHeader(HEADER_DG_CHANGE_NAME, dwHandle, sizeof(TPacketDGChangeName));
pdg.pid = p->pid;
strlcpy(pdg.name, p->name, sizeof(pdg.name));
strncpy(pdg.name, p->name, sizeof(pdg.name));
peer->Encode(&pdg, sizeof(TPacketDGChangeName));
}

View File

@ -405,7 +405,7 @@ void CClientManager::QUERY_PLAYER_LOAD(CPeer * peer, DWORD dwHandle, TPlayerLoad
void CClientManager::ItemAward(CPeer * peer,char* login)
{
char login_t[LOGIN_MAX_LEN + 1] = "";
strlcpy(login_t,login,LOGIN_MAX_LEN + 1);
strncpy(login_t,login,LOGIN_MAX_LEN + 1);
std::set<TItemAward *> * pSet = ItemAwardManager::instance().GetByLogin(login_t);
if(pSet == NULL)
return;
@ -458,7 +458,7 @@ bool CreatePlayerTableFromRes(MYSQL_RES * res, TPlayerTable * pkTab)
// "stat_point,skill_point,sub_skill_point,stat_reset_count,part_base,part_hair,"
// "skill_level,quickslot,skill_group,alignment,mobile,horse_level,horse_riding,horse_hp,horse_stamina FROM player%s WHERE id=%d",
str_to_number(pkTab->id, row[col++]);
strlcpy(pkTab->name, row[col++], sizeof(pkTab->name));
strncpy(pkTab->name, row[col++], sizeof(pkTab->name));
str_to_number(pkTab->job, row[col++]);
str_to_number(pkTab->voice, row[col++]);
str_to_number(pkTab->dir, row[col++]);
@ -509,7 +509,7 @@ bool CreatePlayerTableFromRes(MYSQL_RES * res, TPlayerTable * pkTab)
if (row[col])
{
strlcpy(pkTab->szMobile, row[col], sizeof(pkTab->szMobile));
strncpy(pkTab->szMobile, row[col], sizeof(pkTab->szMobile));
}
col++;
@ -759,8 +759,8 @@ void CClientManager::RESULT_QUEST_LOAD(CPeer * peer, MYSQL_RES * pRes, DWORD dwH
row = mysql_fetch_row(pRes);
str_to_number(r.dwPID, row[0]);
strlcpy(r.szName, row[1], sizeof(r.szName));
strlcpy(r.szState, row[2], sizeof(r.szState));
strncpy(r.szName, row[1], sizeof(r.szName));
strncpy(r.szState, row[2], sizeof(r.szState));
str_to_number(r.lValue, row[3]);
}
@ -939,7 +939,7 @@ void CClientManager::__QUERY_PLAYER_CREATE(CPeer *peer, DWORD dwHandle, TPlayerC
pack.bAccountCharacterIndex = packet->account_index;
pack.player.dwID = player_id;
strlcpy(pack.player.szName, packet->player_table.name, sizeof(pack.player.szName));
strncpy(pack.player.szName, packet->player_table.name, sizeof(pack.player.szName));
pack.player.byJob = packet->player_table.job;
pack.player.byLevel = 1;
pack.player.dwPlayMinutes = 0;
@ -1045,7 +1045,7 @@ void CClientManager::__RESULT_PLAYER_DELETE(CPeer *peer, SQLMsg* msg)
str_to_number(deletedLevelLimit, row[1]);
char szName[64];
strlcpy(szName, row[2], sizeof(szName));
strncpy(szName, row[2], sizeof(szName));
if (deletedLevelLimit >= m_iPlayerDeleteLevelLimit && !IsChinaEventServer())
{
@ -1220,7 +1220,7 @@ void CClientManager::QUERY_HIGHSCORE_REGISTER(CPeer* peer, TPacketGDHighscore *
sys_log(0, "HEADER_GD_HIGHSCORE_REGISTER: PID %u", data->dwPID);
ClientHandleInfo * pi = new ClientHandleInfo(0);
strlcpy(pi->login, data->szBoard, sizeof(pi->login));
strncpy(pi->login, data->szBoard, sizeof(pi->login));
pi->account_id = (DWORD)data->lValue;
pi->player_id = data->dwPID;
pi->account_index = (data->cDir > 0);
@ -1235,7 +1235,7 @@ void CClientManager::RESULT_HIGHSCORE_REGISTER(CPeer * pkPeer, SQLMsg * msg)
//DWORD dwHandle = pi->dwHandle;
char szBoard[21];
strlcpy(szBoard, pi->login, sizeof(szBoard));
strncpy(szBoard, pi->login, sizeof(szBoard));
int value = (int)pi->account_id;
SQLResult * res = msg->Get();

View File

@ -117,7 +117,7 @@ bool CConfig::LoadFile(const char* filename)
switch (mode)
{
case 0:
strlcpy(comment, szTmp, sizeof(comment));
strncpy(comment, szTmp, sizeof(comment));
++mode;
break;
@ -229,7 +229,7 @@ bool CConfig::GetValue(const char * key, char *dest, size_t destSize)
if (!Search(key))
return false;
strlcpy(dest, Get(key), destSize);
strncpy(dest, Get(key), destSize);
if (!*dest)
return false;

View File

@ -7,7 +7,7 @@
// 코드 by 꼬붕 후로그래머 아노아~ = _=)b
#include <mysql/mysql.h>
#include "../../libsql/AsyncSQL.h"
#include <libsql/include/CAsyncSQL.h>
#define SQL_SAFE_LENGTH(size) (size * 2 + 1)
#define QUERY_SAFE_LENGTH(size) (1024 + SQL_SAFE_LENGTH(size))

View File

@ -137,7 +137,7 @@ void CGuildManager::ParseResult(SQLResult * pRes)
TGuild & r_info = TouchGuild(GID);
strlcpy(r_info.szName, row[1], sizeof(r_info.szName));
strncpy(r_info.szName, row[1], sizeof(r_info.szName));
str_to_number(r_info.ladder_point, row[2]);
str_to_number(r_info.win, row[3]);
str_to_number(r_info.draw, row[4]);
@ -1228,7 +1228,7 @@ void CGuildWarReserve::Initialize()
while ((row = mysql_fetch_row(res)))
{
dwGuild = dwGold = 0;
strlcpy(szLogin, row[0], sizeof(szLogin));
strncpy(szLogin, row[0], sizeof(szLogin));
str_to_number(dwGuild, row[1]);
str_to_number(dwGold, row[2]);
@ -1254,7 +1254,7 @@ void CGuildWarReserve::OnSetup(CPeer * peer)
while (it != mapBet.end())
{
strlcpy(pckBet.szLogin, it->first.c_str(), sizeof(pckBet.szLogin));
strncpy(pckBet.szLogin, it->first.c_str(), sizeof(pckBet.szLogin));
pckBet.dwGuild = it->second.first;
pckBet.dwGold = it->second.second;
@ -1316,7 +1316,7 @@ bool CGuildWarReserve::Bet(const char * pszLogin, DWORD dwGold, DWORD dwGuild)
TPacketGDGuildWarBet pckBet;
pckBet.dwWarID = m_data.dwID;
strlcpy(pckBet.szLogin, pszLogin, sizeof(pckBet.szLogin));
strncpy(pckBet.szLogin, pszLogin, sizeof(pckBet.szLogin));
pckBet.dwGuild = dwGuild;
pckBet.dwGold = dwGold;

View File

@ -5,8 +5,8 @@
#include "Peer.h"
#include <queue>
#include <utility>
#include "../../libsql/libsql.h"
#include "../../libpoly/Poly.h"
#include <libsql/include/libsql.h>
#include <libpoly/include/Poly.h>
enum
{

View File

@ -53,7 +53,7 @@ void ItemAwardManager::Load(SQLMsg * pMsg)
if (row[col])
{
strlcpy(kData->szWhy, row[col], sizeof(kData->szWhy));
strncpy(kData->szWhy, row[col], sizeof(kData->szWhy));
//게임 중에 why콜룸에 변동이 생기면
char* whyStr = kData->szWhy; //why 콜룸 읽기
char cmdStr[100] = ""; //why콜룸에서 읽은 값을 임시 문자열에 복사해둠

View File

@ -66,7 +66,7 @@ DWORD CLoginData::GetLogonTime()
void CLoginData::SetIP(const char * c_pszIP)
{
strlcpy(m_szIP, c_pszIP, sizeof(m_szIP));
strncpy(m_szIP, c_pszIP, sizeof(m_szIP));
}
const char * CLoginData::GetIP()

View File

@ -121,8 +121,8 @@ namespace marriage
p.dwPID1 = dwPID1;
p.dwPID2 = dwPID2;
p.tMarryTime = now;
strlcpy(p.szName1, szName1, sizeof(p.szName1));
strlcpy(p.szName2, szName2, sizeof(p.szName2));
strncpy(p.szName1, szName1, sizeof(p.szName1));
strncpy(p.szName2, szName2, sizeof(p.szName2));
CClientManager::instance().ForwardPacket(HEADER_DG_MARRIAGE_ADD, &p, sizeof(p));
}
@ -263,8 +263,8 @@ namespace marriage
p.dwPID1 = pMarriage->pid1;
p.dwPID2 = pMarriage->pid2;
p.tMarryTime = pMarriage->time;
strlcpy(p.szName1, pMarriage->name1.c_str(), sizeof(p.szName1));
strlcpy(p.szName2, pMarriage->name2.c_str(), sizeof(p.szName2));
strncpy(p.szName1, pMarriage->name1.c_str(), sizeof(p.szName1));
strncpy(p.szName2, pMarriage->name2.c_str(), sizeof(p.szName2));
peer->EncodeHeader(HEADER_DG_MARRIAGE_ADD, 0, sizeof(p));
peer->Encode(&p, sizeof(p));
}

View File

@ -1,5 +1,5 @@
#include "Monarch.h"
#include "../../common/utils.h"
#include <common/utils.h>
#include "Main.h"
#include "ClientManager.h"
@ -81,7 +81,7 @@ bool CMonarch::AddCandidacy(DWORD pid, const char * name)
MonarchCandidacy info;
info.pid = pid;
strlcpy(info.name, name, sizeof(info.name));
strncpy(info.name, name, sizeof(info.name));
m_vec_MonarchCandidacy.push_back(info);
char szQuery[256];
@ -192,10 +192,10 @@ bool CMonarch::LoadMonarch()
int Empire = 0; str_to_number(Empire, row[idx++]);
str_to_number(p->pid[Empire], row[idx++]);
strlcpy(p->name[Empire], row[idx++], sizeof(p->name[Empire]));
strncpy(p->name[Empire], row[idx++], sizeof(p->name[Empire]));
str_to_number(p->money[Empire], row[idx++]);
strlcpy(p->date[Empire], row[idx++], sizeof(p->date[Empire]));
strncpy(p->date[Empire], row[idx++], sizeof(p->date[Empire]));
if (g_test_server)
sys_log(0, "[LOAD_MONARCH] Empire %d pid %d money %lld windate %s", Empire, p->pid[Empire], p->money[Empire], p->date[Empire]);
@ -227,7 +227,7 @@ bool CMonarch::SetMonarch(const char * name)
str_to_number(Empire, row[idx++]);
str_to_number(p->pid[Empire], row[idx++]);
strlcpy(p->name[Empire], row[idx++], sizeof(p->name[Empire]));
strncpy(p->name[Empire], row[idx++], sizeof(p->name[Empire]));
p->money[Empire] = atoll(row[idx++]);
if (g_test_server)

View File

@ -5,8 +5,8 @@
#include "../../libthecore/include/stdafx.h"
#include <map>
#include <vector>
#include "../../common/singleton.h"
#include "../../common/tables.h"
#include <common/singleton.h>
#include <common/tables.h>
class CMonarch : public singleton<CMonarch>
{

View File

@ -52,7 +52,7 @@ bool CPeerBase::Accept(socket_t fd_accept)
socket_sndbuf(m_fd, 233016);
socket_rcvbuf(m_fd, 233016);
strlcpy(m_host, inet_ntoa(peer.sin_addr), sizeof(m_host));
strncpy(m_host, inet_ntoa(peer.sin_addr), sizeof(m_host));
m_outBuffer = buffer_new(DEFAULT_PACKET_BUFFER_SIZE);
m_inBuffer = buffer_new(MAX_INPUT_LEN);
@ -71,7 +71,7 @@ bool CPeerBase::Accept(socket_t fd_accept)
bool CPeerBase::Connect(const char* host, WORD port)
{
strlcpy(m_host, host, sizeof(m_host));
strncpy(m_host, host, sizeof(m_host));
if ((m_fd = socket_connect(host, port)) == INVALID_SOCKET)
return false;

View File

@ -586,16 +586,16 @@ bool Set_Proto_Mob_Table(TMobTable *mobTable, cCsvTable &csvTable,std::map<int,c
{
int col = 0;
str_to_number(mobTable->dwVnum, csvTable.AsStringByIndex(col++));
strlcpy(mobTable->szName, csvTable.AsStringByIndex(col++), sizeof(mobTable->szName));
strncpy(mobTable->szName, csvTable.AsStringByIndex(col++), sizeof(mobTable->szName));
//3. 지역별 이름 넣어주기.
map<int,const char*>::iterator it;
it = nameMap.find(mobTable->dwVnum);
if (it != nameMap.end()) {
const char * localeName = it->second;
strlcpy(mobTable->szLocaleName, localeName, sizeof (mobTable->szLocaleName));
strncpy(mobTable->szLocaleName, localeName, sizeof (mobTable->szLocaleName));
} else {
strlcpy(mobTable->szLocaleName, mobTable->szName, sizeof (mobTable->szLocaleName));
strncpy(mobTable->szLocaleName, mobTable->szName, sizeof (mobTable->szLocaleName));
}
//RANK
@ -626,7 +626,7 @@ bool Set_Proto_Mob_Table(TMobTable *mobTable, cCsvTable &csvTable,std::map<int,c
str_to_number(mobTable->bEmpire, csvTable.AsStringByIndex(col++)); //col = 11
strlcpy(mobTable->szFolder, csvTable.AsStringByIndex(col++), sizeof(mobTable->szFolder));
strncpy(mobTable->szFolder, csvTable.AsStringByIndex(col++), sizeof(mobTable->szFolder));
str_to_number(mobTable->bOnClickType, csvTable.AsStringByIndex(col++));
@ -776,15 +776,15 @@ bool Set_Proto_Item_Table(TItemTable *itemTable, cCsvTable &csvTable,std::map<in
}
}
strlcpy(itemTable->szName, csvTable.AsStringByIndex(1), sizeof(itemTable->szName));
strncpy(itemTable->szName, csvTable.AsStringByIndex(1), sizeof(itemTable->szName));
//지역별 이름 넣어주기.
map<int,const char*>::iterator it;
it = nameMap.find(itemTable->dwVnum);
if (it != nameMap.end()) {
const char * localeName = it->second;
strlcpy(itemTable->szLocaleName, localeName, sizeof (itemTable->szLocaleName));
strncpy(itemTable->szLocaleName, localeName, sizeof (itemTable->szLocaleName));
} else {
strlcpy(itemTable->szLocaleName, itemTable->szName, sizeof (itemTable->szLocaleName));
strncpy(itemTable->szLocaleName, itemTable->szName, sizeof (itemTable->szLocaleName));
}
itemTable->bType = dataArray[2];
itemTable->bSubType = dataArray[3];

View File

@ -1,7 +1,7 @@
#include <string.h>
#include <stdio.h>
#include "../../libthecore/include/memcpy.h"
#include "../../common/stl.h"
#include <common/stl.h>
#include "grid.h"
CGrid::CGrid(int w, int h) : m_iWidth(w), m_iHeight(h)

View File

@ -1,7 +1,7 @@
#ifndef __INC_METiN_II_DBSERV_STDAFX_H__
#define __INC_METiN_II_DBSERV_STDAFX_H__
#include "../../libthecore/include/stdafx.h"
#include <libthecore/include/stdafx.h>
#ifndef __WIN32__
#include <semaphore.h>
@ -10,11 +10,11 @@
#define isspace iswspace
#endif
#include "../../common/length.h"
#include "../../common/tables.h"
#include "../../common/singleton.h"
#include "../../common/utils.h"
#include "../../common/stl.h"
#include "../../common/service.h"
#include <common/length.h>
#include <common/tables.h>
#include <common/singleton.h>
#include <common/utils.h>
#include <common/stl.h>
#include <common/service.h>
#endif

View File

@ -8,8 +8,7 @@ void WriteVersion()
if (NULL != fp)
{
fprintf(fp, "game perforce revision: %s\n", __P4_VERSION__);
fprintf(fp, "%s@%s:%s\n", __USER__, __HOSTNAME__, __PWD__);
fprintf(fp, "db\n");
fclose(fp);
}
else

View File

@ -1,6 +1,6 @@
#include "stdafx.h"
#include "ClientPackageCryptInfo.h"
#include "../../common/stl.h"
#include <common/stl.h>
#ifndef __FreeBSD__
#include "../../libthecore/include/xdirent.h"

View File

@ -1,7 +1,7 @@
#include <boost/unordered_map.hpp>
#include "../../common/stl.h"
#include <common/stl.h>
class CDragonLair
{

View File

@ -1,7 +1,7 @@
#ifndef __INC_METIN_II_GAME_DRAGON_SOUL_H__
#define __INC_METIN_II_GAME_DRAGON_SOUL_H__
#include "../../common/length.h"
#include <common/length.h>
class CHARACTER;
class CItem;

View File

@ -140,7 +140,7 @@ bool COXEventManager::AddQuiz(unsigned char level, const char* pszQuestion, bool
struct tag_Quiz tmpQuiz;
tmpQuiz.level = level;
strlcpy(tmpQuiz.Quiz, pszQuestion, sizeof(tmpQuiz.Quiz));
strncpy(tmpQuiz.Quiz, pszQuestion, sizeof(tmpQuiz.Quiz));
tmpQuiz.answer = answer;
m_vec_quiz[level].push_back(tmpQuiz);

View File

@ -6,7 +6,7 @@
#include "char_manager.h"
#include "mob_manager.h"
#include "PetSystem.h"
#include "../../common/VnumHelper.h"
#include <common/VnumHelper.h>
#include "packet.h"
#include "item_manager.h"
#include "item.h"

View File

@ -1,7 +1,7 @@
#ifndef __INC_METIN_II_GAME_SPEEDSERVER_H__
#define __INC_METIN_II_GAME_SPEEDSERVER_H__
#include "../../common/length.h"
#include <common/length.h>
#include <list>
// castle.cpp 에 있는 것을 복붙 하였다

View File

@ -157,27 +157,27 @@ DWORD ANI::load_one_weapon(const char *dir_name, int weapon, BYTE combo, bool ho
switch (weapon)
{
case WEAPON_SWORD:
strlcpy(format, "%s/%sonehand_sword/combo_%02d.msa", sizeof(format));
strncpy(format, "%s/%sonehand_sword/combo_%02d.msa", sizeof(format));
break;
case WEAPON_DAGGER:
strlcpy(format, "%s/%sdualhand_sword/combo_%02d.msa", sizeof(format));
strncpy(format, "%s/%sdualhand_sword/combo_%02d.msa", sizeof(format));
break;
case WEAPON_BOW:
strlcpy(format, "%s/%sbow/attack.msa", sizeof(format));
strncpy(format, "%s/%sbow/attack.msa", sizeof(format));
break;
case WEAPON_TWO_HANDED:
strlcpy(format, "%s/%stwohand_sword/combo_%02d.msa", sizeof(format));
strncpy(format, "%s/%stwohand_sword/combo_%02d.msa", sizeof(format));
break;
case WEAPON_BELL:
strlcpy(format, "%s/%sbell/combo_%02d.msa", sizeof(format));
strncpy(format, "%s/%sbell/combo_%02d.msa", sizeof(format));
break;
case WEAPON_FAN:
strlcpy(format, "%s/%sfan/combo_%02d.msa", sizeof(format));
strncpy(format, "%s/%sfan/combo_%02d.msa", sizeof(format));
break;
default:

View File

@ -13,7 +13,7 @@
#include <boost/bind.hpp>
#include "item.h"
#include "desc_client.h"
#include "../../common/tables.h"
#include <common/tables.h>
#include "protocol.h"
#include "auction_manager.h"
extern int auction_server;

View File

@ -1,8 +1,8 @@
#ifndef __INC_AUCTION_MANAGER_H
#define __INC_AUCTION_MANAGER_H
#include "../../libsql/AsyncSQL.h"
#include "../../common/auction_table.h"
#include <libsql/include/AsyncSQL.h>
#include <common/auction_table.h>
#include <boost/unordered_map.hpp>
#include <algorithm>

View File

@ -57,7 +57,7 @@ static int FN_make_request(const char *login, const char *password, /*out*/ char
static int FN_parse_reply(char *reply)
{
char buffer[2048];
strlcpy(buffer, reply, sizeof(buffer));
strncpy(buffer, reply, sizeof(buffer));
const char *delim = "\r\n";
char *last = 0;

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#include "../../common/tables.h"
#include <common/tables.h>
#include "item.h"
#include "char.h"
#include "buff_on_attributes.h"

View File

@ -1,7 +1,7 @@
#ifndef __INC_METIN_II_BUILDING_H__
#define __INC_METIN_II_BUILDING_H__
#include "../../common/building.h"
#include <common/building.h>
namespace building
{

View File

@ -1,7 +1,7 @@
#include "stdafx.h"
#include "../../common/teen_packet.h"
#include "../../common/VnumHelper.h"
#include <common/teen_packet.h>
#include <common/VnumHelper.h>
#include "char.h"
@ -612,7 +612,7 @@ void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, BYTE
}
char szSign[SHOP_SIGN_MAX_LEN+1];
strlcpy(szSign, c_pszSign, sizeof(szSign));
strncpy(szSign, c_pszSign, sizeof(szSign));
m_stShopSign = szSign;
@ -713,7 +713,7 @@ void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, BYTE
p.bHeader = HEADER_GC_SHOP_SIGN;
p.dwVID = GetVID();
strlcpy(p.szSign, c_pszSign, sizeof(p.szSign));
strncpy(p.szSign, c_pszSign, sizeof(p.szSign));
PacketAround(&p, sizeof(TPacketGCShopSign));
@ -909,7 +909,7 @@ void CHARACTER::EncodeInsertPacket(LPENTITY entity)
else
{
show_all_info:
strlcpy(addPacket.name, GetName(), sizeof(addPacket.name));
strncpy(addPacket.name, GetName(), sizeof(addPacket.name));
if (GetGuild() != NULL)
{
@ -959,7 +959,7 @@ void CHARACTER::EncodeInsertPacket(LPENTITY entity)
p.bHeader = HEADER_GC_SHOP_SIGN;
p.dwVID = GetVID();
strlcpy(p.szSign, m_stShopSign.c_str(), sizeof(p.szSign));
strncpy(p.szSign, m_stShopSign.c_str(), sizeof(p.szSign));
d->Packet(&p, sizeof(TPacketGCShopSign));
}
@ -1142,14 +1142,14 @@ void CHARACTER::CreatePlayerProto(TPlayerTable & tab)
if (GetNewName().empty())
{
strlcpy(tab.name, GetName(), sizeof(tab.name));
strncpy(tab.name, GetName(), sizeof(tab.name));
}
else
{
strlcpy(tab.name, GetNewName().c_str(), sizeof(tab.name));
strncpy(tab.name, GetNewName().c_str(), sizeof(tab.name));
}
strlcpy(tab.ip, GetDesc()->GetHostName(), sizeof(tab.ip));
strncpy(tab.ip, GetDesc()->GetHostName(), sizeof(tab.ip));
tab.id = m_dwPlayerID;
tab.voice = GetPoint(POINT_VOICE);
@ -1239,7 +1239,7 @@ void CHARACTER::CreatePlayerProto(TPlayerTable & tab)
tab.quickslot[i] = m_quickslot[i];
if (m_stMobile.length() && !*m_szMobileAuth)
strlcpy(tab.szMobile, m_stMobile.c_str(), sizeof(tab.szMobile));
strncpy(tab.szMobile, m_stMobile.c_str(), sizeof(tab.szMobile));
thecore_memcpy(tab.parts, m_pointsInstant.parts, sizeof(tab.parts));
@ -1318,7 +1318,7 @@ void CHARACTER::Disconnect(const char * c_pszReason)
// P2P Logout
TPacketGGLogout p;
p.bHeader = HEADER_GG_LOGOUT;
strlcpy(p.szName, GetName(), sizeof(p.szName));
strncpy(p.szName, GetName(), sizeof(p.szName));
P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGLogout));
char buf[51];
snprintf(buf, sizeof(buf), "%s %d %d %ld %d",
@ -1551,10 +1551,10 @@ void CHARACTER::MainCharacterPacket()
mainChrPacket.lz = GetZ();
mainChrPacket.empire = GetDesc()->GetEmpire();
mainChrPacket.skill_group = GetSkillGroup();
strlcpy(mainChrPacket.szChrName, GetName(), sizeof(mainChrPacket.szChrName));
strncpy(mainChrPacket.szChrName, GetName(), sizeof(mainChrPacket.szChrName));
mainChrPacket.fBGMVol = bgmInfo.vol;
strlcpy(mainChrPacket.szBGMName, bgmInfo.name.c_str(), sizeof(mainChrPacket.szBGMName));
strncpy(mainChrPacket.szBGMName, bgmInfo.name.c_str(), sizeof(mainChrPacket.szBGMName));
GetDesc()->Packet(&mainChrPacket, sizeof(TPacketGCMainCharacter4_BGM_VOL));
}
else
@ -1569,8 +1569,8 @@ void CHARACTER::MainCharacterPacket()
mainChrPacket.lz = GetZ();
mainChrPacket.empire = GetDesc()->GetEmpire();
mainChrPacket.skill_group = GetSkillGroup();
strlcpy(mainChrPacket.szChrName, GetName(), sizeof(mainChrPacket.szChrName));
strlcpy(mainChrPacket.szBGMName, bgmInfo.name.c_str(), sizeof(mainChrPacket.szBGMName));
strncpy(mainChrPacket.szChrName, GetName(), sizeof(mainChrPacket.szChrName));
strncpy(mainChrPacket.szBGMName, bgmInfo.name.c_str(), sizeof(mainChrPacket.szBGMName));
GetDesc()->Packet(&mainChrPacket, sizeof(TPacketGCMainCharacter3_BGM));
}
//if (m_stMobile.length())
@ -1590,7 +1590,7 @@ void CHARACTER::MainCharacterPacket()
pack.lz = GetZ();
pack.empire = GetDesc()->GetEmpire();
pack.skill_group = GetSkillGroup();
strlcpy(pack.szName, GetName(), sizeof(pack.szName));
strncpy(pack.szName, GetName(), sizeof(pack.szName));
GetDesc()->Packet(&pack, sizeof(TPacketGCMainCharacter));
if (m_stMobile.length())
@ -5323,7 +5323,7 @@ void CHARACTER::WarpEnd()
TPacketGGLogin p;
p.bHeader = HEADER_GG_LOGIN;
strlcpy(p.szName, GetName(), sizeof(p.szName));
strncpy(p.szName, GetName(), sizeof(p.szName));
p.dwPID = GetPlayerID();
p.bEmpire = GetEmpire();
p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(GetX(), GetY());
@ -5569,8 +5569,8 @@ void CHARACTER::ReqSafeboxLoad(const char* pszPassword)
TSafeboxLoadPacket p;
p.dwID = GetDesc()->GetAccountTable().id;
strlcpy(p.szLogin, GetDesc()->GetAccountTable().login, sizeof(p.szLogin));
strlcpy(p.szPassword, pszPassword, sizeof(p.szPassword));
strncpy(p.szLogin, GetDesc()->GetAccountTable().login, sizeof(p.szLogin));
strncpy(p.szPassword, pszPassword, sizeof(p.szPassword));
db_clientdesc->DBPacket(HEADER_GD_SAFEBOX_LOAD, GetDesc()->GetHandle(), &p, sizeof(p));
}
@ -6517,7 +6517,7 @@ void CHARACTER::ConfirmWithMsg(const char* szMsg, int iTimeout, DWORD dwRequestP
p.header = HEADER_GC_QUEST_CONFIRM;
p.requestPID = dwRequestPID;
p.timeout = iTimeout;
strlcpy(p.msg, szMsg, sizeof(p.msg));
strncpy(p.msg, szMsg, sizeof(p.msg));
GetDesc()->Packet(&p, sizeof(p));
}

View File

@ -3,7 +3,7 @@
#include <boost/unordered_map.hpp>
#include "../../common/stl.h"
#include <common/stl.h>
#include "entity.h"
#include "FSM.h"
#include "horse_rider.h"

View File

@ -11,7 +11,7 @@
#include "locale_service.h"
#include "arena.h"
#include "../../common/VnumHelper.h"
#include <common/VnumHelper.h>
bool CHARACTER::StartRiding()
{

View File

@ -41,7 +41,7 @@
#include "safebox.h"
#include "shop.h"
#include "../../common/VnumHelper.h"
#include <common/VnumHelper.h>
#include "DragonSoul.h"
#include "buff_on_attributes.h"
#include "belt_inventory_helper.h"

View File

@ -5,8 +5,8 @@
#include "pool.h"
#endif
#include "../../common/stl.h"
#include "../../common/length.h"
#include <common/stl.h>
#include <common/length.h>
#include "vid.h"

View File

@ -22,7 +22,7 @@
#include "locale_service.h"
#include "BlueDragon.h"
#include "../../common/VnumHelper.h"
#include <common/VnumHelper.h>
BOOL g_test_server;
extern LPCHARACTER FindVictim(LPCHARACTER pkChr, int iMaxDistance);

View File

@ -33,7 +33,7 @@
#include "unique_item.h"
#include "threeway_war.h"
#include "log.h"
#include "../../common/VnumHelper.h"
#include <common/VnumHelper.h>
#ifdef __AUCTION__
#include "auction_manager.h"
#endif
@ -390,7 +390,7 @@ ACMD(do_cmd)
info->ch = ch;
info->subcmd = subcmd;
strlcpy(info->szReason, argument, sizeof(info->szReason));
strncpy(info->szReason, argument, sizeof(info->szReason));
ch->m_pkTimedEvent = event_create(timed_event, info, 1);
}
@ -928,8 +928,8 @@ ACMD(do_safebox_change_password)
TSafeboxChangePasswordPacket p;
p.dwID = ch->GetDesc()->GetAccountTable().id;
strlcpy(p.szOldPassword, arg1, sizeof(p.szOldPassword));
strlcpy(p.szNewPassword, arg2, sizeof(p.szNewPassword));
strncpy(p.szOldPassword, arg1, sizeof(p.szOldPassword));
strncpy(p.szNewPassword, arg2, sizeof(p.szNewPassword));
db_clientdesc->DBPacket(HEADER_GD_SAFEBOX_CHANGE_PASSWORD, ch->GetDesc()->GetHandle(), &p, sizeof(p));
}
@ -963,8 +963,8 @@ ACMD(do_mall_password)
TSafeboxLoadPacket p;
p.dwID = ch->GetDesc()->GetAccountTable().id;
strlcpy(p.szLogin, ch->GetDesc()->GetAccountTable().login, sizeof(p.szLogin));
strlcpy(p.szPassword, arg1, sizeof(p.szPassword));
strncpy(p.szLogin, ch->GetDesc()->GetAccountTable().login, sizeof(p.szLogin));
strncpy(p.szPassword, arg1, sizeof(p.szPassword));
db_clientdesc->DBPacket(HEADER_GD_MALL_LOAD, ch->GetDesc()->GetHandle(), &p, sizeof(p));
}
@ -1635,7 +1635,7 @@ ACMD(do_monarch_transfer)
TPacketGGTransfer pgg;
pgg.bHeader = HEADER_GG_TRANSFER;
strlcpy(pgg.szName, arg1, sizeof(pgg.szName));
strncpy(pgg.szName, arg1, sizeof(pgg.szName));
pgg.lX = ch->GetX();
pgg.lY = ch->GetY();

View File

@ -165,7 +165,7 @@ ACMD(do_transfer)
TPacketGGTransfer pgg;
pgg.bHeader = HEADER_GG_TRANSFER;
strlcpy(pgg.szName, arg1, sizeof(pgg.szName));
strncpy(pgg.szName, arg1, sizeof(pgg.szName));
pgg.lX = ch->GetX();
pgg.lY = ch->GetY();
@ -258,7 +258,7 @@ bool FindInString(const char * c_pszFind, const char * c_pszIn)
do
{
strlcpy(sz, c, MIN(sizeof(sz), (p - c) + 1));
strncpy(sz, c, MIN(sizeof(sz), (p - c) + 1));
if (!strncasecmp(c_pszFind, sz, strlen(c_pszFind)))
return true;
@ -266,7 +266,7 @@ bool FindInString(const char * c_pszFind, const char * c_pszIn)
c = p + 1;
} while ((p = strchr(c, '|')));
strlcpy(sz, c, sizeof(sz));
strncpy(sz, c, sizeof(sz));
if (!strncasecmp(c_pszFind, sz, strlen(c_pszFind)))
return true;
@ -1599,7 +1599,7 @@ ACMD(do_makeguild)
memset(&cp, 0, sizeof(cp));
cp.master = ch;
strlcpy(cp.name, arg1, sizeof(cp.name));
strncpy(cp.name, arg1, sizeof(cp.name));
if (!check_name(cp.name))
{
@ -2719,7 +2719,7 @@ ACMD(do_vote_block_chat)
TPacketGGBlockChat p;
p.bHeader = HEADER_GG_BLOCK_CHAT;
strlcpy(p.szName, name, sizeof(p.szName));
strncpy(p.szName, name, sizeof(p.szName));
p.lBlockDuration = lBlockDuration;
P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGBlockChat));
}
@ -2727,7 +2727,7 @@ ACMD(do_vote_block_chat)
{
TPacketBlockChat p;
strlcpy(p.szName, name, sizeof(p.szName));
strncpy(p.szName, name, sizeof(p.szName));
p.lDuration = lBlockDuration;
db_clientdesc->DBPacket(HEADER_GD_BLOCK_CHAT, ch ? ch->GetDesc()->GetHandle() : 0, &p, sizeof(p));
@ -2789,7 +2789,7 @@ ACMD(do_block_chat)
TPacketGGBlockChat p;
p.bHeader = HEADER_GG_BLOCK_CHAT;
strlcpy(p.szName, name, sizeof(p.szName));
strncpy(p.szName, name, sizeof(p.szName));
p.lBlockDuration = lBlockDuration;
P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGBlockChat));
}
@ -2797,7 +2797,7 @@ ACMD(do_block_chat)
{
TPacketBlockChat p;
strlcpy(p.szName, name, sizeof(p.szName));
strncpy(p.szName, name, sizeof(p.szName));
p.lDuration = lBlockDuration;
db_clientdesc->DBPacket(HEADER_GD_BLOCK_CHAT, ch ? ch->GetDesc()->GetHandle() : 0, &p, sizeof(p));
}

View File

@ -267,7 +267,7 @@ bool GetIPInfo()
if (!strncmp(netip, "192.168", 7)) // ignore if address is starting with 192
{
strlcpy(g_szInternalIP, netip, sizeof(g_szInternalIP));
strncpy(g_szInternalIP, netip, sizeof(g_szInternalIP));
#ifndef __WIN32__
fprintf(stderr, "INTERNAL_IP: %s interface %s\n", netip, ifap->ifa_name);
#else
@ -276,7 +276,7 @@ bool GetIPInfo()
}
else if (!strncmp(netip, "10.", 3))
{
strlcpy(g_szInternalIP, netip, sizeof(g_szInternalIP));
strncpy(g_szInternalIP, netip, sizeof(g_szInternalIP));
#ifndef __WIN32__
fprintf(stderr, "INTERNAL_IP: %s interface %s\n", netip, ifap->ifa_name);
#else
@ -285,7 +285,7 @@ bool GetIPInfo()
}
else if (g_szPublicIP[0] == '0')
{
strlcpy(g_szPublicIP, netip, sizeof(g_szPublicIP));
strncpy(g_szPublicIP, netip, sizeof(g_szPublicIP));
#ifndef __WIN32__
fprintf(stderr, "PUBLIC_IP: %s interface %s\n", netip, ifap->ifa_name);
#else
@ -768,7 +768,7 @@ void config_init(const string& st_localeServiceName)
TOKEN("db_addr")
{
strlcpy(db_addr, value_string, sizeof(db_addr));
strncpy(db_addr, value_string, sizeof(db_addr));
for (int n =0; n < ADDRESS_MAX_LEN; ++n)
{
@ -966,7 +966,7 @@ void config_init(const string& st_localeServiceName)
TOKEN("teen_addr")
{
strlcpy(teen_addr, value_string, sizeof(teen_addr));
strncpy(teen_addr, value_string, sizeof(teen_addr));
for (int n =0; n < ADDRESS_MAX_LEN; ++n)
{
@ -1009,7 +1009,7 @@ void config_init(const string& st_localeServiceName)
TOKEN("bind_ip")
{
strlcpy(g_szPublicIP, value_string, sizeof(g_szPublicIP));
strncpy(g_szPublicIP, value_string, sizeof(g_szPublicIP));
}
TOKEN("view_range")

View File

@ -1181,7 +1181,7 @@ const int aiAccessorySocketPutPct[ITEM_ACCESSORY_SOCKET_MAX_NUM + 1] =
};
// END_OF_ACCESSORY_REFINE
#include "../../common/length.h"
#include <common/length.h>
// from import_item_proto.c
typedef struct SValueName
{

View File

@ -1,7 +1,7 @@
#ifndef __INC_METIN_II_GAME_CONSTANTS_H__
#define __INC_METIN_II_GAME_CONSTANTS_H__
#include "../../common/tables.h"
#include <common/tables.h>
enum EMonsterChatState
{

View File

@ -1,7 +1,7 @@
#include "stdafx.h"
#include <sstream>
#include "../../common/billing.h"
#include "../../common/length.h"
#include <common/billing.h>
#include <common/length.h>
#include "db.h"
@ -253,9 +253,9 @@ void DBManager::PushBilling(CLoginData * pkLD)
if (t.bBillType == BILLING_IP_FREE || t.bBillType == BILLING_IP_TIME || t.bBillType == BILLING_IP_DAY)
snprintf(t.szLogin, sizeof(t.szLogin), "%u", pkLD->GetBillID());
else
strlcpy(t.szLogin, pkLD->GetLogin(), sizeof(t.szLogin));
strncpy(t.szLogin, pkLD->GetLogin(), sizeof(t.szLogin));
strlcpy(t.szIP, pkLD->GetIP(), sizeof(t.szIP));
strncpy(t.szIP, pkLD->GetIP(), sizeof(t.szIP));
m_vec_kUseTime.push_back(t);
}
@ -460,7 +460,7 @@ void DBManager::SendLoginPing(const char * c_pszLogin)
TPacketGGLoginPing ptog;
ptog.bHeader = HEADER_GG_LOGIN_PING;
strlcpy(ptog.szLogin, c_pszLogin, sizeof(ptog.szLogin));
strncpy(ptog.szLogin, c_pszLogin, sizeof(ptog.szLogin));
if (!g_pkAuthMasterDesc) // If I am master, broadcast to others
{
@ -485,7 +485,7 @@ void DBManager::SendAuthLogin(LPDESC d)
ptod.dwID = r.id;
trim_and_lower(r.login, ptod.szLogin, sizeof(ptod.szLogin));
strlcpy(ptod.szSocialID, r.social_id, sizeof(ptod.szSocialID));
strncpy(ptod.szSocialID, r.social_id, sizeof(ptod.szSocialID));
ptod.dwLoginKey = d->GetLoginKey();
ptod.bBillType = pkLD->GetBillType();
ptod.dwBillID = pkLD->GetBillID();
@ -598,7 +598,7 @@ bool GetGameTimeIP(MYSQL_RES * pRes, BYTE & bBillType, DWORD & dwBillID, int & s
str_to_number(day_seconds, row[col++]);
char szIP[MAX_HOST_LENGTH + 1];
strlcpy(szIP, c_pszIP, sizeof(szIP));
strncpy(szIP, c_pszIP, sizeof(szIP));
char * p = strrchr(szIP, '.');
++p;
@ -668,7 +668,7 @@ void SendBillingExpire(const char * c_pszLogin, BYTE bBillType, int iSecs, CLogi
{
TPacketBillingExpire ptod;
strlcpy(ptod.szLogin, c_pszLogin, sizeof(ptod.szLogin));
strncpy(ptod.szLogin, c_pszLogin, sizeof(ptod.szLogin));
ptod.bBillType = bBillType;
ptod.dwRemainSeconds = MAX(0, iSecs);
db_clientdesc->DBPacket(HEADER_GD_BILLING_EXPIRE, 0, &ptod, sizeof(TPacketBillingExpire));
@ -735,7 +735,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
break;
}
strlcpy(szEncrytPassword, row[col++], sizeof(szEncrytPassword));
strncpy(szEncrytPassword, row[col++], sizeof(szEncrytPassword));
if (!row[col])
{
@ -744,7 +744,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
break;
}
strlcpy(szPassword, row[col++], sizeof(szPassword));
strncpy(szPassword, row[col++], sizeof(szPassword));
if (!row[col])
{
@ -753,7 +753,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
}
else
{
strlcpy(szMatrixCode, row[col++], sizeof(szMatrixCode));
strncpy(szMatrixCode, row[col++], sizeof(szMatrixCode));
}
if (!row[col])
@ -763,7 +763,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
break;
}
strlcpy(szSocialID, row[col++], sizeof(szSocialID));
strncpy(szSocialID, row[col++], sizeof(szSocialID));
if (!row[col])
{
@ -781,7 +781,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
break;
}
strlcpy(szStatus, row[col++], sizeof(szStatus));
strncpy(szStatus, row[col++], sizeof(szStatus));
BYTE bNotAvail = 0;
str_to_number(bNotAvail, row[col++]);
@ -879,8 +879,8 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
r.id = dwID;
trim_and_lower(pinfo->login, r.login, sizeof(r.login));
strlcpy(r.passwd, pinfo->passwd, sizeof(r.passwd));
strlcpy(r.social_id, szSocialID, sizeof(r.social_id));
strncpy(r.passwd, pinfo->passwd, sizeof(r.passwd));
strncpy(r.social_id, szSocialID, sizeof(r.social_id));
DESC_MANAGER::instance().ConnectAccount(r.login, d);
d->SetMatrixCode(szMatrixCode);
@ -961,7 +961,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
break;
}
strlcpy(szEncrytPassword, row[col++], sizeof(szEncrytPassword));
strncpy(szEncrytPassword, row[col++], sizeof(szEncrytPassword));
if (!row[col])
{
@ -970,7 +970,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
break;
}
strlcpy(szPassword, row[col++], sizeof(szPassword));
strncpy(szPassword, row[col++], sizeof(szPassword));
if (!row[col])
{
@ -979,7 +979,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
}
else
{
strlcpy(szMatrixCode, row[col++], sizeof(szMatrixCode));
strncpy(szMatrixCode, row[col++], sizeof(szMatrixCode));
}
if (!row[col])
@ -989,7 +989,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
break;
}
strlcpy(szSocialID, row[col++], sizeof(szSocialID));
strncpy(szSocialID, row[col++], sizeof(szSocialID));
if (!row[col])
{
@ -1007,7 +1007,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
break;
}
strlcpy(szStatus, row[col++], sizeof(szStatus));
strncpy(szStatus, row[col++], sizeof(szStatus));
BYTE bNotAvail = 0;
str_to_number(bNotAvail, row[col++]);
@ -1111,8 +1111,8 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
r.id = dwID;
trim_and_lower(pinfo->login, r.login, sizeof(r.login));
strlcpy(r.passwd, pinfo->passwd, sizeof(r.passwd));
strlcpy(r.social_id, szSocialID, sizeof(r.social_id));
strncpy(r.passwd, pinfo->passwd, sizeof(r.passwd));
strncpy(r.social_id, szSocialID, sizeof(r.social_id));
DESC_MANAGER::instance().ConnectAccount(r.login, d);
d->SetMatrixCode(szMatrixCode);
@ -1542,10 +1542,10 @@ void VCardUse(LPCHARACTER CardOwner, LPCHARACTER CardTaker, LPITEM item)
TPacketGDVCard p;
p.dwID = item->GetSocket(0);
strlcpy(p.szSellCharacter, CardOwner->GetName(), sizeof(p.szSellCharacter));
strlcpy(p.szSellAccount, CardOwner->GetDesc()->GetAccountTable().login, sizeof(p.szSellAccount));
strlcpy(p.szBuyCharacter, CardTaker->GetName(), sizeof(p.szBuyCharacter));
strlcpy(p.szBuyAccount, CardTaker->GetDesc()->GetAccountTable().login, sizeof(p.szBuyAccount));
strncpy(p.szSellCharacter, CardOwner->GetName(), sizeof(p.szSellCharacter));
strncpy(p.szSellAccount, CardOwner->GetDesc()->GetAccountTable().login, sizeof(p.szSellAccount));
strncpy(p.szBuyCharacter, CardTaker->GetName(), sizeof(p.szBuyCharacter));
strncpy(p.szBuyAccount, CardTaker->GetDesc()->GetAccountTable().login, sizeof(p.szBuyAccount));
db_clientdesc->DBPacket(HEADER_GD_VCARD, 0, &p, sizeof(TPacketGDVCard));
@ -1573,7 +1573,7 @@ void DBManager::RequestBlockException(const char *login, int cmd)
TPacketBlockException packet;
packet.cmd = cmd;
strlcpy(packet.login, login, sizeof(packet.login));
strncpy(packet.login, login, sizeof(packet.login));
db_clientdesc->DBPacket(HEADER_GD_BLOCK_EXCEPTION, 0, &packet, sizeof(packet));
}

View File

@ -1,7 +1,7 @@
#ifndef __INC_METIN_II_DB_MANAGER_H__
#define __INC_METIN_II_DB_MANAGER_H__
#include "../../libsql/AsyncSQL.h"
#include <libsql/include/CAsyncSQL.h>
#include "any_function.h"
enum

View File

@ -144,8 +144,8 @@ void DESC::Destroy()
{
TLogoutPacket pack;
strlcpy(pack.login, m_accountTable.login, sizeof(pack.login));
strlcpy(pack.passwd, m_accountTable.passwd, sizeof(pack.passwd));
strncpy(pack.login, m_accountTable.login, sizeof(pack.login));
strncpy(pack.passwd, m_accountTable.passwd, sizeof(pack.passwd));
db_clientdesc->DBPacket(HEADER_GD_LOGOUT, m_dwHandle, &pack, sizeof(TLogoutPacket));
}
@ -441,7 +441,7 @@ void DESC::Packet(const void * c_pvData, int iSize)
TPacketGGRelay p;
p.bHeader = HEADER_GG_RELAY;
strlcpy(p.szName, m_stRelayName.c_str(), sizeof(p.szName));
strncpy(p.szName, m_stRelayName.c_str(), sizeof(p.szName));
p.lSize = iSize;
if (!packet_encode(m_lpOutputBuffer, &p, sizeof(p)))
@ -941,7 +941,7 @@ void DESC::SendLoginSuccessPacket()
if (g)
{
p.guild_id[i] = g->GetID();
strlcpy(p.guild_name[i], g->GetName(), sizeof(p.guild_name[i]));
strncpy(p.guild_name[i], g->GetName(), sizeof(p.guild_name[i]));
}
else
{

View File

@ -156,7 +156,7 @@ void CLIENT_DESC::SetPhase(int iPhase)
TPacketGDSetup p;
memset(&p, 0, sizeof(p));
strlcpy(p.szPublicIP, g_szPublicIP, sizeof(p.szPublicIP));
strncpy(p.szPublicIP, g_szPublicIP, sizeof(p.szPublicIP));
if (!g_bAuthServer)
{
@ -192,9 +192,9 @@ void CLIENT_DESC::SetPhase(int iPhase)
if (r.id != 0)
{
pck.dwID = r.id;
strlcpy(pck.szLogin, r.login, sizeof(pck.szLogin));
strlcpy(pck.szSocialID, r.social_id, sizeof(pck.szSocialID));
strlcpy(pck.szHost, d->GetHostName(), sizeof(pck.szHost));
strncpy(pck.szLogin, r.login, sizeof(pck.szLogin));
strncpy(pck.szSocialID, r.social_id, sizeof(pck.szSocialID));
strncpy(pck.szHost, d->GetHostName(), sizeof(pck.szHost));
pck.dwLoginKey = d->GetLoginKey();
#ifndef _IMPROVED_PACKET_ENCRYPTION_
thecore_memcpy(pck.adwClientKey, d->GetDecryptionKey(), 16);

View File

@ -156,7 +156,7 @@ LPDESC DESC_MANAGER::AcceptDesc(LPFDWATCH fdw, socket_t s)
if ((desc = socket_accept(s, &peer)) == -1)
return NULL;
strlcpy(host, inet_ntoa(peer.sin_addr), sizeof(host));
strncpy(host, inet_ntoa(peer.sin_addr), sizeof(host));
if (g_bAuthServer)
{
@ -205,7 +205,7 @@ LPDESC DESC_MANAGER::AcceptP2PDesc(LPFDWATCH fdw, socket_t bind_fd)
if ((fd = socket_accept(bind_fd, &peer)) == -1)
return NULL;
strlcpy(host, inet_ntoa(peer.sin_addr), sizeof(host));
strncpy(host, inet_ntoa(peer.sin_addr), sizeof(host));
LPDESC_P2P pkDesc = M2_NEW DESC_P2P;

View File

@ -3,8 +3,8 @@
#include <boost/unordered_map.hpp>
#include "../../common/stl.h"
#include "../../common/length.h"
#include <common/stl.h>
#include <common/length.h>
#include "IFileMonitor.h"
class CLoginKey;

View File

@ -10,7 +10,7 @@
#include "log.h"
#include "db.h"
#include "locale_service.h"
#include "../../common/length.h"
#include <common/length.h>
#include "exchange.h"
#include "DragonSoul.h"

View File

@ -248,7 +248,7 @@ void Initialize()
do
{
strlcpy(szCol2, start, MIN(sizeof(szCol2), (tab - start) + 1));
strncpy(szCol2, start, MIN(sizeof(szCol2), (tab - start) + 1));
szCol2[tab-start] = '\0';
trim_and_lower(szCol2, szCol, sizeof(szCol));
@ -259,7 +259,7 @@ void Initialize()
{
switch (iColCount++)
{
case 0: strlcpy(fish_info[idx].name, szCol, sizeof(fish_info[idx].name)); break;
case 0: strncpy(fish_info[idx].name, szCol, sizeof(fish_info[idx].name)); break;
case 1: str_to_number(fish_info[idx].vnum, szCol); break;
case 2: str_to_number(fish_info[idx].dead_vnum, szCol); break;
case 3: str_to_number(fish_info[idx].grill_vnum, szCol); break;
@ -660,11 +660,11 @@ void Take(fishing_event_info* info, LPCHARACTER ch)
if (info->fish_id == 5)
{
strlcpy(p.szBoard, LC_TEXT("낚시이벤트월척붕어"), sizeof(p.szBoard));
strncpy(p.szBoard, LC_TEXT("낚시이벤트월척붕어"), sizeof(p.szBoard));
}
else if (info->fish_id == 6)
{
strlcpy(p.szBoard, LC_TEXT("낚시이벤트잉어"), sizeof(p.szBoard));
strncpy(p.szBoard, LC_TEXT("낚시이벤트잉어"), sizeof(p.szBoard));
}
db_clientdesc->DBPacket(HEADER_GD_HIGHSCORE_REGISTER, 0, &p, sizeof(TPacketGDHighscore));

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#include "../../common/stl.h"
#include <common/stl.h>
#include "group_text_parse_tree.h"
CGroupTextParseTreeLoader::CGroupTextParseTreeLoader()

View File

@ -1,8 +1,8 @@
#ifndef __INC_METIN_II_GROUP_TEXT_PARSE_TREE_H__
#define __INC_METIN_II_GROUP_TEXT_PARSE_TREE_H__
#include "../../common/d3dtype.h"
#include "../../common/pool.h"
#include <common/d3dtype.h>
#include <common/pool.h>
#include "file_loader.h"
#include <sstream>
typedef std::map<std::string, TTokenVector> TTokenVectorMap;

View File

@ -61,14 +61,14 @@ CGuild::CGuild(TGuildCreateParameter & cp)
m_iMemberCountBonus = 0;
strlcpy(m_data.name, cp.name, sizeof(m_data.name));
strncpy(m_data.name, cp.name, sizeof(m_data.name));
m_data.master_pid = cp.master->GetPlayerID();
strlcpy(m_data.grade_array[0].grade_name, LC_TEXT("±æµåÀå"), sizeof(m_data.grade_array[0].grade_name));
strncpy(m_data.grade_array[0].grade_name, LC_TEXT("±æµåÀå"), sizeof(m_data.grade_array[0].grade_name));
m_data.grade_array[0].auth_flag = GUILD_AUTH_ADD_MEMBER | GUILD_AUTH_REMOVE_MEMBER | GUILD_AUTH_NOTICE | GUILD_AUTH_USE_SKILL;
for (int i = 1; i < GUILD_GRADE_COUNT; ++i)
{
strlcpy(m_data.grade_array[i].grade_name, LC_TEXT("±æµå¿ø"), sizeof(m_data.grade_array[i].grade_name));
strncpy(m_data.grade_array[i].grade_name, LC_TEXT("±æµå¿ø"), sizeof(m_data.grade_array[i].grade_name));
m_data.grade_array[i].auth_flag = 0;
}
@ -446,7 +446,7 @@ void CGuild::SendListPacket(LPCHARACTER ch)
buf.write(&(it->second), sizeof(DWORD)*3+1);
strlcpy(c, it->second.name.c_str(), MIN(sizeof(c), it->second.name.length() + 1));
strncpy(c, it->second.name.c_str(), MIN(sizeof(c), it->second.name.length() + 1));
buf.write(c, CHARACTER_NAME_MAX_LEN+1 );
@ -579,7 +579,7 @@ void CGuild::LoadGuildGradeData(SQLMsg* pmsg)
if (grade >= 1 && grade <= 15)
{
//sys_log(0, "GuildGradeLoad %s", name);
strlcpy(m_data.grade_array[grade-1].grade_name, name, sizeof(m_data.grade_array[grade-1].grade_name));
strncpy(m_data.grade_array[grade-1].grade_name, name, sizeof(m_data.grade_array[grade-1].grade_name));
m_data.grade_array[grade-1].auth_flag = auth;
}
}
@ -596,7 +596,7 @@ void CGuild::LoadGuildData(SQLMsg* pmsg)
m_data.master_pid = strtoul(row[0], (char **)NULL, 10);
m_data.level = (BYTE)strtoul(row[1], (char **)NULL, 10);
m_data.exp = strtoul(row[2], (char **)NULL, 10);
strlcpy(m_data.name, row[3], sizeof(m_data.name));
strncpy(m_data.name, row[3], sizeof(m_data.name));
m_data.skill_point = (BYTE) strtoul(row[4], (char **) NULL, 10);
if (row[5])
@ -703,7 +703,7 @@ void CGuild::__P2PUpdateGrade(SQLMsg* pmsg)
// 등급 명칭이 현재와 다르다면 업데이트
if (0 != strcmp(m_data.grade_array[grade].grade_name, name))
{
strlcpy(m_data.grade_array[grade].grade_name, name, sizeof(m_data.grade_array[grade].grade_name));
strncpy(m_data.grade_array[grade].grade_name, name, sizeof(m_data.grade_array[grade].grade_name));
TPacketGCGuild pack;
@ -715,7 +715,7 @@ void CGuild::__P2PUpdateGrade(SQLMsg* pmsg)
pack.size += sizeof(pack2);
pack2.grade = grade + 1;
strlcpy(pack2.grade_name, name, sizeof(pack2.grade_name));
strncpy(pack2.grade_name, name, sizeof(pack2.grade_name));
TEMP_BUFFER buf;
@ -810,7 +810,7 @@ void CGuild::ChangeGradeName(BYTE grade, const char* grade_name)
DBManager::instance().FuncAfterQuery(FSendChangeGrade(GetID(), grade), "UPDATE guild_grade%s SET name = '%s' where guild_id = %u and grade = %d", get_table_postfix(), text, m_data.guild_id, grade);
grade--;
strlcpy(m_data.grade_array[grade].grade_name, grade_name, sizeof(m_data.grade_array[grade].grade_name));
strncpy(m_data.grade_array[grade].grade_name, grade_name, sizeof(m_data.grade_array[grade].grade_name));
TPacketGCGuild pack;
pack.header = HEADER_GC_GUILD;
@ -820,7 +820,7 @@ void CGuild::ChangeGradeName(BYTE grade, const char* grade_name)
TOneGradeNamePacket pack2;
pack.size+=sizeof(pack2);
pack2.grade = grade+1;
strlcpy(pack2.grade_name,grade_name, sizeof(pack2.grade_name));
strncpy(pack2.grade_name,grade_name, sizeof(pack2.grade_name));
TEMP_BUFFER buf;
buf.write(&pack,sizeof(pack));
@ -896,7 +896,7 @@ void CGuild::SendGuildInfoPacket(LPCHARACTER ch)
pack_sub.master_pid = m_data.master_pid;
pack_sub.exp = m_data.exp;
pack_sub.level = m_data.level;
strlcpy(pack_sub.name, m_data.name, sizeof(pack_sub.name));
strncpy(pack_sub.name, m_data.name, sizeof(pack_sub.name));
pack_sub.gold = m_data.gold;
pack_sub.has_land = HasLand();
@ -1079,8 +1079,8 @@ void CGuild::RefreshCommentForce(DWORD player_id)
MYSQL_ROW row = mysql_fetch_row(pmsg->Get()->pSQLResult);
DWORD id = strtoul(row[0], NULL, 10);
strlcpy(szName, row[1], sizeof(szName));
strlcpy(szContent, row[2], sizeof(szContent));
strncpy(szName, row[1], sizeof(szName));
strncpy(szContent, row[2], sizeof(szContent));
d->BufferedPacket(&id, sizeof(id));
d->BufferedPacket(szName, sizeof(szName));
@ -1679,7 +1679,7 @@ void CGuild::Chat(const char* c_pszText)
p1.bHeader = HEADER_GG_GUILD;
p1.bSubHeader = GUILD_SUBHEADER_GG_CHAT;
p1.dwGuild = GetID();
strlcpy(p2.szText, c_pszText, sizeof(p2.szText));
strncpy(p2.szText, c_pszText, sizeof(p2.szText));
P2P_MANAGER::instance().Send(&p1, sizeof(TPacketGGGuild));
P2P_MANAGER::instance().Send(&p2, sizeof(TPacketGGGuildChat));

View File

@ -50,7 +50,7 @@ void CHorseNameManager::BroadcastHorseName(DWORD dwPlayerID, const char* szHorse
{
TPacketUpdateHorseName packet;
packet.dwPlayerID = dwPlayerID;
strlcpy(packet.szHorseName, szHorseName, sizeof(packet.szHorseName));
strncpy(packet.szHorseName, szHorseName, sizeof(packet.szHorseName));
db_clientdesc->DBPacket(HEADER_GD_UPDATE_HORSE_NAME, 0, &packet, sizeof(TPacketUpdateHorseName));
}

View File

@ -241,7 +241,7 @@ void LoginFailure(LPDESC d, const char * c_pszStatus)
TPacketGCLoginFailure failurePacket;
failurePacket.header = HEADER_GC_LOGIN_FAILURE;
strlcpy(failurePacket.szStatus, c_pszStatus, sizeof(failurePacket.szStatus));
strncpy(failurePacket.szStatus, c_pszStatus, sizeof(failurePacket.szStatus));
d->Packet(&failurePacket, sizeof(failurePacket));
}
@ -395,7 +395,7 @@ int CInputHandshake::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
p.dwID = (DWORD)(atoi(msg.c_str()));
snprintf(szTmp,sizeof(szTmp),"Sent to DB cache to delete ItemAward, id: %d",p.dwID);
//sys_log(0,"%d",p.dwID);
// strlcpy(p.login, msg.c_str(), sizeof(p.login));
// strncpy(p.login, msg.c_str(), sizeof(p.login));
db_clientdesc->DBPacket(HEADER_GD_DELETE_AWARDID, 0, &p, sizeof(p));
stResult += szTmp;
}
@ -446,14 +446,14 @@ dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());
TPacketGGDisconnect pgg;
pgg.bHeader = HEADER_GG_DISCONNECT;
strlcpy(pgg.szLogin, msg.c_str(), sizeof(pgg.szLogin));
strncpy(pgg.szLogin, msg.c_str(), sizeof(pgg.szLogin));
P2P_MANAGER::instance().Send(&pgg, sizeof(TPacketGGDisconnect));
// delete login key
{
TPacketDC p;
strlcpy(p.login, msg.c_str(), sizeof(p.login));
strncpy(p.login, msg.c_str(), sizeof(p.login));
db_clientdesc->DBPacket(HEADER_GD_DC, 0, &p, sizeof(p));
}
}

View File

@ -135,7 +135,7 @@ void CInputAuth::Login(LPDESC d, const char * c_pData)
trim_and_lower(pinfo->login, login, sizeof(login));
char passwd[PASSWD_MAX_LEN + 1];
strlcpy(passwd, pinfo->passwd, sizeof(passwd));
strncpy(passwd, pinfo->passwd, sizeof(passwd));
sys_log(0, "InputAuth::Login : %s(%d) desc %p",
login, strlen(login), get_pointer(d));
@ -154,7 +154,7 @@ void CInputAuth::Login(LPDESC d, const char * c_pData)
TPacketGCLoginFailure failurePacket;
failurePacket.header = HEADER_GC_LOGIN_FAILURE;
strlcpy(failurePacket.szStatus, "SHUTDOWN", sizeof(failurePacket.szStatus));
strncpy(failurePacket.szStatus, "SHUTDOWN", sizeof(failurePacket.szStatus));
d->Packet(&failurePacket, sizeof(failurePacket));
return;
@ -287,7 +287,7 @@ void CInputAuth::LoginOpenID(LPDESC d, const char * c_pData)
trim_and_lower(pinfo->login, login, sizeof(login));
char passwd[PASSWD_MAX_LEN + 1];
strlcpy(passwd, pinfo->passwd, sizeof(passwd));
strncpy(passwd, pinfo->passwd, sizeof(passwd));
sys_log(0, "InputAuth::Login : %s(%d) desc %p",
login, strlen(login), get_pointer(d));
@ -306,7 +306,7 @@ void CInputAuth::LoginOpenID(LPDESC d, const char * c_pData)
TPacketGCLoginFailure failurePacket;
failurePacket.header = HEADER_GC_LOGIN_FAILURE;
strlcpy(failurePacket.szStatus, "SHUTDOWN", sizeof(failurePacket.szStatus));
strncpy(failurePacket.szStatus, "SHUTDOWN", sizeof(failurePacket.szStatus));
d->Packet(&failurePacket, sizeof(failurePacket));
return;

View File

@ -134,7 +134,7 @@ void CInputDB::LoginSuccess(DWORD dwHandle, const char *data)
TLogoutPacket pack;
strlcpy(pack.login, pTab->login, sizeof(pack.login));
strncpy(pack.login, pTab->login, sizeof(pack.login));
db_clientdesc->DBPacket(HEADER_GD_LOGOUT, dwHandle, &pack, sizeof(pack));
return;
}
@ -145,7 +145,7 @@ void CInputDB::LoginSuccess(DWORD dwHandle, const char *data)
TLogoutPacket pack;
strlcpy(pack.login, pTab->login, sizeof(pack.login));
strncpy(pack.login, pTab->login, sizeof(pack.login));
db_clientdesc->DBPacket(HEADER_GD_LOGOUT, dwHandle, &pack, sizeof(pack));
LoginFailure(d, pTab->status);
@ -323,14 +323,14 @@ void CInputDB::ChangeName(LPDESC d, const char * data)
for (size_t i = 0; i < PLAYER_PER_ACCOUNT; ++i)
if (r.players[i].dwID == p->pid)
{
strlcpy(r.players[i].szName, p->name, sizeof(r.players[i].szName));
strncpy(r.players[i].szName, p->name, sizeof(r.players[i].szName));
r.players[i].bChangeName = 0;
TPacketGCChangeName pgc;
pgc.header = HEADER_GC_CHANGE_NAME;
pgc.pid = p->pid;
strlcpy(pgc.name, p->name, sizeof(pgc.name));
strncpy(pgc.name, p->name, sizeof(pgc.name));
d->Packet(&pgc, sizeof(TPacketGCChangeName));
break;
@ -408,7 +408,7 @@ void CInputDB::PlayerLoad(LPDESC d, const char * data)
TPacketGGLogin p;
p.bHeader = HEADER_GG_LOGIN;
strlcpy(p.szName, ch->GetName(), sizeof(p.szName));
strncpy(p.szName, ch->GetName(), sizeof(p.szName));
p.dwPID = ch->GetPlayerID();
p.bEmpire = ch->GetEmpire();
p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(ch->GetX(), ch->GetY());
@ -1282,7 +1282,7 @@ void CInputDB::LoginAlready(LPDESC d, const char * c_pData)
TPacketGGDisconnect pgg;
pgg.bHeader = HEADER_GG_DISCONNECT;
strlcpy(pgg.szLogin, p->szLogin, sizeof(pgg.szLogin));
strncpy(pgg.szLogin, p->szLogin, sizeof(pgg.szLogin));
P2P_MANAGER::instance().Send(&pgg, sizeof(TPacketGGDisconnect));
}
@ -1981,7 +1981,7 @@ void CInputDB::Notice(const char * c_pData)
extern void SendNotice(const char * c_pszBuf);
char szBuf[256+1];
strlcpy(szBuf, c_pData, sizeof(szBuf));
strncpy(szBuf, c_pData, sizeof(szBuf));
sys_log(0, "InputDB:: Notice: %s", szBuf);

View File

@ -1,6 +1,6 @@
#include "stdafx.h"
#include "constants.h"
#include "../../common/teen_packet.h"
#include <common/teen_packet.h>
#include "config.h"
#include "utils.h"
#include "input.h"
@ -98,7 +98,7 @@ void CInputLogin::Login(LPDESC d, const char * data)
if (g_iUseLocale && !test_server)
{
failurePacket.header = HEADER_GC_LOGIN_FAILURE;
strlcpy(failurePacket.szStatus, "VERSION", sizeof(failurePacket.szStatus));
strncpy(failurePacket.szStatus, "VERSION", sizeof(failurePacket.szStatus));
d->Packet(&failurePacket, sizeof(TPacketGCLoginFailure));
return;
}
@ -106,7 +106,7 @@ void CInputLogin::Login(LPDESC d, const char * data)
if (g_bNoMoreClient)
{
failurePacket.header = HEADER_GC_LOGIN_FAILURE;
strlcpy(failurePacket.szStatus, "SHUTDOWN", sizeof(failurePacket.szStatus));
strncpy(failurePacket.szStatus, "SHUTDOWN", sizeof(failurePacket.szStatus));
d->Packet(&failurePacket, sizeof(TPacketGCLoginFailure));
return;
}
@ -122,7 +122,7 @@ void CInputLogin::Login(LPDESC d, const char * data)
if (g_iUserLimit <= iTotal)
{
failurePacket.header = HEADER_GC_LOGIN_FAILURE;
strlcpy(failurePacket.szStatus, "FULL", sizeof(failurePacket.szStatus));
strncpy(failurePacket.szStatus, "FULL", sizeof(failurePacket.szStatus));
d->Packet(&failurePacket, sizeof(TPacketGCLoginFailure));
return;
}
@ -130,8 +130,8 @@ void CInputLogin::Login(LPDESC d, const char * data)
TLoginPacket login_packet;
strlcpy(login_packet.login, login, sizeof(login_packet.login));
strlcpy(login_packet.passwd, pinfo->passwd, sizeof(login_packet.passwd));
strncpy(login_packet.login, login, sizeof(login_packet.login));
strncpy(login_packet.passwd, pinfo->passwd, sizeof(login_packet.passwd));
db_clientdesc->DBPacket(HEADER_GD_LOGIN, d->GetHandle(), &login_packet, sizeof(TLoginPacket));
}
@ -162,7 +162,7 @@ void CInputLogin::LoginByKey(LPDESC d, const char * data)
TPacketGCLoginFailure failurePacket;
failurePacket.header = HEADER_GC_LOGIN_FAILURE;
strlcpy(failurePacket.szStatus, "SHUTDOWN", sizeof(failurePacket.szStatus));
strncpy(failurePacket.szStatus, "SHUTDOWN", sizeof(failurePacket.szStatus));
d->Packet(&failurePacket, sizeof(TPacketGCLoginFailure));
return;
}
@ -180,7 +180,7 @@ void CInputLogin::LoginByKey(LPDESC d, const char * data)
TPacketGCLoginFailure failurePacket;
failurePacket.header = HEADER_GC_LOGIN_FAILURE;
strlcpy(failurePacket.szStatus, "FULL", sizeof(failurePacket.szStatus));
strncpy(failurePacket.szStatus, "FULL", sizeof(failurePacket.szStatus));
d->Packet(&failurePacket, sizeof(TPacketGCLoginFailure));
return;
@ -196,10 +196,10 @@ void CInputLogin::LoginByKey(LPDESC d, const char * data)
TPacketGDLoginByKey ptod;
strlcpy(ptod.szLogin, login, sizeof(ptod.szLogin));
strncpy(ptod.szLogin, login, sizeof(ptod.szLogin));
ptod.dwLoginKey = pinfo->dwLoginKey;
thecore_memcpy(ptod.adwClientKey, pinfo->adwClientKey, sizeof(DWORD) * 4);
strlcpy(ptod.szIP, d->GetHostName(), sizeof(ptod.szIP));
strncpy(ptod.szIP, d->GetHostName(), sizeof(ptod.szIP));
db_clientdesc->DBPacket(HEADER_GD_LOGIN_BY_KEY, d->GetHandle(), &ptod, sizeof(TPacketGDLoginByKey));
}
@ -230,7 +230,7 @@ void CInputLogin::ChangeName(LPDESC d, const char * data)
TPacketGDChangeName pdb;
pdb.pid = c_r.players[p->index].dwID;
strlcpy(pdb.name, p->name, sizeof(pdb.name));
strncpy(pdb.name, p->name, sizeof(pdb.name));
db_clientdesc->DBPacket(HEADER_GD_CHANGE_NAME, d->GetHandle(), &pdb, sizeof(TPacketGDChangeName));
}
@ -284,7 +284,7 @@ bool NewPlayerTable(TPlayerTable * table,
memset(table, 0, sizeof(TPlayerTable));
strlcpy(table->name, name, sizeof(table->name));
strncpy(table->name, name, sizeof(table->name));
table->level = 1;
table->job = job;
@ -400,7 +400,7 @@ bool NewPlayerTable2(TPlayerTable * table, const char * name, BYTE race, BYTE sh
memset(table, 0, sizeof(TPlayerTable));
strlcpy(table->name, name, sizeof(table->name));
strncpy(table->name, name, sizeof(table->name));
table->level = 1;
table->job = race; // Á÷¾÷´ë½Å Á¾Á·À» ³Ö´Â´Ù
@ -493,7 +493,7 @@ void CInputLogin::CharacterCreate(LPDESC d, const char * data)
const TAccountTable & c_rAccountTable = d->GetAccountTable();
trim_and_lower(c_rAccountTable.login, player_create_packet.login, sizeof(player_create_packet.login));
strlcpy(player_create_packet.passwd, c_rAccountTable.passwd, sizeof(player_create_packet.passwd));
strncpy(player_create_packet.passwd, c_rAccountTable.passwd, sizeof(player_create_packet.passwd));
player_create_packet.account_id = c_rAccountTable.id;
player_create_packet.account_index = pinfo->index;
@ -538,7 +538,7 @@ void CInputLogin::CharacterDelete(LPDESC d, const char * data)
trim_and_lower(c_rAccountTable.login, player_delete_packet.login, sizeof(player_delete_packet.login));
player_delete_packet.player_id = c_rAccountTable.players[pinfo->index].dwID;
player_delete_packet.account_index = pinfo->index;
strlcpy(player_delete_packet.private_code, pinfo->private_code, sizeof(player_delete_packet.private_code));
strncpy(player_delete_packet.private_code, pinfo->private_code, sizeof(player_delete_packet.private_code));
db_clientdesc->DBPacket(HEADER_GD_PLAYER_DELETE, d->GetHandle(), &player_delete_packet, sizeof(TPlayerDeletePacket));
}

View File

@ -148,7 +148,7 @@ bool SpamBlockCheck(LPCHARACTER ch, const char* const buf, const size_t buflen)
if (it->second.first >= g_uiSpamBlockScore)
{
spam_event_info* info = AllocEventInfo<spam_event_info>();
strlcpy(info->host, ch->GetDesc()->GetHostName(), sizeof(info->host));
strncpy(info->host, ch->GetDesc()->GetHostName(), sizeof(info->host));
it->second.second = event_create(block_chat_by_ip_event, info, PASSES_PER_SEC(g_uiSpamBlockDuration));
sys_log(0, "SPAM_IP: %s for %u seconds", info->host, g_uiSpamBlockDuration);
@ -326,7 +326,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
pack.bHeader = HEADER_GC_WHISPER;
pack.bType = WHISPER_TYPE_SENDER_BLOCKED;
pack.wSize = sizeof(TPacketGCWhisper);
strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom));
strncpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom));
ch->GetDesc()->Packet(&pack, sizeof(pack));
}
return iExtraLen;
@ -361,7 +361,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
pack.bHeader = HEADER_GC_WHISPER;
pack.bType = WHISPER_TYPE_NOT_EXIST;
pack.wSize = sizeof(TPacketGCWhisper);
strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom));
strncpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom));
ch->GetDesc()->Packet(&pack, sizeof(TPacketGCWhisper));
sys_log(0, "WHISPER: no player");
}
@ -376,7 +376,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
pack.bHeader = HEADER_GC_WHISPER;
pack.bType = WHISPER_TYPE_SENDER_BLOCKED;
pack.wSize = sizeof(TPacketGCWhisper);
strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom));
strncpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom));
ch->GetDesc()->Packet(&pack, sizeof(pack));
}
}
@ -388,7 +388,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
pack.bHeader = HEADER_GC_WHISPER;
pack.bType = WHISPER_TYPE_TARGET_BLOCKED;
pack.wSize = sizeof(TPacketGCWhisper);
strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom));
strncpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom));
ch->GetDesc()->Packet(&pack, sizeof(pack));
}
}
@ -397,7 +397,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
BYTE bType = WHISPER_TYPE_NORMAL;
char buf[CHAT_MAX_LEN + 1];
strlcpy(buf, data + sizeof(TPacketCGWhisper), MIN(iExtraLen + 1, sizeof(buf)));
strncpy(buf, data + sizeof(TPacketCGWhisper), MIN(iExtraLen + 1, sizeof(buf)));
const size_t buflen = strlen(buf);
if (true == SpamBlockCheck(ch, buf, buflen))
@ -464,7 +464,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
pack.bHeader = HEADER_GC_WHISPER;
pack.bType = WHISPER_TYPE_ERROR;
pack.wSize = sizeof(TPacketGCWhisper) + len;
strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom));
strncpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom));
ch->GetDesc()->BufferedPacket(&pack, sizeof(pack));
ch->GetDesc()->Packet(buf, len);
@ -488,7 +488,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
pack.bHeader = HEADER_GC_WHISPER;
pack.wSize = sizeof(TPacketGCWhisper) + buflen;
pack.bType = bType;
strlcpy(pack.szNameFrom, ch->GetName(), sizeof(pack.szNameFrom));
strncpy(pack.szNameFrom, ch->GetName(), sizeof(pack.szNameFrom));
// desc->BufferedPacket을 하지 않고 버퍼에 써야하는 이유는
// P2P relay되어 패킷이 캡슐화 될 수 있기 때문이다.
@ -567,7 +567,7 @@ struct FEmpireChatPacket
else
{
// 사람마다 스킬레벨이 다르니 매번 해야합니다
size_t len = strlcpy(converted_msg, orig_msg, sizeof(converted_msg));
size_t len = strncpy(converted_msg, orig_msg, sizeof(converted_msg));
if (len >= sizeof(converted_msg))
len = sizeof(converted_msg) - 1;
@ -659,7 +659,7 @@ int CInputMain::Chat(LPCHARACTER ch, const char * data, size_t uiBytes)
}
char buf[CHAT_MAX_LEN - (CHARACTER_NAME_MAX_LEN + 3) + 1];
strlcpy(buf, data + sizeof(TPacketCGChat), MIN(iExtraLen + 1, sizeof(buf)));
strncpy(buf, data + sizeof(TPacketCGChat), MIN(iExtraLen + 1, sizeof(buf)));
const size_t buflen = strlen(buf);
if (buflen > 1 && *buf == '/')
@ -745,7 +745,7 @@ int CInputMain::Chat(LPCHARACTER ch, const char * data, size_t uiBytes)
p.bHeader = HEADER_GG_SHOUT;
p.bEmpire = ch->GetEmpire();
strlcpy(p.szText, chatbuf, sizeof(p.szText));
strncpy(p.szText, chatbuf, sizeof(p.szText));
P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout));
@ -965,7 +965,7 @@ int CInputMain::Messenger(LPCHARACTER ch, const char* c_pData, size_t uiBytes)
return -1;
char name[CHARACTER_NAME_MAX_LEN + 1];
strlcpy(name, c_pData, sizeof(name));
strncpy(name, c_pData, sizeof(name));
if (ch->GetGMLevel() == GM_PLAYER && gm_get_level(name) != GM_PLAYER)
{
@ -1002,7 +1002,7 @@ int CInputMain::Messenger(LPCHARACTER ch, const char* c_pData, size_t uiBytes)
return -1;
char char_name[CHARACTER_NAME_MAX_LEN + 1];
strlcpy(char_name, c_pData, sizeof(char_name));
strncpy(char_name, c_pData, sizeof(char_name));
MessengerManager::instance().RemoveFromList(ch->GetName(), char_name);
}
return CHARACTER_NAME_MAX_LEN;
@ -2002,7 +2002,7 @@ void CInputMain::QuestInputString(LPCHARACTER ch, const void* c_pData)
TPacketCGQuestInputString * p = (TPacketCGQuestInputString*) c_pData;
char msg[65];
strlcpy(msg, p->msg, sizeof(msg));
strncpy(msg, p->msg, sizeof(msg));
sys_log(0, "QUEST InputString pid %u msg %s", ch->GetPlayerID(), msg);
quest::CQuestManager::Instance().Input(ch->GetPlayerID(), msg);
@ -2429,7 +2429,7 @@ void CInputMain::AnswerMakeGuild(LPCHARACTER ch, const char* c_pData)
memset(&cp, 0, sizeof(cp));
cp.master = ch;
strlcpy(cp.name, p->guild_name, sizeof(cp.name));
strncpy(cp.name, p->guild_name, sizeof(cp.name));
if (cp.name[0] == 0 || !check_name(cp.name))
{
@ -2685,7 +2685,7 @@ int CInputMain::Guild(LPCHARACTER ch, const char * data, size_t uiBytes)
case GUILD_SUBHEADER_CG_CHANGE_GRADE_NAME:
{
char gradename[GUILD_GRADE_NAME_MAX_LEN + 1];
strlcpy(gradename, c_pData + 1, sizeof(gradename));
strncpy(gradename, c_pData + 1, sizeof(gradename));
const TGuildMember * m = pGuild->GetMember(ch->GetPlayerID());
@ -2918,7 +2918,7 @@ void CInputMain::Hack(LPCHARACTER ch, const char * c_pData)
TPacketCGHack * p = (TPacketCGHack *) c_pData;
char buf[sizeof(p->szBuf)];
strlcpy(buf, p->szBuf, sizeof(buf));
strncpy(buf, p->szBuf, sizeof(buf));
sys_err("HACK_DETECT: %s %s", ch->GetName(), buf);

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#include "../../common/billing.h"
#include <common/billing.h>
#include "config.h"
#include "desc_client.h"
#include "desc_manager.h"
@ -117,7 +117,7 @@ int CInputP2P::Notice(LPDESC d, const char * c_pData, size_t uiBytes)
}
char szBuf[256+1];
strlcpy(szBuf, c_pData + sizeof(TPacketGGNotice), MIN(p->lSize + 1, sizeof(szBuf)));
strncpy(szBuf, c_pData + sizeof(TPacketGGNotice), MIN(p->lSize + 1, sizeof(szBuf)));
SendNotice(szBuf);
return (p->lSize);
}
@ -137,7 +137,7 @@ int CInputP2P::MonarchNotice(LPDESC d, const char * c_pData, size_t uiBytes)
}
char szBuf[256+1];
strlcpy(szBuf, c_pData + sizeof(TPacketGGMonarchNotice), MIN(p->lSize + 1, sizeof(szBuf)));
strncpy(szBuf, c_pData + sizeof(TPacketGGMonarchNotice), MIN(p->lSize + 1, sizeof(szBuf)));
SendMonarchNotice(p->bEmpire, szBuf);
return (p->lSize);
}

View File

@ -9,7 +9,7 @@
#include "stdafx.h"
#include "constants.h"
#include "../../common/teen_packet.h"
#include <common/teen_packet.h>
#include "input.h"
#include "desc.h"
#include "desc_manager.h"

View File

@ -114,7 +114,7 @@ class IP
if (!pDot)
break;
strlcpy(szNum, p, sizeof(szNum));
strncpy(szNum, p, sizeof(szNum));
str_to_number(dest[bClass++], szNum);
p = pDot + 1;
@ -157,7 +157,7 @@ bool LoadBanIP(const char * filename)
if (!p)
{
strlcpy(start, buf, sizeof(start));
strncpy(start, buf, sizeof(start));
*end = '\0';
}
else
@ -167,10 +167,10 @@ bool LoadBanIP(const char * filename)
if (p2)
*p2 = '\0';
strlcpy(end, p + 1, sizeof(end));
strncpy(end, p + 1, sizeof(end));
*p = '\0';
strlcpy(start, buf, sizeof(start));
strncpy(start, buf, sizeof(start));
}
IP ip(start, end);
@ -340,14 +340,14 @@ int main(int argc, char **argv)
if (!p)
{
strlcpy(start, buf, sizeof(start));
strncpy(start, buf, sizeof(start));
*end = '\0';
}
else
{
strlcpy(end, p + 1, sizeof(end));
strncpy(end, p + 1, sizeof(end));
*p = '\0';
strlcpy(start, buf, sizeof(start));
strncpy(start, buf, sizeof(start));
}
v.push_back(IP(start, end));

View File

@ -20,7 +20,7 @@
#include "DragonSoul.h"
#include "buff_on_attributes.h"
#include "belt_inventory_helper.h"
#include "../../common/VnumHelper.h"
#include <common/VnumHelper.h>
CItem::CItem(DWORD dwVnum)
: m_dwVnum(dwVnum), m_bWindow(0), m_dwID(0), m_bEquipped(false), m_dwVID(0), m_wCell(0), m_dwCount(0), m_lFlag(0), m_dwLastOwnerPID(0),
@ -151,7 +151,7 @@ void CItem::EncodeInsertPacket(LPENTITY ent)
p.bHeader = HEADER_GC_ITEM_OWNERSHIP;
p.dwVID = m_dwVID;
strlcpy(p.szName, info->szOwnerName, sizeof(p.szName));
strncpy(p.szName, info->szOwnerName, sizeof(p.szName));
d->Packet(&p, sizeof(TPacketGCItemOwnership));
}
@ -1095,7 +1095,7 @@ void CItem::SetOwnership(LPCHARACTER ch, int iSec)
m_dwOwnershipPID = ch->GetPlayerID();
item_event_info* info = AllocEventInfo<item_event_info>();
strlcpy(info->szOwnerName, ch->GetName(), sizeof(info->szOwnerName));
strncpy(info->szOwnerName, ch->GetName(), sizeof(info->szOwnerName));
info->item = this;
SetOwnershipEvent(event_create(ownership_event, info, PASSES_PER_SEC(iSec)));
@ -1104,7 +1104,7 @@ void CItem::SetOwnership(LPCHARACTER ch, int iSec)
p.bHeader = HEADER_GC_ITEM_OWNERSHIP;
p.dwVID = m_dwVID;
strlcpy(p.szName, ch->GetName(), sizeof(p.szName));
strncpy(p.szName, ch->GetName(), sizeof(p.szName));
PacketAround(&p, sizeof(p));
}

View File

@ -18,7 +18,7 @@
#include "item.h"
#include "item_manager.h"
#include "../../common/VnumHelper.h"
#include <common/VnumHelper.h>
#include "DragonSoul.h"
#include "cube.h"

View File

@ -60,7 +60,7 @@ bool ITEM_MANAGER::ReadCommonDropItemFile(const char * c_pszFileName)
if (!p2)
break;
strlcpy(szTemp, p, MIN(sizeof(szTemp), (p2 - p) + 1));
strncpy(szTemp, p, MIN(sizeof(szTemp), (p2 - p) + 1));
p = p2 + 1;
switch (j)
@ -69,7 +69,7 @@ bool ITEM_MANAGER::ReadCommonDropItemFile(const char * c_pszFileName)
case 1: str_to_number(d[i].iLvStart, szTemp); break;
case 2: str_to_number(d[i].iLvEnd, szTemp); break;
case 3: d[i].fPercent = atof(szTemp); break;
case 4: strlcpy(d[i].szItemName, szTemp, sizeof(d[i].szItemName)); break;
case 4: strncpy(d[i].szItemName, szTemp, sizeof(d[i].szItemName)); break;
case 5: str_to_number(d[i].iCount, szTemp); break;
}
}
@ -451,7 +451,7 @@ bool ITEM_MANAGER::ReadEtcDropItemFile(const char * c_pszFileName)
char szItemName[256];
float fProb = 0.0f;
strlcpy(szItemName, buf, sizeof(szItemName));
strncpy(szItemName, buf, sizeof(szItemName));
char * cpTab = strrchr(szItemName, '\t');
if (!cpTab)

View File

@ -30,7 +30,7 @@ const char * locale_find(const char *string)
if( iter == localeString.end() )
{
static char s_line[1024] = "@0949";
strlcpy(s_line + 5, string, sizeof(s_line) - 5);
strncpy(s_line + 5, string, sizeof(s_line) - 5);
sys_err("LOCALE_ERROR: \"%s\";", string);
return s_line;

View File

@ -1,7 +1,7 @@
#ifndef __INC_LOG_MANAGER_H__
#define __INC_LOG_MANAGER_H__
#include "../../libsql/AsyncSQL.h"
#include <libsql/include/AsyncSQL.h>
#include "any_function.h"
enum GOLDBAR_HOW

View File

@ -81,7 +81,7 @@ DWORD CLoginData::GetLogonTime()
void CLoginData::SetIP(const char * c_pszIP)
{
strlcpy(m_szIP, c_pszIP, sizeof(m_szIP));
strncpy(m_szIP, c_pszIP, sizeof(m_szIP));
}
const char * CLoginData::GetIP()

View File

@ -186,11 +186,11 @@ void ShutdownOnFatalError()
{
char buf[256];
strlcpy(buf, LC_TEXT("서버에 치명적인 오류가 발생하여 자동으로 재부팅됩니다."), sizeof(buf));
strncpy(buf, LC_TEXT("서버에 치명적인 오류가 발생하여 자동으로 재부팅됩니다."), sizeof(buf));
SendNotice(buf);
strlcpy(buf, LC_TEXT("10초후 자동으로 접속이 종료되며,"), sizeof(buf));
strncpy(buf, LC_TEXT("10초후 자동으로 접속이 종료되며,"), sizeof(buf));
SendNotice(buf);
strlcpy(buf, LC_TEXT("5분 후에 정상적으로 접속하실수 있습니다."), sizeof(buf));
strncpy(buf, LC_TEXT("5분 후에 정상적으로 접속하실수 있습니다."), sizeof(buf));
SendNotice(buf);
}
@ -722,7 +722,7 @@ int start(int argc, char **argv)
switch (ch)
{
case 'I': // IP
strlcpy(g_szPublicIP, argv[optind], sizeof(g_szPublicIP));
strncpy(g_szPublicIP, argv[optind], sizeof(g_szPublicIP));
printf("IP %s\n", g_szPublicIP);

View File

@ -1,5 +1,5 @@
#include "../../common/stl.h"
#include <common/stl.h>
class CMapLocation : public singleton<CMapLocation>
{

View File

@ -45,7 +45,7 @@ namespace marriage
TPacketGCLoverInfo p;
p.header = HEADER_GC_LOVER_INFO;
strlcpy(p.name, lover_name.c_str(), sizeof(p.name));
strncpy(p.name, lover_name.c_str(), sizeof(p.name));
p.love_point = love_point;
ch->GetDesc()->Packet(&p, sizeof(p));
}
@ -552,8 +552,8 @@ namespace marriage
p.dwPID1 = dwPID1;
p.dwPID2 = dwPID2;
strlcpy(p.szName1, szName1, sizeof(p.szName1));
strlcpy(p.szName2, szName2, sizeof(p.szName2));
strncpy(p.szName1, szName1, sizeof(p.szName1));
strncpy(p.szName2, szName2, sizeof(p.szName2));
db_clientdesc->DBPacket(HEADER_GD_MARRIAGE_ADD, 0, &p, sizeof(p));
}

View File

@ -200,8 +200,8 @@ void MessengerManager::AddToList(MessengerManager::keyA account, MessengerManage
TPacketGGMessenger p2ppck;
p2ppck.bHeader = HEADER_GG_MESSENGER_ADD;
strlcpy(p2ppck.szAccount, account.c_str(), sizeof(p2ppck.szAccount));
strlcpy(p2ppck.szCompanion, companion.c_str(), sizeof(p2ppck.szCompanion));
strncpy(p2ppck.szAccount, account.c_str(), sizeof(p2ppck.szAccount));
strncpy(p2ppck.szCompanion, companion.c_str(), sizeof(p2ppck.szCompanion));
P2P_MANAGER::instance().Send(&p2ppck, sizeof(TPacketGGMessenger));
}
@ -231,8 +231,8 @@ void MessengerManager::RemoveFromList(MessengerManager::keyA account, MessengerM
TPacketGGMessenger p2ppck;
p2ppck.bHeader = HEADER_GG_MESSENGER_REMOVE;
strlcpy(p2ppck.szAccount, account.c_str(), sizeof(p2ppck.szAccount));
strlcpy(p2ppck.szCompanion, companion.c_str(), sizeof(p2ppck.szCompanion));
strncpy(p2ppck.szAccount, account.c_str(), sizeof(p2ppck.szAccount));
strncpy(p2ppck.szCompanion, companion.c_str(), sizeof(p2ppck.szCompanion));
P2P_MANAGER::instance().Send(&p2ppck, sizeof(TPacketGGMessenger));
}

View File

@ -1,7 +1,7 @@
#ifndef __INC_METIN_II_MONARCH_H__
#define __INC_METIN_II_MONARCH_H__
#include "../../common/tables.h"
#include <common/tables.h>
class CMonarch : public singleton<CMonarch>
{

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#include "../../common/stl.h"
#include <common/stl.h>
#include "constants.h"
#include "motion.h"
#include "text_file_loader.h"

View File

@ -1,7 +1,7 @@
#ifndef __INC_GAME_MOTION_H__
#define __INC_GAME_MOTION_H__
#include "../../common/d3dtype.h"
#include <common/d3dtype.h>
enum EMotionMode
{

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#include "../../common/stl.h"
#include <common/stl.h>
#include "constants.h"
#include "config.h"
@ -41,7 +41,7 @@ void P2P_MANAGER::Boot(LPDESC d)
it++;
p.bHeader = HEADER_GG_LOGIN;
strlcpy(p.szName, ch->GetName(), sizeof(p.szName));
strncpy(p.szName, ch->GetName(), sizeof(p.szName));
p.dwPID = ch->GetPlayerID();
p.bEmpire = ch->GetEmpire();
p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(ch->GetX(), ch->GetY());
@ -142,7 +142,7 @@ void P2P_MANAGER::Login(LPDESC d, const TPacketGGLogin * p)
pkCCI = M2_NEW CCI;
if (false == LC_IsBrazil())
strlcpy(pkCCI->szName, p->szName, sizeof(pkCCI->szName));
strncpy(pkCCI->szName, p->szName, sizeof(pkCCI->szName));
else
trim_and_lower(p->szName, pkCCI->szName, sizeof(pkCCI->szName));

View File

@ -5,7 +5,7 @@
#include <boost/unordered_map.hpp>
#include "input.h"
#include "../../common/stl.h"
#include <common/stl.h>
typedef struct _CCI
{

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#include "../../common/stl.h"
#include <common/stl.h>
#include "constants.h"
#include "packet_info.h"
#include "HackShield_Impl.h"

View File

@ -77,7 +77,7 @@ void SendPanamaList(LPDESC d)
while (it != s_panamaVector.end())
{
strlcpy(pack.szPackName, it->first.c_str(), sizeof(pack.szPackName));
strncpy(pack.szPackName, it->first.c_str(), sizeof(pack.szPackName));
memcpy(pack.abIV, it->second, sizeof(pack.abIV));

View File

@ -689,7 +689,7 @@ void CParty::SendPartyJoinOneToAll(DWORD pid)
p.header = HEADER_GC_PARTY_ADD;
p.pid = pid;
strlcpy(p.name, r.strName.c_str(), sizeof(p.name));
strncpy(p.name, r.strName.c_str(), sizeof(p.name));
for (TMemberMap::iterator it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
{
@ -711,7 +711,7 @@ void CParty::SendPartyJoinAllToOne(LPCHARACTER ch)
for (TMemberMap::iterator it = m_memberMap.begin();it!= m_memberMap.end(); ++it)
{
p.pid = it->first;
strlcpy(p.name, it->second.strName.c_str(), sizeof(p.name));
strncpy(p.name, it->second.strName.c_str(), sizeof(p.name));
ch->GetDesc()->Packet(&p, sizeof(p));
}
}
@ -1441,7 +1441,7 @@ void CParty::UpdateOnlineState(DWORD dwPID, const char* name)
p.header = HEADER_GC_PARTY_ADD;
p.pid = dwPID;
r.strName = name;
strlcpy(p.name, name, sizeof(p.name));
strncpy(p.name, name, sizeof(p.name));
for (TMemberMap::iterator it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
{

View File

@ -218,7 +218,7 @@ void CPVPManager::Insert(LPCHARACTER pkChr, LPCHARACTER pkVictim)
pack.bHeader = HEADER_GC_WHISPER;
pack.wSize = sizeof(TPacketGCWhisper) + len;
pack.bType = WHISPER_TYPE_SYSTEM;
strlcpy(pack.szNameFrom, pkChr->GetName(), sizeof(pack.szNameFrom));
strncpy(pack.szNameFrom, pkChr->GetName(), sizeof(pack.szNameFrom));
TEMP_BUFFER buf;

View File

@ -97,7 +97,7 @@ END_OF_TIMER_EVENT:
info->name = M2_NEW char[nameCapacity];
if (info->name)
strlcpy(info->name, name, nameCapacity);
strncpy(info->name, name, nameCapacity);
return event_create(quest_server_timer_event, info, ltime_cycle);
}
@ -115,7 +115,7 @@ END_OF_TIMER_EVENT:
info->name = M2_NEW char[nameCapacity];
if (info->name)
strlcpy(info->name, name, nameCapacity);
strncpy(info->name, name, nameCapacity);
sys_log(0, "QUEST timer name %s cycle %d pc %u npc %u loop? %d", name ? name : "<noname>", ltime_cycle, player_id, npc_id, loop ? 1 : 0);

View File

@ -226,7 +226,7 @@ namespace quest
THighscoreRegisterQueryInfo * qi = M2_NEW THighscoreRegisterQueryInfo;
strlcpy(qi->szBoard, lua_tostring(L, 1), sizeof(qi->szBoard));
strncpy(qi->szBoard, lua_tostring(L, 1), sizeof(qi->szBoard));
qi->dwPID = q.GetCurrentCharacterPtr()->GetPlayerID();
qi->iValue = (int) lua_tonumber(L, 2);
qi->bOrder = (int) lua_tonumber(L, 3);

View File

@ -2,7 +2,7 @@
#include "threeway_war.h"
#include "../../common/stl.h"
#include <common/stl.h>
#include "questlua.h"
#include "questmanager.h"

View File

@ -191,7 +191,7 @@ namespace quest
TPacketGDGuildWarBet p;
p.dwWarID = (DWORD) lua_tonumber(L, 1);
strlcpy(p.szLogin, ch->GetDesc()->GetAccountTable().login, sizeof(p.szLogin));
strncpy(p.szLogin, ch->GetDesc()->GetAccountTable().login, sizeof(p.szLogin));
p.dwGuild = (DWORD) lua_tonumber(L, 2);
p.dwGold = (DWORD) lua_tonumber(L, 3);

View File

@ -706,7 +706,7 @@ namespace quest
TPacketGGTransfer pgg;
pgg.bHeader = HEADER_GG_TRANSFER;
strlcpy(pgg.szName, name.c_str(), sizeof(pgg.szName));
strncpy(pgg.szName, name.c_str(), sizeof(pgg.szName));
pgg.lX = ch->GetX();
pgg.lY = ch->GetY();
@ -793,7 +793,7 @@ namespace quest
return 0;
char vnum[256];
strlcpy(vnum, lua_tostring(L, 1), sizeof(vnum));
strncpy(vnum, lua_tostring(L, 1), sizeof(vnum));
do_monarch_mob(ch, vnum, 0, 0);
return 0;
}

View File

@ -1155,7 +1155,7 @@ namespace quest
void CQuestManager::RequestSetEventFlag(const string& name, int value)
{
TPacketSetEventFlag p;
strlcpy(p.szFlagName, name.c_str(), sizeof(p.szFlagName));
strncpy(p.szFlagName, name.c_str(), sizeof(p.szFlagName));
p.lValue = value;
db_clientdesc->DBPacket(HEADER_GD_SET_EVENT_FLAG, 0, &p, sizeof(TPacketSetEventFlag));
}

View File

@ -61,7 +61,7 @@ namespace quest
continue;
sys_log(1, "QUEST reading %s", pde->d_name);
strlcpy(buf + is, pde->d_name, sizeof(buf) - is);
strncpy(buf + is, pde->d_name, sizeof(buf) - is);
LoadStateScript(event_index, buf, pde->d_name);
}

View File

@ -571,8 +571,8 @@ namespace quest
TQuestTable & r = s_table[i++];
r.dwPID = m_dwID;
strlcpy(r.szName, stName.c_str(), sizeof(r.szName));
strlcpy(r.szState, stState.c_str(), sizeof(r.szState));
strncpy(r.szName, stName.c_str(), sizeof(r.szName));
strncpy(r.szState, stState.c_str(), sizeof(r.szState));
r.lValue = lValue;
}

View File

@ -1149,7 +1149,7 @@ void SECTREE_MANAGER::SendNPCPosition(LPCHARACTER ch)
for (it = m_mapNPCPosition[lMapIndex].begin(); it != m_mapNPCPosition[lMapIndex].end(); ++it)
{
np.bType = it->bType;
strlcpy(np.name, it->name, sizeof(np.name));
strncpy(np.name, it->name, sizeof(np.name));
np.x = it->x;
np.y = it->y;
buf.write(&np, sizeof(np));

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#include "../../common/stl.h"
#include <common/stl.h>
#include "constants.h"
#include "skill.h"
@ -101,7 +101,7 @@ bool CSkillManager::Initialize(TSkillTable * pTab, int iSize)
CSkillProto * pkProto = M2_NEW CSkillProto;
pkProto->dwVnum = t->dwVnum;
strlcpy(pkProto->szName, t->szName, sizeof(pkProto->szName));
strncpy(pkProto->szName, t->szName, sizeof(pkProto->szName));
pkProto->dwType = t->bType;
pkProto->bMaxLevel = t->bMaxLevel;
pkProto->dwFlag = t->dwFlag;

View File

@ -1,7 +1,7 @@
#include "stdafx.h"
#include "../../common/length.h"
#include <common/length.h>
#include "skill_power.h"

View File

@ -7,7 +7,7 @@
#include <vector>
#include <utility>
#include "../../common/singleton.h"
#include <common/singleton.h>
#include "utils.h"
class SpamManager : public singleton<SpamManager>

Some files were not shown because too many files have changed in this diff Show More