Skip to content

Commit

Permalink
Char_serv upd
Browse files Browse the repository at this point in the history
-Fix bugreport:7970 (char deletion for 2013+ client, thx ivanyan)
-Fix bugreport:8087 (guild storage broken by bound_item)
  • Loading branch information
lighta committed Oct 8, 2013
1 parent 475e6b7 commit 9a5a6b9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
28 changes: 20 additions & 8 deletions src/char/char.c
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,7 @@ int mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p)
offset += MAP_NAME_LENGTH_EXT;
#endif
#if PACKETVER >= 20100803
WBUFL(buf,124) = TOL(p->delete_date);
WBUFL(buf,124) = (p->delete_date?TOL(p->delete_date)-time(NULL):0);
offset += 4;
#endif
#if PACKETVER >= 20110111
Expand Down Expand Up @@ -3592,7 +3592,11 @@ void char_delete2_ack(int fd, int char_id, uint32 result, time_t delete_date)
WFIFOW(fd,0) = 0x828;
WFIFOL(fd,2) = char_id;
WFIFOL(fd,6) = result;
#if PACKETVER > 20130000
WFIFOL(fd,10) = TOL(delete_date) - time(NULL);
#else
WFIFOL(fd,10) = TOL(delete_date);
#endif
WFIFOSET(fd,14);
}

Expand All @@ -3607,11 +3611,20 @@ void char_delete2_ack(int fd, int char_id, uint32 result, time_t delete_date)
/// Any (0x718): An unknown error has occurred.
void char_delete2_accept_ack(int fd, int char_id, uint32 result)
{// HC: <082a>.W <char id>.L <Msg:0-5>.L
WFIFOHEAD(fd,10);
WFIFOW(fd,0) = 0x82a;
WFIFOL(fd,2) = char_id;
WFIFOL(fd,6) = result;
WFIFOSET(fd,10);
if(result == 1)
{
struct char_session_data* sd;
sd = (struct char_session_data*)session[fd]->session_data;
mmo_char_send(fd, sd);
}
else
{
WFIFOHEAD(fd,10);
WFIFOW(fd,0) = 0x82a;
WFIFOL(fd,2) = char_id;
WFIFOL(fd,6) = result;
WFIFOSET(fd,10);
}
}


Expand Down Expand Up @@ -3755,8 +3768,7 @@ static void char_delete2_accept(int fd, struct char_session_data* sd)
}

// refresh character list cache
for(k = i; k < MAX_CHARS-1; k++)
{
for(k = i; k < MAX_CHARS-1; k++) {
sd->found_char[k] = sd->found_char[k+1];
}
sd->found_char[MAX_CHARS-1] = -1;
Expand Down
6 changes: 5 additions & 1 deletion src/char/int_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ int mapif_parse_itembound_retrieve(int fd)
SqlStmt_ShowDebug(stmt);
SqlStmt_Free(stmt);
StringBuf_Destroy(&buf);
mapif_itembound_ack(fd,aid,guild_id);
return 1;
}

Expand All @@ -297,10 +298,11 @@ int mapif_parse_itembound_retrieve(int fd)
}
}
Sql_FreeResult(sql_handle);

if(!i) { //No items found - No need to continue
StringBuf_Destroy(&buf);
SqlStmt_Free(stmt);
mapif_itembound_ack(fd,aid,guild_id);
return 0;
}

Expand All @@ -321,6 +323,7 @@ int mapif_parse_itembound_retrieve(int fd)
SqlStmt_ShowDebug(stmt);
SqlStmt_Free(stmt);
StringBuf_Destroy(&buf);
mapif_itembound_ack(fd,aid,guild_id);
return 1;
}

Expand Down Expand Up @@ -351,6 +354,7 @@ int mapif_parse_itembound_retrieve(int fd)
SqlStmt_ShowDebug(stmt);
SqlStmt_Free(stmt);
StringBuf_Destroy(&buf);
mapif_itembound_ack(fd,aid,guild_id);
return 1;
}

Expand Down

0 comments on commit 9a5a6b9

Please sign in to comment.