Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

My fix for the "desyncing" problem


Scorpious2k
 Share

Recommended Posts

  • Replies 65
  • Created
  • Last Reply

Top Posters In This Topic

@[THE-KRIS:

> link=topic=51502.msg541823#msg541823 date=1252415790]
> whats the client side for that? the PLAYERNEWXY i use 2.7 for kryce so :P

OH, OK, got it.

In **modHandleData Sub HandleData()**

at the end, before

```
End Sub
```
insert

```
    If (casestring = "playernewxy") Then
        X = Val(parse(1))
        y = Val(parse(2))

        If Not GetPlayerX(MyIndex) = X Then Call SetPlayerX(MyIndex, X)
        If Not GetPlayerY(MyIndex) = y Then Call SetPlayerY(MyIndex, y)

        Exit Sub
    End If
```
Link to comment
Share on other sites

@AydanWatkins:

> I tried adding it in but I had an error server side with this line
>
> SendPlayerNewXY(index)
>
> Any ideas? I'm using 2.7 as well so…
>
> thats the only error I have.

I already answered this for 2.7 server:

http://www.touchofdeathforums.com/smf/index.php/topic,51502.msg541189.html#msg541189

for the 2.7 client:

http://www.touchofdeathforums.com/smf/index.php/topic,51502.msg541898.html#msg541898
Link to comment
Share on other sites

@Scorpious2k:

> OH, OK, got it.
>
> In **modHandleData Sub HandleData()**
>
> at the end, before
>
> ```
> End Sub
> ```
> insert
>
> ```
>     If (casestring = "playernewxy") Then
>         X = Val(parse(1))
>         y = Val(parse(2))
>
>         If Not GetPlayerX(MyIndex) = X Then Call SetPlayerX(MyIndex, X)
>         If Not GetPlayerY(MyIndex) = y Then Call SetPlayerY(MyIndex, y)
>
>         Exit Sub
>     End If
> ```

Do we need to add this, or is it just something [THE-KRIS] asked for?
Link to comment
Share on other sites

The eagle-eyed Damian666, found anotther problem in the code when changing the max number of characters;. This will fix it and potentially any others involving new accounts/characters.

in **modDatabase Sub ClearChar()**

after

```
    Dim n As Long
```
insert

```
    ' version info
    Player(index).Char(CharNum).Vflag = 128
    Player(index).Char(CharNum).Ver = 2
    Player(index).Char(CharNum).SubVer = 8
    Player(index).Char(CharNum).Rel = 0
```
This early posts that tell how to install this fix has been edited to include this, but if you have it already in you will want to add this.

Thank you again, Damian666.
Link to comment
Share on other sites

for whatever reson 2.7 doesnt like setting the players x below 0 (ie -1)so if you ARE using 2.7 and you have problems going left to the next map then replace

```
' update it to match client - this will be correct 99% of the time 
  Call SetPlayerX(Index, Xpos) 
  Call SetPlayerY(Index, Ypos) 

```
with

[code=vb
' update it to match client - this will be correct 99% of the time
If Xpos >= 0 Then
  Call SetPlayerX(Index, Xpos)
End If
  Call SetPlayerY(Index, Ypos)

that works :P

and that also means you dont have to change the player rec. cos i didnt :P
Link to comment
Share on other sites

Wouldn't updating a players location based on the clients location create some security holes? Someone with the proper tools (packet editor) would be able to warp on a map by just sending a PlayerMove packet with the coordinates they want to go to. Then they can skip blocks, scripts, etc.
Link to comment
Share on other sites

It's possible, but with an open source client you really don't have much security anyway.  There *are* a few rudimentary hacker checks in the code.

Something I have in my "to-do" list is to replace the text packet names (ie "playermove") with shorter codes to reduce bandwidth. I will be doing this by making constants with the packet name and assigning values to them, Using obfuscating values would help in security.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...