summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/mmo.h8
-rw-r--r--src/common/showmsg.h1
-rw-r--r--src/common/utils.c11
-rw-r--r--src/common/utils.h2
4 files changed, 22 insertions, 0 deletions
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 369f5c894..309203aa8 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -853,6 +853,14 @@ enum ammo_type {
A_THROWWEAPON //9
};
+enum e_char_server_type {
+ CST_NORMAL = 0,
+ CST_MAINTENANCE = 1,
+ CST_OVER18 = 2,
+ CST_PAYING = 3,
+ CST_P2P = 4,
+};
+
/* packet size constant for itemlist */
#if MAX_INVENTORY > MAX_STORAGE && MAX_INVENTORY > MAX_CART
#define MAX_ITEMLIST MAX_INVENTORY
diff --git a/src/common/showmsg.h b/src/common/showmsg.h
index 59a0d9538..43d38973f 100644
--- a/src/common/showmsg.h
+++ b/src/common/showmsg.h
@@ -99,5 +99,6 @@ extern void ClearScreen(void);
extern void ShowFatalError(const char *, ...);
extern void ShowConfigWarning(config_setting_t *config, const char *string, ...);
#endif
+extern int _vShowMessage(enum msg_type flag, const char *string, va_list ap);
#endif /* _SHOWMSG_H_ */
diff --git a/src/common/utils.c b/src/common/utils.c
index 9e3dbac47..9a7d4971b 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -287,6 +287,17 @@ unsigned int get_percentage(const unsigned int A, const unsigned int B)
return (unsigned int)floor(result);
}
+//-----------------------------------------------------
+// custom timestamp formatting (from eApp)
+//-----------------------------------------------------
+const char* timestamp2string(char* str, size_t size, time_t timestamp, const char* format)
+{
+ size_t len = strftime(str, size, format, localtime(&timestamp));
+ memset(str + len, '\0', size - len);
+ return str;
+}
+
+
/* [Ind/Hercules] Caching */
bool HCache_check(const char *file) {
struct stat bufa, bufb;
diff --git a/src/common/utils.h b/src/common/utils.h
index 32087d78f..3e1463d6b 100644
--- a/src/common/utils.h
+++ b/src/common/utils.h
@@ -25,6 +25,8 @@ bool exists(const char* filename);
/// calculates the value of A / B, in percent (rounded down)
unsigned int get_percentage(const unsigned int A, const unsigned int B);
+const char* timestamp2string(char* str, size_t size, time_t timestamp, const char* format);
+
//////////////////////////////////////////////////////////////////////////
// byte word dword access [Shinomori]
//////////////////////////////////////////////////////////////////////////