Welcome to Darkmmo

Şimdi bize katılın ve tüm özelliklerimize erişim sağlayın. Kayıt olup giriş yaptıktan sonra, yeni konular oluşturabilir, mevcut konulara yanıtlar yazabilir, kendi özel mesajlaşma sisteminize sahip olabilir ve çok daha fazlasını yapabilirsiniz. Ayrıca hızlı ve tamamen ücretsizdir, öyleyse ne bekliyorsunuz?

[C++] - Rebootsuz Sabitlediğiniz Herşeyi Yenileme

Reklam vermek içinTıklayın!

FarquesFarques doğrulanmış üye.

~ Everything has an end
Admin
Developer
VİP Üye
Katılım
Tem 11, 2024
Mesajlar
260
Tepkime puanı
369
Konum
ANKARA
Dark Puan
3,203
Konuyu Vurgula
Profil Müziği
Kullanıcı Başlığı Stili
Discord
farques6
TagLise
farques
game/cmd.cpp aratılır.
arat
ACMD(reload_regen);
altına ekle.
{ "nowar", do_nowar, 0, POS_DEAD, GM_PLAYER },
arat
{ "reload_regen", reload_regen , 0, POS_DEAD, GM_GOD },
altına ekle.
game/cmd_gm.cpp aratılır.
arat
C++:
ACMD(reload_regen)
{
 std::vector<LPEVENT> regenEvent = SECTREE_MANAGER::instance().GetRegenEvent(ch->GetMapIndex());
 for (std::vector<LPEVENT>::iterator it = regenEvent.begin(); it != regenEvent.end(); ++it)
 {
 event_cancel(&(*it));
 }
 FuncPurge func(ch);
 func.m_bAll = true;
 LPSECTREE_MAP lm = SECTREE_MANAGER::instance().GetMap(ch->GetMapIndex());
 lm->for_each(func);
 char * mapIndex;
 mapIndex = number_to_str(ch->GetMapIndex(), 10);
 SECTREE_MANAGER::instance().BuildMap(mapIndex, LocaleService_GetMapPath().c_str());
}
altına ekle.
game/sectree_manager.cpp aratılır.
int SECTREE_MANAGER::Build(const char * c_pszListFileName, const char* c_pszMapBasePath)
arat
C++:
int SECTREE_MANAGER::BuildMap(const char * c_pszMapID, const char* c_pszMapBasePath)
{
 
 std::string mapIndexPath = c_pszMapBasePath;
 mapIndexPath += "/index";
 int test;
 FILE* fp = fopen(mapIndexPath.c_str(), "rb");
 if (fp == NULL)
 {
 return 0;
 }
 std::string line;
 char buf[256 + 1];
 while (fgets(buf, 256, fp))
 {
 std::string tmp = buf;
 if (tmp.find(c_pszMapID) != std::string::npos)
 {
 printf("found!!");
 break;
 }
 
 }

 char szFilename[256];
 char szMapName[256];
 int iIndex;

 *strrchr(buf, '\n') = '\0';

 if (!strncmp(buf, "//", 2) || *buf == '#')
 return 0;

 sscanf(buf, " %d %s ", &iIndex, szMapName);

 snprintf(szFilename, sizeof(szFilename), "%s/%s/Setting.txt", c_pszMapBasePath, szMapName);

 TMapSetting setting;
 setting.iIndex = iIndex;

 if (!LoadSettingFile(iIndex, szFilename, setting))
 {
 sys_err("can't load file %s in LoadSettingFile", szFilename);
 return 0;
 }

 snprintf(szFilename, sizeof(szFilename), "%s/%s/Town.txt", c_pszMapBasePath, szMapName);

 if (!LoadMapRegion(szFilename, setting, szMapName))
 {
 sys_err("can't load file %s in LoadMapRegion", szFilename);
 return 0;
 }

 if (true == test_server)
 sys_log(0, "[BUILD] Build %s %s %d ", c_pszMapBasePath, szMapName, iIndex);

 // ¸ÕÀú ÀÌ ¼¹ö¿¡¼ ÀÌ ¸ÊÀÇ ¸ó½ºÅ͸¦ ½ºÆùÇØ¾ß Çϴ°¡ È®ÀÎ ÇÑ´Ù.
 if (map_allow_find(iIndex))
 {
 LPSECTREE_MAP pkMapSectree = BuildSectreeFromSetting(setting);
 m_map_pkSectree.insert(std::map<DWORD, LPSECTREE_MAP>::value_type(iIndex, pkMapSectree));

 snprintf(szFilename, sizeof(szFilename), "%s/%s/server_attr", c_pszMapBasePath, szMapName);
 LoadAttribute(pkMapSectree, szFilename, setting);

 snprintf(szFilename, sizeof(szFilename), "%s/%s/regen.txt", c_pszMapBasePath, szMapName);
 regen_load(szFilename, setting.iIndex, setting.iBaseX, setting.iBaseY);

 snprintf(szFilename, sizeof(szFilename), "%s/%s/npc.txt", c_pszMapBasePath, szMapName);
 regen_load(szFilename, setting.iIndex, setting.iBaseX, setting.iBaseY);

 snprintf(szFilename, sizeof(szFilename), "%s/%s/boss.txt", c_pszMapBasePath, szMapName);
 regen_load(szFilename, setting.iIndex, setting.iBaseX, setting.iBaseY);

 snprintf(szFilename, sizeof(szFilename), "%s/%s/stone.txt", c_pszMapBasePath, szMapName);
 regen_load(szFilename, setting.iIndex, setting.iBaseX, setting.iBaseY);

 snprintf(szFilename, sizeof(szFilename), "%s/%s/dungeon.txt", c_pszMapBasePath, szMapName);
 LoadDungeon(iIndex, szFilename);

 pkMapSectree->Build();
 }
 return 1;
}
altına ekle.
game/regen.cpp aratılır.
regen-&gt;event = event_create(regen_event, info, PASSES_PER_SEC(number(0, 16)) + PASSES_PER_SEC(regen-&gt;time));
arat
SECTREE_MANAGER::instance().AddRegenEventToMap(lMapIndex, regen-&gt;event);
altına ekle.
game/sectree_manager.h aratılır.
std::map&lt;DWORD, std::vector&lt;npc_info&gt; &gt; m_mapNPCPosition;
arat
std::map&lt;long, std::vector&lt;LPEVENT&gt;&gt; m_mapRegen;
altına ekle
bool GetRandomLocation(long lMapIndex, PIXEL_POSITION &amp; r_pos, DWORD dwCurrentX = 0, DWORD dwCurrentY = 0, int iMaxDistance = 0);
arat

C++:
void        AddRegenEventToMap(long lMapIndex, LPEVENT event) { m_mapRegen[lMapIndex].push_back(event); }
        std::vector<LPEVENT>        GetRegenEvent(long lMapIndex) { return m_mapRegen[lMapIndex]; }
altına ekle
game/utils.h
/*----atoi function-----*/
arat
C++:
/*----itoa function-----*/

inline char* number_to_str(int val, int base)
{
 static char buf[32] = { 0 };

 int i = 30;

 for (; val && i; --i, val /= base)

 buf[i] = "0123456789abcdef"[val % base];

 return &buf[i + 1];

}

/*----itoa function-----*/
altına ekle.
Not : Oyunculu PvpServerlerinizde
/reload regen çekmeyiniz. 3 5 Saniyelik Lag Girmesine Sebep Olur.
 
194Konular
582Mesajlar
4,451Kullanıcılar
KennoSon üye
Üst