-
Notifications
You must be signed in to change notification settings - Fork 8
Messaging protocol
clonejo edited this page Mar 18, 2012
·
6 revisions
- mc_erl_chunk_manager
- mc_erl_entity_tracker
- mc_erl_tcp_listener
- mc_erl_event_passer
- mc_erl_player_sup
-
chunk_location->{X, Z} -
block_location->{X, Y, Z} -
entity_position->{X, Y, Z, Yaw, Pitch} -
chunk_column_data->{chunk_column_data, full_column, chunks=[], add_data=[], biome=Binary} -
chunk_data->{chunk_data, types=<<…>>>, metadata=<<…>>, block_light=<<…>>, sky_light=<<…>>} -
block_data->{Type, Metadata, Block_light, Sky_light, Biome}
- Call
{get_chunk, Chunk_location}- looks chunk up in storage or generates it. Returns #chunk_column_data. - Call
{get_compressed_chunk, Chunk_location}- fetches a chunk in a get_chunk-like action, encodes it, stashes result in its private cache and returns raw binary chunk data. - Cast
{set_block, Block_location, Block_data}- sets a block in the world.
- Call
{register_entity, Type, Supervisor}- Type isplayer,mobordrop. Registers entity with entity_location_update message destination Supervisor and returns Eid. Supervisor may benone. - Call '{register_entity, Type, Supervisor, Entity_position}` - same as above, but also initializes it with starting position.
- Cast
{update_entity, Eid, Entity_position}- Updates entity position and broadcasts this to each Supervisor of entities nearby. - Message format for entity_tracker's casts to supervisors: {entity_location_update, Eid, NewLocation}