Jump to content

Matteo

Member
  • Posts

    96
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Posts posted by Matteo

  1. Think about it realistically guys... there is az unknown program which was compiled like 10 minutes ago and its downloading files from an unknown website with Administrator privileges... every patcher will be detected as a virus at some point until you sign it with a Microsoft certificate. However there are smart ways to "wrap" this behaviour but nothing last forever.

    • Lmao 1
  2. Hi,

    I have a core crash, i dont really understand whats the problem.

    https://metin2.download/picture/09K0qsj0xP9ZPje3FnmmsRF4533Ccrii/.png
    https://metin2.download/picture/fRR4xS3Br06pviwr0vQVIZP3K7S4Ec0E/.png

    https://metin2.download/picture/w0M4XtvtxK5O3RMxIXNmvV2aLVLxaQCw/.png

    https://metin2.download/picture/3CwK6PPz5cxPX857jIsG4MRdxS82Mj0v/.png

    RZyLfnN.png

    Corresponding code lines:


    item.cpp

    #ifdef ENABLE_EXTENDED_ITEMNAME_ON_GROUND
    const char* CItem::GetName()
    {
    #	ifdef ENABLE_MULTI_LANGUAGE_SYSTEM
    	BYTE bLocale = (GetOwner() && GetOwner()->GetDesc()) ? GetOwner()->GetDesc()->GetLanguage() : LOCALE_DEFAULT;
    #	endif
    
    	static char szItemName[128];
    	memset(szItemName, 0, sizeof(szItemName));
    	if (GetProto())
    	{
    		int len = 0;
    		switch (GetType())
    		{
    		case ITEM_POLYMORPH:
    		{
    			const DWORD dwMobVnum = GetSocket(0);
    			const CMob* pMob = CMobManager::instance().Get(dwMobVnum);
    			if (pMob)
    			{
    #	ifdef ENABLE_MULTI_LANGUAGE_SYSTEM
    				len = snprintf(szItemName, sizeof(szItemName), "%s", LC_LOCALE_MOB_TEXT(dwMobVnum, bLocale));
    #	else
    				len = snprintf(szItemName, sizeof(szItemName), "%s", pMob->m_table.szLocaleName);
    #	endif
    			}
    			break;
    		}
    		case ITEM_SKILLBOOK:

     

    https://metin2.download/picture/9I16e553nCZNCl5Ha0irx2kP2T5pzWW3/.png

    item_manager.cpp

     

    	if(!item->GetName()) {
    		sys_err("SaveSingleItem: item->GetName NULL");
    		return;
    	}
    	
    	if (!item->GetOwner()) 
    	{
    		DWORD dwID = item->GetID();
    		DWORD dwOwnerID = item->GetLastOwnerPID();
    		
    		//sys_log(0, "item->GetOwner NULL - Name: %s dwID: %d dwOwnerID: %d",item->GetName(), dwID, dwOwnerID);
    		db_clientdesc->DBPacketHeader(HEADER_GD_ITEM_DESTROY, 0, sizeof(DWORD) + sizeof(DWORD));
    		db_clientdesc->Packet(&dwID, sizeof(DWORD));
    		db_clientdesc->Packet(&dwOwnerID, sizeof(DWORD));
    
    		//sys_log(1, "ITEM_DELETE %s:%u", item->GetName(), dwID);
    		return;
    	}
    	
    	//sys_log(1, "ITEM_SAVE %s:%d in %s window %d", item->GetName(), item->GetID(), item->GetOwner()->GetName(), item->GetWindow());
    
    	TPlayerItem t;

     

    Thanks.

    Spoiler

  3. Hi,

    There is a "pickup all" function in my client but it creates a little freeze when picking up items. As i see it iterates and sends a lot of SendItemClickPacket

    	if (CPythonSystem::Instance().GetPickupMode() == CPythonSystem::PICKUP_MODE_ALL)
    	{
    		std::vector<uint32_t> vecCloseItems = rkItem.GetCloseMoneys(kPPosMain, __GetPickableDistance());
    		for (uint32_t dwItemID : vecCloseItems)
    		{
    			SendClickItemPacket(dwItemID);
    		}
    	}

    Any ideas to modify it in a way that doesn't create lag?

    Thanks.

  4. 10Gbit/s OVH Server is the only solution you can get. Otherwise you are easily attackable. Even OVH 1Gbit/s has some exploit and they can make your server offline in seconds. 10Gbit/s is really hard to get DDoS, anyone will need a lot of bandwith to make your server unavailable. For web, PAID Cloudflare (MAYBE!!!). Only if our project is very serious, because 10Gbit is $$$$$$$$$. Otherwise any OVH Dedicated Game Server.

  5. 31 minutes ago, Mefarious said:

    yea i wanted to get gold, but i have to think about how muchm its like im creating RogueLike server and need for example
    2 lvl -50yang
    3lvl 75yang
    4lvl 150yang etc etc as i want 120 lvl -10kk etc

    edit, quest doesnt work, it doesnt reset level

    You should fill in all level gold rewards. What it says? nothing? 

     

    ALUA(pc_reset_level)
    {
    	LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
    	int lvlBeforeReset = ch->GetLevel();
    	
    	ch->ResetPoint(MINMAX(1, DEATH_INITIAL_LEVEL, PLAYER_MAX_LEVEL_CONST));
    	ch->ClearSkill();
    	ch->ClearSubSkill();
    
    	LPITEM item;
    	for (int i = 0; i < INVENTORY_AND_EQUIP_SLOT_MAX; ++i)
    	{
    		if ((item = ch->GetInventoryItem(i)))
    		{
    			ITEM_MANAGER::instance().RemoveItem(item, "DEATH_EVENT_BY_QUEST");
    			ch->SyncQuickslot(QUICKSLOT_TYPE_ITEM, i, 255);
    		}
    	}
    	int goldByLevel[PLAYER_EXP_TABLE_MAX + 1] =
    	{
    		0,  // PLACEHOLDER
    		10, // LV 1
    		20, // LV 2
    		30, // LV 3
    		40, // LV 4
    		50, // LV 5
    		60, // LV 6
    	};
    	ch->PointChange(POINT_GOLD, goldByLevel[lvlBeforeReset]);
    	ch->ChatPacket(CHAT_TYPE_INFO, "<Death Request> Your level was %d, because of that same amount of gold is credited.", lvlBeforeReset);
    	
    	return 0;
    }

     

  6. 1 hour ago, Mefarious said:

    @ msnas Could you help me again?
    I want to make quest when talk to NPC for example 20094.chat."balbla" she will reset level to 1 and give me gold equal to level i had.
    I dont know how to call dead function in quest, she can even kill me to cause definition you helped me last time.
    Thanks in advance

     

    Add this to your questlua_pc + add quest_functions according. pc.reset_level (code not tested)

    
    
    { "reset_level",	pc_reset_level},
    
    #ifdef DEATH_EVENT
    #define DEATH_INITIAL_LEVEL	1 // What's the level the player should start?
    ALUA(pc_reset_level)
    {
    	LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
    	int lvlBeforeReset = ch->GetLevel();
    	
    	ch->ResetPoint(MINMAX(1, DEATH_INITIAL_LEVEL, PLAYER_MAX_LEVEL_CONST));
    	ch->ClearSkill();
    	ch->ClearSubSkill();
    
    	LPITEM item;
    	for (int i = 0; i < INVENTORY_AND_EQUIP_SLOT_MAX; ++i)
    	{
    		if ((item = ch->GetInventoryItem(i)))
    		{
    			ITEM_MANAGER::instance().RemoveItem(item, "DEATH_EVENT_BY_QUEST");
    			ch->SyncQuickslot(QUICKSLOT_TYPE_ITEM, i, 255);
    		}
    	}
    	
    	ch->PointChange(POINT_GOLD, lvlBeforeReset);
    	ch->ChatPacket(CHAT_TYPE_INFO, "<Death Request> Resetted. Your level was %d, because of that same amount of gold is credited.", lvlBeforeReset);
    }
    #endif

     

    Then in quest like:

     

    quest resetchar begin
    	state start begin
    		when 20094.chat."balbla" begin
    			if pc.get_level() > 1 then
    				pc.reset_level()
    			end
    		end
    	end
    end

     

  7. Hi,

    After a period of time on the server, some players are disconnected by the server randomly. I guess one of the installed systems "overflowing" the buffer(??). If i restart the server, for a given time there is no random disconnects, after it starts again until restart. I have increased the receiving buffer on the binary but that didn't help a lot... is there a way to debug it what keeps growing and growing?

    Some syserrs from the players:
     

    0109 14:07:39244 :: Unknown packet header: 108, last: 124 70
    0107 16:53:06382 :: Unknown packet header: 231, last: 238 217
    1228 20:00:42501 :: Unknown packet header: 183, last: 163 163
    1228 17:17:43336 :: Unknown packet header: 197, last: 236 117
    1230 20:55:27097 :: Unknown packet header: 35, last: 3 79
    1230 18:31:27797 :: Unknown packet header: 201, last: 3 3
    0105 22:17:33005 :: Unknown packet header: 178, last: 17 253
    0105 22:18:25466 :: Unknown packet header: 202, last: 3 3

     

    So its not stuck/broken at the same packet, very random. Any ideas to debug it? 

  8. 3 minutes ago, PACI said:

    Replied to their question as they didn't want to elaborate further on their issue. At least this, for them, may buy some time until they figure what is wrong and share it with us.

    Its really hard to do the bug but there is still 1-2 player who can abuse it. I've contacted the developer of the system (since its not a  pirated system) he also sent some fixes but after that it became very hard but there is still a possibility to do it. I dont want to discuss neither the system or the exact steps to reproduce the bug because it can affect a some server that uses the given system. After the fix i'll post it of course. 

    • Good 1
  9. 2 hours ago, TMP4 said:

    That's not how you solve such problems. That would be a weak workaround here, not a fix.

    You have to fix your glitch's origin.
    Have a look at this: 

    Even if your problem is about another system like sash combination, battle pass or anything, the solution is the same: use CHARACTER :: CanWarp so players cannot warp when they are not allowed to.

    Hi,

    Its already done for days now. I have added obviusly CanWarp to everything that is related, but mainly the warp gates that teleports instantly the main problem. (Yes, i have added the CanWarp to the gates too but then they do a logout->change channel->login->warp gate instantly->crash back into loginscreen (by spamming ESC)->relog to another channel )

  10. 12 hours ago, I bims 1 WLAN said:

    What does that mean?:

    const DWORD exp_table_euckr[PLAYER_EXP_TABLE_MAX + 1]

    const DWORD exp_table_common[PLAYER_EXP_TABLE_MAX + 1]

    const DWORD exp_table_newcibn[PLAYER_EXP_TABLE_MAX + 1 ]

    const DWORD party_exp_distribute_table[PLAYER_MAX_LEVEL_CONST + 1]

    const int aiExpLossPercents[PLAYER_EXP_TABLE_MAX + 1]

     

    I expand to 500, what should I keep changing the numbers

     

     

     

    ???

     


    In your source edit the needed array as you want with the desired level. Look for exp_table_common (for example) in your source and you will find the EXP table where you need to add as many exp values as many levels you want. (since you need exp value for every level)

     

    After in your MySQL server change the level field in your player table (which you can find in the player database) according to the instructions

  11. Hi,

    Im trying with a function to filter some string from the chat, but it gives a strange error.

    Functions:

    const char* FilterChat(const char* c_pszBuffer)
    {
        std::string strChatBuf = c_pszBuffer;
    
        // Other stuff with the string, but its commented out rn.
        
        char szTmpBuf[1024 + 1] = {};
        const char* c_szpFilterBuf = strChatBuf.c_str();
        _snprintf(szTmpBuf, sizeof(szTmpBuf), "%s", c_szpFilterBuf);
    
        return szTmpBuf;
    
    }

    In bool CPythonNetworkStream::RecvChatPacket():

    #ifdef CHAT_FILTER
    	CPythonTextTail::Instance().RegisterChatTail(kChat.dwVID, FilterChat(line));
    #else
    	CPythonTextTail::Instance().RegisterChatTail(kChat.dwVID, line);
    #endif

     

    And in-game its junk:

    junk.png

     

    What's the problem? With debugging it seems the array gets created with full of junk already, but i've initialized it with full of zeroes if im not wrong.

  12. 23 hours ago, VegaS™ said:

    I didn't test it, let me know if it works.

    There are other solutions as well, with resurrection vnum, but you need a custom function since you want it with a spawn chance.

    Srcs/Server/game/src/char_battle.cpp

    void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
    {
    	[...]
    	// At the end of the function
    	if (pkKiller && pkKiller->IsPC() && IsStone())
    	{
    		static const auto SPAWN_STONE_LIST = {
    			8001,
    			8002,
    			8003,
    		};
    		
    		if (std::find(SPAWN_STONE_LIST.begin(), SPAWN_STONE_LIST.end(), GetRaceNum()) != SPAWN_STONE_LIST.end())
    		{
    			static const auto SPAWN_STONE_PCT = 100;
    			if (number(1, 100) <= SPAWN_STONE_PCT)
    			{
    				static auto& character_manager = CHARACTER_MANAGER::instance();
    				character_manager.SpawnMob(GetRaceNum(), GetMapIndex(), GetX(), GetY(), GetZ(), true, static_cast<int>(GetRotation()), true);
    				if (test_server)
    					pkKiller->ChatPacket(CHAT_TYPE_INFO, "SpawnMob: name(%s), x(%ld), y(%ld), z(%ld)", GetName(), GetX(), GetY(), GetZ());
    			}
    		}
    	}
    }

     

    It works perfectly thank you @VegaS™

    • Good 1
×
×
  • 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.