Skip to content

Commit

Permalink
Added GPL information on interactive server startup
Browse files Browse the repository at this point in the history
  • Loading branch information
MishimaHaruna committed Dec 15, 2015
1 parent 7a39715 commit 86fab91
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/char/char.c
Original file line number Diff line number Diff line change
Expand Up @@ -5977,6 +5977,7 @@ int do_init(int argc, char **argv) {
Sql_HerculesUpdateCheck(inter->sql_handle);
#ifdef CONSOLE_INPUT
console->input->setSQL(inter->sql_handle);
console->display_gplnotice();
#endif
ShowStatus("The char-server is "CL_GREEN"ready"CL_RESET" (Server is listening on the port %d).\n\n", chr->port);

Expand Down
11 changes: 11 additions & 0 deletions src/common/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ void display_title(void) {
ShowInfo("Compiled with %s\n", sysinfo->compiler());
ShowInfo("Compile Flags: %s\n", sysinfo->cflags());
}

/**
* Shows a license notice as per GNU GPL recommendation.
*/
void display_gplnotice(void)
{
ShowInfo("Hercules, Copyright (C) 2012-2015, Hercules Dev Team and others.\n");
ShowInfo("Licensed under the GNU General Public License, version 3 or later.\n");
}

#ifdef CONSOLE_INPUT
int console_parse_key_pressed(void)
{
Expand Down Expand Up @@ -532,6 +542,7 @@ void console_defaults(void)
console->init = console_init;
console->final = console_final;
console->display_title = display_title;
console->display_gplnotice = display_gplnotice;
#ifdef CONSOLE_INPUT
console->input = &console_input_s;
console->input->parse_init = console_parse_init;
Expand Down
1 change: 1 addition & 0 deletions src/common/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ struct console_interface {
void (*init) (void);
void (*final) (void);
void (*display_title) (void);
void (*display_gplnotice) (void);

struct console_input_interface *input;
};
Expand Down
4 changes: 4 additions & 0 deletions src/login/login.c
Original file line number Diff line number Diff line change
Expand Up @@ -2033,6 +2033,10 @@ int do_init(int argc, char** argv)
core->runflag = LOGINSERVER_ST_RUNNING;
}

#ifdef CONSOLE_INPUT
console->display_gplnotice();
#endif // CONSOLE_INPUT

ShowStatus("The login-server is "CL_GREEN"ready"CL_RESET" (Server is listening on the port %u).\n\n", login_config.login_port);
login_log(0, "login server", 100, "login server started");

Expand Down
2 changes: 2 additions & 0 deletions src/map/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -5959,6 +5959,8 @@ int do_init(int argc, char *argv[])

#ifdef CONSOLE_INPUT
console->input->setSQL(map->mysql_handle);
if (!minimal && core->runflag != CORE_ST_STOP)
console->display_gplnotice();
#endif

ShowStatus("Server is '"CL_GREEN"ready"CL_RESET"' and listening on port '"CL_WHITE"%d"CL_RESET"'.\n\n", map->port);
Expand Down

0 comments on commit 86fab91

Please sign in to comment.