Jump to content

[TuT] c++17 client side


Recommended Posts

  • Silver

How to Update Client src c++17

 

 

Step 1:

 

First, we open the client source with visual studio 2019/2022.

 

Select all projects and right click on them -> properties -> General -> c++ language standard -> Here we choose c++17.

 

https://metin2.download/picture/hT48lN0hPs6zA9z2IQkOY0gQV2Ady3ip/.gif

 

 

 

Step 2:

 

In each file (ctrl + shift +f) , we search for the following & delete them:

 

using namespace std;

Step 3:

 

Now the following details need to be modified (every file):

 

string

pair

make_pair

vector

 

 to

std::string

std::pair

std::make_pair

std::vector

 

Step 4:

 

Open Eterbase project stl.h file and delete this code:

namespace std

{

    template <class _Ty>

    class void_mem_fun_t

        : public unary_function<_Ty *, void> {

    public:

        explicit void_mem_fun_t(void (_Ty::*_Pm)())

            : _Ptr(_Pm) {}

        void operator()(_Ty *_P) const

        {((_P->*_Ptr)()); }

    private:

        void (_Ty::*_Ptr)();

        };

    template<class _Ty> inline

    void_mem_fun_t<_Ty> void_mem_fun(void (_Ty::*_Pm)())

    { return (void_mem_fun_t<_Ty>(_Pm)); }



    template<class _Ty>

    class void_mem_fun_ref_t : public unary_function<_Ty, void> {

    public:

        explicit void_mem_fun_ref_t(void (_Ty::*_Pm)())

            : _Ptr(_Pm) {}

        void operator()(_Ty& _X) const

        { return ((_X.*_Ptr)()); }

    private:

        void (_Ty::*_Ptr)();

    };



    template<class _Ty> inline

    void_mem_fun_ref_t<_Ty> void_mem_fun_ref(void (_Ty::*_Pm)())

    { return (void_mem_fun_ref_t< _Ty>(_Pm)); }





        // TEMPLATE CLASS mem_fun1_t

template<class _R, class _Ty, class _A>

    class void_mem_fun1_t : public binary_function<_Ty *, _A, _R> {

public:

    explicit void_mem_fun1_t(_R (_Ty::*_Pm)(_A))

        : _Ptr(_Pm) {}

    _R operator()(_Ty *_P, _A _Arg) const

        { return ((_P->*_Ptr)(_Arg)); }

private:

    _R (_Ty::*_Ptr)(_A);

    };

        // TEMPLATE FUNCTION mem_fun1

template<class _R, class _Ty, class _A> inline

    void_mem_fun1_t<_R, _Ty, _A> void_mem_fun1(_R (_Ty::*_Pm)(_A))

    { return (void_mem_fun1_t<_R, _Ty, _A>(_Pm)); }





}

 

Step 5:

 

In each file (ctrl + shift +f) , we search for the following & modify them:

 

std::void_mem_fun

 

to

 

std::mem_fn

 

this

 

std::auto_ptr

 to:

 

std::unique_ptr

 

Step 6:

 

Open userinterface/userinterface.cpp

 

Search this:

extern "C" {

extern int _fltused;

volatile int _AVOID_FLOATING_POINT_LIBRARY_BUG = _fltused;

}; 

 

add under this:

 extern "C" { FILE __iob_func[3] = { *stdin,*stdout,*stderr }; } 

 

Step 7:

 

Open Speherelib/spherepack.h

 

modify this:

inline void LostChild(SpherePack *pack);

 

to:

 

void LostChild(SpherePack *pack);

 

Step 8:

 

 

open etherBase/cipher.h

 

search this:

#include <cryptopp/cryptlib.h>

#pragma warning(pop)

 

add under this:

 

using CryptoPP::byte;

 

 

Step 9

 

Open etherpack/Eterpack.h

#include <boost/unordered_map.hpp>

#include <boost/shared_array.hpp>

 

modify to:

 

#include <unordered_map>

 

Replace all file this:

 

boost::

 

to:

 

std::

 

Open etherpack/EterpackManager.h & EterPackPolicy_CSHybridCrypt.h

 

modify this:

 

#include <boost/unordered_map.hpp>

 

to

 

#include <unordered_map>

 

 

Open GameLib/Area.cpp

 

remove this:

 

#include <boost/algorithm/string.hpp>

 

and this:

 

boost::algorithm::to_lower(attrFileName);

 

modify to:

 

std::transform(attrFileName.begin(), attrFileName.end(), attrFileName.begin(), [](unsigned char c) { return std::tolower(c); });

 

You can also delete the boost in the include folder.

If you don't understand something, you can ask your questions here.

thanks for @ Mali and @xXIntelXx some detail.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 2
  • Good 7
  • Love 1
  • Love 8
Link to comment
Share on other sites

  • 4 weeks later...
  • 9 months later...
On 10/30/2021 at 5:24 PM, centarus said:

There was no problem while building, but it gave an error like this when entering the game

LOG

FATAL ERROR!! Python Library file not exist!

1 Year later but if someone have the same Problem look at Userinterface.cpp static const char * sc_apszPythonLibraryFilenames[] = maybe you has make the same mistake like me and just change everything via strg shift f and     "string.pyc", is changed to std::string.pyc took me sometime to find that and modify it back 😄 

  • Good 2
Link to comment
Share on other sites

  • 10 months later...

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.