Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Nostale
You last visited: Today at 16:13

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[ON] Packet ptctl [Crash Fix]

Discussion on [ON] Packet ptctl [Crash Fix] within the Nostale forum part of the MMORPGs category.

Reply
 
Old   #1

 
Shıgeo's Avatar
 
elite*gold: 61
Join Date: Apr 2011
Posts: 172
Received Thanks: 125
[ON] Packet ptctl [Crash Fix]

Change:
Code:
public void PetMove(PtCtlPacket ptCtlPacket) {
	string[] packetsplit = ptCtlPacket.PacketEnd.Split(' ');
	for (int i = 0; i < ptCtlPacket.Amount * 3; i += 3) {
		if (packetsplit.Length >= ptCtlPacket.Amount * 3 && int.TryParse(packetsplit[i], out int petId) && short.TryParse(packetsplit[i + 1], out short positionX) && short.TryParse(packetsplit[i + 2], out short positionY))
		{
			Mate mate = Session.Character?.Mates.Find(s => s.MateTransportId == petId);
			if (mate != null) {
				mate.PositionX = positionX;
				mate.PositionY = positionY;
				Session.CurrentMapInstance?.Broadcast(StaticPacketHelper.Move(UserType.Npc, petId, positionX, positionY, mate.Monster.Speed));
			}
		}
	}
}
to
Code:
public void PetMove(PtCtlPacket ptCtlPacket) {
	if(ptCtlPacket.PacketEnd != null) {
		string[] packetsplit = ptCtlPacket.PacketEnd.Split(' ');
		for (int i = 0; i < ptCtlPacket.Amount * 3; i += 3) {
			if (packetsplit.Length >= ptCtlPacket.Amount * 3 && int.TryParse(packetsplit[i], out int petId) && short.TryParse(packetsplit[i + 1], out short positionX) && short.TryParse(packetsplit[i + 2], out short positionY))
			{
				Mate mate = Session.Character?.Mates.Find(s => s.MateTransportId == petId);
				if (mate != null) {
					mate.PositionX = positionX;
					mate.PositionY = positionY;
					Session.CurrentMapInstance?.Broadcast(StaticPacketHelper.Move(UserType.Npc, petId, positionX, positionY, mate.Monster.Speed));
				}
			}
		}
	}
}
also add 'if' in 'PetMove' function

Hf ^^


Maybe it works if u put an '?' to 'string[] packetsplit = ptCtlPacket.PacketEnd.Split(' ');'
Also 'string[] packetsplit = ptCtlPacket.PacketEnd?.Split(' ');'
But I'm not sure.

Edit: Löschen bitte hab nen neuen offen wo ich die dinger mit der Zeit sammel ^^
Shıgeo is offline  
Thanks
2 Users
Old 03/17/2018, 20:01   #2


 
elite*gold: 260
Join Date: Aug 2009
Posts: 161
Received Thanks: 245
Thanx a lot mate.
I hope we can work more often together!

Edit: @ Thanx to you too for the help!
LikeAGinger is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[04.09.13] GigaByte v2.6 [FIX, FIX, FIX, FIX AND FIX]
09/11/2013 - WarRock Hacks, Bots, Cheats & Exploits - 79 Replies
http://www.elitepvpers.com/forum/warrock-hacks-bot s-cheats-exploits/2843300-11-09-gigabyte-public-v2 -7-a.html
Crash Crash Crash
07/27/2010 - SRO Private Server - 3 Replies
When i try to log in with bot, after i log in, instant CRASH. It is because of the traffic on ZSZC ? What should i do ?
Crash. Crash. Crash. Help?
10/30/2009 - Dekaron - 10 Replies
Okay EPVPr's, I have a question for you. Is anyone else having the 2moons/dekaron client crash on them as much as it is for me? I'll explain my full situation unlike alot of people on here(I'm sure most of you guy's know what i'm referring to :p) Situation: I start 2Moons, login. Usually on char select i'll open CE 5.5 from my "Up To Date" .CT file. Other times it will be "in map" depends on the situation as you all know. With as little as only one script activated(or even all) which most...



All times are GMT +1. The time now is 16:15.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.