Skip to content

Only keep server teams and remove teams which strategy is not compatible with engine version - #95

Open
DivineThreepwood wants to merge 2 commits into
devfrom
feature/94-only-keep-team-delivered-by-the-server
Open

DivineThreepwood wants to merge 2 commits into
devfrom
feature/94-only-keep-team-delivered-by-the-server

Conversation

@DivineThreepwood

Copy link
Copy Markdown
Member

📜 Description

Changes proposed in this pull request:

  • teams that only exist locally are removed after server sync
  • teams are removed once the strategy is not loading.

@tommy33790 tommy33790 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sadly couldn't test/debug it at all without a server. On paper, I haven't found anything particular wrong.

It's a bit weird to have a deleteTeamFile-function which is not used by removeTeamsNotFromServer (only removeTeamsWithUnavailableStrategies references is).

try {
val teamFolder = JPService.getProperty(JPTeamPath::class.java).value.canonicalFile
val teamFile = File(teamFolder, "$teamName.team").canonicalFile
if (teamFile.parentFile != teamFolder || teamFile.name == "default.team") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just making sure: teamFile.parentFile != teamFolder is there to prevent directory traversal, isn't it?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only keep Team delivered by the server

2 participants