Przeglądaj źródła

- Corrected /invite letting you invite people even if you are not the party leader.
- Added some reply messages when you try /invite and a. the character is not found or b. you are not the party leader.
- Added a check so that the 'save on crash' routine won't get stuck if it happens to crash while attempting to save characters.
- People in chat-rooms no longer receive @main messages.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11179 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 17 lat temu
rodzic
commit
1e822f6deb
5 zmienionych plików z 31 dodań i 2 usunięć
  1. 8 0
      Changelog-Trunk.txt
  2. 1 0
      db/const.txt
  3. 1 1
      src/map/clif.c
  4. 6 0
      src/map/map.c
  5. 15 1
      src/map/party.c

+ 8 - 0
Changelog-Trunk.txt

@@ -3,6 +3,14 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+2007/09/10
+	* Corrected /invite letting you invite people even if you are not the party
+	  leader.
+	* Added some reply messages when you try /invite and a. the character is
+	  not found or b. you are not the party leader.
+	* Added a check so that the 'save on crash' routine won't get stuck if it
+	  happens to crash while attempting to save characters.
+	* People in chat-rooms no longer receive @main messages. [Skotlex]
 2007/09/10
 	* Added a safeguard to skill_get_unit_layout() against incorrectly
 	  defined layout ids (will give weird results but won't crash at least)

+ 1 - 0
db/const.txt

@@ -383,6 +383,7 @@ bAddEffWhenHit	2016
 bAutoSpellWhenHit	2017
 bSkillAtk	2018
 bUnstripable	2019
+
 bSPGainValue	2021
 bHPRegenRate	2022
 bHPLossRate	2023

+ 1 - 1
src/map/clif.c

@@ -362,7 +362,7 @@ int clif_send(const uint8* buf, int len, struct block_list* bl, enum send_target
 		for(i=1; i<fd_max; i++) {
 			if (session[i] && session[i]->func_parse == clif_parse &&
 				(sd = (struct map_session_data*)session[i]->session_data) != NULL &&
-				sd->state.mainchat && (fd=sd->fd))
+				sd->state.mainchat && !sd->chatID && (fd=sd->fd))
 			{
 				WFIFOHEAD(fd,len);
 				memcpy(WFIFOP(fd,0), buf, len);

+ 6 - 0
src/map/map.c

@@ -3227,7 +3227,13 @@ static int map_abort_sub(DBKey key,void * data,va_list ap)
 //------------------------------
 void do_abort(void)
 {
+	static int run = 0;
 	//Save all characters and then flush the inter-connection.
+	if (run) {
+		ShowFatalError("Server has crashed while trying to save characters. Character data can't be saved!\n");
+		return;
+	}
+	run = 1;
 	if (!chrif_isconnected())
 	{
 		if (pc_db->size(pc_db))

+ 15 - 1
src/map/party.c

@@ -9,6 +9,7 @@
 #include "../common/showmsg.h"
 
 #include "party.h"
+#include "atcommand.h"	//msg_txt()
 #include "pc.h"
 #include "map.h"
 #include "battle.h"
@@ -259,15 +260,28 @@ int party_invite(struct map_session_data *sd,struct map_session_data *tsd)
 	int i,flag=0;
 	
 	nullpo_retr(0, sd);
+	if (p==NULL)
+		return 0;
 
-	if(tsd==NULL || p==NULL)
+	if(tsd==NULL) {	//TODO: Find the correct reply packet.
+		clif_displaymessage(sd->fd, msg_txt(3));
+		return 0;
+	}
+	//Only leader can invite.
+	ARR_FIND(0, MAX_PARTY, i, i < MAX_PARTY && p->data[i].sd != sd);
+	if (i == MAX_PARTY || !p->party.member[i].leader)
+	{	//TODO: Find the correct reply packet.
+		clif_displaymessage(sd->fd, msg_txt(282));
 		return 0;
+	}
+
 	if(!battle_config.invite_request_check) {
 		if (tsd->guild_invite>0 || tsd->trade_partner) {
 			clif_party_inviteack(sd,tsd->status.name,0);
 			return 0;
 		}
 	}
+
 	if (!tsd->fd) { //You can't invite someone who has already disconnected.
 		clif_party_inviteack(sd,tsd->status.name,1);
 		return 0;