Closed runfalk closed 11 years ago
plugins/backup change is confirmed, will pull.
what led you to change user_server and user_client? if you were having errors, it might be symptomatic of a deeper problem we can fix.
FWIW, nerd are having the same unicode trouble and PRP get them sometimes too.
Okay, regarding the unicode issue, it seems that json.loads does some encoding inference based on environment, and this fails in some circumstances (works for me as regular user, but if I sudo su
it starts giving me unicode usernames). The solution here is probably to encode em as ascii in lineReceived, as they should never actually contain non-ascii.
I'd like to keep mark2 compatible with older versions of minecraft, and I definitely did get that other version of the autosave line in recent testing (though I can't actually recall exact setup). As such I reckon it's probably best to check for both.
I've added these two changes to the code, both of which are slightly different from this pull req. As such I'm closing this unpulled, but thanks very much nevertheless!
for reference: 2f2b00c and f6b5881
what led you to change user_server and user_client? if you were having errors, it might be symptomatic of a deeper problem we can fix.
I did get both str and unicode when attaching to an instance. If I changed it to unicode.lower it crashed as well so I figured it'd be better to not assume the string type.
I'd like to keep mark2 compatible with older versions of minecraft, and I definitely did get that other version of the autosave line in recent testing (though I can't actually recall exact setup). As such I reckon it's probably best to check for both.
Maybe bukkit has a different output format? I didn't test for that.
Backup plugin did not work with the current autosave toggle output, tested in the latest FTB Mindcrack 8.2 (based on vanilla 1.4.7) and vanilla 1.5.1.
There was also an issue with attaching to servers. The method user_client.UserClientFactory.server_users sometimes handled unicode and sometimes regular byte strings, so I changed the str.lower to lambda x: x.lower(). There was another occasion in user_server.py that I changed for good measure.
I also removed some unnecessary trailing whitespace.
Thank you for making this wonderful script.