Jump to content

Amun

Contributor
  • Posts

    199
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    100%

Posts posted by Amun

  1. Spoiler

      

    13 hours ago, ziad said:

    This include affected my binary , so its not the right solution .. 

     

    again i have a bad path while building my srcs , 

     

    VS 2022 in use . 

     

    https://metin2.download/picture/iGS4Susdr23u23900538A0kNbN2ARyH4/.png

     


    Error    MSB3073    The command "cd C:\Users\Ziad-\OneDrive\Desktop\Altyapı\Binary\Client\CRootLib\\Workplace\
    call 2.bat
    call 3.bat

    I dont know if its related to this code

    if someone can help please thanks 

     

        <PreBuildEvent>
          <Command>cd $(ProjectDir)\Workplace\
    call 2.bat
    call 3.bat
    </Command>
          <Message>cythonizing root</Message>
        </PreBuildEvent>
      </ItemDefinitionGroup>
      <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
        <ClCompile>
          <WarningLevel>Level3</WarningLevel>
          <PrecompiledHeader>
          </PrecompiledHeader>
          <Optimization>MaxSpeed</Optimization>
          <FunctionLevelLinking>true</FunctionLevelLinking>
          <IntrinsicFunctions>true</IntrinsicFunctions>
          <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
          <AdditionalIncludeDirectories>..\..\Extern\include\Python-2.7;..\..\Extern\include</AdditionalIncludeDirectories>
          <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
          <CompileAs>CompileAsC</CompileAs>
          <MultiProcessorCompilation>true</MultiProcessorCompilation>
          <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
          <OmitFramePointers>true</OmitFramePointers>
          <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
          <WholeProgramOptimization>false</WholeProgramOptimization>
          <BrowseInformation>true</BrowseInformation>
        </ClCompile>
        <Link>
          <SubSystem>Windows</SubSystem>
          <GenerateDebugInformation>true</GenerateDebugInformation>
          <EnableCOMDATFolding>true</EnableCOMDATFolding>
          <OptimizeReferences>true</OptimizeReferences>
        </Link>
        <PreBuildEvent>
          <Message>cythonizing root</Message>
          <Command>cd $(ProjectDir)\Workplace\
    call 2.bat
    call 3.bat
    </Command>

     

     

    call 2.bat
    call 3.bat

    I see they are used to cythonize the root. If you don't have these, remove them from the build events.

    If you have them, update your paths.

    Also, try common sense, it usually works(like with your first problem, one simple google search would've taken you to this page https://en.cppreference.com/w/cpp/memory/shared_ptr, which clearly says shared_ptr is defined in the <memory> header)

     

    Good luck

  2. Don't know if I'm too late, but try this:

    //////////////////////
    // questlua_pc.cpp
    //////////////////////
    add
    	int pc_get_players_count_in_current_map_index(lua_State* L)
    	{
    		uint32_t mIdx = CQuestManager::instance().GetCurrentCharacterPtr()->GetMapIndex();
    		uint32_t pCount = SECTREE_MANAGER::Instance().GetPlayerCountInMap(mIdx);
    
    		lua_pushnumber(L, pCount);
    		return 1;
    	}
    
    find
    luaL_reg pc_functions[] =
    {
    
    add
    	{ "get_players_count_in_map",		pc_get_players_count_in_current_map_index},
    
    
    
    
    //////////////////////
    // sectree_manager.h
    //////////////////////
    find
    size_t		GetMonsterCountInMap(long lMapIndex);
    
    add
    size_t		GetPlayerCountInMap(long lMapIndex);
    
    
    
    //////////////////////
    // sectree_manager.cpp
    //////////////////////
    
    struct FCountPlayers
    {
    	std::unordered_map<VID, VID> m_map_Players;
    
    	void operator() (LPENTITY ent)
    	{
    		if (ent->IsType(ENTITY_CHARACTER) == true)
    		{
    			LPCHARACTER lpChar = (LPCHARACTER)ent;
    
    			if (lpChar->IsPC())
    			{
    				m_map_Players[lpChar->GetVID()] = lpChar->GetVID();
    			}
    		}
    	}
    };
    
    size_t SECTREE_MANAGER::GetPlayerCountInMap(long lMapIndex)
    {
    	LPSECTREE_MAP sectree = SECTREE_MANAGER::instance().GetMap(lMapIndex);
    
    	if (sectree != NULL)
    	{
    		struct FCountPlayers f;
    
    		sectree->for_each(f);
    
    		return f.m_map_Players.size();
    	}
    
    	return 0;
    }
    
    ////////////
    // USAGE:
    ////////////
    /*
    	local pCount = get_players_count_in_map() -- it might be pc.get_players_count_in_map, dunno
    	
    	or
    	
    	when something with get_players_count_in_map() > whatever begin
    */

     

    Before you do, though: Counting them all the time isn't the most optimal way of doing this. In reality, you should keep track of the number of players from the beginning and just increment, decrement when they get in/get out of the map.

    However, I gave you some code, what you do with it is your choice.

     

    Also, I made this in the past 10 minutes, so I didn't test it(that's your job).

    Good luck!

  3. 1 minute ago, Helia01 said:

    Don't you think he wrote this to emphasize a good codding skill level?

    You missed the point of everything I wrote. I said most people have delusional expectations about the amount of work that goes into coding. Also, I explicitly noted where I wasn't specifically talking about him, but in general, hence the "Not related to you" part.

     

    Does it look like I didn't understand what he said?

    • Not Good 2
  4. 3 hours ago, Kafa said:

    Interesting question.. i bet overall approximately couple of hours.. he is a god xD

    Damn, bro, you've probably never written a line of code in your life. That, or you must be a manager, considering you have such unrealistic expectations.

     

    Not related to you, but worth mentioning:

    That's exactly what most idiots think when leaking shit or complaining about the prices developers put on their code: "I bet he made that shit in a few hours, and now he's charging me X amount of money for it", effectively shitting on people's time because they have no idea about the amount of work that went into it.

    • Good 1
    • Love 1
  5. What's dumb is that they checked for the PID when deleting a player

    	if (!c_rAccountTable.players[pinfo->index].dwID)
    	{
    		sys_err("PlayerDelete: Wrong Social ID index %d, login: %s", pinfo->index, c_rAccountTable.login);
    		d->Packet(encode_byte(HEADER_GC_CHARACTER_DELETE_WRONG_SOCIAL_ID), 1);
    		return;
    	}

    but they didn't check when selecting it(they've done the same shit in ::ChangeName, the method above ::CharacterSelect).

    I advise you to check all packets using indexes sent by the client, because it's not just the one @ LTGT posted.

    • Love 1
  6. 10 hours ago, bunker said:

    In his post he said that he deleted that part of the code.

    Not sure how it works now though (without inventorywindows.py)

    Most likely because the source part is working, but he didn't add the other 2 inventories in uiInventory/inventoryWindow. Basically, it's working because he has 4 inventories, but he can't see shit because they're not displayed in inventory.

  7. Spoiler
    5 hours ago, Torres said:

    I'm using the new character login interface (interface), when I translated from english and used the chinese epk, but I don't know how to show you the error (upload a picture), so this problem has been bugging me, thank you Answer, can you teamviewer show me the error?

    Thank you for your answer, best wishes to you!

     

    [1]. https://imgur.com/ or https://metin2.download/manage/picture/add/

    [2]. No. I already told you what to do.

    • Good 1
  8. The client is freezing for a while(anywhere from a few ms to multiple seconds for slower PCs) when meeting a new NPC/enemy for the first time because that's when it registers, creates and loads the entity.

    Note: This is only a partial fix.

    Why is it partial? Because it only loads the static mobs and NPCs available in the map(npc, regen, boss, group and group_group), so it won't fix the problem for dynamic entities, like pets and mounts.

    It can be extended to load those as well, of course, but you'll have to take care of that on your own.

    Variant:

    A way of completely fixing this would be to create the instances and load their files after registering the path(in root->playerSettingModule->LoadGameNPC), BUT that would slow down the initial loading quite a bit, since it'll load ALL mobs/npcs/pets/mounts, even if most of them will never be used.

    There's advantages and drawbacks to both methods. Choose for yourself.

     

    Here's the link:

     

    Good luck!

    - Amun


    Edit:

    Spoiler

    PS: Fuck off - NO SUPPORT.

    PSS: Another reason why the client is freezing is because of granular loading of maps. Implement the first step of @ masodikbela experimental full terrain render and you'll get rid of that as well.

    Here's the link(Show some love while you're there):

     

     

     UPDATE 08/12/2022:

    1. Refactored to use unordered_set from the beginning instead of creating a vector, then filtering unique entities by creating a set, and then moving them back to a vector.

    2. Extended to load the full spectrum of entities(both static and dynamic), except for PC(which are loaded in loading phase), WARP, GOTO, and DOOR. They can be included by altering this block in char_manager.cpp:

    #ifdef ENABLE_ENTITY_PRELOADING
    	//@Amun: or be specific, like if(ch->ispet, mount, whatever)
    	if (!ch->IsPC() && !ch->IsGoto() && !ch->IsWarp() && !ch->IsDoor())
    		SECTREE_MANAGER::Instance().ExtendPreloadedEntitiesMap(lMapIndex, pkMob->m_table.dwVnum);
    #endif

     

    • Metin2 Dev 213
    • kekw 1
    • Eyes 3
    • Not Good 2
    • Think 5
    • Scream 2
    • Good 47
    • Love 4
    • Love 102
  9. You're getting that error because the client can't find the index of your character's hair which, most likely, might be because it doesn't actually exist in pack.

    Both select and game phases receive the index(vnum) of your hair from the database(player->player->part_hair, as SirEldar mentioned) when HEADER_GC_CHARACTER_DETAILS is sent from the server(if I remember correctly), and attach them to your character by calling chr.SetHair(details.part_hair, which is the vnum).

    What I would do if I were you is check to see if you have the vnum(18841) in item_proto, item_list and race.msm, then check to see if the skin exists in pack(item/hair).

     

    To avoid showing up with no head when a skin is missing, we should probably have some sort of fallback to default when it can't find the current hair.

     

    Good luck,

    - Amun

    • Metin2 Dev 1
  10. Maybe you messed something up around these?

    PythonBackground.cpp

    void CPythonBackground::RenderCharacterShadowToTexture()
    {
    	extern bool GRAPHICS_CAPS_CAN_NOT_DRAW_SHADOW;
    	if (GRAPHICS_CAPS_CAN_NOT_DRAW_SHADOW)
    		return;
    
    	if (!IsMapReady())
    		return;
    
    	CMapOutdoor& rkMap = GetMapOutdoorRef();
    	uint32_t t1 = ELTimer_GetMSec();
    
    	if (m_eShadowLevel == SHADOW_ALL ||
    		m_eShadowLevel == SHADOW_ALL_HIGH ||
    		m_eShadowLevel == SHADOW_ALL_MAX ||
    		m_eShadowLevel == SHADOW_GROUND_AND_SOLO)
    	{
    		D3DXMATRIX matWorld;
    		STATEMANAGER.GetTransform(D3DTS_WORLD, &matWorld);
    
    		bool canRender = rkMap.BeginRenderCharacterShadowToTexture();
    		if (canRender)
    		{
    			CPythonCharacterManager& rkChrMgr = CPythonCharacterManager::Instance();
    
    			if (m_eShadowLevel == SHADOW_GROUND_AND_SOLO)
    				rkChrMgr.RenderShadowMainInstance();
    			else
    				rkChrMgr.RenderShadowAllInstances();
    		}
    		rkMap.EndRenderCharacterShadowToTexture();
    
    		STATEMANAGER.SetTransform(D3DTS_WORLD, &matWorld);
    	}
    
    	uint32_t t2 = ELTimer_GetMSec();
    
    	m_dwRenderShadowTime = t2 - t1;
    }

    PythonCharacterManager.cpp

    void CPythonCharacterManager::RenderShadowMainInstance()
    {
    	CInstanceBase* pkInstMain = GetMainInstancePtr();
    	if (pkInstMain)
    		pkInstMain->RenderToShadowMap();
    }

     

    Have you tried only rendering your shadow and nothing else?

    • Love 1
  11. Right.

    1. You just butchered English(I can't understand shit from the last block of text).

    2. You keep rambling about what you can do and what a fucking unicorn dev you are, but I don't see shit about why this topic was created in the first place. Is it about 3D models? I see you said that's what you're not good at. Is it about someone making a server for you?

     

    How is the last sentence supposed to explain what the fuck you're looking for?

    Do you need help choosing the correct source files?

    Do you need help choosing the right host?

    Do you need help starting an existing server in a correct way?

     

    What the fuck does "start correct" supposed to mean in this context???

     

    Regards,

    - Amun

    • kekw 1
    • Good 1
  12. 59 minutes ago, Ulas said:

    libthecore/include/stdafx.h

    find and comment this:

    #define strtof(str, endptr) (float)strtod(str, endptr)

     

     

    Edit:

    Just refreshed the page and noticed you updated your previous reply.

    59 minutes ago, Ulas said:

    https://metin2.download/picture/981BW8QSawm7P4YcpnbKv0kxdMf18rH8/.png

    libthecore/stdafx.h
    //search:
    struct timespec
    {
    	time_t  tv_sec;         /* seconds */
    	long    tv_nsec;        /* and nanoseconds */
    };
    
    //change:
    
    #ifndef WIN32
    struct timespec
    {
    	time_t  tv_sec;         /* seconds */
    	long    tv_nsec;        /* and nanoseconds */
    };
    #define strtof(str, endptr) (float)strtod(str, endptr)
    #endif
    
    remove the bottom one
    https://prnt.sc/O_S90eyNRWZk

     

    Anyhow, wrapping them in "ifndef WIN32" is absolutely useless, since the whole block is wrapped in "ifdef WIN32", so you can just delete them.

  13. 32 minutes ago, Ulas said:

    @ Amun I can try serversource to win32 can you help me ? I don't understand really, ı have sql files.

    Mate, I'm sorry, but I don't understand what you're trying to say.

    Are you trying to compile your server's source with Visual Studio(win32) or what do you mean? And what do "sql files" have to do with anything?

     

    I asked you to show us the piece of code that throws the first error. Where is it?

  14. Whenever you have errors, go to the first one, not last, because the first one is usually creating a cascade/domino, triggering other errors. Show us the line where you get the first error.

     

    Also, as a piece of advice, since you're coding/programming in English, keep the damn IDE in English as well, because we can't understand shit and it certainly doesn't help you very much either.

    • Metin2 Dev 1
    • Good 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.