raduprv / Eternal-Lands

http://www.eternal-lands.com
Other
157 stars 57 forks source link

Downloading new (official) custom clothes goes wonky when starting multiple clients #142

Closed feeltheburn closed 2 years ago

feeltheburn commented 3 years ago

Not that big a deal, but if the custom_clothes.zip file needs to be downloaded (it's been updated) on initial client start, and you open multiple clients at once, the zip file somehow just gets deleted after it finishes all the downloads.

REPRODUCE: This can be tested by closing clients, deleting the ~/.elc/custom_clothes.zip (linux loc), then opening two clients at the same time. The battle to download it between them somehow results in it just being deleted.

(if you don't have that zip file, maybe check to see if Server -> Custom Looks Updates is marked.)

gvissers commented 3 years ago

I don't know how the file gets lost, but I can see how multiple clients can tread on each other's toes since they use the same temporary file names. We should probably use mkstemp() or tmpfile() instead so that update file names are unique. I can have a look tomorrow.

EDIT: typo

gvissers commented 3 years ago

Should be fixed with 91ee2ff

feeltheburn commented 2 years ago

This seems to be fixed from a few initial test, so I'll close, thanks.