From 4d81f68ece4dee6282024fe7189d8402a05428db Mon Sep 17 00:00:00 2001 From: amber Date: Wed, 30 Mar 2005 22:14:36 +0000 Subject: eAthena VC7 solution and support added for native builds [MouseJstr] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1347 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-SVN.txt | 5 + eAthena.sln | 37 ++++ src/char/char.c | 21 ++- src/char/int_guild.c | 8 +- src/char/int_party.c | 4 +- src/char/inter.c | 8 +- src/login/login.c | 2 + src/login_sql/login.c | 2 + src/map/clif.c | 2 +- src/map/mail.c | 2 + src/map/skill.c | 1 + vcproj/char-server_txt.vcproj | 179 +++++++++++++++++++ vcproj/login-server_txt.vcproj | 167 ++++++++++++++++++ vcproj/map-server_txt.vcproj | 377 +++++++++++++++++++++++++++++++++++++++++ 14 files changed, 797 insertions(+), 18 deletions(-) create mode 100644 eAthena.sln create mode 100644 vcproj/char-server_txt.vcproj create mode 100644 vcproj/login-server_txt.vcproj create mode 100644 vcproj/map-server_txt.vcproj diff --git a/Changelog-SVN.txt b/Changelog-SVN.txt index 527b8e7f5..d4ebdfe8b 100644 --- a/Changelog-SVN.txt +++ b/Changelog-SVN.txt @@ -2,6 +2,11 @@ Date Added 03/30 + * text char-server and login-server now build using VC7. You + can use the eAthena.sln solution to build all three. These + are currently just the text versions of the servers. I have + not added projects yet to build the sql versions. + [SVN: 1357 MouseJstr] * Made the map-server build cleanly using Microsoft Visual Studio.. entirely native code without any cygwin dependency [SVN: 1345 MouseJstr] diff --git a/eAthena.sln b/eAthena.sln new file mode 100644 index 000000000..830da50d5 --- /dev/null +++ b/eAthena.sln @@ -0,0 +1,37 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "map-server_txt", "vcproj\map-server_txt.vcproj", "{D356871D-58E1-450B-967A-E1E9646175AF}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "login-server_txt", "vcproj\login-server_txt.vcproj", "{D356871D-58E1-450B-967A-E2E9646175AF}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "char-server_txt", "vcproj\char-server_txt.vcproj", "{D356871D-58E1-450B-967A-E3E9646175AF}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {D356871D-58E1-450B-967A-E1E9646175AF}.Debug.ActiveCfg = Debug|Win32 + {D356871D-58E1-450B-967A-E1E9646175AF}.Debug.Build.0 = Debug|Win32 + {D356871D-58E1-450B-967A-E1E9646175AF}.Release.ActiveCfg = Release|Win32 + {D356871D-58E1-450B-967A-E1E9646175AF}.Release.Build.0 = Release|Win32 + {D356871D-58E1-450B-967A-E2E9646175AF}.Debug.ActiveCfg = Debug|Win32 + {D356871D-58E1-450B-967A-E2E9646175AF}.Debug.Build.0 = Debug|Win32 + {D356871D-58E1-450B-967A-E2E9646175AF}.Release.ActiveCfg = Release|Win32 + {D356871D-58E1-450B-967A-E2E9646175AF}.Release.Build.0 = Release|Win32 + {D356871D-58E1-450B-967A-E3E9646175AF}.Debug.ActiveCfg = Debug|Win32 + {D356871D-58E1-450B-967A-E3E9646175AF}.Debug.Build.0 = Debug|Win32 + {D356871D-58E1-450B-967A-E3E9646175AF}.Release.ActiveCfg = Release|Win32 + {D356871D-58E1-450B-967A-E3E9646175AF}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/src/char/char.c b/src/char/char.c index b2fc12ddb..1a5fa49e8 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -2,19 +2,26 @@ // original : char2.c 2003/03/14 11:58:35 Rev.1.5 #include -#include #include #include + +#ifdef _WIN32 +#include +typedef long in_addr_t; +#else +#include #include -#include -#include +#include +#include #include +#include #include +#endif + +#include #include #include #include -#include -#include #include #include "../common/strlib.h" @@ -1073,7 +1080,7 @@ void create_online_files(void) { char temp[256]; // to prepare what we must display time_t time_server; // for number of seconds struct tm *datetime; // variable for time in structure ->tm_mday, ->tm_sec, ... - int id[online_players_max]; + int id[4096]; // don't return here if we display nothing, because server[j].users is updated in the first loop. @@ -1822,7 +1829,7 @@ int parse_tologin(int fd) { char_log("'ladmin': Receiving a message for broadcast, but no map-server is online." RETCODE); else { unsigned char buf[128]; - char message[RFIFOL(fd,4) + 1]; // +1 to add a null terminated if not exist in the packet + char message[4096]; // +1 to add a null terminated if not exist in the packet int lp; char *p; memset(message, '\0', sizeof(message)); diff --git a/src/char/int_guild.c b/src/char/int_guild.c index 8b9de1a89..95f0cf099 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -731,7 +731,7 @@ int mapif_guild_noinfo(int fd, int guild_id) { // ギルド情報まとめ送り int mapif_guild_info(int fd, struct guild *g) { - unsigned char buf[4 + sizeof(struct guild)]; + unsigned char buf[2048]; WBUFW(buf,0) = 0x3831; memcpy(buf + 4, g, sizeof(struct guild)); @@ -805,7 +805,7 @@ int mapif_guild_broken(int guild_id, int flag) { // ギルド内発言 int mapif_guild_message(int guild_id, int account_id, char *mes, int len, int sfd) { - unsigned char buf[len+12]; + unsigned char buf[2048]; WBUFW(buf,0) = 0x3837; WBUFW(buf,2) = len + 12; @@ -832,7 +832,7 @@ int mapif_guild_basicinfochanged(int guild_id, int type, const void *data, int l // ギルドメンバ情報変更通知 int mapif_guild_memberinfochanged(int guild_id, int account_id, int char_id, int type, const void *data, int len) { - unsigned char buf[len + 18]; + unsigned char buf[4096]; WBUFW(buf, 0) = 0x383a; WBUFW(buf, 2) = len + 18; @@ -878,7 +878,7 @@ int mapif_guild_alliance(int guild_id1, int guild_id2, int account_id1, int acco // ギルド役職変更通知 int mapif_guild_position(struct guild *g, int idx) { - unsigned char buf[sizeof(struct guild_position) + 12]; + unsigned char buf[2048]; WBUFW(buf,0) = 0x383b; WBUFW(buf,2) = sizeof(struct guild_position) + 12; diff --git a/src/char/int_party.c b/src/char/int_party.c index 8c87f2cb4..31f489d2e 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -281,7 +281,7 @@ int mapif_party_noinfo(int fd, int party_id) { // パ?ティ情報まとめ送り int mapif_party_info(int fd, struct party *p) { - unsigned char buf[4 + sizeof(struct party)]; + unsigned char buf[2048]; WBUFW(buf,0) = 0x3821; memcpy(buf + 4, p, sizeof(struct party)); @@ -368,7 +368,7 @@ int mapif_party_broken(int party_id, int flag) { // パ?ティ??言 int mapif_party_message(int party_id, int account_id, char *mes, int len, int sfd) { - unsigned char buf[len+12]; + unsigned char buf[2048]; WBUFW(buf,0) = 0x3827; WBUFW(buf,2) = len + 12; diff --git a/src/char/inter.c b/src/char/inter.c index a6893aecc..0dca38559 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -296,7 +296,7 @@ int inter_mapif_init(int fd) { // GMメッセージ送信 int mapif_GMmessage(unsigned char *mes, int len, int sfd) { - unsigned char buf[len]; + unsigned char buf[2048]; WBUFW(buf,0) = 0x3800; WBUFW(buf,2) = len; @@ -309,7 +309,7 @@ int mapif_GMmessage(unsigned char *mes, int len, int sfd) { // Wisp/page transmission to all map-server int mapif_wis_message(struct WisData *wd) { - unsigned char buf[56 + wd->len]; + unsigned char buf[2048]; WBUFW(buf, 0) = 0x3801; WBUFW(buf, 2) = 56 + wd->len; @@ -337,7 +337,7 @@ int mapif_wis_end(struct WisData *wd, int flag) { // アカウント変数送信 int mapif_account_reg(int fd, unsigned char *src) { - unsigned char buf[WBUFW(src,2)]; + unsigned char buf[2048]; memcpy(WBUFP(buf,0),src,WBUFW(src,2)); WBUFW(buf, 0) = 0x3804; @@ -489,7 +489,7 @@ int mapif_parse_WisReply(int fd) { // Received wisp message from map-server for ALL gm (just copy the message and resends it to ALL map-servers) int mapif_parse_WisToGM(int fd) { - unsigned char buf[RFIFOW(fd,2)]; // 0x3003/0x3803 .w .24B .w .?B + unsigned char buf[2048]; // 0x3003/0x3803 .w .24B .w .?B memcpy(WBUFP(buf,0), RFIFOP(fd,0), RFIFOW(fd,2)); WBUFW(buf, 0) = 0x3803; diff --git a/src/login/login.c b/src/login/login.c index 747fe0a94..7dafc7443 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -2841,6 +2841,8 @@ int parse_login(int fd) { sprintf(ip, "%d.%d.%d.%d", p[0], p[1], p[2], p[3]); + memset(&account, 0, sizeof(account)); + if (session[fd]->eof) { close(fd); delete_session(fd); diff --git a/src/login_sql/login.c b/src/login_sql/login.c index 85f08391d..414b0efda 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -1134,6 +1134,8 @@ int parse_login(int fd) { sprintf(ip, "%d.%d.%d.%d", p[0], p[1], p[2], p[3]); + memset(&account, 0, sizeof(account)); + if (ipban > 0) { //ip ban //p[0], p[1], p[2], p[3] diff --git a/src/map/clif.c b/src/map/clif.c index 20db97554..3761f52bf 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10871,7 +10871,7 @@ static int packetdb_readdb(void) char line[1024]; int ln=0; int cmd,j,k,packet_ver; - char *str[32],*p,*str2[32],*p2,w1[24],w2[24]; + char *str[64],*p,*str2[64],*p2,w1[64],w2[64]; struct { void (*func)(int, struct map_session_data *); diff --git a/src/map/mail.c b/src/map/mail.c index 46e80be9f..42a83de52 100644 --- a/src/map/mail.c +++ b/src/map/mail.c @@ -1,3 +1,4 @@ +#ifndef TXT_ONLY // Mail System for eAthena SQL // Created by Valaris // moved all strings to msg_athena.conf [Lupus] @@ -333,3 +334,4 @@ int do_init_mail(void) return 0; } +#endif diff --git a/src/map/skill.c b/src/map/skill.c index b6010f151..0ea0c81fa 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -9394,6 +9394,7 @@ int skill_readdb(void) printf("can't read db/skill_unit_db.txt\n"); return 1; } + k = 0; while (fgets(line,1020,fp)) { char *split[50]; if (line[0]=='/' && line[1]=='/') diff --git a/vcproj/char-server_txt.vcproj b/vcproj/char-server_txt.vcproj new file mode 100644 index 000000000..809c06124 --- /dev/null +++ b/vcproj/char-server_txt.vcproj @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vcproj/login-server_txt.vcproj b/vcproj/login-server_txt.vcproj new file mode 100644 index 000000000..679c06cc7 --- /dev/null +++ b/vcproj/login-server_txt.vcproj @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vcproj/map-server_txt.vcproj b/vcproj/map-server_txt.vcproj new file mode 100644 index 000000000..3387ea695 --- /dev/null +++ b/vcproj/map-server_txt.vcproj @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3-70-g09d2