vmangos / core

Progressive Vanilla Core aimed at all versions from 1.2 to 1.12
GNU General Public License v2.0
679 stars 487 forks source link

🐛 [Bug] High GUID in character db/ item_instance etc due Partybots and battlebots #2230

Closed Vanndar closed 1 year ago

Vanndar commented 1 year ago

🐛 Bug report

Character GUIIDs, item_instance guids are getting crazy big after spawning battle and partybots, they shouldn't increase guids (guids increase only, maybe add a seperate table for it so we can clean it?) in the database, would be nice if this could be fixed.

Expected behavior

Only real players should count and increase the guids

Steps to reproduce

  1. Create a new character, check the GUID, then spawn bots , create a new character and the guid will be increased. after some time this is getting big. No big deal since I play alone but might be good if public one day.

Version & Environment

Client Version: 1.12.1

Commit Hash: Latest

OS Client: Win OS Server: Win

Crashlog

GrenderG commented 1 year ago

I guess as a solution the system could reuse unused guids instead of always doing a +1.

Wall-core commented 1 year ago

Best solution that I recently started using myself was splitting player guid into low/high, putting bot guids in the million range while keeping playerguids low value. This may help resolve this issue, though isn't strictly necessary as default vmangos playerbots don't generate new guids themselves.

GrenderG commented 1 year ago

default vmangos playerbots don't generate new guids themselves.

Hmm they do as far as I know. To quickly test it spawn many bots, then create a new character and check its guid.

ratkosrb commented 1 year ago

Player bots are as the name implies Player objects, just controlled by an AI, so it's unavoidable that guid counter must be incremented, as player guids need to be unique.