diff options
Diffstat (limited to 'src/char/char.c')
-rw-r--r-- | src/char/char.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/char/char.c b/src/char/char.c index ffb093f..fcb4535 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -31,3 +31,31 @@ void echar_parse_char_login_map_server(int *fd) hookStop(); } } + +void echar_parse_char_create_new_char(int *fdPtr, struct char_session_data* sd) +{ + // ignore char creation disable option + const int fd = *fdPtr; + const int result = chr->make_new_char_sql(sd, (char*)RFIFOP(fd, 2), 1, 1, 1, 1, 1, 1, RFIFOB(fd, 26), RFIFOW(fd, 27), RFIFOW(fd, 29)); + if (result < 0) + { + chr->creation_failed(fd, result); + } + else + { + // retrieve data + struct mmo_charstatus char_dat; + chr->mmo_char_fromsql(result, &char_dat, false); //Only the short data is needed. + + const uint16 race = RFIFOW(fd, 31); + char_dat.class_ = race; + chr->mmo_char_tosql(result, &char_dat); + + chr->creation_ok(fd, &char_dat); + + // add new entry to the chars list + sd->found_char[char_dat.slot] = result; // the char_id of the new char + } + RFIFOSKIP(fd, 31 + 2); + hookStop(); +} |