summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/core.c26
-rw-r--r--src/common/mmo.h81
-rw-r--r--src/common/showmsg.c27
-rw-r--r--src/common/showmsg.h1
-rw-r--r--src/common/socket.c12
-rw-r--r--src/common/sql.h5
6 files changed, 92 insertions, 60 deletions
diff --git a/src/common/core.c b/src/common/core.c
index d528861c2..5b00f228b 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -180,26 +180,22 @@ const char* get_svn_revision(void)
/*======================================
* CORE : Display title
+ * ASCII By CalciumKid 1/12/2011
*--------------------------------------*/
static void display_title(void)
{
//ClearScreen(); // clear screen and go up/left (0, 0 position in text)
ShowMessage("\n");
- ShowMessage(""CL_WTBL" (=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=)"CL_CLL""CL_NORMAL"\n");
- ShowMessage(""CL_XXBL" ("CL_BT_YELLOW" eAthena Development Team presents "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
- ShowMessage(""CL_XXBL" ("CL_BOLD" ______ __ __ "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
- ShowMessage(""CL_XXBL" ("CL_BOLD" /\\ _ \\/\\ \\__/\\ \\ "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
- ShowMessage(""CL_XXBL" ("CL_BOLD" __\\ \\ \\_\\ \\ \\ ,_\\ \\ \\___ __ ___ __ "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
- ShowMessage(""CL_XXBL" ("CL_BOLD" /'__`\\ \\ __ \\ \\ \\/\\ \\ _ `\\ /'__`\\/' _ `\\ /'__`\\ "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
- ShowMessage(""CL_XXBL" ("CL_BOLD" /\\ __/\\ \\ \\/\\ \\ \\ \\_\\ \\ \\ \\ \\/\\ __//\\ \\/\\ \\/\\ \\_\\.\\_ "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
- ShowMessage(""CL_XXBL" ("CL_BOLD" \\ \\____\\\\ \\_\\ \\_\\ \\__\\\\ \\_\\ \\_\\ \\____\\ \\_\\ \\_\\ \\__/.\\_\\ "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
- ShowMessage(""CL_XXBL" ("CL_BOLD" \\/____/ \\/_/\\/_/\\/__/ \\/_/\\/_/\\/____/\\/_/\\/_/\\/__/\\/_/ "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
- ShowMessage(""CL_XXBL" ("CL_BOLD" _ _ _ _ _ _ _ _ _ _ _ _ _ "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
- ShowMessage(""CL_XXBL" ("CL_BOLD" / \\ / \\ / \\ / \\ / \\ / \\ / \\ / \\ / \\ / \\ / \\ / \\ / \\ "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
- ShowMessage(""CL_XXBL" ("CL_BOLD" ( e | n | g | l | i | s | h ) ( A | t | h | e | n | a ) "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
- ShowMessage(""CL_XXBL" ("CL_BOLD" \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
- ShowMessage(""CL_XXBL" ("CL_BOLD" "CL_XXBL")"CL_CLL""CL_NORMAL"\n");
- ShowMessage(""CL_WTBL" (=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=)"CL_CLL""CL_NORMAL"\n\n");
+ ShowMessage(""CL_PASS" "CL_BOLD" "CL_PASS""CL_CLL""CL_NORMAL"\n");
+ ShowMessage(""CL_PASS" "CL_BT_WHITE" RAthena Development Team presents "CL_PASS""CL_CLL""CL_NORMAL"\n");
+ ShowMessage(""CL_PASS" "CL_BOLD" ____ ___ __ __ "CL_PASS""CL_CLL""CL_NORMAL"\n");
+ ShowMessage(""CL_PASS" "CL_BOLD" / __ \\/ | / /_/ /_ ___ ____ ____ _ "CL_PASS""CL_CLL""CL_NORMAL"\n");
+ ShowMessage(""CL_PASS" "CL_BOLD" / /_/ / /| |/ __/ __ \\/ _ \\/ __ \\/ __ `/ "CL_PASS""CL_CLL""CL_NORMAL"\n");
+ ShowMessage(""CL_PASS" "CL_BOLD" / _, _/ ___ / /_/ / / / __/ / / / /_/ / "CL_PASS""CL_CLL""CL_NORMAL"\n");
+ ShowMessage(""CL_PASS" "CL_BOLD" /_/ |_/_/ |_\\__/_/ /_/\\___/_/ /_/\\___,_/ "CL_PASS""CL_CLL""CL_NORMAL"\n");
+ ShowMessage(""CL_PASS" "CL_BOLD" "CL_PASS""CL_CLL""CL_NORMAL"\n");
+ ShowMessage(""CL_PASS" "CL_GREEN" http://rathena.org/board/ "CL_PASS""CL_CLL""CL_NORMAL"\n");
+ ShowMessage(""CL_PASS" "CL_BOLD" "CL_PASS""CL_CLL""CL_NORMAL"\n");
ShowInfo("SVN Revision: '"CL_WHITE"%s"CL_RESET"'.\n", get_svn_revision());
}
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 49a738b08..f8ef63390 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -41,10 +41,11 @@
// 20100803 - 2010-08-03aRagexeRE+ - 0x6b, 0x6d, 0x827, 0x828, 0x829, 0x82a, 0x82b, 0x82c, 0x842, 0x843
// 20101124 - 2010-11-24aRagexeRE+ - 0x856, 0x857, 0x858
// 20110111 - 2011-01-11aRagexeRE+ - 0x6b, 0x6d
+// 20110928 - 2011-09-28aRagexeRE+ - 0x6b, 0x6d
#ifndef PACKETVER
- #define PACKETVER 20081126
- //#define PACKETVER 20100707
+ #define PACKETVER 20110609
+ //#define PACKETVER 20100730
#endif
// backward compatible PACKETVER 8 and 9
#if PACKETVER == 8
@@ -175,6 +176,7 @@ enum item_types {
IT_UNKNOWN2,//9
IT_AMMO, //10
IT_DELAYCONSUME,//11
+ IT_THROWWEAPON= 17,//17
IT_CASH = 18,
IT_MAX
};
@@ -645,21 +647,27 @@ enum {
JOB_STAR_GLADIATOR,
JOB_STAR_GLADIATOR2,
JOB_SOUL_LINKER,
-
+ /**
+ * 3.1 (2.1)
+ **/
JOB_RUNE_KNIGHT = 4054,
JOB_WARLOCK,
JOB_RANGER,
- JOB_ARCHBISHOP,
+ JOB_ARCH_BISHOP,
JOB_MECHANIC,
JOB_GUILLOTINE_CROSS,
-
- JOB_RUNE_KNIGHT_H,
- JOB_WARLOCK_H,
- JOB_RANGER_H,
- JOB_ARCHBISHOP_H,
- JOB_MECHANIC_H,
- JOB_GUILLOTINE_CROSS_H,
-
+ /**
+ * 3.1 (2.1 Trans)
+ **/
+ JOB_RUNE_KNIGHT_T,
+ JOB_WARLOCK_T,
+ JOB_RANGER_T,
+ JOB_ARCH_BISHOP_T,
+ JOB_MECHANIC_T,
+ JOB_GUILLOTINE_CROSS_T,
+ /**
+ * 3.2 (2.2)
+ **/
JOB_ROYAL_GUARD,
JOB_SORCERER,
JOB_MINSTREL,
@@ -667,42 +675,27 @@ enum {
JOB_SURA,
JOB_GENETIC,
JOB_SHADOW_CHASER,
-
- JOB_ROYAL_GUARD_H,
- JOB_SORCERER_H,
- JOB_MINSTREL_H,
- JOB_WANDERER_H,
- JOB_SURA_H,
- JOB_GENETIC_H,
- JOB_SHADOW_CHASER_H,
-
+ /**
+ * 3.2 (2.2 Trans)
+ **/
+ JOB_ROYAL_GUARD_T,
+ JOB_SORCERER_T,
+ JOB_MINSTREL_T,
+ JOB_WANDERER_T,
+ JOB_SURA_T,
+ JOB_GENETIC_T,
+ JOB_SHADOW_CHASER_T,
+ /**
+ * 3.x Mounts / Vehicles
+ **/
JOB_RUNE_KNIGHT2,
- JOB_RUNE_KNIGHT_H2,
+ JOB_RUNE_KNIGHT_T2,
JOB_ROYAL_GUARD2,
- JOB_ROYAL_GUARD_H2,
+ JOB_ROYAL_GUARD_T2,
JOB_RANGER2,
- JOB_RANGER_H2,
+ JOB_RANGER_T2,
JOB_MECHANIC2,
- JOB_MECHANIC_H2,
-
- JOB_BABY_RUNE = 4096,
- JOB_BABY_WARLOCK,
- JOB_BABY_RANGER,
- JOB_BABY_BISHOP,
- JOB_BABY_MECHANIC,
- JOB_BABY_CROSS,
- JOB_BABY_GUARD,
- JOB_BABY_SORCERER,
- JOB_BABY_MINSTREL,
- JOB_BABY_WANDERER,
- JOB_BABY_SURA,
- JOB_BABY_GENETIC,
- JOB_BABY_CHASER,
-
- JOB_BABY_RUNE2,
- JOB_BABY_GUARD2,
- JOB_BABY_RANGER2,
- JOB_BABY_MECHANIC2,
+ JOB_MECHANIC_T2,
JOB_MAX,
};
diff --git a/src/common/showmsg.c b/src/common/showmsg.c
index fc1badd26..a69c73ba2 100644
--- a/src/common/showmsg.c
+++ b/src/common/showmsg.c
@@ -4,6 +4,8 @@
#include "../common/cbasetypes.h"
#include "../common/strlib.h" // StringBuf
#include "showmsg.h"
+#include "core.h" //[Ind] - For SERVER_TYPE
+#include "version.h" //[Ind] - For SERVER_TYPE values
#include <stdio.h>
#include <string.h>
@@ -51,6 +53,8 @@ int stdout_with_ansisequence = 0;
int msg_silent = 0; //Specifies how silent the console is.
+int console_msg_log = 0;//[Ind] msg error logging
+
///////////////////////////////////////////////////////////////////////////////
/// static/dynamic buffer for the messages
@@ -684,6 +688,29 @@ int _vShowMessage(enum msg_type flag, const char *string, va_list ap)
return 1;
}
if(
+ ( flag == MSG_WARNING && console_msg_log&1 ) ||
+ ( ( flag == MSG_ERROR || flag == MSG_SQL ) && console_msg_log&2 ) ||
+ ( flag == MSG_DEBUG && console_msg_log&4 ) ) {//[Ind]
+ FILE *log = NULL;
+ if( (log = fopen(SERVER_TYPE == ATHENA_SERVER_MAP ? "./log/map-msg_log.log" : "./log/unknown.log","a+")) ) {
+ char timestring[255];
+ time_t curtime;
+ time(&curtime);
+ strftime(timestring, 254, "%m/%d/%Y %H:%M:%S", localtime(&curtime));
+ fprintf(log,"(%s) [ %s ] : ",
+ timestring,
+ flag == MSG_WARNING ? "Warning" :
+ flag == MSG_ERROR ? "Error" :
+ flag == MSG_SQL ? "SQL Error" :
+ flag == MSG_DEBUG ? "Debug" :
+ "Unknown");
+ va_copy(apcopy, ap);
+ vfprintf(log,string,apcopy);
+ va_end(apcopy);
+ fclose(log);
+ }
+ }
+ if(
(flag == MSG_INFORMATION && msg_silent&1) ||
(flag == MSG_STATUS && msg_silent&2) ||
(flag == MSG_NOTICE && msg_silent&4) ||
diff --git a/src/common/showmsg.h b/src/common/showmsg.h
index 998296b66..5f80a4312 100644
--- a/src/common/showmsg.h
+++ b/src/common/showmsg.h
@@ -67,6 +67,7 @@
extern int stdout_with_ansisequence; //If the color ansi sequences are to be used. [flaviojs]
extern int msg_silent; //Specifies how silent the console is. [Skotlex]
+extern int console_msg_log; //Specifies what error messages to log. [Ind]
extern char timestamp_format[20]; //For displaying Timestamps [Skotlex]
enum msg_type {
diff --git a/src/common/socket.c b/src/common/socket.c
index b522ac607..4f7afd8fd 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -647,6 +647,14 @@ int WFIFOSET(int fd, size_t len)
ShowFatalError("WFIFOSET: Packet 0x%x is too big. (len=%u, max=%u)\n", (*(uint16*)(s->wdata + s->wdata_size)), (unsigned int)len, 0xFFFF);
exit(EXIT_FAILURE);
}
+ else if( len == 0 )
+ {
+ // abuses the fact, that the code that did WFIFOHEAD(fd,0), already wrote
+ // the packet type into memory, even if it could have overwritten vital data
+ // this can happen when a new packet was added on map-server, but packet len table was not updated
+ ShowWarning("WFIFOSET: Attempted to send zero-length packet, most likely 0x%04x (please report this).\n", WFIFOW(fd,0));
+ return 0;
+ }
if( !s->flag.server && len > socket_max_client_packet )
{// see declaration of socket_max_client_packet for details
@@ -1222,6 +1230,7 @@ int socket_getips(uint32* ips, int max)
void socket_init(void)
{
char *SOCKET_CONF_FILENAME = "conf/packet_athena.conf";
+ unsigned int rlim_cur = FD_SETSIZE;
#ifdef WIN32
{// Start up windows networking
@@ -1265,6 +1274,7 @@ void socket_init(void)
if( err == EPERM )
errmsg = "permission denied";
ShowWarning("socket_init: failed to set socket limit to %d, setting to maximum allowed (original limit=%d, current limit=%d, maximum allowed=%d, error=%s).\n", FD_SETSIZE, rlim_ori, (int)rlp.rlim_cur, (int)rlp.rlim_max, errmsg);
+ rlim_cur = rlp.rlim_cur;
}
}
}
@@ -1294,6 +1304,8 @@ void socket_init(void)
add_timer_func_list(connect_check_clear, "connect_check_clear");
add_timer_interval(gettick()+1000, connect_check_clear, 0, 0, 5*60*1000);
#endif
+
+ ShowInfo("Server supports up to '"CL_WHITE"%u"CL_RESET"' concurrent connections.\n", rlim_cur);
}
diff --git a/src/common/sql.h b/src/common/sql.h
index 5b318ab4d..898e2c778 100644
--- a/src/common/sql.h
+++ b/src/common/sql.h
@@ -14,7 +14,10 @@
#define SQL_SUCCESS 0
#define SQL_NO_DATA 100
-
+// macro definition to determine whether the mySQL engine is running on InnoDB (rather than MyISAM)
+// uncomment this line if the your mySQL tables have been changed to run on InnoDB
+// this macro will adjust how logs are recorded in the database to accommodate the change
+//#define SQL_INNODB
/// Data type identifier.
/// String, enum and blob data types need the buffer length specified.