bbuck / dragon-mud

A text-based game engine written in Go and scripted with Lua.
Other
116 stars 16 forks source link

Add mutex 'hell' to emitters and handlers to remove race conditions. #52

Closed bbuck closed 7 years ago

bbuck commented 7 years ago

This also includes a small change that causes emitted data to get copied. This prevents any kind of race conditions with the emitting code changing the map after emit. Once event data is always copied, it can never be modified for future handlers from the time of being emitted.