summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-07-03 19:47:38 +0200
committerGitHub <noreply@github.com>2016-07-03 19:47:38 +0200
commitd2f666fc10eac20f70729176c088b2c81d233531 (patch)
tree55902d4e252f365f511137d4022670ccfad59a62 /src
parent6fbc00f9454d33caf79f89708cab9e46ec996eeb (diff)
parent7b350fbf497d737c12cc03ddd888bb6a0ee486e4 (diff)
downloadhercules-d2f666fc10eac20f70729176c088b2c81d233531.tar.gz
hercules-d2f666fc10eac20f70729176c088b2c81d233531.tar.bz2
hercules-d2f666fc10eac20f70729176c088b2c81d233531.tar.xz
hercules-d2f666fc10eac20f70729176c088b2c81d233531.zip
Merge pull request #1336 from 4144/travisext
Different travis extensions
Diffstat (limited to 'src')
-rw-r--r--src/char/char.c16
-rw-r--r--src/common/showmsg.h4
-rw-r--r--src/common/socket.c2
-rw-r--r--src/login/login.c14
-rw-r--r--src/map/chrif.c2
-rw-r--r--src/map/map.c2
6 files changed, 40 insertions, 0 deletions
diff --git a/src/char/char.c b/src/char/char.c
index cf2f7d87c..5f92e37bf 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -5758,11 +5758,25 @@ static CMDLINEARG(netconfig)
chr->NET_CONF_NAME = aStrdup(params);
return true;
}
+
+/**
+ * --run-once handler
+ *
+ * Causes the server to run its loop once, and shutdown. Useful for testing.
+ * @see cmdline->exec
+ */
+static CMDLINEARG(runonce)
+{
+ core->runflag = CORE_ST_STOP;
+ return true;
+}
+
/**
* Initializes the command line arguments handlers.
*/
void cmdline_args_init_local(void)
{
+ CMDLINEARG_DEF2(run-once, runonce, "Closes server after loading (testing).", CMDLINE_OPT_NORMAL);
CMDLINEARG_DEF2(char-config, charconfig, "Alternative char-server configuration.", CMDLINE_OPT_PARAM);
CMDLINEARG_DEF2(inter-config, interconfig, "Alternative inter-server configuration.", CMDLINE_OPT_PARAM);
CMDLINEARG_DEF2(net-config, netconfig, "Alternative network configuration.", CMDLINE_OPT_PARAM);
@@ -5801,11 +5815,13 @@ int do_init(int argc, char **argv) {
sockt->net_config_read(chr->NET_CONF_NAME);
chr->sql_config_read(chr->SQL_CONF_NAME);
+#ifndef BUILDBOT
if (strcmp(chr->userid, "s1")==0 && strcmp(chr->passwd, "p1")==0) {
ShowWarning("Using the default user/password s1/p1 is NOT RECOMMENDED.\n");
ShowNotice("Please edit your 'login' table to create a proper inter-server user/password (gender 'S')\n");
ShowNotice("And then change the user/password to use in conf/char-server.conf (or conf/import/char_conf.txt)\n");
}
+#endif
inter->init_sql(chr->INTER_CONF_NAME); // inter server configuration
diff --git a/src/common/showmsg.h b/src/common/showmsg.h
index 7b48d0df2..303c8dd28 100644
--- a/src/common/showmsg.h
+++ b/src/common/showmsg.h
@@ -130,7 +130,11 @@ struct showmsg_interface {
#define ShowSQL(fmt, ...) (showmsg->showSQL((fmt), ##__VA_ARGS__))
#define ShowInfo(fmt, ...) (showmsg->showInfo((fmt), ##__VA_ARGS__))
#define ShowNotice(fmt, ...) (showmsg->showNotice((fmt), ##__VA_ARGS__))
+#ifdef BUILDBOT
+#define ShowWarning(fmt, ...) (showmsg->showError((fmt), ##__VA_ARGS__))
+#else // BUILDBOT
#define ShowWarning(fmt, ...) (showmsg->showWarning((fmt), ##__VA_ARGS__))
+#endif // BUILDBOT
#define ShowDebug(fmt, ...) (showmsg->showDebug((fmt), ##__VA_ARGS__))
#define ShowError(fmt, ...) (showmsg->showError((fmt), ##__VA_ARGS__))
#define ShowFatalError(fmt, ...) (showmsg->showFatalError((fmt), ##__VA_ARGS__))
diff --git a/src/common/socket.c b/src/common/socket.c
index 75b6128b6..60759d0bb 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -1752,10 +1752,12 @@ void socket_net_config_read(const char *filename)
ShowError("No allowed server IP ranges configured. This server won't be able to accept connections from any char servers.\n");
}
ARR_FIND(0, VECTOR_LENGTH(sockt->allowed_ips), i, SUBNET_MATCH(0, VECTOR_INDEX(sockt->allowed_ips, i).ip, VECTOR_INDEX(sockt->allowed_ips, i).mask));
+#ifndef BUILDBOT
if (i != VECTOR_LENGTH(sockt->allowed_ips)) {
ShowWarning("Using a wildcard IP range in the allowed server IPs is NOT RECOMMENDED.\n");
ShowNotice("Please edit your '%s' allowed list to fit your network configuration.\n", filename);
}
+#endif
libconfig->destroy(&network_config);
return;
}
diff --git a/src/login/login.c b/src/login/login.c
index d7c7321d8..49508d564 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -1671,6 +1671,19 @@ static CMDLINEARG(loginconfig)
login->LOGIN_CONF_NAME = aStrdup(params);
return true;
}
+
+/**
+ * --run-once handler
+ *
+ * Causes the server to run its loop once, and shutdown. Useful for testing.
+ * @see cmdline->exec
+ */
+static CMDLINEARG(runonce)
+{
+ core->runflag = CORE_ST_STOP;
+ return true;
+}
+
/**
* --net-config handler
*
@@ -1688,6 +1701,7 @@ static CMDLINEARG(netconfig)
*/
void cmdline_args_init_local(void)
{
+ CMDLINEARG_DEF2(run-once, runonce, "Closes server after loading (testing).", CMDLINE_OPT_NORMAL);
CMDLINEARG_DEF2(login-config, loginconfig, "Alternative login-server configuration.", CMDLINE_OPT_PARAM);
CMDLINEARG_DEF2(net-config, netconfig, "Alternative subnet configuration.", CMDLINE_OPT_PARAM);
}
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 52af1137e..51e8e5143 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -236,11 +236,13 @@ void chrif_setpasswd(char *pwd) {
// security check, prints warning if using default password
void chrif_checkdefaultlogin(void) {
+#ifndef BUILDBOT
if (strcmp(chrif->userid, "s1")==0 && strcmp(chrif->passwd, "p1")==0) {
ShowWarning("Using the default user/password s1/p1 is NOT RECOMMENDED.\n");
ShowNotice("Please edit your 'login' table to create a proper inter-server user/password (gender 'S')\n");
ShowNotice("and then edit your user/password in conf/map-server.conf (or conf/import/map_conf.txt)\n");
}
+#endif
}
// sets char-server's ip address
diff --git a/src/map/map.c b/src/map/map.c
index 779f8d601..30c849ed1 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -6062,7 +6062,9 @@ int do_init(int argc, char *argv[])
char ip_str[16];
sockt->ip2str(sockt->addr_[0], ip_str);
+#ifndef BUILDBOT
ShowWarning("Not all IP addresses in /conf/map-server.conf configured, auto-detecting...\n");
+#endif
if (sockt->naddr_ == 0)
ShowError("Unable to determine your IP address...\n");