summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-02-14 19:13:14 -0200
committershennetsind <ind@henn.et>2013-02-14 19:22:56 -0200
commit82005a99f5b1cca68e9fb1ac6b1614c815e4bd45 (patch)
tree219766035a17c63286c5be2b3699a07868810b21 /src/map/pc.c
parentef503ce5ad834d4601d6420bddf85655b6428c24 (diff)
downloadhercules-82005a99f5b1cca68e9fb1ac6b1614c815e4bd45.tar.gz
hercules-82005a99f5b1cca68e9fb1ac6b1614c815e4bd45.tar.bz2
hercules-82005a99f5b1cca68e9fb1ac6b1614c815e4bd45.tar.xz
hercules-82005a99f5b1cca68e9fb1ac6b1614c815e4bd45.zip
Introducing Git Hash
Added 'Git Hash' way to identify where you last updated your working copy (it won't detect your local changes' hash -- intended). Also Implemented HERC_UNKNOWN_VER, a simple way to detect whether get_svn_revision or get_git_hash failed to detect (before you'd need to strncmp for "unknown" or similars) Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 1bc37040e..e544fdd53 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1058,9 +1058,16 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
if( !changing_mapservers ) {
- if (battle_config.display_version == 1){
+ if (battle_config.display_version == 1) {
+ const char* svn = get_svn_revision();
+ const char* git = get_git_hash();
char buf[256];
- sprintf(buf, "SVN version: %s", get_svn_revision());
+ if( git[0] != HERC_UNKNOWN_VER )
+ sprintf(buf,"Git Hash: %s", git);
+ else if( svn[0] != HERC_UNKNOWN_VER )
+ sprintf(buf,"SVN Revision: %s", svn);
+ else
+ sprintf(buf,"Unknown Version");
clif_displaymessage(sd->fd, buf);
}