src/Network/Protocol.hh
changeset 187 f41f894213ca
child 200 2dbf40661580
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Network/Protocol.hh	Wed Dec 03 19:40:37 2008 +0000
@@ -0,0 +1,66 @@
+#ifndef NETWORK_PROTOCOL_HH
+#define NETWORK_PROTOCOL_HH
+
+/*
+ * The network protocol is defined here :o
+ */
+
+enum NetworkChannel {
+    /*
+     * Core channel used for NetworkSession
+     */
+    NETCHAN_CORE            = 0x01,
+};
+
+enum NetworkPhysicsFlags {
+    NETWORK_PHYSICS_INAIR      = 0x01,
+};
+
+enum NetworkMessage {
+    NETMSG_PACKET_INVALID   = 0x00,
+
+    /*
+     * You have joined the game:
+     *
+     *  Vector      initial_position
+     */
+    NETMSG_SERVER_HELLO = 0x0100,
+
+    /*
+     * New client has connected to server:
+     *  
+     *  Vector      initial_position
+     */
+    NETMSG_PLAYER_JOIN  = 0x0101,
+
+    /*
+     * Client has left server:
+     *
+     */
+    NETMSG_PLAYER_QUIT  = 0x0102,
+
+    /*
+     * Client has moved
+     *
+     *  uint16_t    PlayerInput_Move
+     */
+    NETMSG_CLIENT_MOVE  = 0x0201,
+    
+    /*
+     * Initial player info
+     *
+     *  Vector      initial_position
+     */
+    NETMSG_PLAYER_INFO  = 0x0300,
+
+    /*
+     * Player position update
+     *
+     * Vector   position
+     * Vector   velocity
+     * uint8_t  NetworkPhysicsFlags
+     */
+    NETMSG_PLAYER_POSITION  = 0x0301,
+};
+
+#endif