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

    • More fluid combat, not 100% yet, but I think it's acceptable. I put the following logic in movetopawn, moveto, maybemovetopawn, validatelocation, movetolocation: If Config.GeoData is active, it applies the coordinates using geodata; if disabled, use setdistanceplansq to measure the distance of things! Fix for reflected damage (if the attacker is null, it will not be calculated). Minor improvements to the Day/Night item generation manager. Fix to not punish players who destroy items with a count = 0... Fix for when a player tried to use a resurrection scroll while seated, it disappeared without effect. Fix for when it was possible to equip armor while paralyzed. Cleanup of System message. Rework of PathNodes. Fixed the ia for mobs attack range when chasing the player (test) Fixed Pathnodes loading Added # ------------------------ #Show Red Name for Aggressive Mobs # ------------------------ ShowRedName = True Which was missing in the configs
    • ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ⚔️ L2JOmen High Five - SERVIDOR 100% RETAIL ⚔️ 📢 SOLICITAMOS APOYO PARA TESTING 📢 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ¡Saludos, comunidad de Lineage II! Estamos desarrollando un proyecto ambicioso y de calidad: L2JOmen High Five, un servidor  100% RETAIL que busca ofrecer la experiencia más auténtica de High Five.  Nos encontramos en la fase de desarrollo y testing, y necesitamos tu ayuda para hacerlo  grande. Si eres un amante del retail, disfrutas probar nuevas funciones y quieres formar  parte de un proyecto serio desde sus inicios, ¡tu apoyo es invaluable! ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🎮 CARACTERÍSTICAS PRINCIPALES 🎮 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✅ SERVIDOR 100% RETAIL    • Experiencia auténtica de High Five    • Geodata PTS Official    • Plataforma Premium 2025 ✅ SISTEMA DE RATES DINÁMICO (Progresión Retail x1 con ayuda x5 -> x1)    • XP: 1-20 (5.0x) | 21-40 (3.0x) | 41-60 (2.0x) | 61-75 (1.5x) | 76-85 (1.0x)    • SP: 1-20 (5.0x) | 21-40 (3.0x) | 41-60 (2.0x) | 61-75 (1.5x) | 76-85 (1.0x)    • Adena: x2.0 (Retail con pequeño ajuste)    • Drop y Spoil: x1.0 (Mobs, Raids y Epics) ✅ SISTEMA DE ENCANTAMIENTO PROFESIONAL    • Enchant Safe: +6 (100% seguro hasta +6)    • Enchant Máximo: +30    • Tasas de encantamiento balanceadas:      * 0-3: 100% | 4: 80% | 5: 75% | 6: 70% | 7: 65% | 8: 60%      * 9: 55% | 10: 50% | 11: 45% | 12: 40%      * 13: 10% | 14-25: 5-9% | 26-30: 1-4%    • Sistema Blessed Enchant habilitado ✅ INICIO DE PERSONAJE    • Dynasty Masterwork Set completo +12    • 1 Ticket para Weapon S +12    • Duración: 7 días ✅ CONFIGURACIÓN RETAIL    • Element Limit: Nivel 4    • Buffs: Duración de 1 hora    • Nobless: Obtenible mediante quest    • Subclass Máxima: 10 (Certificación para cada Subclass) ✅ SISTEMA DE FARM Y ECONOMÍA    • Múltiples monedas de farm (Adena, Ancient Adena, Coin of Luck, PC Bang Points, Farm Coins)    • Varias zonas de farm disponibles    • Zona de Party Farm (se habilita cada 3 horas por 1 hora)    • 4 Raids diarias programadas ✅ SISTEMA PC BANG POINTS    • Aproximadamente 10,000 puntos por 24 horas conectado    • Entrega cada 10 minutos    • Jugadores Normales: 60-72 puntos/intervalo    • Jugadores Premium: 96-116 puntos/intervalo    • 5% probabilidad de doble puntos ✅ SHOPS COMPLETOS    • Shop Normal (Adena y Farm Coins)    • Shop Donate (con opciones premium)    • Armaduras y Armas hasta Grado Dynasty, Moirai, S84    • Joyas completas, no incluye Epics    • Scrolls (Normales, Blessed, Divine, Ancient)    • Elementos hasta nivel 4-7    • Accesorios y consumibles ✅ SISTEMA VIP    • 5 niveles de VIP disponibles    • Bonificaciones progresivas de XP/SP/Drop    • Recompensas diarias exclusivas ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🤝 ¿QUÉ NECESITAMOS DE TI? 🤝 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔍 TESTERS ACTIVOS    • Jugadores que prueben todas las funciones del servidor    • Feedback constructivo sobre bugs, balance y mejoras    • Reporte de problemas encontrados 🎮 JUGADORES DEDICADOS    • Amantes del retail que valoren la experiencia auténtica    • Personas dispuestas a ayudar a mejorar el proyecto    • Comunidad comprometida con el crecimiento del servidor 📊 REPORTES DETALLADOS    • Bugs y errores encontrados    • Sugerencias de balance    • Opiniones sobre el gameplay    • Feedback sobre sistemas implementados ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 💎 ¿POR QUÉ UNIRTE A L2JOmen? 💎 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🌟 PROYECTO SERIO Y COMPROMETIDO    • Desarrollo constante y mejoras continuas    • Atención a la comunidad activa    • Transparencia en todas las decisiones 🎯 EXPERIENCIA 100% RETAIL    • Sin modificaciones que rompan el juego original    • Balance auténtico de High Five    • Gameplay puro y tradicional ⚡ TECNOLOGÍA DE VANGUARDIA    • Servidor optimizado y estable    • Geodata oficial de PTS    • Sistema robusto y sin lag    • Sistema Anticheat Premium 🎁 RECOMPENSAS PARA TESTERS    • Participación activa en el desarrollo    • Reconocimiento especial en el lanzamiento    • Beneficios exclusivos para early testers ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 📞 CONTACTO E INFORMACIÓN 📞 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Si estás interesado en formar parte de este proyecto y ayudarnos a crear el mejor  servidor retail de High Five, contáctanos. Tu apoyo es fundamental para hacer realidad  este grandioso proyecto. 💬 Únete a nuestro grupo de testing 🌐 WhatsApp: https://chat.whatsapp.com/Km6uRtFsoUq2tNZZalo5HB?mode=wwt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🏆 ¡Juntos construimos el mejor servidor retail! 🏆 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  
    • any server used these files? if yes let me know in pm.
    • L2Net is an in-game (IG) bot. I already have Adrenaline for that. I'm looking for an out-of-game (OOG) bot - one that doesn’t require the Lineage 2 client to run.
  • 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