Jump to content
×
×
  • Create New...
  • 0

Client Binary Source with code startup?


.Incredible™

Question

  • Answers 7
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

7 answers to this question

Recommended Posts

  • 0
On 21.11.2016 at 2:32 PM, arves100 said:

#define ENABLE_ARGUMENT_STARTUP //Enable or disable this if you want startup with a code

#define ENABLE_ARGUMENT_POPUP //Enable this if you want that a popup will be showed, disable it for silent exit

#define ARGUMENT_PATCHER_NAME "Name of the Pather to start"

#define ARGUMENT_STARTUP "Your code at startup like --startmyserver"

 

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{

#ifdef ENABLE_ARGUMENT_STARTUP
    if (strstr(lpCmdLine, ARGUMENT_STARTUP) == 0) {
#ifdef ENABLE_ARGUMENT_POPUP
        std::string msg = std::string("Execute: ") + std::string(ARGUMENT_PATCHER_NAME);
        MessageBoxA(NULL, msg.c_str(), APP_NAME, MB_OK);
#endif
#else
    if (strstr(lpCmdLine, ARGUMENT_STARTUP) != 0) {
#endif
        return 0;
    }

 

APP_NAME can be edited on UserInterface\Stdafx.h

Thanks, how to paste?
 

Link to comment
  • 0

How to make the Patcher for the Startup with a code?
       

private void StartGame()
        {

            this.AddTextToList("Das Spiel wird gestartet.\r\n");

            Process proc = new Process();
            proc.StartInfo.FileName = Config.BinaryName;
            proc.StartInfo.UseShellExecute = false;
            try
            {
                proc.Start();
            }
            catch
            {
                MessageBox.Show(String.Format("Die Datei {0} existiert nicht.", Config.BinaryName), "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
            }

config:

 

        public const string BinaryName = "metin2client.exe";

 

Link to comment
  • 0

I mean where i can add there the Code for Startup.. :l

Like:
 

#define ENABLE_ARGUMENT_STARTUP //Enable or disable this if you want startup with a code

#define ENABLE_ARGUMENT_POPUP //Enable this if you want that a popup will be showed, disable it for silent exit

#define ARGUMENT_PATCHER_NAME "Patcher.exe"

#define ARGUMENT_STARTUP "--denexistk1ngya3"

Now the Patcher need the "--denexistk1ngya"

Where i need to paste that?

Edit: Sorry i have understand it now. thank you very much!

 

Link to comment

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

Announcements

  • -15% Discount in Metin2 Dev Store (01/10/2021 => 31/12/2021) => Code => 15_PCT_OCT_TO_DEC_2021


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.