KanColleTool / kcsrv

An open source KanColle server
MIT License
41 stars 16 forks source link

Unexpected ship moving behaviour (sort issue, and sometimes doesn't save). #19

Closed SoftwareGuy closed 9 years ago

SoftwareGuy commented 9 years ago

I know you've implemented basic support in moving ships around, but here's a functionality report.

Since it's easier to explain with a video, I've uploaded it to my cache subdomain, because it's easier to explain that way. May not be if you're reading this email while you're on your way to work on your phone/tablet though.

Basically, moving the ships around leads to unexpected behaviour. For example, slot 4 has Ooyou and Nagato is in slot 3, but when the game goes to save, it switches Nagato and Ooyou around.

Of course, we're still working out how to do it, but at least it's working partially. Still good work on getting it to work, I was stumped on this for quite some time with my own API.

Fuyukai commented 9 years ago

lying in bed thismorning, just figured out a way to fix it.

Fuyukai commented 9 years ago

Or not, this will require a signifcant amount of work and overhaul because of a few design flaws.

liclac commented 9 years ago

The easiest way to do this would be to put a fleet_order column on AdmiralShip and sort by that - this is how acts_as_list does it, among others. Just have to make sure to keep it consistent when moving ships.

Fuyukai commented 9 years ago

I did that in commit 215a360 but of course it doesn't work properly

liclac commented 9 years ago

It should work, assuming you're actually sorting on it.

Also, please name your columns consistently; tablename_id is for foreign keys (not tablenameid, that's just dumb). Inconsistent naming makes the code harder to understand for no good reason.