* Added a fix to @sound where if you forgot the .wav exention, i'd attempt to play the file without it (it adds the .wav) [Codemaster] [SVN 949]

* Added @disguiseall / @undisguiseall [Codemaster] [SVN 949]
* Added misc. clif.c fixes (jAthena added alot of close(fd)'s, so i added them, too) [Codemaster] [SVN 949]
* Added bug reports - Celest, you might want to check one of those out [Codemaster] [SVN 949]

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@949 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
codemaster 2005-01-11 03:32:32 +00:00
parent c235d956bf
commit f955bd688d
7 changed files with 115 additions and 9 deletions

View File

@ -1,5 +1,9 @@
Date Added Date Added
01/11 01/11
* Added a fix to @sound where if you forgot the .wav exention, i'd attempt to play the file without it (it adds the .wav) [Codemaster] [SVN 949]
* Added @disguiseall / @undisguiseall [Codemaster] [SVN 949]
* Added misc. clif.c fixes (jAthena added alot of close(fd)'s, so i added them, too) [Codemaster] [SVN 949]
* Added bug reports - Celest, you might want to check one of those out [Codemaster] [SVN 949]
* Fixed a bug in clif.c which didn't allow to enther the map-server. * Fixed a bug in clif.c which didn't allow to enther the map-server.
It worked under win32, but didn't under Linux. [Lupus] It worked under win32, but didn't under Linux. [Lupus]
01/10 01/10

View File

@ -209,3 +209,10 @@ Problem: SCRIPT CRASH BUG
Assigned: N/A Assigned: N/A
Progress: 0% Progress: 0%
Problem: Berserk Skill supposedly disappears randomly.
Assigned: N/A
Progress: 0%
Problem: Lord Kaho Horns supposedly disappear when equipped.
Assigned: N/A
Progress: 0%

View File

@ -295,6 +295,9 @@ charkillable: 40
charkillableid: 40 charkillableid: 40
charkillableid2: 40 charkillableid2: 40
// Play a Sound!
sound: 40
//--------------------- //---------------------
// 50: Sub-GM+ commands // 50: Sub-GM+ commands
@ -609,6 +612,10 @@ setbattleflag: 99
// Refresh only status of players - SQL Only // Refresh only status of players - SQL Only
refreshonline: 99 refreshonline: 99
// [Un]Disguise All Players
disguiseall: 99
undisguiseall: 99
//--------------------------------------------------------------- //---------------------------------------------------------------
// 99: Weather effects // 99: Weather effects

View File

@ -217,7 +217,7 @@ ACMD_FUNC(readmail); // [Valaris]
ACMD_FUNC(sendmail); // [Valaris] ACMD_FUNC(sendmail); // [Valaris]
ACMD_FUNC(sendprioritymail); // [Valaris] ACMD_FUNC(sendprioritymail); // [Valaris]
ACMD_FUNC(deletemail); // [Valaris] ACMD_FUNC(deletemail); // [Valaris]
ACMD_FUNC(sound); // [Valaris] //ACMD_FUNC(sound); // [Valaris]
ACMD_FUNC(refreshonline); // [Valaris] ACMD_FUNC(refreshonline); // [Valaris]
#endif /* TXT_ONLY */ #endif /* TXT_ONLY */
@ -248,6 +248,8 @@ ACMD_FUNC(killid2); // by Dino9021
ACMD_FUNC(charkillableid); // by Dino9021 ACMD_FUNC(charkillableid); // by Dino9021
ACMD_FUNC(charkillableid2); // by Dino9021 ACMD_FUNC(charkillableid2); // by Dino9021
ACMD_FUNC(sound); ACMD_FUNC(sound);
ACMD_FUNC(undisguiseall);
ACMD_FUNC(disguiseall);
/*========================================== /*==========================================
*AtCommandInfo atcommand_info[]<EFBFBD>\¢ÌÌè` *AtCommandInfo atcommand_info[]<EFBFBD>\¢ÌÌè`
@ -518,6 +520,8 @@ static AtCommandInfo atcommand_info[] = {
{ AtCommand_CharKillableId, "@charkillableid", 40, atcommand_charkillableid }, // [Dino9021] { AtCommand_CharKillableId, "@charkillableid", 40, atcommand_charkillableid }, // [Dino9021]
{ AtCommand_CharKillableId2, "@charkillableid2", 40, atcommand_charkillableid2 }, // [Dino9021] { AtCommand_CharKillableId2, "@charkillableid2", 40, atcommand_charkillableid2 }, // [Dino9021]
{ AtCommand_Sound, "@sound", 40, atcommand_sound }, { AtCommand_Sound, "@sound", 40, atcommand_sound },
{ AtCommand_UndisguiseAll, "@undisguiseall", 99, atcommand_undisguiseall },
{ AtCommand_DisguiseAll, "@disguiseall", 99, atcommand_disguiseall },
// add new commands before this line // add new commands before this line
{ AtCommand_Unknown, NULL, 1, NULL } { AtCommand_Unknown, NULL, 1, NULL }
@ -6452,6 +6456,50 @@ int atcommand_disguise(
return 0; return 0;
} }
/*==========================================
* DisguiseAll
*------------------------------------------
*/
int atcommand_disguiseall(
const int fd, struct map_session_data* sd,
const char* command, const char* message)
{
int mob_id=0, i=0;
struct map_session_data *pl_sd;
nullpo_retr(-1, sd);
if (!message || !*message) {
clif_displaymessage(fd, "Please, enter a Monster/NPC name/id (usage: @disguiseall <monster_name_or_monster_ID>).");
return -1;
}
if ((mob_id = mobdb_searchname(message)) == 0) // check name first (to avoid possible name begining by a number)
mob_id = atoi(message);
if ((mob_id >= 46 && mob_id <= 125) || (mob_id >= 700 && mob_id <= 718) || // NPC
(mob_id >= 721 && mob_id <= 755) || (mob_id >= 757 && mob_id <= 811) || // NPC
(mob_id >= 813 && mob_id <= 834) || // NPC
(mob_id > 1000 && mob_id < 1582)) { // monsters
for(i=0; i < fd_max; i++) {
if(session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
if(pc_isriding(pl_sd)) { // temporary prevention of crash caused by peco + disguise, will look into a better solution [Valaris]
clif_displaymessage(fd, msg_table[227]); // Cannot wear disguise while riding a Peco.
} else {
pl_sd->disguiseflag = 1; // set to override items with disguise script [Valaris]
pl_sd->disguise = mob_id;
pc_setpos(pl_sd, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y, 3);
}
}
}
clif_displaymessage(fd, msg_table[122]); // Disguise applied.
} else {
return -1;
}
return 0;
}
/*========================================== /*==========================================
* @undisguise by [Yor] * @undisguise by [Yor]
*------------------------------------------ *------------------------------------------
@ -6474,6 +6522,30 @@ int atcommand_undisguise(
return 0; return 0;
} }
/*==========================================
* UndisguiseAll
*------------------------------------------
*/
int atcommand_undisguiseall(
const int fd, struct map_session_data* sd,
const char* command, const char* message)
{
struct map_session_data *pl_sd;
int i;
nullpo_retr(-1, sd);
for(i=0; i < fd_max; i++) {
if(session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && pl_sd->disguise) {
clif_clearchar(&pl_sd->bl, 9);
pl_sd->disguise = 0;
pc_setpos(pl_sd, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y, 3);
}
}
clif_displaymessage(fd, msg_table[124]); // Undisguise applied.
return 0;
}
/*========================================== /*==========================================
* @broadcast by [Valaris] * @broadcast by [Valaris]
*------------------------------------------ *------------------------------------------
@ -7579,6 +7651,9 @@ atcommand_sound(
if(sscanf(message, "%99[^\n]", sound_file) < 1) if(sscanf(message, "%99[^\n]", sound_file) < 1)
return -1; return -1;
if(strstr(sound_file, ".wav") == NULL)
strcat(sound_file, ".wav");
clif_soundeffectall(&sd->bl, sound_file,0); clif_soundeffectall(&sd->bl, sound_file,0);
return 0; return 0;

View File

@ -233,6 +233,8 @@ enum AtCommandType {
AtCommand_CharKillableId, // by Dino9021 AtCommand_CharKillableId, // by Dino9021
AtCommand_CharKillableId2, // by Dino9021 AtCommand_CharKillableId2, // by Dino9021
AtCommand_Sound, AtCommand_Sound,
AtCommand_UndisguiseAll,
AtCommand_DisguiseAll,
// end // end
AtCommand_Unknown, AtCommand_Unknown,

View File

@ -1527,6 +1527,7 @@ static int clif_waitclose(int tid, unsigned int tick, int id, int data) {
if (session[id]) if (session[id])
session[id]->eof = 1; session[id]->eof = 1;
close(id);
return 0; return 0;
} }
@ -10347,6 +10348,7 @@ static int clif_parse(int fd) {
RFIFOSKIP(fd,2); RFIFOSKIP(fd,2);
break; break;
case 0x7532: // 接続の切断 case 0x7532: // 接続の切断
close(fd);
session[fd]->eof=1; session[fd]->eof=1;
break; break;
} }
@ -10416,6 +10418,7 @@ static int clif_parse(int fd) {
cmd >= MAX_PACKET_DB || packet_size_table[packet_ver-5][cmd] == 0) { cmd >= MAX_PACKET_DB || packet_size_table[packet_ver-5][cmd] == 0) {
if (!fd) if (!fd)
return 0; return 0;
close(fd);
session[fd]->eof = 1; session[fd]->eof = 1;
printf("clif_parse: session #%d, packet 0x%x (%d bytes received) -> disconnected.\n", fd, cmd, RFIFOREST(fd)); printf("clif_parse: session #%d, packet 0x%x (%d bytes received) -> disconnected.\n", fd, cmd, RFIFOREST(fd));
return 0; return 0;
@ -10428,6 +10431,7 @@ static int clif_parse(int fd) {
return 0; // 可変長パケットで長さの所までデータが来てない return 0; // 可変長パケットで長さの所までデータが来てない
packet_len = RFIFOW(fd,2); packet_len = RFIFOW(fd,2);
if (packet_len < 4 || packet_len > 32768) { if (packet_len < 4 || packet_len > 32768) {
close(fd);
session[fd]->eof =1; session[fd]->eof =1;
return 0; return 0;
} }

View File

@ -13,7 +13,14 @@ typedef unsigned int in_addr_t;
#include "map.h" #include "map.h"
#define MAX_PACKET_DB 0x224
extern int packet_db_ver; extern int packet_db_ver;
struct packet_db {
short len;
void (*func)();
short pos[20];
};
void clif_setip(char*); void clif_setip(char*);
void clif_setport(int); void clif_setport(int);