127.0.0.1
Banned-
Posts
51 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Everything posted by 127.0.0.1
-
LOW_WIZARD no GM icon in PM
127.0.0.1 replied to Defective's topic in Community Support - Questions & Answers
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); } -
@EnKor DUDE USE YOU BRAIN. Use my codes, as you can see it compiles.
-
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; };
-
get global players with p2p
127.0.0.1 replied to iPeri's topic in Community Support - Questions & Answers
I do not think this is possible. -
The organizer is banned, so?
-
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.
-
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 ?
-
How to 0xFFFFFFFFL to long long??
127.0.0.1 replied to Krusty's topic in Community Support - Questions & Answers
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 -
How to 0xFFFFFFFFL to long long??
127.0.0.1 replied to Krusty's topic in Community Support - Questions & Answers
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 -
If it's easy, why have you opened this topic?
-
Delete character C++
127.0.0.1 replied to iFreakTime~.~'s topic in Community Support - Questions & Answers
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. -
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.