Jump to content
×
×
  • Create New...

C++ Fix Config


Recommended Posts

Fix for changing default settings during the first run of the game and blocking settings lower than 800x600.

Spoiler
#Search:
		if (!stricmp(command, "WIDTH"))
			m_Config.width = atoi(value);
		else if (!stricmp(command, "HEIGHT"))
			m_Config.height = atoi(value);
		
#Substitute:
		if (!stricmp(command, "WIDTH")) {
			if(atoi(value) < 800)
				m_Config.width = 800;
			else
				m_Config.width = atoi(value);
		}
		else if (!stricmp(command, "HEIGHT")) {
			if (atoi(value) < 600)
				m_Config.height = 600;
			else
				m_Config.height = atoi(value);
		}
		
#Search:
void CPythonSystem::SetDefaultConfig()

#My default settings:
void CPythonSystem::SetDefaultConfig()
{
	m_Config = {};

	m_Config.width = 1280;
	m_Config.height = 720;
	m_Config.bpp = 32;
	m_Config.frequency = 60;

	m_Config.bWindowed = true;

	m_Config.is_software_cursor = false;
	m_Config.is_object_culling = true;
	m_Config.iDistance = 3;

	m_Config.gamma = 3;
	m_Config.music_volume = 0.0f;
	m_Config.voice_volume = 0;

	m_Config.bDecompressDDS = false;
	m_Config.bSoftwareTiling = 0;
	m_Config.iShadowLevel = 3;
	m_Config.bViewChat = true;
	m_Config.bAlwaysShowName = DEFAULT_VALUE_ALWAYS_SHOW_NAME;
	m_Config.bShowDamage = true;
	m_Config.bShowSalesText = true;
	m_Config.bHideEmojiInfo = false;
}

 

https://github.com/Alerinos/M2-Fix-Config

 

  • Love 1
Link to comment
Share on other sites

  • Moderator

This feature already was there since beginning, but just for Japan.

PythonSystem.cpp, just remove the preprocessor directive and set the bWindowed to true.

This is the hidden content, please

For the music just change the music_volume to 0.0f, you don't have to mute the voice volume.

	m_Config.music_volume		= 1.0f;

Also, maybe I'm wrong, but why you're doing this:

Spoiler
Quote



		if (!stricmp(command, "WIDTH")) {
			if(atoi(value) < 800)
				m_Config.width = 800;
			else
				m_Config.width = atoi(value);
		}
		else if (!stricmp(command, "HEIGHT")) {
			if (atoi(value) < 600)
				m_Config.height = 600;
			else
				m_Config.height = atoi(value);
		}

When you can simply change:

void CPythonSystem::SetDefaultConfig()
{
	[...]
	m_Config.width				= 1024;
	m_Config.height				= 768;
}

To:

	m_Config.width				= 800;
	m_Config.height				= 600;

 

Edited by VegaS™
  • Metin2 Dev 7
  • Love 5
  • Good 4
  • Think 1
  • Confused 2
Link to comment
Share on other sites

@VegaS™

		if (!stricmp(command, "WIDTH")) {
			if(atoi(value) < 800)
				m_Config.width = 800;
			else
				m_Config.width = atoi(value);
		}
		else if (!stricmp(command, "HEIGHT")) {
			if (atoi(value) < 600)
				m_Config.height = 600;
			else
				m_Config.height = atoi(value);
		}

This is a lock so that the client cannot run at a resolution lower than 800x600. (Lots of people run m2bob in 10x10 so it takes me resources)

 

Function void CPythonSystem::SetDefaultConfig() is responsible for creating the first config when starting the game for the first time. I believe that here should be set according to our preferences.

Edited by Alerin
Link to comment
Share on other sites

  • Moderator
1 hour ago, Alerin said:

Function void CPythonSystem::SetDefaultConfig() is responsible for creating the first config when starting the game for the first time.

  

The function SetDefaultConfig it's called everytime before LoadConfig when the singleton it's initialized.

Yes, first it will load the default values then will try to read the values from metin2.cfg, so if you put specific width/height in the default config everything it's fine for the first run.

 

1 hour ago, Alerin said:

This is a lock so that the client cannot run at a resolution lower than 800x600. (Lots of people run m2bob in 10x10 so it takes me resources)

 

Is impossible for a player to have a resolution lower than 800x600 if he set it from config.exe.

What you did is just for the people who editing metin2.cfg manually, like m2bob does, otherwise has no sense that check inside of the LoadConfig.

We should block the hacks, not doing workaround conditions for "consuming more resources by resolution if the hackers has the resolution < 800x600", just saying. 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Metin2 Dev Github
  • Activity

    1. 1

      Metin2 Privat Server selfmade

    2. 1

      Costumes

    3. 1

      Costumes

    4. 0

      game.core (Thank you in advance for your help.)

    5. 1

      [Help] Problem with the system I added

    6. 7

      Serversource build win32

    7. 1

      Extended blend system

    8. 7

      Serversource build win32

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.