Jump to content

Karbust

Management
  • Posts

    1161
  • Joined

  • Days Won

    10
  • Feedback

    100%

Posts posted by Karbust

  1. 3 minutes ago, Denizeri24 said:

    c = 0x0 (null)

    ------

    check CItemCache * CClientManager::GetItemCache

    This is the function, already checks if c is null and allocates a new...

    void CClientManager::PutItemCache(TPlayerItem * pNew, bool bSkipQuery)
    {       
    	CItemCache * c;     
    
    	if (!pNew)
    		return;
    	
    	c = GetItemCache(pNew->id);
    	
    	// 아이템 새로 생성
    	if (!c)
    	{
    		if (g_log)
    			sys_log(0, "ITEM_CACHE: PutItemCache ==> New CItemCache id%d vnum%d new owner%d", pNew->id, pNew->vnum, pNew->owner);
    
    		c = new CItemCache; //crashes here...
    		m_map_itemCache.insert(TItemCacheMap::value_type(pNew->id, c));
    	}
    	// 있을시
    	else
    	{
    		if (g_log)
    			sys_log(0, "ITEM_CACHE: PutItemCache ==> Have Cache");
    		// 소유자가 틀리면
    		if (pNew->owner != c->Get()->owner)
    		{
    			// 이미 이 아이템을 가지고 있었던 유저로 부터 아이템을 삭제한다.
    			TItemCacheSetPtrMap::iterator it = m_map_pkItemCacheSetPtr.find(c->Get()->owner);
    
    			if (it != m_map_pkItemCacheSetPtr.end())
    			{
    				if (g_log)
    				sys_log(0, "ITEM_CACHE: delete owner %u id %u new owner %u", c->Get()->owner, c->Get()->id, pNew->owner);
    				it->second->erase(c);
    			}
    		}
    	}
    
    	// 새로운 정보 업데이트 
    	c->Put(pNew, bSkipQuery);
    	
    	TItemCacheSetPtrMap::iterator it = m_map_pkItemCacheSetPtr.find(c->Get()->owner);
    
    	if (it != m_map_pkItemCacheSetPtr.end())
    	{
    		if (g_log)
    			sys_log(0, "ITEM_CACHE: save %u id %u", c->Get()->owner, c->Get()->id);
    		else
    			sys_log(1, "ITEM_CACHE: save %u id %u", c->Get()->owner, c->Get()->id);
    		it->second->insert(c);
    	}
    	else
    	{
    		// 현재 소유자가 없으므로 바로 저장해야 다음 접속이 올 때 SQL에 쿼리하여
    		// 받을 수 있으므로 바로 저장한다.
    		if (g_log)
    			sys_log(0, "ITEM_CACHE: direct save %u id %u", c->Get()->owner, c->Get()->id);
    		else
    			sys_log(1, "ITEM_CACHE: direct save %u id %u", c->Get()->owner, c->Get()->id);
    
    		c->OnFlush();
    	}
    }

     

  2. Well, I'm reliving this topic because recently got back at it and I haven't fixed it before...

    I get either one of this 2 errors, but they all end up crashing on PutItemCache...

    iMpRG3G.png

    BvtY24D.png

     

    I also noticed this random items showing up on item table...

    WXIrRUg.png

  3. First of all, thank you for this release.

    Since I use a hostname instead of an IP, this didn't work for me, this are the changes I made to make it work (also works with IP).

    	CAccountConnector& rkAccountConnector = CAccountConnector::Instance();
    
    	struct hostent* remoteHost;
    
    	if ((remoteHost = gethostbyname(rkAccountConnector.GetServerAddr())) == NULL) {
    #if defined(_DEBUG_RTT)
    		TraceError("Unknown Hostname.\n\n");
    #endif
    		return; // Unkown Hostname
    	}
    
    	char* pDmsIP = inet_ntoa(*(struct in_addr*)(remoteHost->h_addr_list[0]));
    	ipaddr = inet_addr(pDmsIP);

     

    • Good 1
  4. JFeOiL0.png

    Update

    Today I'm fixing the textures for most mobile devices.

    Since most mobile devices don't have support for S3 Texture Compression (S3TC) (DDS Textures), I'm adding the option to switch to PNG in case that extension doesn't exist on the browser.

    PNG textures are heavier than DDS, which may cause more network usage on mobile devices, but it's the only way to load them correctly.

    Also fixed a small bug on the 3D Model Viewer URL that didn't allow to select the sex and always stayed male (Thanks @DemOnJR for finding it).

    • Metin2 Dev 2
    • Think 1
    • Good 4
    • Love 1
    • Love 2
  5. JFeOiL0.png

    Update

    Today I'm launching armors and body costumes 3D preview.

    The 3D Model Viewer supports embedding form them, but currently only official items are supported (how-to on the website)

    I am aware the Halloween costumes of 2020 are showing black textures, I'm trying to understand why that's happening.

    Next thing to do is add a hair on armor preview and add hair preview.

    Thanks again to @xP3NG3Rx for the official updates and to @Mali, if it wasn't for his tool to convert MSM to JSON I wouldn't have done it yet.

    • Metin2 Dev 4
    • Good 2
    • Love 4
    • Love 2
  6. 1 hour ago, AltanOzkan said:

    What happens if I do 0 and what does the other line below mean ?
    Thank you.

     

    if (IsRevive() == false && HasReviverInParty() == true)
    {
    	m_pkDeadEvent = event_create(dead_event, pEventInfo, bImmediateDead ? 1 : PASSES_PER_SEC(3));
    }
    else
    {
    	m_pkDeadEvent = event_create(dead_event, pEventInfo, bImmediateDead ? 1 : PASSES_PER_SEC(0));
    }

     

    Won't happen anything. This is the function that it executes, when it's less than 1 it will be set to 1 either way.

    LPEVENT event_create_ex(TEVENTFUNC func, event_info_data* info, long when)
    {
    	LPEVENT new_event = NULL;
    
    	/* 반드시 다음 pulse 이상의 시간이 지난 후에 부르도록 한다. */
    	if (when < 1)
    		when = 1;
    
    #ifdef M2_USE_POOL
    	new_event = event_pool.Construct();
    #else
    	new_event.reset(M2_NEW event);
    #endif
    
    	assert(NULL != new_event);
    
    	new_event->func = func;
    	new_event->info	= info;
    	new_event->q_el	= cxx_q.Enqueue(new_event, when, thecore_heart->pulse);
    	new_event->is_processing = FALSE;
    	new_event->is_force_to_end = FALSE;
    
    	return (new_event);
    }

     

    • Love 1
  7. 17 hours ago, Smiley said:

    Hi, I was wondering if you guys are still continuing working on the emulator?

    I looked over the source code and I really liked the progress you guys already made. 

    Also, what client did you use to test stuff out?

     

    Good work! 🙂

    The project is dead.

    • Sad 2
  8. JFeOiL0.png

    Update

    Today I'm officially launching the 3D Model Viewer, currently only available to weapons, some etc items and wings (aka sash aka acce).

    I'll also support embedding of the 3D Model Viewer (how-to on the website). For official items it can be used without problems (same as the availability above).

    It also support the use of custom 3D models, but this is still in testing phase and may receive changes in the future.

    Also added the icons and 3D models for the new update 21.2.8 (thank you @xP3NG3Rx) and a lot of new unofficial icons (thank you @MrQuin)

    • Good 1
    • Love 3
  9. M2 Download Center

    This is the hidden content, please
    ( Internal )

    Hello

    Since most of the work I do is in NodeJS (JavaScript and TypeScript), I needed to make a script to access the Metin2 API.

    GitHub: 

    This is the hidden content, please

    It has a JavaScript and a TypeScript version.

    To use just edit either file and set your server's data. This code is synchronous, meaning, it will block while waiting for a response from the server. It can be made asynchronous with Promises.

    On both files there's also a list of the most useful commands available, you can create more on the game source.

    You can find how to use it on the GitHub repository.

    Hope it's useful to someone.

    • Metin2 Dev 133
    • Eyes 6
    • Dislove 6
    • Angry 1
    • Not Good 1
    • Cry 1
    • Think 2
    • Confused 4
    • Scream 2
    • Good 49
    • Love 5
    • Love 80
  10. Update

    Added multi-language support. Instructions can be found on the README.

    This is the hidden content, please

    Multi-language

    It ships with support for two languages, English (default) and Portuguese. These can be used as examples to add more languages.

    To add more languages, you must edit both src\i18n.ts and src_electron\i18n.ts.

    Three things are needed, import the translation file (.json) that must go inside the folder localization\, and add the language on resources and supportedLngs.

    Do not edit the placeholders ( {{ }} ) when creating a new language, otherwise it won't work as expected.

    To add flags edit the file src\components\Buttons.ts. There are flags for every language that are supported by the official, just need to add the button.

    • Metin2 Dev 17
    • Good 3
    • Love 14
  11. 3 minutes ago, danhakhavro said:

    Isn't this a Portuguese forum?

    Pastel, sardinha, bacalhau e Francesinha

     

    575cfd9559653466ed194f7d97f904c0.png

    We are slowly taking over...

  12. JFeOiL0.png

    Today I launched a new update that allows search's and multi-language.

    Previously I added search's, but only by the ID, it wasn't enough, now it also search's by name.

    The names are based on the language set (it can be auto detected or changed using the flag icon).

    If you find any errors on any translation (except icons, using the official names), please, let me know.

     

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