Small party/guild creation cleanup. Added packet comments. Removed fake reply packet usage.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12538 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
db678f0eb0
commit
c16def84aa
@ -5980,7 +5980,12 @@ int clif_mvp_exp(struct map_session_data *sd, unsigned int exp)
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* ギルド作成可否通知
|
||||
* Guild creation result
|
||||
* R 0167 <flag>.B
|
||||
* flag = 0 -> "Guild has been created."
|
||||
* flag = 1 -> "You are already in a Guild."
|
||||
* flag = 2 -> "That Guild Name already exists."
|
||||
* flag = 3 -> "You need the neccessary item to create a Guild."
|
||||
*------------------------------------------*/
|
||||
int clif_guild_created(struct map_session_data *sd,int flag)
|
||||
{
|
||||
@ -9696,6 +9701,9 @@ void clif_parse_StoragePassword(int fd, struct map_session_data *sd)
|
||||
*------------------------------------------*/
|
||||
void clif_parse_CreateParty(int fd, struct map_session_data *sd)
|
||||
{
|
||||
char* name = (char*)RFIFOP(fd,2);
|
||||
name[NAME_LENGTH-1] = '\0';
|
||||
|
||||
if( map[sd->bl.m].flag.partylock )
|
||||
{// Party locked.
|
||||
clif_displaymessage(fd, msg_txt(227));
|
||||
@ -9707,14 +9715,16 @@ void clif_parse_CreateParty(int fd, struct map_session_data *sd)
|
||||
return;
|
||||
}
|
||||
|
||||
party_create(sd,(char*)RFIFOP(fd,2),0,0);
|
||||
party_create(sd,name,0,0);
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* パーティを作る
|
||||
*------------------------------------------*/
|
||||
void clif_parse_CreateParty2(int fd, struct map_session_data *sd)
|
||||
{
|
||||
char* name = (char*)RFIFOP(fd,2);
|
||||
int item1 = RFIFOB(fd,26);
|
||||
int item2 = RFIFOB(fd,27);
|
||||
name[NAME_LENGTH-1] = '\0';
|
||||
|
||||
if( map[sd->bl.m].flag.partylock )
|
||||
{// Party locked.
|
||||
clif_displaymessage(fd, msg_txt(227));
|
||||
@ -9726,7 +9736,7 @@ void clif_parse_CreateParty2(int fd, struct map_session_data *sd)
|
||||
return;
|
||||
}
|
||||
|
||||
party_create(sd,(char*)RFIFOP(fd,2),RFIFOB(fd,26),RFIFOB(fd,27));
|
||||
party_create(sd,name,item1,item2);
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -9951,16 +9961,21 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd)
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* ギルドを作る
|
||||
* Guild creation request
|
||||
* S 0165 <account id>.L <guild name>.24S
|
||||
*------------------------------------------*/
|
||||
void clif_parse_CreateGuild(int fd,struct map_session_data *sd)
|
||||
{
|
||||
char* name = (char*)RFIFOP(fd,6);
|
||||
name[NAME_LENGTH-1] = '\0';
|
||||
|
||||
if(map[sd->bl.m].flag.guildlock)
|
||||
{ //Guild locked.
|
||||
clif_displaymessage(fd, msg_txt(228));
|
||||
return;
|
||||
}
|
||||
guild_create(sd, (char*)RFIFOP(fd,6));
|
||||
|
||||
guild_create(sd, name);
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
|
@ -397,29 +397,32 @@ int guild_send_dot_remove(struct map_session_data *sd)
|
||||
}
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
// 作成要求
|
||||
int guild_create(struct map_session_data *sd,char *name)
|
||||
int guild_create(struct map_session_data *sd, const char *name)
|
||||
{
|
||||
char tname[NAME_LENGTH];
|
||||
struct guild_member m;
|
||||
nullpo_retr(0, sd);
|
||||
|
||||
safestrncpy(tname, name, NAME_LENGTH);
|
||||
if( strlen(trim(tname)) == 0 )
|
||||
return 0; // empty name
|
||||
|
||||
if(sd->status.guild_id || strlen(trim(tname)) == 0)
|
||||
{
|
||||
clif_guild_created(sd,1); // すでに所属している
|
||||
if( sd->status.guild_id )
|
||||
{// already in a guild
|
||||
clif_guild_created(sd,1);
|
||||
return 0;
|
||||
}
|
||||
if(!battle_config.guild_emperium_check || pc_search_inventory(sd,714) >= 0) {
|
||||
struct guild_member m;
|
||||
if( battle_config.guild_emperium_check && pc_search_inventory(sd,714) == -1 )
|
||||
{// item required
|
||||
clif_guild_created(sd,3);
|
||||
return 0;
|
||||
}
|
||||
|
||||
guild_makemember(&m,sd);
|
||||
m.position=0;
|
||||
intif_guild_create(name,&m);
|
||||
return 1;
|
||||
}
|
||||
clif_guild_created(sd,3); // エンペリウムがいない
|
||||
return 0;
|
||||
}
|
||||
|
||||
// <20>ì<EFBFBD>¬‰Â”Û
|
||||
int guild_created(int account_id,int guild_id)
|
||||
|
@ -44,7 +44,7 @@ int guild_getposition(struct guild *g, struct map_session_data *sd);
|
||||
unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp);
|
||||
int guild_getexp(struct map_session_data *sd,int exp); // [Celest]
|
||||
|
||||
int guild_create(struct map_session_data *sd,char *name);
|
||||
int guild_create(struct map_session_data *sd, const char *name);
|
||||
int guild_created(int account_id,int guild_id);
|
||||
int guild_request_info(int guild_id);
|
||||
int guild_recv_noinfo(int guild_id);
|
||||
|
@ -110,16 +110,16 @@ int party_create(struct map_session_data *sd,char *name,int item,int item2)
|
||||
{
|
||||
struct party_member leader;
|
||||
char tname[NAME_LENGTH];
|
||||
safestrncpy(tname, name, NAME_LENGTH);
|
||||
|
||||
if(sd->status.party_id) {
|
||||
clif_party_created(sd,2);
|
||||
return 0; // "already in a party"
|
||||
safestrncpy(tname, name, NAME_LENGTH);
|
||||
if( strlen(trim(tname)) == 0 )
|
||||
{// empty name
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(strlen(trim(tname)) == 0)
|
||||
{
|
||||
clif_party_created(sd, 1);
|
||||
if( sd->status.party_id )
|
||||
{// already in a party
|
||||
clif_party_created(sd,2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user