Jump to content

ridetpro

Banned
  • Posts

    106
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Posts posted by ridetpro

  1. Acum 13 minute, bumxd a spus:
    // Open EterPack folder
    //Find inline.h
    // And paste this
    
    	std::string ConvertPackFilename(const std::string& name)
    	{
    		std::string ret;
    		std::transform(name.begin(), name.end(), std::back_inserter(ret), [](char ch) {
    			if (ch == '\\')
    				return '/';
    			else
    				return (char)tolower(ch);
    		});
    		return ret;
    	}

    I apologize for so many replies, I wrote these codes a long time ago. So I forgot all the code dependencies.

     

     

    • Love 1
  2. // PythonNetworkStreamModule.cpp
    
    PyObject* netSendVersionPacket(PyObject* poSelf, PyObject* poArgs)
    {
    	CPythonNetworkStream &rkNetStream = CPythonNetworkStream::Instance();
    	rkNetStream.SendClientVersionPacket();
    	return Py_BuildNone();
    }
    
    // static PyMethodDef s_methods[] =
    
    { "SendVersionPacket", netSendVersionPacket, METH_VARARGS },

    This function have no argument, it will just send the version from this function.

    bool CPythonNetworkStream::SendClientVersionPacket()
    // this line
    	strncpy(kVersionPacket.timestamp, 1111111, sizeof(kVersionPacket.timestamp) - 1); // 111111 IS THE CLIENT VERSION

     

     

    Do you want a function in python Like this ?

    net.SendClientVersionPacket(123456)

     

  3. // Intro pc_mount function from questlua_pc.cpp
    // Under LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
    // Add
    
    		int CalcLastMoveSec = (get_dword_time() - ch->GetLastMountTime()) / 1000 + 0.5;
    
    		if (CalcLastMoveSec < 1) // Replace 1 with seconds number.
    		{
    			return 0;
    		}

    8d79641cfda2bf7a40fbf62f568689e3.png

     

    Do same for unmount function intro questlua_pc

     

  4. Enumeration must be identical in client / server / SQL/ dump_proto

    Example of a wrong enumeration OF source.

    enum Server : std::uint8_t
    {
    POINT_WOLFMAN, // OK
    POINT_WARRIOR, // OK
    }
    
    enum Client : std::uint8_t
    {
    POINT_WARRIOR, // WRONG
    POINT_WOLFMAN, // WRONG
    }

     

    Example of a correct enumeration.

    enum Server : std::uint8_t
    {
    POINT_WOLFMAN, // OK
    POINT_WARRIOR, // OK
    }
    
    enum client : std::uint8_t
    {
    POINT_WOLFMAN, // OK
    POINT_WARRIOR, // OK
    }

     

    Read more about how enum works here.  https://en.cppreference.com/w/cpp/language/enum

    Most likely, I think you fucked the dump_proto enumerations.

     

    Example of wrong dump_proto enumeration.

    //Dump_proto
    int get_Item_ApplyType_Value(string inputString)
    {
    	string arApplyType[] =
    	{
    
    		"APPLY_WOLFMAN", // ok
    		"APPLY_BLEEDING", // ok
    	};
    	int retInt = -1;
      
    // ProtoReader.cpp
    int get_Item_ApplyType_Value(std::string inputString)
    {
    	std::string arApplyType[] =
    	{
    		"APPLY_BLEEDING", // wrong
    		"APPLY_WOLFMAN", // wrong
    	};
    
    	int retInt = -1;

    Check also the  SQL enumeration order, from item_attr

    • Love 2
  5. //Add this at top of the EterPack.cpp
    
    namespace bfs = boost::filesystem;
    
    namespace
    {
    	bool is_ymir(const bfs::path& p)
    	{
    		auto it = p.begin();
    
    		if (it == p.end() || *it != "d:")
    			return false;
    
    		++it;
    
    		if (it == p.end())
    			return false;
    
    		if (*it == "/" || *it == "\\")
    			++it;
    
    		if (it == p.end() || *it != "ymir work")
    			return false;
    
    		return true;
    	}
    };
    
    //Intro bool CEterPack::Put
    //Add
    	bfs::path packpath = ConvertPackFilename(filename);
    
    	if (!is_ymir(packpath) && !packpath.is_relative())
    		return false;

     

     

  6. Acum 38 minute, bumxd a spus:

    Hello, after last update packets windows 10, the function python is os.listdir don't work, give error what can't find directory.. but on other version windows all perfect works. So for which function can change os.listdir? 

    P.s I want does white list all files from client, and  check files in client folder, if have file which don't have in white list then delete this file. And without function os.listdir I don't know how does this.. have anybody idea?

    Python developers no longer support python2.7
    Most likely, this is a bug that will never be solved because it no longer creates patches for bug fixes.

     

    http://bfy.tw/Iylm

    https://www.saltycrane.com/blog/2010/04/options-listing-files-directory-python/

     

    • Love 1
  7. char szQuery[QUERY_MAX_LEN];
    snprintf(szQuery, sizeof(szQuery), "SELECT infernus FROM player.player WHERE name='%s'", GetName());
    std::unique_ptr<SQLMsg> pSelectMsg(DBManager::instance().DirectQuery(szQuery);
    
    SQLResult* pRes = pSelectMsg->Get();
    	
    if (pRes->uiNumRows > 0)
    {
    	MYSQL_ROW row = mysql_fetch_row(pRes->pSQLResult);
    		
    	DWORD GetVal = 0;
    	str_to_number(GetVal, row[0]);
    
    	ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Total count is %d"), GetVal);
    }

    It should work now. 

    • Love 2
×
×
  • 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.