Jump to content

Welcome to M2Tec

The global development community for Metin2

Knowledge is Freedom

Feel free to share your ideas, your knowledge in our community, your community.

Follow the Rules

Respect the rules of the community, the users and their administrative team. Let's be friends!
M2Tec - Community Maintenance Read more... √ó
Heathcliff‚ĄĘ

guide [Mini Tut] Server loads regen only once after start

Recommended Posts

Posted (edited)

Hello! ūüôā

 

In the last days I needed that my server loads some mobs only once at server start. I found a function that only quests use (called: "regen_load_in_file") and it's similar what I need. I think it will be useful for some of you, so I decided to share it.

 

In common/service.h - Add:

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

 

In game/src/sectree_manager.cpp - Search:

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

Add under:

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

 

In game/src/regen.cpp - Search:

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

 

Add under:

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

 

 

If you done it, you can create regen_once.txt with some mobs, and place it to your map folder next to regen.txt.¬†If you don't place it in every map folder, you will get some syserr that says he can't find regen_once.txt.¬†It won't cause any problem, just making your syserr bigger. ūüėĄ

 

Best regards, and sorry for my english!

Edited by Heathcliff‚ĄĘ
  • Like 15
  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, Heathcliff‚ĄĘ said:

Hello! ūüôā

 

In the last days I needed that my server loads some mobs only once at server start. I found a function that only quests use (called: "regen_load_in_file") and it's similar what I need. I think it will be useful for some of you, so I decided to share it.

 

In common/service.h - Add:

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

 

In game/src/sectree_manager.cpp - Search:

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

Add under:

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

 

In game/src/regen.cpp - Search:

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

 

Add under:

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

 

 

If you done it, you can create regen_once.txt with some mobs, and place it to your map folder next to regen.txt.¬†If you don't place it in every map folder, you will get some syserr that says he can't find regen_once.txt.¬†It won't cause any problem, just making your syserr bigger. ūüėĄ

 

Best regards, and sorry for my english!

Why you don't check if file exists then load, when not then return and don't spamm my syserr 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)
1 hour ago, .Kori said:

Why you don't check if file exists then load, when not then return and don't spamm my syserr 

It has already a check inside regen_load_in_file function. If you want, you can comment or delete syserr's line:

Hidden Content

    Give reaction or reply to this topic to see the hidden content.

I don't want to delete, because I use this in every map and it can notice me if my quest didn't find my regen file ūüėĄ

Edited by Heathcliff‚ĄĘ
  • Like 2

Share this post


Link to post
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

√ó