summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-04-09 00:35:55 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-04-09 00:35:55 -0700
commit312e4d37cc964bbc5bd4e20fd25500b08dc70268 (patch)
tree47df84785736864cbf0690bb7ed1dfb960477595 /src
parentd6b80d1b95ac566e7eb9b75389fb10ae8610dd6f (diff)
downloadtmwa-312e4d37cc964bbc5bd4e20fd25500b08dc70268.tar.gz
tmwa-312e4d37cc964bbc5bd4e20fd25500b08dc70268.tar.bz2
tmwa-312e4d37cc964bbc5bd4e20fd25500b08dc70268.tar.xz
tmwa-312e4d37cc964bbc5bd4e20fd25500b08dc70268.zip
Add @source command to help modified verions satisfy the AGPL
Diffstat (limited to 'src')
-rw-r--r--src/conf/version.hpp7
-rw-r--r--src/map/atcommand.cpp21
-rw-r--r--src/map/pc.cpp8
-rw-r--r--src/mmo/version.cpp17
4 files changed, 41 insertions, 12 deletions
diff --git a/src/conf/version.hpp b/src/conf/version.hpp
index ab7a3d5..8dd31ed 100644
--- a/src/conf/version.hpp
+++ b/src/conf/version.hpp
@@ -9,7 +9,10 @@
# include "conf-raw/int-VERSION_PATCH.h"
# include "conf-raw/int-VERSION_DEVEL.h"
-# include "conf-raw/str-VENDOR.h"
-# include "conf-raw/int-VENDOR_VERSION.h"
+# include "conf-raw/str-VENDOR_NAME.h"
+# include "conf-raw/int-VENDOR_POINT.h"
+# include "conf-raw/str-VENDOR_SOURCE.h"
+
+# include "conf-raw/str-VERSION_STRING.h"
#endif // TMWA_CONF_VERSION_HPP
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp
index 78a50ab..4b07a52 100644
--- a/src/map/atcommand.cpp
+++ b/src/map/atcommand.cpp
@@ -4,6 +4,8 @@
#include <cstring>
#include <ctime>
+#include "../conf/version.hpp"
+
#include "../compat/nullpo.hpp"
#include "../compat/fun.hpp"
@@ -4888,6 +4890,22 @@ ATCE atcommand_doomspot(Session *s, dumb_ptr<map_session_data> sd,
return ATCE::OKAY;
}
+static
+ATCE atcommand_source(Session *s, dumb_ptr<map_session_data>,
+ ZString)
+{
+ clif_displaymessage(s,
+ "This server code consists of Free Software under GPL3&AGPL3");
+ clif_displaymessage(s,
+ "This is commit " VERSION_HASH ", also known as " VERSION_FULL);
+ clif_displaymessage(s,
+ "The version is " VERSION_STRING);
+ clif_displaymessage(s,
+ "For source, see " VENDOR_SOURCE);
+
+ return ATCE::OKAY;
+}
+
// declared extern above
@@ -5310,4 +5328,7 @@ Map<XString, AtCommandInfo> atcommand_info =
{"doomspot", {"",
60, atcommand_doomspot,
"Kill all players on the same tile"}},
+ {"source", {"",
+ 0, atcommand_source,
+ "Legal information about source code (must be a level 0 command!)"}},
};
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index 7077b44..fa633b8 100644
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -789,6 +789,14 @@ int pc_authok(int id, int login_id2, TimeT connect_until_time,
// this is far from the only such thing, but most of the others are logs
void pc_show_motd(dumb_ptr<map_session_data> sd)
{
+ // Attention all forks: DO NOT REMOVE THIS NOTICE.
+ // It exists to meet legal requirements.
+ //
+ // If you remove the sending of this message,
+ // the license does not permit you to publicly use this software.
+
+ clif_displaymessage(sd->sess, "This server is Free Software, for details type @source in chat or use the tmwa-source tool");
+
sd->state.seen_motd = true;
io::ReadFile in(motd_txt);
if (in.is_open())
diff --git a/src/mmo/version.cpp b/src/mmo/version.cpp
index dd18fe1..6f42f11 100644
--- a/src/mmo/version.cpp
+++ b/src/mmo/version.cpp
@@ -14,7 +14,7 @@ Version CURRENT_VERSION =
VERSION_DEVEL,
0, 0,
- VENDOR_VERSION,
+ VENDOR_POINT,
};
Version CURRENT_LOGIN_SERVER_VERSION =
{
@@ -22,7 +22,7 @@ Version CURRENT_LOGIN_SERVER_VERSION =
VERSION_DEVEL,
0, TMWA_SERVER_LOGIN,
- VENDOR_VERSION,
+ VENDOR_POINT,
};
Version CURRENT_CHAR_SERVER_VERSION =
{
@@ -30,7 +30,7 @@ Version CURRENT_CHAR_SERVER_VERSION =
VERSION_DEVEL,
0, TMWA_SERVER_CHAR | TMWA_SERVER_INTER,
- VENDOR_VERSION,
+ VENDOR_POINT,
};
Version CURRENT_MAP_SERVER_VERSION =
{
@@ -38,18 +38,15 @@ Version CURRENT_MAP_SERVER_VERSION =
VERSION_DEVEL,
0, TMWA_SERVER_MAP,
- VENDOR_VERSION,
+ VENDOR_POINT,
};
-#define S2(a) #a
-#define S(a) S2(a)
-
-const char CURRENT_VERSION_STRING[] = "TMWA "
- S(VERSION_MAJOR) "." S(VERSION_MINOR) "." S(VERSION_PATCH)
- " dev" S(VERSION_DEVEL) " (" VENDOR " " S(VENDOR_VERSION) ")";
+const char CURRENT_VERSION_STRING[] = VERSION_STRING;
bool extract(XString str, Version *vers)
{
*vers = {};
+ // TODO should I try to extract dev and vend also?
+ // It would've been useful during the magic migration.
return extract(str, record<'.'>(&vers->major, &vers->minor, &vers->patch));
}