File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,6 +62,10 @@ def include_path_abs
6262 "#{ CONTROLLER_BASE_DIR_INCLUDE } /#{ @path . join ( '/' ) } /#{ header_filename } "
6363 end
6464
65+ def include_sql_path_abs
66+ "#{ CONTROLLER_BASE_DIR_INCLUDE } /#{ @path . join ( '/' ) } /sql_columns.h"
67+ end
68+
6569 def self . base_pvp
6670 return @base_pvp_controller if @base_pvp_controller
6771
Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ def gen_cpp_header
5353 '' ,
5454 "#include <#{ @parent_controller . include_path_abs } >" ,
5555 '' ,
56+ header_sql ,
57+ '' ,
5658 "class #{ @controller . class_name } : public #{ @parent_controller . class_name } " ,
5759 '{' ,
5860 'public:' ,
@@ -161,4 +163,15 @@ def header_methods
161163 'int OnCharacterDeath(class CCharacter *pVictim, CPlayer *pKiller, int Weapon) override;'
162164 ] . map { |m | "\t #{ m } " } . join ( "\n " )
163165 end
166+
167+ def header_sql
168+ [
169+ '// uncomment the lines below if you bring your own sql_columns.h file' ,
170+ '// this is optional and only needed if your gamemode needs additional' ,
171+ '// columns in the sql database.' ,
172+ "// #define SQL_COLUMN_FILE <#{ @controller . include_sql_path_abs } >" ,
173+ "// #define SQL_COLUMN_CLASS C#{ @controller . name } Columns" ,
174+ '// #include <game/server/instagib/column_template.h>' ,
175+ ] . join ( "\n " )
176+ end
164177end
You can’t perform that action at this time.
0 commit comments