Znote / ZnoteAAC

Developement repository for the Znote AAC project. A website portal to represent and manage your Open Tibia server.
MIT License
145 stars 127 forks source link

houses fetch #324

Closed Danat7 closed 4 years ago

Danat7 commented 6 years ago

Hello, first thanks for the amazing work on this AAC. I wanted to post this issue, as I'm having difficulties fixing it. Surely its an easy fix, but i cant see it yet. Here is the Issue: Houses.php Everytime i have to update the Cache from the Houses.php fetch option, it sends this; Notice: Undefined offset: 7 in (filelocation...)\houses.php on line 212 If i resend the Fetch but cache hasnt expired, it doesnt send the error. here is the line 212 part of the code to fetch: $houses[$i]['ownername'] = $tmpById[$houses[$i]['owner']];

Znote commented 6 years ago

Does any owner data works? Which server distribution are you using? Line 212 adds the player name to the house row, this should only happen when the house has a configured player id. Perhaps that player id doesn't exist in the players table? (The code currently assumes that all player ids found in the houses table exists in the players table, and retrieves their name there).

Normally, triggers would come in place and remove the player id from the houses table once the player has been deleted, but a server crash might have messed it up.