Jump to content

Block Drop Hack | Binary Check Name | Get IP | Get Version | Disconnect | Delayed DC


Recommended Posts

Try that

void LoadExpTable(char* name)
{
    std::ifstream f(name);
 
    printf("EXP_TABLE load: %s n", name);
    if (!f.is_open())
    {
        printf("EXP_TABLE load: FILE %s OPEN ERROR", name);
        return;
    }
 
    int level = 0;
    long long int exp = 0;
    int line = 0;
 
    while (!f.eof())
    {
        f>>level;
        f>>exp;
        line++;
         
        if (level <= 0 || exp <= 0)
            printf("EXP_TABLE load !ERROR!: LINE %d LEVEL %d EXP %lld n", line, level, exp);
        else if (level > PLAYER_EXP_TABLE_MAX)
            printf("EXP_TABLE load !ERROR!: LINE %d LEVEL %d > MAX EXP LEVEL %dn", line, level, PLAYER_EXP_TABLE_MAX);
        else
        {
            printf("EXP_TABLE load: LINE %d LEVEL %d EXP %lld n", line, level, exp);
            exp_table_common[level] = exp;
        }
    }
 
    printf("EXP_TABLE load: done n");
}

 

There shouldn't be any problems unless your EXP table exceed this number 9223372036854775807 which I think won't happen.  :blink:

//Forgot to mention.. When you get bigger numbers in your EXP table than 4294967295, this line will start to make errors:

exp_table_common[level] = exp;

so be cautious.

Don't work :|

Link to comment
Share on other sites

ExpTable with text file "Source Vanilla"

 

	char* tmp2 = new char[64];
	sprintf(tmp2, "locale/%s/exp_table.txt", temp_locale.c_str());
	if ((fp = fopen(tmp2, "r")))
	{
		fprintf(stderr, "~~~> exp_table section begins <~~~n");
		int x = 0;
		while (fgets(buf, 256, fp))
		{
			if(strlen(buf)>0)
			{
				if(*buf == '#')
					continue;
				char lv[32], exp_blank[32];
				two_arguments(buf, lv, sizeof(lv), exp_blank, sizeof(exp_blank));
				long int level = atol(lv);
				long long int exp = atoll(exp_blank);
				if(level > PLAYER_EXP_TABLE_MAX)
					sys_err("Error with reading exp_table.txt! level is bigger than exp table!!!");
				else
				{
					exp_table_common[level - 1] = exp;
					fprintf(stderr, "exp_table override: level %ld exp -> %lldn", level, exp);
				}
				x++;
			}
		}
		fclose(fp);
		fprintf(stderr, "~~~> exp_table section ends <~~~n");
	}
	else
	{
		sys_log(0, "exp_table does not exist: %s", tmp2);
	}
	delete[] tmp2;

Link to comment
Share on other sites

  • 2 months later...
  • 2 years later...

Block the drop hacks:

Which is correct ?

1

	if (pkItemToDrop->AddToGround (GetMapIndex(), pxPos))
	{
		ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("¶łľîÁř ľĆŔĚĹŰŔş 3şĐ ČÄ »ç¶óÁý´Ď´Ů."));
		pkItemToDrop->StartDestroyEvent(30);

		ITEM_MANAGER::instance().FlushDelayedSave (pkItemToDrop);

		char szHint[32 + 1];
		snprintf (szHint, sizeof (szHint), "%s %u %u", pkItemToDrop->GetName(), pkItemToDrop->GetCount(), pkItemToDrop->GetOriginalVnum());
		LogManager::instance().ItemLog (this, pkItemToDrop, "DROP", szHint);
		LastDropTime = thecore_pulse();
		CountDrops++;		
	}

	if (thecore_pulse() > LastDropTime + 25)
	{
		CountDrops = 0;
	}

	if (thecore_pulse() < LastDropTime + 25 && CountDrops >= 4)
	{
		CountDrops = 0;
		sys_err("%s[%d] has been disconnected because of drophack using", GetName(), GetPlayerID());
		GetDesc()->SetPhase(PHASE_CLOSE);
		return false;
	}

2

	if (pkItemToDrop->AddToGround (GetMapIndex(), pxPos))
	{
		if (thecore_pulse() > LastDropTime + 25)
		{
			CountDrops = 0;
		}

		if (thecore_pulse() < LastDropTime + 25 && CountDrops >= 4)
		{
			CountDrops = 0;
			sys_err("%s[%d] has been disconnected because of drophack using", GetName(), GetPlayerID());
			GetDesc()->SetPhase(PHASE_CLOSE);
			return false;
		}		
		
		ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("¶łľîÁř ľĆŔĚĹŰŔş 3şĐ ČÄ »ç¶óÁý´Ď´Ů."));
		pkItemToDrop->StartDestroyEvent(30);

		ITEM_MANAGER::instance().FlushDelayedSave (pkItemToDrop);

		char szHint[32 + 1];
		snprintf (szHint, sizeof (szHint), "%s %u %u", pkItemToDrop->GetName(), pkItemToDrop->GetCount(), pkItemToDrop->GetOriginalVnum());
		LogManager::instance().ItemLog (this, pkItemToDrop, "DROP", szHint);
		LastDropTime = thecore_pulse();
		CountDrops++;		
	}

 

Link to comment
Share on other sites

Announcements



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