Bläddra i källkod

Fixed @version issue

Signed-off-by: Cahyadi Ramadhan Togihon <house.bad@gmail.com>
Cahyadi Ramadhan Togihon 11 år sedan
förälder
incheckning
e0397a6e34
6 ändrade filer med 24 tillägg och 26 borttagningar
  1. 1 1
      conf/motd.txt
  2. 2 2
      conf/msg_conf/map_msg.conf
  3. 2 2
      conf/msg_conf/map_msg_idn.conf
  4. 1 8
      src/map/atcommand.c
  5. 16 13
      src/map/pc.c
  6. 2 0
      src/map/pc.h

+ 1 - 1
conf/motd.txt

@@ -1,2 +1,2 @@
 // Internal default is limited to 128 lines.  If you need more, you will need to modify the MOTD_LINE_SIZE definition in pc.c
-Welcome to rAthena SVN! Enjoy! Please report any bugs you find.
+Welcome to rAthena! Enjoy! Please report any bugs you find.

+ 2 - 2
conf/msg_conf/map_msg.conf

@@ -1229,8 +1229,8 @@
 1294: They are family... wish them luck.
 
 // @version
-1295: rAthena Version SVN r%s
-1296: Cannot determine SVN revision.
+1295: rAthena Version %s %s
+1296: Cannot determine SVN/Git version.
 
 // @mutearea
 1297: Please enter a time in minutes (usage: @mutearea/@stfu <time in minutes>).

+ 2 - 2
conf/msg_conf/map_msg_idn.conf

@@ -1228,8 +1228,8 @@
 1294: Sekarang mereka adalah satu keluarga... Selamat!!
 
 // @version
-1295: Versi SVN rAthena r%s
-1296: Tidak dapat mendapatkan revisi SVN.
+1295: Versi rAthena %s %s
+1296: Tidak dapat mendapatkan versi saat ini.
 
 // @mutearea
 1297: Harap masukkan waktu dalam menit. (Penggunaan: @mutearea/@stfu <waktu dalam menit>).

+ 1 - 8
src/map/atcommand.c

@@ -7498,14 +7498,7 @@ ACMD_FUNC(whereis)
 
 ACMD_FUNC(version)
 {
-	const char * revision;
-
-	if ((revision = get_svn_revision()) != 0) {
-		sprintf(atcmd_output,msg_txt(sd,1295),revision); // rAthena Version SVN r%s
-		clif_displaymessage(fd,atcmd_output);
-	} else
-		clif_displaymessage(fd,msg_txt(sd,1296)); // Cannot determine SVN revision.
-
+	pc_show_version(sd);
 	return 0;
 }
 

+ 16 - 13
src/map/pc.c

@@ -1113,19 +1113,8 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
 
 	if( !changing_mapservers ) {
 
-		if (battle_config.display_version == 1) {
-			const char* svn = get_svn_revision();
-			const char* git = get_git_hash();
-			char buf[256];
-
-			if( svn[0] != UNKNOWN_VERSION )
-				sprintf(buf,"SVN Revision: %s", svn);
-			else if( git[0] != UNKNOWN_VERSION )
-				sprintf(buf,"Git Hash: %s", git);
-			else
-				sprintf(buf,"Unknown Version");
-			clif_displaymessage(sd->fd, buf);
-		}
+		if (battle_config.display_version == 1)
+			pc_show_version(sd);
 
 		// Message of the Day [Valaris]
 		for(i=0; motd_text[i][0] && i < MOTD_LINE_SIZE; i++) {
@@ -10347,6 +10336,20 @@ void pc_crimson_marker_clear(struct map_session_data *sd) {
 	}
 }
 
+void pc_show_version(struct map_session_data *sd) {
+	const char* svn = get_svn_revision();
+	const char* git = get_git_hash();
+	char buf[CHAT_SIZE_MAX];
+
+	if( svn[0] != UNKNOWN_VERSION )
+		sprintf(buf,msg_txt(sd,1295),"SVN: r",svn); //rAthena Version SVN: r%s
+	else if( git[0] != UNKNOWN_VERSION )
+		sprintf(buf,msg_txt(sd,1295),"Git Hash: ",git); //rAthena Version Git Hash: %s
+	else
+		sprintf(buf,msg_txt(sd,1296)); //Cannot determine SVN/Git version.
+	clif_displaymessage(sd->fd,buf);
+}
+
 /*==========================================
  * pc Init/Terminate
  *------------------------------------------*/

+ 2 - 0
src/map/pc.h

@@ -1023,6 +1023,8 @@ enum e_BANKING_WITHDRAW_ACK pc_bank_withdraw(struct map_session_data *sd, int mo
 
 void pc_crimson_marker_clear(struct map_session_data *sd);
 
+void pc_show_version(struct map_session_data *sd);
+
 #if defined(RENEWAL_DROP) || defined(RENEWAL_EXP)
 int pc_level_penalty_mod(struct map_session_data *sd, int mob_level, uint32 mob_race, uint32 mob_mode, int type);
 #endif