Skip to content

Commit

Permalink
Fix shapes not syncing during mousemove
Browse files Browse the repository at this point in the history
  • Loading branch information
Kruptein committed Dec 5, 2019
1 parent 3c6b419 commit b3f6362
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ All notable changes to this project will be documented in this file.

## Unreleased

## [0.18.0] - 2019-09-11
## [0.18.1] - 2019-12-05

### Fixed

- Shapes not syncing on mouse move.

## [0.18.0] - 2019-11-09

### Added

Expand Down
17 changes: 10 additions & 7 deletions server/api/socket/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,16 @@ async def sync_shape_update(layer, room, data, sid, shape):
if psid == sid:
continue
pdata = { el: data[el] for el in data if el != "shape" }
if data["temporary"] and player.name not in data["shape"]["owners"]:
pdata["shape"] = deepcopy(data["shape"])
# Although we have no guarantees that the message is faked, we still would like to verify data as if it were legitimate.
for element in ["auras", "labels", "trackers"]:
pdata["shape"][element] = [el for el in pdata["shape"][element] if el["visible"]]
if not pdata["shape"]["name_visible"]:
pdata["shape"]["name"] = "?"
if data["temporary"]:
if player.name not in data["shape"]["owners"]:
pdata["shape"] = deepcopy(data["shape"])
# Although we have no guarantees that the message is faked, we still would like to verify data as if it were legitimate.
for element in ["auras", "labels", "trackers"]:
pdata["shape"][element] = [el for el in pdata["shape"][element] if el["visible"]]
if not pdata["shape"]["name_visible"]:
pdata["shape"]["name"] = "?"
else:
pdata["shape"] = shape
else:
pdata["shape"] = shape.as_dict(player, False)
await sio.emit("Shape.Update", pdata, room=psid, namespace="/planarally")
Expand Down

0 comments on commit b3f6362

Please sign in to comment.