Jump to content

127.0.0.1

Banned
  • Posts

    51
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by 127.0.0.1

  1. Search if(!test_server) { if(GetGMLevel() > GM_LOW_WIZARD) { m_afAffectFlag.Set(AFF_YMIR); m_bPKMode = PK_MODE_PROTECT; } } Add after if(GetGMLevel() == GM_GOD) { m_afAffectFlag.Set(AFF_YMIR); }
  2. @EnKor DUDE USE YOU BRAIN. Use my codes, as you can see it compiles.
  3. Here if fixed : #include "stdafx.h" #include "item_block.h" #include <fstream> #include <sstream> void CItemBlock::Process() { std::string strMapIndex; std::string strItemVnums; std::ifstream File("blocked_items.txt"); if (!File.is_open()) return; if (!m_map_BlockedItems.empty()) m_map_BlockedItems.clear(); while (!File.eof()) { File >> strMapIndex >> strItemVnums; std::string strItemVnum; std::istringstream Vnums(strItemVnums); while (std::getline(Vnums, strItemVnum, ',')) { AddItem(strtoul(strMapIndex.c_str(), NULL, 10), strtoul(strItemVnum.c_str(), NULL, 10)); } } File.close(); } void CItemBlock::AddItem(const long lMapIndex, const DWORD dwVnum) { if (lMapIndex < 0 || dwVnum < 0) return; m_map_BlockedItems.insert(std::make_pair(lMapIndex, dwVnum)); } void CItemBlock::RemoveItem(const long lMapIndex, const DWORD dwVnum) { if (lMapIndex < 0 || dwVnum < 0) return; BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); if (it != m_map_BlockedItems.end()) { if (it->first == lMapIndex && it->second == dwVnum) it = m_map_BlockedItems.erase(it); else ++it; } } bool CItemBlock::CanUseItem(const long lMapIndex, const DWORD dwVnum) const { BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); if (it != m_map_BlockedItems.end()) { if (it->first == lMapIndex && it->second == dwVnum) return false; } return true; } #pragma once class CItemBlock : public singleton<CItemBlock> { public: CItemBlock() { } ~CItemBlock() { } void Process(); bool CanUseItem(const long lMapIndex, const DWORD dwVnum) const; void AddItem(const long lMapIndex, const DWORD dwVnum); void RemoveItem(const long lMapIndex, const DWORD dwVnum); private: typedef std::multimap<long, DWORD> BLOCKED_ITEMS; BLOCKED_ITEMS m_map_BlockedItems; };
  4. What a silly question. It's like asking: Who fucked my mother? Only she knows. Same happens with your problem, where to we know what is in your server? This issue can have 100 cases? Do you want to make a list of them all? Silly. You do not even bother to tell if you have syserr or to receive any core dump. And you want help ? If you want a good answer, ask a good question. I've learned so on StackOverflow.
  5. No one can say what is wrong with this function. Matter how it is used. This topic should be deleted because you have not given enough information. def GetAlignmentTitleName(alignment): import chr import player race = player.GetRace() sex = chr.RaceToSex(race) align = player.GetAlignmentData() if align >= 12000: if sex == 1: # Do stuff else: # Do stuff USE YOU BRAIN WHEN YOU POST A QUESTION. And who is that exygo ?
  6. You could use ctypes.c_longlong: >>> from ctypes import c_longlong as int64_t >>> int64_t(2 ** 63 - 1) c_longlong(9223372036854775807L) >>> int64_t(2 ** 63) c_longlong(-9223372036854775808L) >>> int64_t(2 ** 63).value -9223372036854775808L Add this import from ctypes import c_longlong as int64_t Python usage exmple : if (int64_t(text) <= 0): return True
  7. You want to cast hexadecimal to long long ? long long x; std::stringstream ss; ss << std::hex << "0xFFFFFFFFL"; ss >> x; std::cout << static_cast<long long>(x) << std::endl; [Hidden Content] Live compile and test. Will produce the following result : 4294967295
  8. You don't have brain #confirmed Read my post again. Think logically. If using the old flag, what should you do?
  9. Sure, the TablePostfix is used to use 2 database intro same server. If you set TABLE_POSTFIX = "dev" the player will become player_dev intro mysql. This is not the correct fix, if you have TABLE_POSTFIX=" " intro CONFIG then player_deleted will become player _delete wtith one space and this will break database. But if you have the TABLE_POSTFIX="" this is default postfix and this fix is useless. snprintf(queryStr, sizeof(queryStr), "INSERT INTO player_deleted SELECT * FROM player WHERE id=%d", pi->player_id); std::auto_ptr<SQLMsg> pIns(CDBManager::instance().DirectQuery(queryStr)); if (pIns->Get()->uiAffectedRows == 0 || pIns->Get()->uiAffectedRows == (uint32_t)-1) { sys_log(0, "PLAYER_DELETE FAILED %u CANNOT INSERT TO player_deleted", dwPID); peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, pi->dwHandle, 1); peer->EncodeBYTE(pi->account_index); return; } This is the best solution. Table postfix is shit. Next use you brain.
  10. ItemData.h enum EItemAntiFlag //////////////////////////// ITEM_ANTIFLAG_MY_OFFLINE_SHOP = (1 << 19), PythonItemModule.cpp PyModule_AddIntConstant(poModule, "ITEM_ANTIFLAG_MY_OFFLINE_SHOP", CItemData::ITEM_ANTIFLAG_MY_OFFLINE_SHOP); Dump_proto.cpp int get_Item_AntiFlag_Value (string inputString) { string arAntiFlag[] = Then add in uiofflineshopbuilder.py / uiofflineshop.py those antiflags. offlineshopbuilder.py def OnSelectEmptySlot(self, selectedSlotPos): if item.IsAntiFlag(item.ANTIFLAG_GIVE) or item.IsAntiFlag(item.ITEM_ANTIFLAG_MY_OFFLINE_SHOP): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OFFLINE_SHOP_CANNOT_SELL_ITEM) return uiofflineshop.py def SelectEmptySlot(self, slotIndex): etc etc... Use you brain.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.