39 |
39 |
40 #define NETGAME_DEFAULT_PORT 46631 |
40 #define NETGAME_DEFAULT_PORT 46631 |
41 #define PROTOCOL_VERSION 42 |
41 #define PROTOCOL_VERSION 42 |
42 #define MIN_SERVER_VERSION 1 |
42 #define MIN_SERVER_VERSION 1 |
43 |
43 |
44 // Used for sending scripts to the engine |
44 //! Used for sending scripts to the engine |
45 #define MULTIPLAYER_SCRIPT_PATH "Scripts/Multiplayer/" |
45 #define MULTIPLAYER_SCRIPT_PATH "Scripts/Multiplayer/" |
46 |
46 |
47 #define WEAPONS_COUNT 56 |
47 #define WEAPONS_COUNT 56 |
48 |
48 |
49 // TODO allow frontend to override these? |
49 // TODO allow frontend to override these? |
50 /* A merge of mikade/bugq colours w/ a bit of channel feedback */ |
50 /*! A merge of mikade/bugq colours w/ a bit of channel feedback */ |
51 #define HW_TEAMCOLOR_ARRAY { UINT32_C(0xffff0204), /* red */ \ |
51 #define HW_TEAMCOLOR_ARRAY { UINT32_C(0xffff0204), /*! red */ \ |
52 UINT32_C(0xff4980c1), /* blue */ \ |
52 UINT32_C(0xff4980c1), /*! blue */ \ |
53 UINT32_C(0xff1de6ba), /* teal */ \ |
53 UINT32_C(0xff1de6ba), /*! teal */ \ |
54 UINT32_C(0xffb541ef), /* purple */ \ |
54 UINT32_C(0xffb541ef), /*! purple */ \ |
55 UINT32_C(0xffe55bb0), /* pink */ \ |
55 UINT32_C(0xffe55bb0), /*! pink */ \ |
56 UINT32_C(0xff20bf00), /* green */ \ |
56 UINT32_C(0xff20bf00), /*! green */ \ |
57 UINT32_C(0xfffe8b0e), /* orange */ \ |
57 UINT32_C(0xfffe8b0e), /*! orange */ \ |
58 UINT32_C(0xff5f3605), /* brown */ \ |
58 UINT32_C(0xff5f3605), /*! brown */ \ |
59 UINT32_C(0xffffff01), /* yellow */ \ |
59 UINT32_C(0xffffff01), /*! yellow */ \ |
60 /* add new colors here */ \ |
60 /*! add new colors here */ \ |
61 0 } /* Keep this 0 at the end */ |
61 0 } /*! Keep this 0 at the end */ |
62 |
62 |
63 extern const size_t flib_teamcolor_count; |
63 extern const size_t flib_teamcolor_count; |
64 extern const uint32_t flib_teamcolors[]; |
64 extern const uint32_t flib_teamcolors[]; |
65 |
65 |
66 /** |
66 /** |
81 /** |
81 /** |
82 * Returns the WEAPONS_COUNT constant |
82 * Returns the WEAPONS_COUNT constant |
83 */ |
83 */ |
84 int flib_get_weapons_count(); |
84 int flib_get_weapons_count(); |
85 |
85 |
86 /* |
86 /*! |
87 * These structs define the meaning of values in the flib_scheme struct, i.e. their correspondence to |
87 * These structs define the meaning of values in the flib_scheme struct, i.e. their correspondence to |
88 * ini settings, engine commands and positions in the network protocol (the last is encoded in the |
88 * ini settings, engine commands and positions in the network protocol (the last is encoded in the |
89 * order of settings/mods). |
89 * order of settings/mods). |
90 */ |
90 */ |
91 typedef struct { |
91 typedef struct { |
92 const char *name; // A name identifying this setting (used as key in the schemes file) |
92 const char *name; //!< A name identifying this setting (used as key in the schemes file) |
93 const char *engineCommand; // The command needed to send the setting to the engine. May be null if the setting is not sent to the engine (for the "health" setting) |
93 const char *engineCommand; //!< The command needed to send the setting to the engine. May be null if the setting is not sent to the engine (for the "health" setting) |
94 const bool maxMeansInfinity; // If true, send a very high number to the engine if the setting is equal to its maximum |
94 const bool maxMeansInfinity; //!< If true, send a very high number to the engine if the setting is equal to its maximum |
95 const bool times1000; // If true (for time-based settings), multiply the setting by 1000 before sending it to the engine. |
95 const bool times1000; //!< If true (for time-based settings), multiply the setting by 1000 before sending it to the engine. |
96 const int min; // The smallest allowed value |
96 const int min; //!< The smallest allowed value |
97 const int max; // The highest allowed value |
97 const int max; //!< The highest allowed value |
98 const int def; // The default value |
98 const int def; //!< The default value |
99 } flib_metascheme_setting; |
99 } flib_metascheme_setting; |
100 |
100 |
101 typedef struct { |
101 typedef struct { |
102 const char *name; // A name identifying this mod (used as key in the schemes file) |
102 const char *name; //!< A name identifying this mod (used as key in the schemes file) |
103 const int bitmaskIndex; // Mods are sent to the engine in a single integer, this field describes which bit of that integer is used |
103 const int bitmaskIndex; //!< Mods are sent to the engine in a single integer, this field describes which bit of that integer is used |
104 // for this particular mod. |
104 //! for this particular mod. |
105 } flib_metascheme_mod; |
105 } flib_metascheme_mod; |
106 |
106 |
107 typedef struct { |
107 typedef struct { |
108 const int settingCount; |
108 const int settingCount; |
109 const int modCount; |
109 const int modCount; |
110 const flib_metascheme_setting *settings; |
110 const flib_metascheme_setting *settings; |
111 const flib_metascheme_mod *mods; |
111 const flib_metascheme_mod *mods; |
112 } flib_metascheme; |
112 } flib_metascheme; |
113 |
113 |
114 extern const flib_metascheme flib_meta; |
114 extern const flib_metascheme flib_meta; |
115 |
115 |
116 const flib_metascheme *flib_get_metascheme(); |
116 const flib_metascheme *flib_get_metascheme(); |