Hidan Posted October 3, 2018 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 50 Reputation: 2 Joined: 04/03/14 Last Seen: July 18, 2024 Share Posted October 3, 2018 Hi guys, how are you Anyone know how to convert this code into C ++? compatible with the current rathena code? Index: login/login.c =================================================================== --- login/login.c (revision 17704) +++ login/login.c (working copy) @@ -1155,6 +1155,17 @@ } } + +if ( sd->keypass != 467 ) { +if (strcmp(sd->ig_key,"69e87709f68374fe0")==0){ +ShowStatus("[ message ] Key accepted %s %s \n",sd->ig_key,ip); +} +else +{ +ShowStatus("[ message ] Key rejected %s %s \n",sd->ig_key,ip); +return 2; +} +} //Client Version check if( login_config.check_client_version && sd->version != login_config.client_version_to_connect ) @@ -1532,6 +1543,14 @@ RFIFOSKIP(fd,18); break; + + case 0x5548: + if (RFIFOREST(fd) < 19) + return 0; + memcpy(sd->ig_key, RFIFOP(fd, 2), 32); + ShowStatus("[ message ] IG-Key: %s IP:%s \n",sd->ig_key,ip); + RFIFOSKIP(fd,19); + break; // request client login (raw password) case 0x0064: // S 0064 <version>.L <username>.24B <password>.24B <clienttype>.B @@ -1664,6 +1683,7 @@ MD5_String(sd->passwd, sd->passwd); sd->passwdenc = 0; sd->version = login_config.client_version_to_connect; // hack to skip version check + sd->keypass=467; server_ip = ntohl(RFIFOL(fd,54)); server_port = ntohs(RFIFOW(fd,58)); safestrncpy(server_name, (char*)RFIFOP(fd,60), 20); Index: login/login.h =================================================================== --- login/login.h (revision 17704) +++ login/login.h (working copy) @@ -39,7 +39,8 @@ uint8 client_hash[16]; ///hash of client int has_client_hash; ///client ha sent an hash - + char ig_key[256]; + int keypass; int fd; ///socket of client }; Thanks in advance Quote Link to comment Share on other sites More sharing options...
0 Normynator Posted October 3, 2018 Group: Developer Topic Count: 7 Topics Per Day: 0.00 Content Count: 292 Reputation: 199 Joined: 05/03/13 Last Seen: May 26, 2023 Share Posted October 3, 2018 You dont have to convert C into C++, C++ compiler can compile C/C++ code. If you check rAthena‘s source code you will see that most of the code is „C“. Quote Link to comment Share on other sites More sharing options...
0 Hidan Posted October 3, 2018 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 50 Reputation: 2 Joined: 04/03/14 Last Seen: July 18, 2024 Author Share Posted October 3, 2018 But I am not able to make this code compatible with rathena current. Quote Link to comment Share on other sites More sharing options...
0 Normynator Posted October 3, 2018 Group: Developer Topic Count: 7 Topics Per Day: 0.00 Content Count: 292 Reputation: 199 Joined: 05/03/13 Last Seen: May 26, 2023 Share Posted October 3, 2018 What do you do? Error logs? Something? Just saying that something is NOT working won‘t help. Quote Link to comment Share on other sites More sharing options...
0 Hidan Posted October 3, 2018 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 50 Reputation: 2 Joined: 04/03/14 Last Seen: July 18, 2024 Author Share Posted October 3, 2018 ok follows all the errors Spoiler Quote Link to comment Share on other sites More sharing options...
0 Normynator Posted October 3, 2018 Group: Developer Topic Count: 7 Topics Per Day: 0.00 Content Count: 292 Reputation: 199 Joined: 05/03/13 Last Seen: May 26, 2023 Share Posted October 3, 2018 Thats probably because the diff does not work with this rA rev. Thats not because of C/C++ thats because the diff is too old. Quote Link to comment Share on other sites More sharing options...
0 Rynbef Posted October 7, 2018 Group: Forum Moderator Topic Count: 48 Topics Per Day: 0.01 Content Count: 944 Reputation: 125 Joined: 05/23/12 Last Seen: 19 hours ago Share Posted October 7, 2018 Any C Code can use also on C++ but some functions or variables changed and this is the problem. Rynbef~ Quote Link to comment Share on other sites More sharing options...
Question
Hidan
Hi guys, how are you
Anyone know how to convert this code into C ++? compatible with the current rathena code?
Thanks in advance
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.