From 312e4d37cc964bbc5bd4e20fd25500b08dc70268 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Wed, 9 Apr 2014 00:35:55 -0700 Subject: Add @source command to help modified verions satisfy the AGPL --- src/map/atcommand.cpp | 21 +++++++++++++++++++++ src/map/pc.cpp | 8 ++++++++ 2 files changed, 29 insertions(+) (limited to 'src/map') 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 #include +#include "../conf/version.hpp" + #include "../compat/nullpo.hpp" #include "../compat/fun.hpp" @@ -4888,6 +4890,22 @@ ATCE atcommand_doomspot(Session *s, dumb_ptr sd, return ATCE::OKAY; } +static +ATCE atcommand_source(Session *s, dumb_ptr, + 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 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 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()) -- cgit v1.2.3-70-g09d2