Jump to content

Client Binary Source with code startup?


Recommended Posts

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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
Share on other sites

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
Share on other sites

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
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.