2021-08-12 23:07:06 +00:00
|
|
|
package engine
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2022-03-03 07:40:14 +00:00
|
|
|
"sirlab.de/go/knowyt/syncdata"
|
2021-08-12 23:07:06 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (eng *Engine) publish(populateSyncDataCb PopulateSyncDataCb) {
|
|
|
|
eng.mu.Lock()
|
|
|
|
defer eng.mu.Unlock()
|
|
|
|
|
|
|
|
eng.versionRef++
|
|
|
|
data := syncdata.SyncData{
|
|
|
|
VersionRef: eng.versionRef,
|
|
|
|
}
|
|
|
|
|
|
|
|
if populateSyncDataCb != nil {
|
|
|
|
populateSyncDataCb(&data)
|
|
|
|
}
|
|
|
|
|
2022-03-16 08:16:40 +00:00
|
|
|
fmt.Printf("%s engine versionRef %d\n", data.GameInfo.GameId, eng.versionRef)
|
2021-08-12 23:07:06 +00:00
|
|
|
eng.obs.Update(data)
|
|
|
|
}
|