Jump to content
  • 0

Client <---> Server Synchronization!


xXObanXx

Question

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?!

Link to comment
Share on other sites

Recommended Posts

  • 0

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

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

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?

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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..! ;)

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hood-services https://campsite.bio/utchihaamkt  
    • Server Rates: » Xp 500x. » Sp 500x. » Aden 500x. » Drop 1x. » PartyXp 2x. » PartySp 2x. » Starting character level -61. Enchant rates: » Safe enchant +4. » Blessed and simple scrolls max enchant (+16). » Crystal scrolls max enchant (+20). » Simple enchant scrolls chance – 65%. » Blessed enchant scrolls chance – 100%. » Crystal enchant scrolls chance – 50% Augmentations: » Mid life stone skill chance – 5%. » High life stone skill chance – 10%. » Top life stone skill chance – 20%. » Augments 1+1 Unique features: » Main town – Giran » Automatic-Manual Potions. » Working 2 castle sieges. (Giran-Aden) » SPS cancel lasts 10 seconds and than buffs come back. » Stackable scrolls, lifestones, book of giants. » Unique pvp zone » More then 11 active raid bosses. » Wedding system. » Unique farming areas. » Npc skill enchanter. » Full npc buffer with auto buff. » Max count of buffs – 55. » Max subclasses – 4. » Free and no quest class change. » Free and no quest sub class. » Raid boss drop nobless item. » No weight limit. » Unique protection anti-hwy armor for archers/daggers etc. » Ingame password change. » Top pvp/pk/online ranks NPC. » Unique monsters & NPC. » Interlude retail skills. » Server up-time [24/7] [99]%. » Perfect class balance (all class can kill all class depending on players skill and setup knowledge,gear,augmentations). » Announcements on double kills triple kills etc. » Announcements on Grand Boss death , with the name of the killer as well as clan name of the player. » Information Npc in game with all servers infromations. Custom server gear : 1). Titanium Armor Lv.1 2). Epic Armor Lv.2 3). Epic Weapons-Kamikaze-Black S grade (Same Stats) 4). Demonic-Angelic Wings-Baium Hair-Custom Accessories (SameStats) 5). Custom Fighter/Mage tattoo Lv1-Lv2-Lv3 6). Shirt (STR,CON,INT +1) 7). Custom Shields Server Commands: .tvtjoin .tvtleave – Join or leave tvt event. .ctfjoin .ctfleave – Join or leave ctf event. .dmjoin .dmleave – Join of leave dm event. .online – current online players count. .repair – repairs stuck character in world. .menu – opens online menu panel. .exit – PVP zone exit in case you are bullied. .changepassword - Opens online menu then u can change ur password in game. .farm - Enable/disable autofarm Event system: » TVT event » CTF event » DM event » Tournament Event » Party Zone » Unique event shop. Olympiad game: » Retail olympiad game. » Competition period [1] week. » Olympiad start time [18:00] end [00:00] GMT+2. » New Heroes every Sunday.
    • Tomorrow grand opening lests go 🙂 
    • New season of Warfire X150 has been postponed to September 28th.
  • Topics

×
×
  • Create New...