Jump to content
  • 0

Map Server crashing when some monsters use some skills


Eris_

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  09/17/18
  • Last Seen:  

Hello everyone!

I'm running a server on my windows PC just to have fun editing and learning source code and customizing Ragnarok Online. Recently I changed some configurations in my server in order to let my friends connect to it using a simulated LAN connection/VPN. Before I made these changes I'm pretty sure I didn't have this problem, but I'm not sure. Perhaps I just didn't observe it before.

What is happening is this: some monsters (not all) crash the Map Server when they use some skills (again, not all skills) on me. For example: Beelzebub uses Land Protector and some other skills and no problem, but something else it does crashes the Map Server. The MVP Eremes can also use some skills just fine, but also has one that crashes the server. When I turn off monster skills in monster.conf no crashes happen, thus I believe my hypothesis is correct.

The configurations I changed so my friends can connect are the following: char_athena.conf, map_athena.conf, subnet_athena.conf (the fields login_ip, char_ip, map_ip and subnet) and the clientinfo inside the grf. I think I'll try reverting all these configurations to see if the crashes still happen, but ultimately I would want to actually fix it and keep the capability to let my friends play with me. Not related to this, but I also have made many source code modifications, but I don't think any of them are the cause.

I've seen people advising the use of GDB to see stacktrace and coredumps of the server crashes, but I don't think I can use it on windows. When the Map Server crashes all I see in game is a simple "Disconnected from Server". Here is a image of the Map Server when it happens:

Spoiler

Capture2.PNG.527870aa746d38bd25455693a4c6acfb.PNG

It simply says "Map-Server has shutdown succesfully." and "Memory manager initialised: log/map-server.exe.leaks" and then proceeds to restart. If the log/map-server.exe.leaks refer to a log file with what happened, I can't seem to find it. I've hidden the IPs in the screenshot because I absolutely don't understand anything about this matter and I'm not sure if I should or should not show it for security reasons or some other reason.

Finally, I've made the server using this guide. Wich means I'm using a fairly recent rAthena version and my exe is 20180530. I have yet to git pull because merging all my changes will be a pain, but I'll do it soon.

Thanks everyone for reading everything and trying to help! I'm grateful!

Edited by Cepphei
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  351
  • Reputation:   263
  • Joined:  09/08/13
  • Last Seen:  

28 minutes ago, Cepphei said:

I've seen people advising the use of GDB to see stacktrace and coredumps of the server crashes, but I don't think I can use it on windows.

http://herc.ws/wiki/MSVC_Crash_Debugging

28 minutes ago, Cepphei said:

I also have made many source code modifications, but I don't think any of them are the cause.

I'm pretty sure that the problem is in your modifications of "src".

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  09/17/18
  • Last Seen:  

Thanks for the link, ended up not using it this time but I'm sure it will come in handy in the future!


And you were right! I changed back all my ip configurations that I had done so my friends could connect to my server and that changed nothing, so I went looking for my source code modifications. I noticed buried amid all the lines of the map server console there was one pointing to some sort of problem in status.cpp. I had written some code that would increase player's base moving speed using their base level and agility as factors, apparently that was also affecting monsters. I think what was crashing the map server was when monsters exceeded the moving speed cap. For example map server crashed when Eremes MVP used Agility Up. Commenting the code solved the problem, and no more crashes happen.

So yeah, the problem existed for a while I only hadn't encountered it yet. The only strange thing is that the return statement of the status_calc_speed function is like this:

return (unsigned short)cap_value(speed, MIN_WALK_SPEED, MAX_WALK_SPEED);

So it already should check for cap and prevent any problems with that. Because of this I can't fully understand what was happening, and if you could clarify it I would be grateful. Nonetheless commenting my custom code fixed it.

Here is my code if you're curious:

Spoiler

//Increases move speeed according to agility
if (sd->status.agi > 100) {
	speed -= 10;
} else {
	speed -= (sd->status.agi / 10);
}

//Increases move speed according to base level
if (sd->status.base_level > 100) {
	speed -= 10;
} else { 
	speed -= (sd->status.base_level / 10);
}

Reading through the function again it appears I should have used speed_rate and not speed. I think I already know how to fix my code. Do you know how to make it so it only affects players tho?

Once again thanks for reading and helping!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  351
  • Reputation:   263
  • Joined:  09/08/13
  • Last Seen:  

14 hours ago, Cepphei said:

Do you know how to make it so it only affects players tho?

	if (sd != NULL) {
		//Increases move speed according to agility
		if (sd->status.agi > 100) {
			speed -= 10;
		} else {
			speed -= (sd->status.agi / 10);
		}

		//Increases move speed according to base level
		if (sd->status.base_level > 100) {
			speed -= 10;
		} else { 
			speed -= (sd->status.base_level / 10);
		}
	}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  09/17/18
  • Last Seen:  

Thanks yet again! Can I bother you a bit more and ask if you can explain what is happening there? No worries if you don't want to! ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  09/17/18
  • Last Seen:  

Yes, if you read my first answer you'll see what was my problem and how I "fixed" it. Furthermore Functor's last answer shows a simple correction to my code that properly fixes it.

I hope you find a solution for your issue.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...