Intro:
I'm creating a game that allows players to build with user-defined blocks. There can be upwards of thousands of these blocks, so in order to stay under the entity limit, I'm coding a single entity that handles all the blocks in the server. I am currently in very early development of this manager, so far all I have is a client and server entity, the client one handling rendering, and the server one handling building. When a client places one of these blocks, it tells the server, which in turn notifies all the clients so that they can render them. Unfortunately, I don't really know how to achieve this. There are also a few other networking-related things I need help with.
Issue #1:
First of all, I need to know how to solve the problem mentioned above, about notifying all the clients that a block has been placed. All blocks are quads, but they can be different sizes, defined by a Vector. There are future plans for block types (doors, stairs, etc.) which will be defined by an integer (e.g. 0 == NORMAL_BLOCK, 1 == DOOR_BLOCK, 2 == STAIR_BLOCK). I also need to send the texture. To keep bandwidth low, instead of sending the texture string, I can send an integer that corresponds to a texture on the client's side (e.g. 0 == wood001, 1 == concrete 001, etc.).
Basically, how do I send 2 integers and a Vector to all the clients? Do I use game events? I tried this, but I couldn't seem to find a way to allow the client class to receive the message, which makes me think game events are for the server only. User messages seem to only be for HUD updates, but could I use them in this way, too?
Issue #2:
When a client connects to a server, they need to receive all the blocks that are currently placed in the server. How do I send all this data effectively? This could be a lot of data. I don't think it would be a good idea to send a massive packet of all the data, but rather to send multiple packets split into 2048 bytes. How does the engine populate the client with all the entities? I could also use this method.
Additional Information
Thanks to anyone that can solve one of my issues, and a big thanks to you if you can solve both. Code samples would be nice, because there is a significant lack of Source engine documentation, and a lot of times the concept isn't the problem, rather doing it correctly in the engine. However, I've been programming C++ for about 3 1/2 years now, so I don't need a step by step explanation of pointers.





