lance icon indicating copy to clipboard operation
lance copied to clipboard

Handle first sync event ( sync world )

Open Unsigno opened this issue 7 years ago • 2 comments

For convenience reasons ( eg. initialize visual scene/world ) should be usefull a firstSyncReceived/worldSync or something similar , maybe with pre/post addition .

I can execute once 'client__syncReceived' , but a interesting thing can be add diferent params as syncReceived .

Eg.

beforeWorldSync( theFirstSyncData )
onWorldSync( the objectInstancesCreated ) // this implies divide onAddToWorld ( to onCreateRenderEl onAddToWorld )
afterWorldSync() // the instances are added to the world now

Unsigno avatar Nov 26 '17 17:11 Unsigno

You're correct in that practically in all cases the game engine has "nothing to do" before the first full sync. but maybe instead of adding to the API we can just make sure that the 'start' for the client game engine only happens after it receives the first full sync.

Thoughts?

OpherV avatar Jan 22 '18 20:01 OpherV

Was the original purpose, but as you mention some one should be interested on run some "local scene", maybe loading another assets or waiting for connection . So could be diferent things , handle first sync and allow run step before or when first sync .

Unsigno avatar Jan 26 '18 05:01 Unsigno