Jump to content

ridetpro

Banned
  • Posts

    106
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Posts posted by ridetpro

  1. 5 hours ago, Defacer35 said:

    I'm just trying learn something, what is wrong about it ? This is not a constructive reply.

     

    Use this select query in input_auth, you need select the ID.. I'm not sure how ( i did not checked whole matrix_card logic) .

     

    Input_auth.cpp

    		"SELECT id, PASSWORD('%s'), password, social_id, status, availDt - NOW() > 0,"

     

    db.cpp

    {
    	if (!row[col])
    	{
    		sys_err("error column %d", col);
    		M2_DELETE(pinfo);
    		break;
    	}
    
    	DWORD dwID = 0;
    	str_to_number(dwID, row[col++]);
    }

     

    • Love 1
  2. Not tested, wrote from phone.

     

    	def Block(self, slot, map, vnum):
    		item_vnum = player.GetItemIndex(slot)
    		item.SelectItem(item_vnum)
    
    		if (background.GetCurrentMapName() == str(map_name)) and (item_vnum == int(vnum)):
    			chat.AppendChat(chat.CHAT_TYPE_INFO, "#error 33121")
    			return
    
    	def __UseItem(self, slotIndex):
    		self.Block(slotIndex, "metin2_map_c1", 19)

    It might be extended to other functions, but thats basic

     

  3. 41 minutes ago, ByLost said:

    Up. @Mali61 

     

    Not close (no name)

    spacer.png

     

    
    0802 17:54:41539 :: Traceback (most recent call last):
    
    0802 17:54:41539 ::   File "ui.py", line 1344, in CallEvent
    
    0802 17:54:41540 ::   File "ui.py", line 87, in __call__
    
    0802 17:54:41541 ::   File "ui.py", line 69, in __call__
    
    0802 17:54:41541 ::   File "uiWhisper.py", line 272, in Close
    
    0802 17:54:41541 :: TypeError
    0802 17:54:41570 :: : 
    0802 17:54:41571 :: bad argument type for built-in operation
    0802 17:54:41571 :: 

     

     

    	def Close(self):
    		chat.ClearWhisper(self.targetName)
    
    		if app.ENABLE_WHISPER_RENEWAL:
    			if self.targetName and whisper.IsSended(self.targetName) and len(self.targetName) > 0:
    				whisper.Remove(self.targetName)

     

    • Love 1
  4. 2 minutes ago, TMP4 said:

    The problem is your map checking solution is not working at all.

    You don't understand how cores working.

     

    Example:

    41 is defined in all ch core1 (except ch99 of course)

     

    I want to check channel2 core1 when the character is in channel1 core1.

     

    It will always return true because channel1 contains 41 too.

    AHHH, well.. i will check when i am back home.. 

    U are right, i am driving right now xD

     

    ::::

    You can just set a fake unique map, on each channel core1 btw

  5. 18 minutes ago, TMP4 said:

    Okey then it's ok if i can check a channel's first core.

    (If the first core is running, the second core should running so it's ok)

    Do you have any reccomendation?

     

    Again: It is a normal channel, not exclusive maps channel.

     

    local ch1_core1_on = pc.is_map_alive(41) -- Check a map from ch1_core1
    local ch1_core2_on = pc.is_map_alive(100) --Check a map from ch1_core2
    
    local ch2_core1_on = pc.is_map_alive(200) --Check a map from ch2_core1
    
    if ch1_core1_on then
    	say("ch1_core1_online")
    end
    
    if ch1_core1_on and ch1_core2_on then
    	say("Whole ch1 is on")
    end

     

    Check how it should look a whole chanel online/offline.. Or you can check just core1 :D As you wish

    And btw, u should rename is_

     

    And you set an unique map, without any usage in client.. in each channel core 1

  6. 2 minutes ago, TMP4 said:

    It's not gonna work because this channel is normal channel like channel1, i just decided to set it as channel98 :D

    So it's not an "exclusive-maps" channel like channel99 where i could check metin2_map_oxevent.

    just read over and over what i wrote, you can't check a whole channel.. Because a channel is made from cores..

    If you want to check only ch99, identify some maps on all cores from ch99 and do the checks as i said above

     

    What if you get a crash on a single core? on ch99.. you can't read the status of whole channel.

  7.  

    You have a quick method here, first of all identify a map on that channel. This method only checks a respective core, if you have a channel on the cores.

    int pc_is_map_alive(lua_State* L)
    {
    	LPCHARACTER ch = CQuestManager::Instance().GetCurrentCharacterPtr();
    	lua_pushboolean(L, map_allow_find(lua_tonumber(L, 1)));
    	return 1;
    }
    
    {"is_map_alive", pc_is_map_alive},

    I think is better to check if a core is up/down because when u get crash it won't crash whole channel :)

    usage :

     

    local channel = pc.is_map_alive(41) or pc.is_map_alive(100)
    -- map 41 , check core 1
    -- map 100, check core 2
    if channel then
    	-- Do something
    end

     

    So, basically check if the map is found. If the map is found then the channel is alive.

    You can add in questlua_global, since channels/cores works for everyone not for a single player..

    How u wish

     

     

  8. // Search char_item.cpp
    		if (item1->EquipTo(this, bEquipCell))
    			item2->AddToCharacter(this, TItemPos(INVENTORY, bInvenCell));
    		else
    			sys_err("SwapItem cannot equip %s! item1 %s", item2->GetName(), item1->GetName());

    Replace

    		if (item1->EquipTo(this, bEquipCell)) {
    
    			item2->AddToCharacter(this, TItemPos(INVENTORY, bInvenCell));
    			item2->ModifyPoints(false);
    			ComputePoints();
    		} else {
    			sys_err("SwapItem cannot equip %s! item1 %s", item2->GetName(), item1->GetName());
    		}

     

    I am not sure if it's the same bug i had few years ago, but looke like you have an issue with item swap like i had..

    So try my fix

     

    4 years old video

     

     

    • Love 2
  9. I told you what to do, if you are not able to do it just ask your host company to do it.

    Just read over and over my message... If you have 5.6 and there's no my.cnf then creare a black my.cnf in usr/locale/

     

    Mysql 5.6 /usr/local/

    [mysqld]
    sql_mode=

    mysql 5.7, edit the existing on    usr/local/etc/mysql/

    [mysqld]
    sql-mode=

    Be careful at underscores

     

    AND RESET MYSQL SERVER 

  10. 27 minutes ago, North43 said:

    is the change visible? can somebody show us a side-by-side comparison?

     

    With FPS increased..

    - Without dogs, the lag is less.. it move better, i reached 250 fps

    - Spawned 500 wild dogs, after few seconds 5 seconds or fps drops to 7-8.. and start to lag a bit

     

    Wihtout FPS increased..

    - Without dogs, the lag is okay.. but better with fps increased.. fps exactly 60

    - Spawned 500 wild dogs, after few 5 seconds fps drops to 10-12, and don't make any lag

     

    So, with FPS increasted i guess is better when there are no soo many entitys around you.. i don't think is worth enough, it's good but  it needs more adjustments.. Like effects, trees.. etc

    • Good 1
    • Love 4
  11. c5e60f44a10b64f75a1b95fe08bda5d7.gif

     

    This is how the SetHP() part should look.

    # uiTaskbar.py
    # def SetHP(self, curPoint, recoveryPoint, maxPoint):
    
    				if app.ENABLE_POISON_GAUGE_EFFECT:
    					if chrmgr.HasAffectByVID(player.GetMainCharacterIndex(), chr.AFFECT_POISON):
    						if self.hpRecoveryGaugeBar.IsShow():
    							self.hpRecoveryGaugeBar.Hide()
    
    						self.hpPoisonRecoveryGaugeBar.SetSize(newWidth, self.GAUGE_HEIGHT)
    						self.hpPoisonRecoveryGaugeBar.Show()
    					else:
    						if self.hpPoisonRecoveryGaugeBar.IsShow():
    							self.hpPoisonRecoveryGaugeBar.Hide()
    						else:
    							self.hpRecoveryGaugeBar.Show()

     

    • Love 2
  12. Acum 1 oră, Sherer a spus:

    Thanks for the hint.
    Due to your feedback I refactored handshake authentication to be done through P2P rather than by CORE->DB->CORE.
    If someone follows this tutorial you need to reimplement that part (with github stuff).
    According to your third question I don't really think it matters since some of methods don't even bother sending any packets at all.
    They just spoof the queue with fake connection and stuck in handshake stage.

     

    Nice idea with OVH_API - haven't really heard about that (you can make some tutorial if you find it helpful for us).
    In reference to the code you attached all methods bother sending packets at all.

    First you need to download

    This is the hidden content, please
    , which is available in PHP or Python.


    AntiDDOS option. Add new IP on permanent mitigation

    Spoiler
    
    <?php
    /**
     * First, download the latest release of PHP wrapper on github
     * And include this script into the folder with extracted files
     */
    require __DIR__ . '/vendor/autoload.php';
    use \Ovh\Api;
    
    /**
     * Instanciate an OVH Client.
     * You can generate new credentials with full access to your account on
     * the token creation page
     */
    $ovh = new Api( 'xxxxxxxxxx',  // Application Key
                    'xxxxxxxxxx',  // Application Secret
                    'ovh-eu',      // Endpoint of API OVH Europe (List of available endpoints)
                    'xxxxxxxxxx'); // Consumer Key
    
    $result = $ovh->post('/ip/xxx.xxx.xxx.xxx/mitigation', array(
        'ipOnMitigation' => 'Metin1', //  (type: ipv4)
    ));
    
    print_r( $result );
    ?>

     

    I was surprised too, to see how great that API from  OVH is. If you ever want to use this API, I suggest you send the data from the source to the website with the help of the web API embedded in the Metin2 source, then from website call the OVH api.

     

    And yes, all DDOS methods send packets. I was referring strictly to the topic, the method by which this attacker killed your server was through packets sent to auth/channels. Anonymous packets, without a name..

    With the code posted below, all incoming packets to auth will be wrote intro a text file then u can block em in few minutes.. Or you can blacklist them to ovh mitigation. Anyway, that's not really necessary right now.. As i said that's just a HOTFIX, it was a hotfix that worked very well.

    • Metin2 Dev 18
    • Think 1
    • Good 7
    • Love 4
  13. else if (!m_pPacketInfo->Get(bHeader, &iPacketLen, &c_pszName))
    {
    	if (g_bAuthServer)
    		LOG_IP("%s",inet_ntoa(lpDesc->GetAddr().sin_addr));
    
    	sys_err("Input: Unknown header:%d, Last header:%d(%d), Remain bytes:%d, fd:%d", bHeader, bLastHeader, iLastPacketLen, m_iBufferLeft, lpDesc->GetSocket());
    	lpDesc->SetPhase(PHASE_CLOSE);
    	return true;
    }

    Or you can save all the ip that send unknown packets to auth/game. After about 1 - 5 minutes you will have all the ips of the attacker and you can block them in the firewall. Or if you use OVH you can use OVH_API to filter IPs through the mitigation system.

    This is the hotfix I used. ?

    • Love 1
  14. Acum 39 minute, Artefact a spus:

    Hello, i recently installed special storage and fixed some problems but I still got one which is big.

    If I have items in the special storage and I`m rebooting the server the items are disappearing but they still appear in  database. I mean in navicat the items are still there.

    Any tips? Thank you

    void CInputDB::ItemLoad(LPDESC d, const char * c_pData)
    
    // You missed this part
    switch (p->window)
    {
    	case INVENTORY:
    	case DRAGON_SOUL_INVENTORY:
    	{
    		item->AddToCharacter(ch, TItemPos(p->window, p->pos));
    	}
    	break;
    
    	case EQUIPMENT:
    	{
    		if (item->CheckItemUseLevel(ch->GetLevel()))
    		{
    			if (!item->EquipTo(ch, p->pos))
    			{
    				v.push_back(item);
    			}
    		}
    		else
    		{
    			v.push_back(item);
    		}
    	}
    	break;
    }

     

  15. If you want a good answer, then you should learn to ask a good question. Try to give as many details as possible. Where did you want us to know you have a physical server at home? What have you tried so far? Have you ever tried to solve yourself before you post here? How do you try to connect to the internet? Cable / Wi-Fi? Do you have static ip? / Do you have dynamic ip? Are you sure the network card works? Which router model do you use?

    It's normal not to respond when you try ping because the server is not connected to the internet.
    Steps should be exactly the same as those posted above, just that you have to jump over the Bridged Adapter.

     

     

    • Love 1
  16. Go to  : Network->Adapter 1->Select bridged adapter (And select the adapter through which you are connected to the internet, in my case I am connected via WI-fi)

    470081c3944b932af8d2bc54b564042c.png

    Go to your adapter list

    444372fa395456bbcddbccac444c1083.png

    You need the default gateway and the netmask

    1ba687d514f54adb3135a74049ddc7eb.png

    Write in console bsdconfig -> Networking management

    a59d1120961b9f1ab1f3456155de857f.png

    Select DNS nameserver and set them like this

    5a36b222a91ed0ceaeebcc72ef6fab99.png

    Select network Interfaces

    eee440e8b5f907918a2e509b4745e775.png

    8266cd451ef4211cef4a22094d8615ba.png

    Select your interface

    0b566a92f36d03c4b2f653234d77557e.png

    Add ipaddr  xxx.xxx.xxx.254, your default gateway adress, last three digits should be 254

    Add netmask xxx.xxx.xxx.xxx

    7990772b24d7a23c619f4617a08987e4.png

    Select save/exit click ok

    f8414bb5d4fd9b7229b6bd0f0a8d7116.png

    When this question apper, click yes.

    cac6ec595b60de98d461253900692c7b.png

    Select exit, click ok.

     

    Reboot vbox machine. Machine ip will be xxx.xxx.xxx.254

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