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

    • Sell ready interlude server files, with all popular features and tested, stable source + fully functional premium geodata for free.   Features include: Events: DM CTF TVT LM Dressme system Custom Buffer GM Shop Custom community board Donation manager  Auto Farm   Album: sell c6 — ImgBB   Test Server online: Patch link: https://drive.google.com/file/d/1mvEbv9XESsvfWwc638xFyyzyESeE2U95/view?usp=drive_link Auto acc create and auto admin   Price: 300$. Discord: l2retro
    • Faltan demasiados archivos,  y lógicas en clases claves como L2pcInstance, entre otras. si bien muchas cosas están y el flujo es valorable.  Gracias por tu esfuerzo es bastante... pero realmente no esta completo el código, falta que subas todas las modificaciones en clases colaterales... podrías intentar subir un diff de todo el mod  completo de tu pack y bueno ahí si que cada uno adapte... pero faltan muchas cosas, dudo que haya gente que lo haya echo funcionar con esto... 
    • I know people who have fully bypassed and reversed AAC. One day, they might even release the full source code, but for now, they’re still making money off it. I won’t name anyone, but it’s clear that there aren’t any truly solid anticheats for Lineage2. As I’ve said before, kernel level anticheats are the only real solution. Anything that runs as Internal and injects gets flagged, and your account ends up getting kicked or banned. That’s just how most games handle it nowadays. To TL;DR the whole thing cheating will always exist because there are people out there smart enough to bypass any protection and run private cheats. Public cheats are always detected eventually, so I don’t see any point in buying AAC, especially when they claim it blocks adr, which simply isn’t true.
    • 🌐 Website: https://l2adonis.com 📅 GRAND OPENING: July 18, 2025 – 20:00 (UTC+2) 💬 Discord: https://discord.com/invite/tZBj8JxAwx 🚫 No auto-farm • No auto-macro • No pay-to-win • No custom   Some Basic Info's (More detalied info's on website)  EXP/SP: x25  Adena: x15  Drop: x15  Spoil: x15  Seal Stones: x15  Raid Boss Drop: x10  Epic Boss Drop: x1  Manor: x10  Safe Enchant: +4  Max Enchant: +16  Normal Scroll Chance: 50%  Blessed Scroll Chance: 66% (If enchant fail item remain +4)  Buff Slots (30+4 extra with Divine Inspiration)  Dances/Songs Slots 14  Auto-learn skills  ⚔️ Real PvP • Real Progression • Retail-like experience JOIN NOW and relive the real L2 experience!
    • Discord         :  utchiha_market Telegram        : https://t.me/utchiha_market Auto Buy Store  : https://utchihamkt.mysellauth.com/ Not sure if we’re legit? Check Our server — real reviews, real buyers https://discord.gg/uthciha-servicess  | https://campsite.bio/utchihaamkt
  • 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