tswow / tswow

Root project for TSWoW
GNU General Public License v3.0
76 stars 42 forks source link

trinitycore: worldstate / game_event overlap and array memory layout #336

Open tswow-admin opened 3 years ago

tswow-admin commented 3 years ago

game_events are special worldstates handled by the core and sent to players, so they cannot be allowed to clash. game_event data in the core is spread over ~15 different arrays so this will be very painful to fix (and slows down core especially with many worldstates). For now we're generating game_event data starting from ids ~100, and they won't clash with any standard worldstates until around 950, but this is unacceptably low.

My suggestion: add a new table game_event_worldstates that allows overriding the worldstate id handled by the server. Only if there is no entry in this table you use the id itself as the worldstate. Then we write worldstate ids automatically when creating new game_events.

ihm-tswow commented 3 years ago

thought we could just skip the known ids until i realized we don't know the ids. second this, performance issues would start showing if we used that many game events in the first place