Greendude120 Posted July 4, 2009 Share Posted July 4, 2009 Actually for those who want to wait for this to be much more stable, what i suggest is your sadscript a command like i did.I made it so if u type /reset, the player is warped on the exact location he is (refresh the map which unfreezes the map)Its easy just call ur map stuff likeDim PlayerMapDim PlayerXDim PlayerYPlayerMap = GetPlayerMap(index)PlayerX = GetPlayerX(Index)same for Ythen you do Call PlayerWarp(index, playermap, playerx, player)as simple as that Link to comment Share on other sites More sharing options...
Pikachu Posted July 17, 2009 Share Posted July 17, 2009 After looking through the code that handles map switching, I found a certain string that appears to only be sent when your on the edge of a map to switch maps, which is "requestnewmap". If you add a check on the server to see if the player is on the edge of a map when that string is received you can synchronize the player with the server without having to constantly synchronize every second or every time the player moves. The code for this is pretty simple: (Sample for EE2.7 Unedited)1\. In modHandleData in the server, find the "Packet_RequestNewMap" sub.2\. Replace the contents of the sub with``` If Dir < DIR_UP Or Dir > DIR_RIGHT Then Call HackingAttempt(Index, "Invalid Direction") Exit Sub End If Select Case GetPlayerDir(Index) Case DIR_UP If GetPlayerY(Index) > 0 And Map(GetPlayerMap(Index)).Up > 0 Then Call SendDataTo(Index, "notgettingmap" & SEP_CHAR & END_CHAR) Call SendPlayerXY(Index) Call PlayerMsg(Index, "Syncronized", 1) Exit Sub End If Case DIR_DOWN If GetPlayerY(Index) < MAX_MAPY And Map(GetPlayerMap(Index)).Down > 0 Then Call SendDataTo(Index, "notgettingmap" & SEP_CHAR & END_CHAR) Call SendPlayerXY(Index) Call PlayerMsg(Index, "Syncronized", 1) Exit Sub End If Case DIR_LEFT If GetPlayerX(Index) > 0 And Map(GetPlayerMap(Index)).Left > 0 Then Call SendDataTo(Index, "notgettingmap" & SEP_CHAR & END_CHAR) Call SendPlayerXY(Index) Call PlayerMsg(Index, "Syncronized", 1) Exit Sub End If Case DIR_RIGHT If GetPlayerX(Index) < MAX_MAPX And Map(GetPlayerMap(Index)).Right > 0 Then Call SendDataTo(Index, "notgettingmap" & SEP_CHAR & END_CHAR) Call SendPlayerXY(Index) Call PlayerMsg(Index, "Syncronized", 1) Exit Sub End If End Select Call PlayerMsg(Index, "Test!", 1) Call PlayerMove(Index, Dir, 1)```3\. Open modHandleData in the client and add this at the bottom of Sub HandleData``` If casestring = "notgettingmap" Then GettingMap = False End If```And thats it!If you want to test this, move your player to the center of the map, make sure the map has switchovers in all directions, and log out. Then open modClientTCP and find Sub PlayerMove. Replace```Call SendData("playermove" & SEP_CHAR & GetPlayerDir(MyIndex) & SEP_CHAR & Player(MyIndex).Moving & END_CHAR)```with```'Call SendData("playermove" & SEP_CHAR & GetPlayerDir(MyIndex) & SEP_CHAR & Player(MyIndex).Moving & END_CHAR)```Then login and move to the each map corner and attempt to switch maps. Since the client is no longer sending the player movements to the server, the server still thinks you are in the center of the map so it will synchronize you :) Link to comment Share on other sites More sharing options...
damian666 Posted July 20, 2009 Share Posted July 20, 2009 ~~just to let you guys know, the fix that raichu posted works much better then the one this topic is about.sure , maybe its not as clean as robin or derrick would do it, but it works, not it will only sync on mapswitch, which will take out the warping back all the time, me like ^^so, if you think you need a desync fix, i suggest this one.~~this stil is not perfect, i am currently thinking about this… hmmDamian666 Link to comment Share on other sites More sharing options...
tiggilyboo Posted July 25, 2009 Share Posted July 25, 2009 This isn't even really fixing the heart of the problem, your just covering up the original issue: The server cannot handle the clients consistent packets for each players location. I would suggest that the procedure would handle the amount of times the packet sends and the server receives, rather than spraying data all over the place. - Just my view on the matterI'm going to fix this soon, as soon as I get the time. Link to comment Share on other sites More sharing options...
damian666 Posted July 25, 2009 Share Posted July 25, 2009 well… cant wait for you to fix it then :)Damian666 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now