diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-31 20:37:39 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-31 20:37:39 +0000 |
commit | 353b697f724a54e5d4f578b0509d8d6e6959d299 (patch) | |
tree | 7f53009c9f9f72347c68f20f66fbf4fe3913f934 /src/char_sql | |
parent | d0d7cb926f66b1e2dbf7e57291c00c27437dcc07 (diff) | |
download | hercules-353b697f724a54e5d4f578b0509d8d6e6959d299.tar.gz hercules-353b697f724a54e5d4f578b0509d8d6e6959d299.tar.bz2 hercules-353b697f724a54e5d4f578b0509d8d6e6959d299.tar.xz hercules-353b697f724a54e5d4f578b0509d8d6e6959d299.zip |
- Made the char_name_option char_athena.conf setting apply to parties and guilds as well. It cannot be applied to pets yet without adding a change-name-request interserver packet.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6897 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r-- | src/char_sql/char.h | 2 | ||||
-rw-r--r-- | src/char_sql/int_guild.c | 15 | ||||
-rw-r--r-- | src/char_sql/int_party.c | 15 |
3 files changed, 32 insertions, 0 deletions
diff --git a/src/char_sql/char.h b/src/char_sql/char.h index 51c4426db..620e5ccd1 100644 --- a/src/char_sql/char.h +++ b/src/char_sql/char.h @@ -59,6 +59,8 @@ int char_child(int parent_id, int child_id); int request_accreg2(int account_id, int char_id);
int save_accreg2(unsigned char* buf, int len);
+extern int char_name_option;
+extern char char_name_letters[];
extern bool char_gm_read;
extern int autosave_interval;
extern int save_log;
diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c index ed30c7031..1849ba130 100644 --- a/src/char_sql/int_guild.c +++ b/src/char_sql/int_guild.c @@ -1185,6 +1185,21 @@ int mapif_parse_CreateGuild(int fd,int account_id,char *name,struct guild_member mapif_guild_created(fd,account_id,NULL);
return 0;
}
+ // Check Authorised letters/symbols in the name of the character
+ if (char_name_option == 1) { // only letters/symbols in char_name_letters are authorised
+ for (i = 0; i < NAME_LENGTH && name[i]; i++)
+ if (strchr(char_name_letters, name[i]) == NULL) {
+ mapif_guild_created(fd,account_id,NULL);
+ return 0;
+ }
+ } else if (char_name_option == 2) { // letters/symbols in char_name_letters are forbidden
+ for (i = 0; i < NAME_LENGTH && name[i]; i++)
+ if (strchr(char_name_letters, name[i]) != NULL) {
+ mapif_guild_created(fd,account_id,NULL);
+ return 0;
+ }
+ }
+
g = (struct guild *)aMalloc(sizeof(struct guild));
memset(g,0,sizeof(struct guild));
diff --git a/src/char_sql/int_party.c b/src/char_sql/int_party.c index 2bdb13aa9..3d6943839 100644 --- a/src/char_sql/int_party.c +++ b/src/char_sql/int_party.c @@ -499,6 +499,21 @@ int mapif_parse_CreateParty(int fd, int account_id, int char_id, char *name, cha mapif_party_created(fd,account_id,char_id,NULL);
return 0;
}
+ // Check Authorised letters/symbols in the name of the character
+ if (char_name_option == 1) { // only letters/symbols in char_name_letters are authorised
+ for (i = 0; i < NAME_LENGTH && name[i]; i++)
+ if (strchr(char_name_letters, name[i]) == NULL) {
+ mapif_party_created(fd,account_id,char_id,NULL);
+ return 0;
+ }
+ } else if (char_name_option == 2) { // letters/symbols in char_name_letters are forbidden
+ for (i = 0; i < NAME_LENGTH && name[i]; i++)
+ if (strchr(char_name_letters, name[i]) != NULL) {
+ mapif_party_created(fd,account_id,char_id,NULL);
+ return 0;
+ }
+ }
+
p= aCalloc(1, sizeof(struct party));
memcpy(p->name,name,NAME_LENGTH);
|