summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-13 12:35:57 +0000
committermc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-13 12:35:57 +0000
commitc905e2e19a9f913a4ea51b8a32dc97735a01b091 (patch)
treeee268e1dc482f4ae0a9ebd2cf5142a4873798bc4
parent053eaa2d289853af24a28bc82e08ffcb74cbaf24 (diff)
downloadhercules-c905e2e19a9f913a4ea51b8a32dc97735a01b091.tar.gz
hercules-c905e2e19a9f913a4ea51b8a32dc97735a01b091.tar.bz2
hercules-c905e2e19a9f913a4ea51b8a32dc97735a01b091.tar.xz
hercules-c905e2e19a9f913a4ea51b8a32dc97735a01b091.zip
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@157 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog.txt2
-rw-r--r--src/char/char.c14
-rw-r--r--src/login/login.c30
-rw-r--r--src/map/chrif.c4
4 files changed, 48 insertions, 2 deletions
diff --git a/Changelog.txt b/Changelog.txt
index 95c86e766..11b23cc7f 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,4 +1,6 @@
Date Added
+11/13
+ * Fixed chrif_changesex and @changesex, now uses packet 0x3000. [MC Cameri]
11/12
* added folder: /save-tmpl, removed folder /save
* battle_athena.conf: Updated Packet Version Flags.
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;
}