Jump to content
  • 0

Client <---> Server Synchronization!


Question

Posted

Hello my friends again...

so i enabled the DEBUG configs today and i saw that the client position and server position are not the same and in some cases an error was appearing..!

so how can i make the server and client to have the same char position?!

Recommended Posts

  • 0
Posted

ur talking about the validatePosition packet...

 

First of all its sooooo hard coded, you wont ever make a worty modification in it...

Secondly the only solution to this is geodata, but imo, the serverXYZ != clientXYZ or serverIntention != clientIntention isnt even close to a problem

  • 0
Posted

ur talking about the validatePosition packet...

 

First of all its sooooo hard coded, you wont ever make a worty modification in it...

Secondly the only solution to this is geodata, but imo, the serverXYZ != clientXYZ or serverIntention != clientIntention isnt even close to a problem

can you explain it better? :P

i have geodata and pathnodes and the Geodata config is setted to 2

  • 0
Posted

can you explain it better? :P

i have geodata and pathnodes and the Geodata config is setted to 2

What he says is that the client reads the l2 world differently from the server, if i am not mistaken.

  • 0
Posted

What he says is that the client reads the l2 world differently from the server, if i am not mistaken.

so the only solution to synchronize these things is just a good geodata?

  • 0
Posted

can you explain it better? :P

i have geodata and pathnodes and the Geodata config is setted to 2

 

You could try to leach ValidatePostion.java packets from other packs, cause formulas differ among projects

  • 0
Posted

You could try to leach ValidatePostion.java packets from other packs, cause formulas differ among projects

hmmm... i will search tomorrow and i will reply the results!

  • 0
Posted (edited)

so... i've made some changes...

		if (activeChar.isInBoat())
		{
			if (Config.COORD_SYNCHRONIZE == 2)
			{
				dx = _x - activeChar.getInVehiclePosition().getX();
				dy = _y - activeChar.getInVehiclePosition().getY();
-				// dz = _z - activeChar.getInVehiclePosition().getZ();
+				dz = _z - activeChar.getInVehiclePosition().getZ();
-				diffSq = ((dx * dx) + (dy * dy));
+				diffSq = ((dx * dx) + (dy * dy) + (dz * dz));
				if (diffSq > 250000)
				{
					sendPacket(new GetOnVehicle(activeChar.getObjectId(), _data, activeChar.getInVehiclePosition()));
				}
			}
			return;
		}

and i've added this option:

			if (Config.COORD_SYNCHRONIZE == 3)
			{
				activeChar.setXYZ(_x, _y, _z);
				return;
			}

i saw that on Config.COORD_SYNCHRONIZE == -1 it's saying only the Z coord will synch with the server... by using the code activeChar.setXYZ(realX, realY, _z);

so if this code is synchronizing only Z... what will happened if i will make it like the code above?!

 

Edit: i tried and something else..

-				if (((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
+				if (((Math.abs(dx) > 200) && (Math.abs(dx) < 1500) && (Math.abs(_x - activeChar.getClientX()) < 800)) && ((Math.abs(dy) > 200) && (Math.abs(dy) < 1500) && (Math.abs(_y - activeChar.getClientY()) < 800)) && ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800)))
				{
-					activeChar.setXYZ(realX, realY, _z);
+					activeChar.setXYZ(_x, _y, _z);
+					realX = _x;
+					realY = _y;
					realZ = _z;
				}

i tested it and i can said that the cords have a better synch than before but not actually the same at all times..!

so these are the coords

 

client pos: 83245 148623 -3405 head 32916
server pos: 83241 148623 -3408 head 32907
 
please can you explain me what exactly is the "heading"? cause in some cases is the same from server with client and in other cases is far different than client..!
 
edit 2: i think is far better the last way i do..
before doing this i was have dual box with admin and a normal char and the char was looking to different way on both clients..!
and now with this the players have fully synchronization on each client!!
Edited by xXObanXx
  • 0
Posted (edited)

Which is the point of trying to synch this thing?

first before changing the last code i placed above the player was looking to giran temple for example and the other player was looking the player to see from the other side..!

 

second and important thing that i THINK will get fixed is on attack... what i mean?

a player is hitting a mob.. and start running... the mob is hunting him.. then an other player is hunting the mob.. the melee attack range is 40 but the player after every attack starting and hitting from far distance more than 40 range..! cause of server and client are not synchronized on this side! ;)

and third may be some bugs by stucking on walls etc. i think this will fix the second and the third thing (first tested and working as it should be) ;)

 

Edit: the second thing tested and working well as it supposed to do!!) :D

Edited by xXObanXx
  • 0
Posted (edited)

You just need a proper geodata to solve that problems...

edit. the heading is the rotation of your char, if I'm not wrong.

Edited by ^Wyatt
  • 0
Posted

You just need a proper geodata to solve that problems...

edit. the heading is the rotation of your char, if I'm not wrong.

i have geodata and pathnodes 1 month now... and never disappointed.. i think my geodata is good... (i know is not the best.. but is good enough for now)

and as i've seen... the problem solved with this:

-				if (((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
+				if (((Math.abs(dx) > 200) && (Math.abs(dx) < 1500) && (Math.abs(_x - activeChar.getClientX()) < 800)) && ((Math.abs(dy) > 200) && (Math.abs(dy) < 1500) && (Math.abs(_y - activeChar.getClientY()) < 800)) && ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800)))
				{
-					activeChar.setXYZ(realX, realY, _z);
+					activeChar.setXYZ(_x, _y, _z);
+					realX = _x;
+					realY = _y;
					realZ = _z;
				}

so i think is not geodata's side but development's side..! ;)

  • 0
Posted (edited)

I think it can be java side if you have not geodata, but with geodata enabled it could be solved through it. But I'm not sure, never played with these things  :poker face:

Edited by ^Wyatt
  • 0
Posted (edited)

I think it can be java side if you have not geodata, but with geodata enabled it could be solved through it. But I'm not sure, never played with these things  :poker face:

actually the code that i modified is for geodata.. ;)

if ((Config.GEODATA > 0) && ((diffSq > 250000) || (Math.abs(dz) > 200)))
			{
				// if ((_z - activeChar.getClientZ()) < 200 && Math.abs(activeChar.getLastServerPosition().getZ()-realZ) > 70)
				
				if (((Math.abs(dx) > 200) && (Math.abs(dx) < 1500) && (Math.abs(_x - activeChar.getClientX()) < 800)) && ((Math.abs(dy) > 200) && (Math.abs(dy) < 1500) && (Math.abs(_y - activeChar.getClientY()) < 800)) && ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800)))
				{
					activeChar.setXYZ(_x, _y, _z);
					realX = _x;
					realY = _y;
					realZ = _z;
				}
				else
				{
					if (Config.DEVELOPER)
					{
						_log.info(activeChar.getName() + ": Synchronizing position Server --> Client");
					}
					
					activeChar.sendPacket(new ValidateLocation(activeChar));
				}
			}

I think the problem solved! what do you think? :)

Edited by xXObanXx
  • 0
Posted

actually the code that i modified is for geodata.. ;)

if ((Config.GEODATA > 0) && ((diffSq > 250000) || (Math.abs(dz) > 200)))
			{
				// if ((_z - activeChar.getClientZ()) < 200 && Math.abs(activeChar.getLastServerPosition().getZ()-realZ) > 70)
				
				if (((Math.abs(dx) > 200) && (Math.abs(dx) < 1500) && (Math.abs(_x - activeChar.getClientX()) < 800)) && ((Math.abs(dy) > 200) && (Math.abs(dy) < 1500) && (Math.abs(_y - activeChar.getClientY()) < 800)) && ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800)))
				{
					activeChar.setXYZ(_x, _y, _z);
					realX = _x;
					realY = _y;
					realZ = _z;
				}
				else
				{
					if (Config.DEVELOPER)
					{
						_log.info(activeChar.getName() + ": Synchronizing position Server --> Client");
					}
					
					activeChar.sendPacket(new ValidateLocation(activeChar));
				}
			}

I think the problem solved! what do you think? :)

 

No, revert anything you did. Bad client xyz is a rare phenomena, you will make the things worse... You can't fix it with simple changes, you think that L2J developers let it that way because the where nubs?

Guest
This topic is now closed to further replies.


  • Posts

    • ## [1.4.0] - 2026-01-28   ### ✨ New Features - **Vote System**: Lineage 2 servers can now use our vote–reward system. Players vote on the website and claim rewards in-game (1 vote = 1 claim) - **Vote Page**: On each server’s page (`/servers/<server>`), a **“Vote for Server”** button opens a dedicated vote page with cooldown info and optional Turnstile verification - **By Votes View**: The **“By Votes”** tab on the main page shows **actual vote counts** per server - **API Documentation**: New **API Docs** page at `/docs` (and footer link) with HMAC auth, endpoints, and examples for game server integration - **Vote API (My Servers)**: Server owners can open **“Vote API”** in My Servers to manage credentials, cooldown, allowed IPs, and open the docs   ### 🔄 Improvements - **Server Pages**: Single-server data is cached and loads faster; server pages can be opened by ID or by name (e.g. `/servers/my-server-name`) - **API Root**: Visiting the API root redirects to the docs URL configured in admin (default: site docs page) - **Admin Panel**: New **“Vote System”** tab for global settings (Turnstile, API security, default cooldown, docs URL)   ### 🔐 Security & Reliability - Turnstile (CAPTCHA) support for vote submissions to reduce abuse - HMAC-protected game server API for secure vote check/claim and stats
    • "I recently purchased the account panel from this developer and wanted to leave a positive review.   The transaction was smooth, and the developer demonstrated exceptional professionalism throughout the process.   What truly sets them apart is their outstanding post-sale support. They are responsive, patient, and genuinely helpful when addressing questions or issues. It's clear they care about their customers' experience beyond just the initial sale.   I am thoroughly satisfied and grateful for the service. This is a trustworthy seller who provides real value through both a quality product and reliable support. 100% recommended."
    • Server owners, Top.MaxCheaters.com is now live and accepting Lineage 2 server listings. There is no voting, no rankings manipulation, and no paid advantages. Visibility is clean and equal, and early listings naturally appear at the top while the platform grows. If your server is active, it should already be listed. Submit here https://Top.MaxCheaters.com This platform is part of the MaxCheaters.com network and is being built as a long-term reference point for the Lineage 2 community. — MaxCheaters.com Team
    • ⚙️ General Changed “No Carrier” title to “Disconnected” to avoid confusion after abnormal DC. On-screen Clan War kill notifications will no longer appear during Sieges, Epics, or Events. Bladedancer or SwordSinger classes can now log in even when Max Clients (2) is reached, you cannot have both at the same time. The max is 3 clients. Duels will now be aborted if a monster aggros players during a duel (retail-like behavior). Players can no longer send party requests to blocked players (retail-like). Fixed Researcher Euclie NPC dialogue HTML error. Changed Clan leave/kick penalty from 12 hours to 3 hours. 🧙 Skills Adjusted Decrease Atk. Spd. & Decrease Speed land rates in Varka & FoG. Fixed augmented weapons not getting cooldown when entering Olympiad. 🎉 Events New Team vs Team map added. New Save the King map added (old TvT map). Mounts disabled during Events. Letter Collector Event enabled Monsters drop letters until Feb. 13th Louie the Cat in Giran until Feb. 16th Inventory slots +10 during event period 📜 Quests Fixed “Possessor of a Precious Soul Part 1” rare stuck issue when exceeding max quest items. Fixed Seven Signs applying Strife buff/debuff every Monday until restart. 🏆 Milestones New milestone: “Defeat 700 Monsters in Varka” 🎁 Rewards: 200 Varka’s Mane + Daily Coin 🌍 NEW EXP Bonus Zones Hot Springs added Varka Silenos added (hidden spots excluded) As always, thank you for your support! L2Elixir keeps evolving, improving, and growing every day 💙   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and 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..