Jump to content

Recommended Posts

Posted

This little code will shows the real diff range of async between server and client position. By default, this code was maked for aCis but can be use for any L2J forks.

 

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/network/clientpackets/MoveBackwardToLocation.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/MoveBackwardToLocation.java	(revision 1133)
+++ java/net/sf/l2j/gameserver/network/clientpackets/MoveBackwardToLocation.java	(working copy)
@@ -2,6 +2,8 @@
 
 import java.nio.BufferUnderflowException;
 
+import net.sf.l2j.commons.math.MathUtil;
+
 import net.sf.l2j.Config;
 import net.sf.l2j.gameserver.model.actor.ai.CtrlIntention;
 import net.sf.l2j.gameserver.model.actor.instance.Player;
@@ -95,6 +97,18 @@
 			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
 			return;
 		}
+		
+		// Check async range.
+		dx = _originX - activeChar.getX();
+		dy = _originY - activeChar.getY();
+		double dz1 = _originZ - activeChar.getZ();
+		float diff = (float) Math.sqrt(dx * dx + dy * dy + dz1 * dz1);
+		int heading = MathUtil.calculateHeadingFrom(_originX, _originY, activeChar.getX(), activeChar.getY());
+		if (Math.abs(activeChar.getHeading() - heading) > 16000)
+			diff = diff * -1;
+		
+		activeChar.sendMessage("Async distance: " + diff);
+		
 		activeChar.getAI().setIntention(CtrlIntention.MOVE_TO, new Location(_targetX, _targetY, _targetZ));
 	}
 }
\ No newline at end of file
Index: java/net/sf/l2j/gameserver/network/clientpackets/ValidatePosition.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/ValidatePosition.java	(revision 1133)
+++ java/net/sf/l2j/gameserver/network/clientpackets/ValidatePosition.java	(working copy)
@@ -1,5 +1,7 @@
 package net.sf.l2j.gameserver.network.clientpackets;
 
+import net.sf.l2j.commons.math.MathUtil;
+
 import net.sf.l2j.gameserver.model.actor.instance.Player;
 import net.sf.l2j.gameserver.model.zone.ZoneId;
 import net.sf.l2j.gameserver.network.serverpackets.GetOnVehicle;
@@ -88,5 +90,17 @@
 		player.setClientY(_y);
 		player.setClientZ(_z);
 		player.setClientHeading(_heading); // No real need to validate heading.
+		
+		// Check async range.
+		dx = _x - player.getX();
+		dy = _y - player.getY();
+		dz = _z - player.getZ();
+		float diff = (float) Math.sqrt(dx * dx + dy * dy + dz * dz);
+		
+		int heading = MathUtil.calculateHeadingFrom(_x, _y, player.getX(), player.getY());
+		if (Math.abs(player.getHeading() - heading) > 16000)
+			diff = diff * -1;
+		
+		player.sendMessage("[4] Async distance: " + diff);
 	}
 }
\ No newline at end of file

Have fun, so! :smile:

  • Like 2
Posted
  On 4/14/2019 at 7:26 AM, Pamela32 said:

I love shares like this one

Bcs give a more realistic gameplay

Expand  

 

?????????????? How a debug is doing that ?????????????? , maybe you mean that help you to fix things and looks more realistic gameplay.

Posted
  On 4/14/2019 at 2:08 PM, StinkyMadness said:

 

?????????????? How a debug is doing that ?????????????? , maybe you mean that help you to fix things and looks more realistic gameplay.

Expand  

 

Well .. yea .. as u can see ky English sucks anyway 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   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.



  • Posts

    • SocNet is looking for new suppliers! — Snapchat accounts  — Reddit accounts with karma  — LinkedIn accounts with real connections Message us or contact support — let’s discuss terms! We’re also open to other partnership opportunities. Our Online Store Offers: ➡ Accounts: Telegram, Facebook, Reddit, Twitter (X), Instagram, YouTube, TikTok, Discord, VK, LinkedIn, GitHub, Snapchat, Gmail, Emails (Outlook, Firstmail, Rambler, Onet, Gazeta, GMX, Yahoo, Proton, Web.de), Google Voice, Google Ads ➡ Premium Subscriptions: Telegram Premium, Twitter Premium X, YouTube Premium, Spotify Premium, Netflix Premium, Discord Nitro, ChatGPT Plus/PRO, XBOX Game Pass ➡ Additional Services: Telegram Stars, Proxies (IPv4, IPv6, ISP, Mobile), VPN (Outline, WireGuard, etc.), VDS/RDP Servers SMM Panel Services: ➡ Use our SMM Panel to boost Facebook, Instagram, Telegram, Spotify, Soundcloud, YouTube, Reddit, Threads, Kick, Discord, LinkedIn, Likee, VK, Twitch, Kwai, Reddit, website traffic, TikTok, TrustPilot, Apple Music, Tripadvisor, Snapchat, and more. Promo code for store discount: PARTNER8 (8% off) Get $1 trial balance for the SMM Panel: Submit a ticket titled “Get Trial Bonus” via our website (Support) ➡ Go to the SMM Panel (clickable) or contact us through the bot Our Key Products: ➡ Online Store: Click ➡ Telegram Shop Bot: Click ➡ SMM Panel: Click Payments accepted: Bank cards · Crypto · Other popular methods Returning buyers receive extra discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop You can also use these contacts to: — Discuss bulk orders — Form partnerships (Current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — your digital goods & subscription store
    • SocNet is looking for new suppliers! — Snapchat accounts  — Reddit accounts with karma  — LinkedIn accounts with real connections Message us or contact support — let’s discuss terms! We’re also open to other partnership opportunities. Our Online Store Offers: ➡ Accounts: Telegram, Facebook, Reddit, Twitter (X), Instagram, YouTube, TikTok, Discord, VK, LinkedIn, GitHub, Snapchat, Gmail, Emails (Outlook, Firstmail, Rambler, Onet, Gazeta, GMX, Yahoo, Proton, Web.de), Google Voice, Google Ads ➡ Premium Subscriptions: Telegram Premium, Twitter Premium X, YouTube Premium, Spotify Premium, Netflix Premium, Discord Nitro, ChatGPT Plus/PRO, XBOX Game Pass ➡ Additional Services: Telegram Stars, Proxies (IPv4, IPv6, ISP, Mobile), VPN (Outline, WireGuard, etc.), VDS/RDP Servers SMM Panel Services: ➡ Use our SMM Panel to boost Facebook, Instagram, Telegram, Spotify, Soundcloud, YouTube, Reddit, Threads, Kick, Discord, LinkedIn, Likee, VK, Twitch, Kwai, Reddit, website traffic, TikTok, TrustPilot, Apple Music, Tripadvisor, Snapchat, and more. Promo code for store discount: PARTNER8 (8% off) Get $1 trial balance for the SMM Panel: Submit a ticket titled “Get Trial Bonus” via our website (Support) ➡ Go to the SMM Panel (clickable) or contact us through the bot Our Key Products: ➡ Online Store: Click ➡ Telegram Shop Bot: Click ➡ SMM Panel: Click Payments accepted: Bank cards · Crypto · Other popular methods Returning buyers receive extra discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop You can also use these contacts to: — Discuss bulk orders — Form partnerships (Current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — your digital goods & subscription store
    • SocNet is looking for new suppliers! — Snapchat accounts  — Reddit accounts with karma  — LinkedIn accounts with real connections Message us or contact support — let’s discuss terms! We’re also open to other partnership opportunities. Our Online Store Offers: ➡ Accounts: Telegram, Facebook, Reddit, Twitter (X), Instagram, YouTube, TikTok, Discord, VK, LinkedIn, GitHub, Snapchat, Gmail, Emails (Outlook, Firstmail, Rambler, Onet, Gazeta, GMX, Yahoo, Proton, Web.de), Google Voice, Google Ads ➡ Premium Subscriptions: Telegram Premium, Twitter Premium X, YouTube Premium, Spotify Premium, Netflix Premium, Discord Nitro, ChatGPT Plus/PRO, XBOX Game Pass ➡ Additional Services: Telegram Stars, Proxies (IPv4, IPv6, ISP, Mobile), VPN (Outline, WireGuard, etc.), VDS/RDP Servers SMM Panel Services: ➡ Use our SMM Panel to boost Facebook, Instagram, Telegram, Spotify, Soundcloud, YouTube, Reddit, Threads, Kick, Discord, LinkedIn, Likee, VK, Twitch, Kwai, Reddit, website traffic, TikTok, TrustPilot, Apple Music, Tripadvisor, Snapchat, and more. Promo code for store discount: PARTNER8 (8% off) Get $1 trial balance for the SMM Panel: Submit a ticket titled “Get Trial Bonus” via our website (Support) ➡ Go to the SMM Panel (clickable) or contact us through the bot Our Key Products: ➡ Online Store: Click ➡ Telegram Shop Bot: Click ➡ SMM Panel: Click Payments accepted: Bank cards · Crypto · Other popular methods Returning buyers receive extra discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop You can also use these contacts to: — Discuss bulk orders — Form partnerships (Current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — your digital goods & subscription store
    • The links are down, why do you publish something that you're just going to delete later?
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock