buildat/design.txt

66 lines
1.8 KiB
Plaintext
Raw Normal View History

2014-09-16 15:27:57 +03:00
Buildat
=======
A Minecraft clone with vast extendability.
2014-09-16 20:39:57 +03:00
License: MIT
2014-09-16 17:58:01 +03:00
Client
------
Built using Polycode C++.
2014-09-16 15:27:57 +03:00
2014-09-16 18:22:12 +03:00
Module code is transfered from the server and run in a safe Lua sandbox.
2014-09-16 17:58:01 +03:00
Server
------
Built using C++ with most functionality in RCC++.
2014-09-16 18:22:12 +03:00
C++ modules can interface with each other by using Cereal.
Module structure
----------------
module
|-- client
2014-09-17 02:21:56 +03:00
| `-- init.lua << Client-side code
2014-09-16 18:22:12 +03:00
|-- server
2014-09-17 02:21:56 +03:00
| `-- init.cpp << Server-side code
2014-09-17 02:18:03 +03:00
|-- include
2014-09-17 02:21:56 +03:00
| `-- api.h << Structures for interfacing between modules
2014-09-16 18:22:12 +03:00
`-- data
2014-09-17 02:21:56 +03:00
`-- media.png << Data files
2014-09-16 18:22:12 +03:00
Module behavior
---------------
2014-09-17 13:37:34 +03:00
No script or data transfer to the client is initiated by the core. The
module/client/init.lua file is a convention followed by the built-in modules.
2014-09-16 15:27:57 +03:00
2014-09-17 13:37:34 +03:00
Modules can be unloaded at runtime. Handling of client-side state is left up to
the C++ modules themselves.
2014-09-16 22:42:47 +03:00
The first module to be loaded is called __loader. It loads all other modules.
C++ modules can use the core/ and interface/ headers. Everything else is
considered unstable.
2014-09-17 13:37:34 +03:00
C++ modules are run in threads, and everything they can officially access is
thread-safe.
C++ modules can provide direct library functionality inlined in their include/
files. They cannot export any internally defined functions directly, but they
can provide convenience wrappers for event-based interfaces.
Startup sequence and what the module should do:
- constructor : Initialize everything you can here
- init() : Subscribe to events
- "core:start" event : Start doing whatever the module wants to actively do
2014-09-17 03:00:54 +03:00
Network protocol
----------------
(Type, length, data) tuples on TCP. In the future TLS can be taken into use. A
name->type registry is used for determining numeric packet types.
Data is freeform. Types 0...100 are reserved for initialization.
Core uses cereal's portable binary serialization.