Jump to content

Alina

Inactive Member
  • Posts

    174
  • Joined

  • Last visited

  • Days Won

    13
  • Feedback

    0%

Posts posted by Alina

  1. You can do it via CMD file, I guess it also works on 34k.

    With that you can grant the LOW_WIZARD profile rights do mute. One of the ranks already don't have gm banner, I can't seem to remember which one it was. Just try it out and if you find it, give it access to the mute command.

    No need to pay ;)

    • Love 4
  2. This board is no support thread for eterhost vps ;)

    You've only 65mb RAM left, it's kinda low. Also for one channel you have a lot game instances open, maybe you'd try to reduce that :D

    For 1,5gb you're running a lot of services like TeamSpeak. Are you sure you ordered the right vps for your needs?

  3. You're getting out of the index with this code!

    Your for loop doesn't look correct and therefore results in this behaviour. What you're doing is:

    for i = 1, data01[1], 1 do

    Which means exactly this:

    for i = 1, 19, 1 do

    So the loop will go from 1 to 19, but the table only has 5 entries. Now we can look at the code:

    if item.vnum == data01[1+1*(i-1)] then

    In which case is the loop out of index? It's when 1+1*(i-1) > 5

    So in your case it'd be at the 6th execution. That's the point where i=6 and the solution would be: 1+1*(6-1) > 5 and yes, 1+5 > 5

     

    What you may wanted to do was this:

    for i = 1, table.getn(data01), 1 do

    This will only iterate through the table until it reaches the maximum. Also the Computation doesn't make sense. Why aren't you just using

    if item.vnum == data01[ i ] then

    instead of your code?

    • Love 1
  4. You can check when the chat command is handled (I guess it's in one of the input cpps) for the map index and then return beforehand. So people can't chat when they're in OX. You can also make an exception when the chat type is whispering, so people can talk privately via pm but not use the normal, guild, group or all chat^^

    • Love 2
  5. thx for the system i didnt test it or add it
    also iam not c++ progream but your code it seem to be ugly -_-

    good luck :)

    ​Really? I can't find anything ugly about this. Actually the c++ part is very nice. I didn't check on python.

    And why are you wishing him good luck at his own release? ._. Sometimes I don't understand people...^^

     

    Anyway, the idea behind that is great and I like the c++ part a lot. Oh, and a german sentence slipped through ;)

  6. void CShopManager::Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount)
    {
    	if (!ch->GetShop())
    		return;
    
    	if (!ch->GetShopOwner())
    		return;
    
    	if (!ch->CanHandleItem())
    		return;
    
    	if (ch->GetShop()->IsPCShop())
    		return;
    
    	if (DISTANCE_APPROX(ch->GetX()-ch->GetShopOwner()->GetX(), ch->GetY()-ch->GetShopOwner()->GetY())>2000)
    	{
    		ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상점과의 거리가 너무 멀어 물건을 팔 수 없습니다."));
    		return;
    	}
        
    	LPITEM item = ch->GetInventoryItem(bCell);
        
            if(!item)
                return;
        
        // special code (Ken) //
    	if (item->GetType() == ITEM_WEAPON || item->GetType() == ITEM_ARMOR || item->GetType() == ITEM_BELT)
    	{
    			char szEventFlag[30];
    			snprintf(szEventFlag, sizeof(szEventFlag), "%d.Engel", item->GetID());
    			if (*szEventFlag)
    			{
    					if (quest::CQuestManager::instance().GetEventFlag(szEventFlag))
    					{
    							ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("item_engel"));
    							return;
    					}
    			}
    	}
        // special code (Ken) //
    
    	if (item->IsEquipped() == true)
    	{
    		ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("착용 중인 아이템은 판매할 수 없습니다."));
    		return;
    	}
    
    	if (true == item->isLocked())
    	{
    		return;
    	}
    
    	if (IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_SELL))
    		return;
    
    	DWORD dwPrice;
    
    	if (bCount == 0 || bCount > item->GetCount())
    		bCount = item->GetCount();
    	
    	dwPrice = item->GetShopBuyPrice();
    
    	if (IS_SET(item->GetFlag(), ITEM_FLAG_COUNT_PER_1GOLD))
    	{
    		if (dwPrice == 0)
    			dwPrice = bCount;
    		else
    			dwPrice = bCount / dwPrice;
    	}
    	else
    		dwPrice *= bCount;
    
    	dwPrice /= 5;
    	
    	//세금 계산
    	DWORD dwTax = 0;
    	int iVal = 0;
    	
    	if (LC_IsYMIR() ||  LC_IsKorea())
    	{
    		dwTax = dwPrice * iVal / 100;
    		dwPrice -= dwTax;
    	}
    	else
    	{
    		dwTax = dwPrice * iVal/100;
    		dwPrice -= dwTax;
    	}
    
    	if (test_server)
    		sys_log(0, "Sell Item price id %d %s itemid %d", ch->GetPlayerID(), ch->GetName(), item->GetID());
    
    	const int64_t nTotalMoney = static_cast<int64_t>(ch->GetGold()) + static_cast<int64_t>(dwPrice);
    
    	if (GOLD_MAX <= nTotalMoney)
    	{
    		sys_err("[OVERFLOW_GOLD] id %u name %s gold %u", ch->GetPlayerID(), ch->GetName(), ch->GetGold());
    		ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("20억냥이 초과하여 물품을 팔수 없습니다."));
    		return;
    	}
    
    	// 20050802.myevan.상점 판매 로그에 아이템 ID 추가
    	sys_log(0, "SHOP: SELL: %s item name: %s(x%d):%u price: %u", ch->GetName(), item->GetName(), bCount, item->GetID(), dwPrice);
    
    	if (iVal > 0)
    		ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("판매금액의 %d %% 가 세금으로 나가게됩니다"), iVal);
    
    	DBManager::instance().SendMoneyLog(MONEY_LOG_SHOP, item->GetVnum(), dwPrice);
    
    	if (bCount == item->GetCount())
    	{
    		// 한국에는 아이템을 버리고 복구해달라는 진상유저들이 많아서
    		// 상점 판매시 속성로그를 남긴다.
    		if (LC_IsYMIR())
    			item->AttrLog();
    
    		ITEM_MANAGER::instance().RemoveItem(item, "SELL");
    	}
    	else
    		item->SetCount(item->GetCount() - bCount);
    
    	//군주 시스템 : 세금 징수
    	CMonarch::instance().SendtoDBAddMoney(dwTax, ch->GetEmpire(), ch);
    
    	ch->PointChange(POINT_GOLD, dwPrice, false);
    }

     

    This is your fixed function.

    • Love 1
  7. Hey :) In char_battle.cpp search for

    m_pkDeadEvent = event_create(dead_event, pEventInfo, bImmediateDead ? 1 : PASSES_PER_SEC(10));

     

    This is the timers when common bodies will vanish. You can change this 10 to another value so they'll will vanish sooner or later :D

  8. Guys it's a p2p command. He didn't set up a firewall and that's the point behind that.

    Set up a firewall and block those p2p ports (and db cache port) and you'll be safe from this attack ;)

     

    adminpage_ip: 127.0.0.1

    This should also work for you.

    Note:

    The attack can be from p2p ports and from normal ports. Against normal ports, you can use adminpage_ip to bind your API to localhost, so it'll only accept connections from localhost!

    Against p2p ports it's more difficult. You need to shut down access to them via firewall. That's gonna fix your problem and the attack you're getting there is through the p2p ports. So you may look at that ;)

  9. Edit: Yeah, it's the API tool.

    Make sure your firewall blocks every connection incoming to your p2p ports except for localhost!

    If you need help, then please send me your firewall rules via pm and I can help you with that.

     

    Example for pf:

    block in on $if FROM any to 127.0.0.1 port $P2P_PORT

    I guess that should do it. It's better to block everything by default and let certain defined ports pass through so you won't get in trouble with that anymore. But be careful with that since you'd block ssh access when working with firewalls!

  10. I'm using vmWare and the system currently occupies about 10gb disk space out of 40gb maximum. So I'll only have to upload 10gb but unfortunetately my connection is so bad that I even can't seem to upload them. I only upload with 100kb/s, which equals to 10 hours upload time :/

    ​It's a night of sleeping.

    ​Sorry, missed a 0.

    It's 100 hours. If I always upload at max speed ;)

  11. I'm using vmWare and the system currently occupies about 10gb disk space out of 40gb maximum. So I'll only have to upload 10gb but unfortunetately my connection is so bad that I even can't seem to upload them. I only upload with 100kb/s, which equals to 10 hours upload time :/

     

    Edit: It's 100 hours, not 10. Sorry for the missing 0 :/

    • Love 1
  12. Hello! If someone can send me the download link via pm (too lazy to search) I'll create a vm for you! Seems like it's a bit difficult and I like difficulty :ph34r:

     

    Oohh aaand that's the wrong section. You may want to post something like that into question section for the future, okay? :P

     

    Aaaand I'm dumb. First post has the source. Oh, crazy me. I'm downloading it right now and I'm onto it! :) Give me some cheers!

    ​Good luck making it to work and ty for offering to help us :)

    ​Sorry that it didn't work out at all. I've managed to set up a machine and compile it but it's way too big to upload :/

    • Love 1
  13. If you're using malloc then you have to use free() to deallocate the memory.

    If you're using the c++ 'version' with new char then you only have to use the delete instruction.

    delete var; //This is for simple variables without multidimensional values

    delete[] var; //This is for things like arrays. Note: You're having a char array. Guess what you'll have to use then.

     

    So in your case you only had to use delete[] yeni;

    If you're first trying to free() it and then delete it, then you're not only misusing free() but also trying to deallocate the memory twice. You know, the memory could also have been reallocated and then you're trying to access memory you shouldn't be able to have.

     

    Simplest solution, like I said, is provided by Ken. Just use a string and you won't have to deal with all that trouble.

    • Love 1
  14. There are delta values defined in your gamefile. I guess you're using that vanilla thing. Some people complained about it letting people drop loot even if their level is way too high.

    Have a look at constants.h at line 108
    #define PERCENT_LVDELTA(me, victim) aiPercentByDeltaLev[MINMAX(0, (victim + 50) - me, MAX_EXP_DELTA_OF_LEV - 1)]
    #define PERCENT_LVDELTA_BOSS(me, victim) aiPercentByDeltaLevForBoss[MINMAX(0, (victim + 50) - me, MAX_EXP_DELTA_OF_LEV - 1)]

     

    See those values? You can change the +50 to +30 or any other value you want. I don't know why she raised them. Anyway, here you can fix it :D

     

    • Love 1
  15. A jail is a FreeBsD environment based on chroot. You create a subsystem which is seperated from the rest of your system: Just like a vm.

    You can install services on those jails. So you can for sure install mysql twice on your machine if you're running jails. Jails are like the virtual machines but only for FreeBSD and they're already implemented. So you won't have to deal with third party applications, you can create your own jail without the need of vmware, virtualbox or anything else.

     

    NAT is for forwarding traffic to your internal ip. Let's check on the following scenario:

    1. You have two jails which run at 192.168.0.50 and 192.168.0.51 for example.

    2. Your own system listens on the following ips 87.65.43.21 and 87.65.43.22 and 87.65.43.23

    If you want to connect to your jails, you're going to have a bad time. Connecting to one of the three ips always results into a connection to your main server but not to your jails! To make them accessable to public you can use NAT. Your firewall then deals with the connection and forwards them. For example:

    1. Let your firewall forward connections to ip 87.65.43.22 to 192.168.0.50

    2. Let your firewall forward connections to ip 87.65.43.23 to 192.168.0.51

    Which results in the following behaviour:

    1. Connecting to 87.65.43.22 will be forwarded so you land on your first jail

    2. Connecting to 87.65.43.23 will be forwarded so you land on your second jail

    3. Connecting to 87.65.43.21 will not be forwarded and you land on your main system.

    That's a brief showcase what NAT can do for you. NAT does not represent jails, it's only (like the name tells you) a network translation service.

     

    I hope I explained it well this time :)

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