summaryrefslogtreecommitdiff
path: root/src/char_sql/char.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-25 09:56:18 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-25 09:56:18 +0000
commitfc135d64a1ad6b36d807e6b7ab9d804bffe95e48 (patch)
tree0c443f2942d07e145f1055d2301d215ebd317976 /src/char_sql/char.c
parentf257beaebc07d3a1d8acae247f10ab35a19d867c (diff)
downloadhercules-fc135d64a1ad6b36d807e6b7ab9d804bffe95e48.tar.gz
hercules-fc135d64a1ad6b36d807e6b7ab9d804bffe95e48.tar.bz2
hercules-fc135d64a1ad6b36d807e6b7ab9d804bffe95e48.tar.xz
hercules-fc135d64a1ad6b36d807e6b7ab9d804bffe95e48.zip
Added proper checks to adoption processing (followup to r12428).
Cleaned up some code / fixed some typos. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12432 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql/char.c')
-rw-r--r--src/char_sql/char.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 73907cf22..9112265da 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -1943,7 +1943,7 @@ int parse_fromlogin(int fd)
{
WFIFOHEAD(i,3);
WFIFOW(i,0) = 0x81;
- WFIFOB(i,2) = 2;
+ WFIFOB(i,2) = 2; // "Someone has already logged in with this id"
WFIFOSET(i,3);
}
else //Shouldn't happen, but just in case.
@@ -2871,11 +2871,17 @@ int parse_char(int fd)
{
// request to connect
+ // 0065 <account id>.L <login id1>.L <login id2>.L <???>.W <sex>.B
case 0x65:
if (RFIFOREST(fd) < 17)
return 0;
{
- ShowInfo("request connect - account_id:%d/login_id1:%d/login_id2:%d\n", RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10));
+ int account_id = RFIFOL(fd,2);
+ int login_id1 = RFIFOL(fd,6);
+ int login_id2 = RFIFOL(fd,10);
+ int sex = RFIFOB(fd,16);
+
+ ShowInfo("request connect - account_id:%d/login_id1:%d/login_id2:%d\n", account_id, login_id1, login_id2);
if (sd) {
//Received again auth packet for already authentified account?? Discard it.
//TODO: Perhaps log this as a hack attempt?
@@ -2887,15 +2893,15 @@ int parse_char(int fd)
CREATE(session[fd]->session_data, struct char_session_data, 1);
sd = (struct char_session_data*)session[fd]->session_data;
sd->connect_until_time = 0; // unknown or unlimited (not displaying on map-server)
- sd->account_id = RFIFOL(fd,2);
- sd->login_id1 = RFIFOL(fd,6);
- sd->login_id2 = RFIFOL(fd,10);
- sd->sex = RFIFOB(fd,16);
+ sd->account_id = account_id;
+ sd->login_id1 = login_id1;
+ sd->login_id2 = login_id2;
+ sd->sex = sex;
sd->auth = false; // not authed yet
// send back account_id
WFIFOHEAD(fd,4);
- WFIFOL(fd,0) = RFIFOL(fd,2);
+ WFIFOL(fd,0) = account_id;
WFIFOSET(fd,4);
// search authentification