summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/char/char.c14
-rw-r--r--src/login/login.c30
-rw-r--r--src/map/chrif.c4
3 files changed, 46 insertions, 2 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 399ac2a5c..152c9247b 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -2412,6 +2412,20 @@ int parse_frommap(int fd) {
// printf("char: save_account_reg (from map)\n");
break;
}
+ // Map server send information to change an email of an account -> login-server
+ case 0x3000:
+ if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2))
+ return 0;
+ if (login_fd > 0) { // don't send request if no login-server
+ WFIFOW(login_fd,0) = 0x3000;
+ WFIFOW(login_fd,2) = RFIFOW(fd,2);
+ WFIFOL(login_fd,4) = RFIFOL(fd,4);
+ WFIFOB(login_fd,8) = RFIFOB(fd,8);
+ WFIFOSET(login_fd, RFIFOW(fd,2));
+ printf("char : change sex -> login %d %d %d \n", RFIFOL(fd,4), RFIFOB(fd,8), RFIFOW(fd,2));
+ }
+ RFIFOSKIP(fd, RFIFOW(fd,2));
+ break;
default:
// inter serverɓn
diff --git a/src/login/login.c b/src/login/login.c
index 5ec6ac201..e51024d9b 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -1677,6 +1677,36 @@ int parse_fromchar(int fd) {
RFIFOSKIP(fd,6);
}
return 0;
+ case 0x3000: //change sex for chrif_changesex()
+ if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2))
+ return 0;
+ {
+ int acc, sex, i = 0;
+ acc = RFIFOL(fd,4);
+ sex = RFIFOB(fd,8);
+ if (sex != 0 && sex != 1)
+ sex = 0;
+ for(i = 0; i < auth_num; i++) {
+ if (auth_dat[i].account_id == acc) {
+ unsigned char buf[16];
+ login_log("Char-server '%s': Sex change (account: %d, new sex %c, ip: %s)." RETCODE,
+ server[id].name, acc, (sex == 2) ? 'S' : (sex ? 'M' : 'F'), ip);
+ auth_fifo[i].login_id1++; // to avoid reconnection error when come back from map-server (char-server will ask again the authentification)
+ auth_dat[i].sex = sex;
+ WBUFW(buf,0) = 0x2723;
+ WBUFL(buf,2) = acc;
+ WBUFB(buf,6) = sex;
+ charif_sendallwos(-1, buf, 7);
+ break;
+ }
+ }
+ if (i == auth_num) {
+ login_log("Char-server '%s': Error of Sex change (account: %d not found, suggested sex %c, ip: %s)." RETCODE,
+ server[id].name, acc, (sex == 2) ? 'S' : (sex ? 'M' : 'F'), ip);
+ }
+ RFIFOSKIP(fd,RFIFOW(fd,2));
+ }
+ return 0;
default:
{
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 2a5f35a37..876c71758 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -419,11 +419,11 @@ int chrif_char_ask_name(int id, char * character_name, short operation_type, int
*------------------------------------------
*/
int chrif_changesex(int id, int sex) {
- WFIFOW(char_fd,0) = 0x2b0c;
+ WFIFOW(char_fd,0) = 0x3000;
WFIFOW(char_fd,2) = 9;
WFIFOL(char_fd,4) = id;
WFIFOB(char_fd,8) = sex;
- printf("chrif : sended 0x2b0c\n");
+ printf("chrif : sent 0x3000(changesex)\n");
WFIFOSET(char_fd,9);
return 0;
}