Jump to content

Sonitex

Premium
  • Posts

    522
  • Joined

  • Days Won

    12
  • Feedback

    100%

Posts posted by Sonitex

  1. 17 minutes ago, Mali61 said:

    thanks for fix :)

    For me, I wouldn't prefer this. Because you are copying pair. Just use simple iterator like this:

    
    for ( ; it != container.end(); ) {
    	if (condition)
    		it = container.erase(it);
    	else
    		++it;
    }

     

     

    That is the other way I was talking about and you are right, this is much more efficient way of doing it as we are not copying elements to another vector and cleaning them up afterwards. Thank you for the code ;)

    • Love 1
  2. When cancelling server timers a core will crash as it is removing a timer from the map and increasing the iterator twice by calling erase() function and afterwards increasing it once again when entering a new cycle of loop. One way of solving this issue is to first collect the timers which must be removed and clean them up at the end. You can also add a simple counter which is increased at each end of the loop's cycle and remove the timer directly from the first loop by specifying the position with the counter itself.

     

    Note that this issue seems to appear after upgrading code to C++11 or higher.

     

    Replace the following function inside questmanager.cpp:

    	void CQuestManager::CancelServerTimers(DWORD arg)
    	{
    		vector<pair<string, DWORD>> ServerTimersToDelete;
    
    		for (const auto& kv : m_mapServerTimer) {
    			if (kv.first.second == arg) {
    				LPEVENT event = kv.second;
    				event_cancel(&event);
    				ServerTimersToDelete.push_back(kv.first);
    			}
    		}
    
    		// Delete all the required server timers
    		for (const auto &timer : ServerTimersToDelete)
    			m_mapServerTimer.erase(timer);
    
    		// Clean up
    		ServerTimersToDelete.clear();
    	}

     

    • Metin2 Dev 1
    • Not Good 1
    • Love 8
  3. 5 minutes ago, DrTurk said:

    @Sonitex

    How do you declare from which locale_string.txt it should load the information?

    My locale_string.txt is located in /locale/de

    
    1217 19:56:49074 :: CPythonLocaleString::FindLocaleString: cannot find "1";

     

     

    It should be automatically loaded from an active locale path 🤔

    • Love 1
  4. 8 minutes ago, Istny said:

     

    Cleaner, only downside is, if someone for unknow reason will have for example socket3 set to 0 and socket4 to 11 loop in CHARACTER::DoRefine will use value frome socket3 as material vnum which is 0. Summarazing don't do a mess and you are good to go 😀

     

    Yeah but it goes both ways. Before if you set a value for socket0, left socket1 empty and set socket2, 3rd socket would be ignored. But as you said, you need a bit more precision & focus when doing things like that.

    • Good 1
  5. 		BYTE material_count = 0;
    		for (int i = 0; i < REFINE_MATERIAL_MAX_NUM; i++)
    		{
    			str_to_number(prt->materials[i].vnum, data[col++]);
    			str_to_number(prt->materials[i].count, data[col++]);
    
    			if (prt->materials[i].vnum)
    				material_count++;
    		}
    
    		prt->material_count = material_count;

     

    Issue is how they approached counting in the first place. When the loop hits a vnum equal to zero, material count was assigned based on current loop index which means if you had 5 slots occupied you would never hit an empty slot which is why material count would be always zero. By extending the loop you would also need to extend mysql columns which does nothing in this case. 

    • Good 2
  6. Yeah because you have to pass index of the string as an argument. In your case, the bottom part of your code should look like this:

     

    pkChar->ChatPacket(CHAT_TYPE_INFO, 880, LC_TEXT("Total number of the Quiz: %d"), c);	

    Or:

    pkChar->ChatPacket(CHAT_TYPE_INFO, 880, "Total number of the Quiz: %d", c);	

     

    Also, this does not support quiz strings. Those are stored in a separate file called locale_quiz.txt and additional changes are needed for it to be usable. This release only supports strings that are inside locale_string text files.

  7. 6 hours ago, newreboot said:

    Please can u explain how to use it?

    I already compiled the source, and added the locale_string on client, But nothing changed. still reading from my locale_string on serverside...

     

    You need to use LocaleChatPacket instead of ChatPacket. 

  8. M2 Download Center

    This is the hidden content, please
      ( Internal )

    This is the hidden content, please
      ( GitHub )

     

    I would not recommend using this as it's missing many features, head over to Mali's release for an updated version.

     

     

    This is the hidden content, please

    • Metin2 Dev 229
    • kekw 3
    • Eyes 2
    • Dislove 4
    • Angry 4
    • Not Good 2
    • Sad 2
    • Cry 3
    • Think 6
    • Confused 8
    • Lmao 2
    • Good 93
    • Love 10
    • Love 253
  9. There isn't any other way other than through events or the gameplay itself (change of the lore, environment rework, new game mechanics). You can empower players' damage, boost their experience rates, etc. Gameplay takes much more effort to be executed correctly and is kind of risky as the whole game is dependent on it/connected to it.

     

    I personally haven't seen a server where players would be amazed with the 2 empire concept, unless it was a total rework of the gameplay. Three kingdom concept is much more appreciated from the player base side.

     

    Guilds also have a pretty big impact on the player arrangement around the empires. 

    • Love 1
  10. Updated.

     

    I assume calculating the duration in the beginning of the function is not the smartest move when dealing with milliseconds. Moved the calculation to skill module's function which is only used at uiToolTip.

     

    It works just fine for me now, if further problems arise I will happily fix them ;) 

    • Love 1
  11. 26 minutes ago, Metin2Place said:

    If you spam the same skill right after cooldown, the second time it won't do damage.

    Sorry to disappoint you but this has nothing to do with damage of the skill. Your issue lays somewhere else.

    • Lmao 1
  12. 29 minutes ago, Distraught said:

    I type the same for the third time now. Packet around will not send anything to the peers because other cores just really don't give a shit what happened real-time with your character. Who sees you (and this is why it sends to them) is connected to the same core as you are.

     

    Third time worked like a charm. Got it ;) (kinda)

    • Love 1
  13. Haven't really took a deep look but the thing that pointed out to me is party flag that saves dungeon index is set when you talk with the NPC 20531. 

    Because you warped out before starting the dungeon, party flag was not saved and you were teleported to a new instance.

     

    I'd recommend to move this part to somewhere else like make_dungeon() function.

    party.setf("dungeon_index", d.get_map_index())
    d.setf("party_leader_pid", party.get_leader_pid())

     

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