Jump to content

[Binario] Argumento


tierrilopes
 Share

Recommended Posts

Serve para que o binário apenas se abra caso seja fornecido um argumento fornecido pelo patcher.

 

No patcher (será usado o aqui fornecido como exemplo), abrir o ficheiro Functions.cs e procurar por:

 public static string[] Launcher =

Editar da seguinte maneira:

public static string[] Launcher = {
            "metin2client.exe",
            "--argumento"
        };

Onde

metin2client.exe = nome do executável a abrir e

--argumento o argumento a ser utilizado

 

No binário, abrir o ficheiro UserInterface/locale.cpp

Procurar por:

void LocaleService_LoadConfig (const char *fileName)
{

Adicionar debaixo:

if (strstr(GetCommandLineA(), "--argumento") == nullptr) {
		exit(0);
	}

 

 

P.S: Caso o nullptr vos dê erro ao compilar, substituíam-no por NULL

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...