Jump to content

Ikh

Banned
  • Posts

    40
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Posts posted by Ikh

  1. 4 hours ago, Vanilla said:

    Using the pkg system isn't as effective. It's faster but it's not better. You'd compile the ports on your machine. I for myself experienced a lot of trouble especially when installing compilers via pkg. Additionally you don't need everything, just like in devil. And you sure know that we use clang and some ports may or may not use it depending on the system you're using? We don't need to link to gcc-prebuilt packages...

    The difference is that you don't build these, but you also don't get to set options, and it's not guaranteed they will work with packages already on the system. That's why there are other commands like pkg upgrade.  There are some special cases like using -march and -mtune ..  Using march can cause problems , if you use march intro game core or db core and not using intro build ports can make a underfined behavior but that's not the case.

    The only reason to use ports inseated of package manager is build options.  The packages is a prebuild port, and don't have flags like mtune and march.    Most likely you did something wrong if you had issues, It happens. I use package since years and it works like a charm..

    ***Note***

    Since you use some modern coding standards consider using stdint.h stuffs also..  It is illegal to add functions in the namespace std , so consider removing that namspace.. xD   stl.h can be removed completly.

    ***Note***

    any_function.h can be replaced with std::function / stable_priority_queue.h can be replaced with  std::priority_queue / thecore_memcpy bulshit can be replaced with std::memcpy  / noncpypable.h is useless it can be deleted /  clean constructors or destructors can be replaced with default or delete.

    • Love 1
  2. 2 hours ago, Vanilla said:

    clang-devel should be installed just via ports. It should work in FreeBSD < 10.
    c++14 needs the newer clang version. If you're on one of the older compilers like gcc 4.2 it most likely won't work. Also you need devel/libc++ and devel/libcxxrt
    To build you then only need security/googletest, security/cryptopp, graphics/devil (only jpg needed, all else is not needed), devel/gmake, devel/makedepend and database/mariadb101-client (or any other mysql client for the lib). These are all the dependencies. I've gathered them together into a list. Note that every additional port should be compiled with clang instead of gcc! You cannot use gcc-compiled libs in a clang-project.

     

    First install:
    - lang/clang-devel (you don't need to use the devel-version of clang, you can just install one of the most recent versions)
    - devel/libc++
    - devel/libcxxrt
    - devel/gmake (should already be installed by one of the ports above)
    - devel/makedepend

    And then add the following to /etc/make.conf:
    CC = clang-devel
    CPP = clang-cpp-devel
    CXX = clang++-devel
    CFLAGS += -stdlib=libc++

    After that you can start installing the dependencies:
    - security/googletest
    - security/cryptopp
    - graphics/devil (note: Only jpg needed)
    - databases/mariadb101-client (no server needed, only the client. You can also use mysql if you wish to, we only need the client lib)

    If everything is installed, make sure you rebuild the Depend-File. For this you can just cd into the source directory and remove it. Then you can just execute the following command:
    gmake depend

    After that you'll have everything you need. You can build the sources.
    gmake debug|release|all
    Note that you can either choose to compile debug, release or all. You can also use install if you specified a path in your Makefile. This way the created binary will be pushed into a directory once it's finished.

    It really is not necessary for you to write so much.

    pkg install clang38
    pkg install googletest
    pkg install cryptopp
    pkg install devil
    pkg install mariadb100-client
    pkg install gmake

    All in one..

    pkg install clang38 googletest cryptopp devil mariadb101-client gmake

     I think the release version 3.8 of clang is enough

  3. Just now, tierrilopes said:

    Are you trolling yourself? Please.

    Before killall  

    c4b17958f537420cb42ca6243aaf2d5d.png

     

    After killall

    a1a55fbcb4c742be80737d2796cc0807.png

     

    That does not mean the program is closed directly.

    As you can see game is not closed because he need to close all of his threads and all runing stuffs.

    Destroy arenaManager

    Destroy ItemManager

    Destroy CClientManager

    When u see in syslog  

    this mean there is nothing shit when using KILLALL

     

    I try to explain you because you used " SHIT " word :)  Thank you

     

    • Love 1
  4. 1 minute ago, tierrilopes said:

    Thats why most of pservers are crap, with "solutions" like those.

    :facepalm: Really ?  Do you know what a .killscript is ?

    killall sends a signal to all processes running any of the specified commands. If no signal name is specified, SIGTERM is sent.
    

    KILL ALL don't kill the process directly / send the SIGTERM

     

    void signal_setup(void)
    {
    	signal_timer_enable(30);
    	signal(SIGVTALRM, checkpointing);
    	signal(SIGHUP, hupsig);
    	signal(SIGCHLD, reap);
    	signal(SIGINT, hupsig);
    	signal(SIGTERM, hupsig);
    	signal(SIGPIPE, SIG_IGN);
    	signal(SIGALRM, SIG_IGN);
    	signal(SIGUSR1, usrsig);
    }

     

    SIGTERM don't close you program imediatly. Just use killall game you will see in you syslog those lines

    	sys_log(0, "<shutdown> Shutting down CHARACTER_MANAGER...");
    	sys_log(0, "<shutdown> Shutting down ITEM_MANAGER...");
    
          etc and more

    this means you program is shutdown correct ;)

    KILLALL just send the signal , not close you program directly.

     

     

    Please watch you language. There are difference bettwen SEND SIGNAL and kill instant.

    • Love 1
  5. 11 minutes ago, Tasho said:

    First one you need to kill processes and after that to do reboot.

    For can make all very easy, just use command:

    
    cd /usr/home/game && sh close.sh && reboot

    Or you can make like this:

    • Create a file with name reboot.sh in ../usr/home/game/
    • Put this in him:
    
    #!/bin/sh
    #[i] If processes change their name, killall may not be able to match them correctly, so change "game" or "db" with your name, type "ps" or "top" for know.
    echo -e "Kill processes and reboot server ..."
    killall game && killall db && reboot

    e12452ee79844ec3b7057c591d53d835.png

    And when you want to make a reboot just type command: sh reboot.sh

     

    You also need to wait 5-10 seconds sometimes

    #!/bin/sh
    #[i] If processes change their name, killall may not be able to match them correctly, so change "game" or "db" with your name, type "ps" or "top" for know.
    echo -e "Kill processes and reboot server ..."
    killall game db && sleep 10 && reboot

    You can also move reboot.sh intro /usr/local/sbin and name it simply  r in this way you not need always to cd /path/to_reboot.sh

    you can write simply  r and enter .. etc

     

     

    43 minutes ago, DarkFire said:

    Hi , devs . After reboot , on my server the time is going back. How to repair this?

     

    • Love 1
  6. 5 minutes ago, Cr5x said:

    Thank you. I just want to make a function do detect if a program is running. Just a test.

    So yes, it must run forever.. other solutions?

    The function "TestFunc" is just a test to see how to loop without freezing the game.

    Is this what you need ?

    http://stackoverflow.com/questions/13179410/check-whether-one-specific-process-is-running-on-windows-with-c

    You not need a loop for that. Just search on google :)

  7. 56 minutes ago, Cr5x said:
    
    #include <Windows.h>
    #include <iostream>
    #include <thread>
    #include <fstream>
    
    
    void TestFunc(){
    	while (1){
    		ofstream myfile;
    		myfile.open("example.txt");
    		myfile << "Just a test";
    		myfile.close();
    	}
    }
      

    And the call in the mainfunc:

     

    
    std::thread t1(TestFunc);
    t1.join();

     

    The function works, but the game doesnt appear..

     

    The thread destructor will terminate your program if the object is destroyed while the thread is still running.  Do you know what is a thread ?

    Is not better to create a class for  TestFunc and after you call? Or you can even make function inline.  while(1) in above example these statements will be executed forever... and will never stops. You are sure about that? You may use an "if condition" and inside it a break statement to terminate loop in some specific situation.

     

    I do not really understand what you want to do. :) 

    inline
    void TestFunc() {
    	std::ofstream ofs("example.txt", std::ofstream::out);
    	ofs << "Just a test";
    	ofs.close();
    }
    
    int main() {
    
    	for (;;)
    	{
    		TestFunc();
    	}
    }

     

  8. 8 minutes ago, Cr5x said:

    Hello,

    i have the client source and i try to make a function which should be called in a loop.

    I tried threading, but it doesn´t work. If i use while and threads, the game doesn´t appear, but the function gets called in a loop.

    Does somebody know how to call a function in a loop from UserInterface without freezing the game?

    Thank you :)

     

     

    Please provide test code

  9. 31 minutes ago, metin2-factory said:

    @tierrilopes Atleast if you give an answer, give a proper one. 

    Anyway, open input_login.cpp, look for :

      Reveal hidden contents
    
    
    else
    	{
    		if (CWarMapManager::instance().IsWarMap(ch->GetMapIndex()) ||
    				marriage::WeddingManager::instance().IsWeddingMap(ch->GetMapIndex()))
    		{
    			if (!test_server)
    				ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
    		}
    	}
    

    add below:

      Reveal hidden contents
    
    
    if (ch->GetMapIndex() == 110)
    	{
    		if (ch->IsRiding())
    		{
    			ch->StopRiding();
    		}
    	}
    

     

    If you want to get a good answer, then you have to ask a good question.

    And learn the difference between  : I want help - works for me - create functins for me

  10. 17 minutes ago, iFreakTime~.~ said:

    Hi all. I have a problem with Stones. I put three stones on a weapon, good, I equip weapon, good here.

    But, I use the removal stone scroll, stone disappear and bonus is still here. Now, I need a restriction to remove stones when armor/weapon is equipped.

    Search char_item.cpp

    case USE_DETACHMENT:
    {
    	LPITEM item2;

    Under you will find

    if(item2->IsExchanging())
    {
    	return false;
    }

    Add under

    if(item2->IsEquipped())
    {
    	return false;
    }

     

    • Love 1
  11. 3 hours ago, R3ktMeight said:

    Hello, so i want, when i create a character in metin2 to be allowed to use special characters like "_" and ".". Can i do this from client or binnary source ? If yes, how ?

    Input_auth.cpp  delete

    	if(!FN_IS_VALID_LOGIN_STRING(login))
    	{
    		sys_log(0, "InputAuth::Login : IS_NOT_VALID_LOGIN_STRING(%s) desc %p", login, boost::get_pointer(d));
    		LoginFailure(d, "NOID");
    		return;
    	}

     

    • Love 1
  12. 12 minutes ago, Kena said:

    Not working, i can't write on shout. I want to delete the button ' PM ' and when i click the someone name on shout, will open PM

    Oh , sorry. Then just replace this line

    		self.__SendChatPacket('|cFF00FF00|HChitra:'+str(player.GetName())+'|h[PM]|h|r: ' + text[1:], chat.CHAT_TYPE_SHOUT)

    with this 

    		self.__SendChatPacket('|cFF00FF00|HChitra:'+str(player.GetName())+ text[1:], chat.CHAT_TYPE_SHOUT)

     

  13. 5 minutes ago, Kena said:

    Sorry, my mistake. :rolleyes:

    This is the hidden content, please

    uiChat.py

    Search 

    Spoiler
    
    	def __SendShoutChatPacket(self, text):
    
    		if 1 == len(text):
    			self.RunCloseEvent()
    			return
    
    		if app.GetTime() < self.lastShoutTime + 15:
    			chat.AppendChat(chat.CHAT_TYPE_INFO, localeinfo.CHAT_SHOUT_LIMIT)
    			self.__ResetChat()
    			return
    
    		a = net.GetServerInfo()
    		Chitra = a[-3:]
    
    		self.__SendChatPacket('|cFF00FF00|HChitra:'+str(player.GetName())+'|h[PM]|h|r: ' + text[1:], chat.CHAT_TYPE_SHOUT)
    
    		self.__ResetChat()
         
    		self.lastShoutTime = app.GetTime()

     

    Replace

    Spoiler
    
    	def __SendShoutChatPacket(self, text):
    		if 1==len(text):
    			self.RunCloseEvent()
    			return
    
    		if app.GetTime() < self.lastShoutTime + 15:
    			chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHAT_SHOUT_LIMIT)
    			self.ResetChat()
    			return
    
    		self.SendChatPacket(text[1:], chat.CHAT_TYPE_SHOUT)
    		self.ResetChat()
    
    		self.lastShoutTime=app.GetTime()

     

     

    • Metin2 Dev 1
    • Love 1
×
×
  • 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.