summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-01-08 19:00:34 -0800
committerBen Longbons <b.r.longbons@gmail.com>2013-01-08 19:54:26 -0800
commitf2fd4885c2a906414e0f36acf95d252e5a9d5805 (patch)
tree918bff247135e9223a5126f1b85f4ae4fc9ba1aa /src/char
parent3e42921c657bc93094f0c7d96855aae9b0be5a7e (diff)
downloadtmwa-f2fd4885c2a906414e0f36acf95d252e5a9d5805.tar.gz
tmwa-f2fd4885c2a906414e0f36acf95d252e5a9d5805.tar.bz2
tmwa-f2fd4885c2a906414e0f36acf95d252e5a9d5805.tar.xz
tmwa-f2fd4885c2a906414e0f36acf95d252e5a9d5805.zip
Improve warning management more
Diffstat (limited to 'src/char')
-rw-r--r--src/char/char.cpp51
-rw-r--r--src/char/char.hpp4
-rw-r--r--src/char/inter.cpp15
3 files changed, 55 insertions, 15 deletions
diff --git a/src/char/char.cpp b/src/char/char.cpp
index 67003b5..05c217d 100644
--- a/src/char/char.cpp
+++ b/src/char/char.cpp
@@ -34,36 +34,64 @@
#include "int_party.hpp"
#include "int_storage.hpp"
+static
struct mmo_map_server server[MAX_MAP_SERVERS];
+static
int server_fd[MAX_MAP_SERVERS];
+static
int server_freezeflag[MAX_MAP_SERVERS]; // Map-server anti-freeze system. Counter. 5 ok, 4...0 freezed
+static
int anti_freeze_enable = 0;
+static
int ANTI_FREEZE_INTERVAL = 6;
// TODO replace all string forms of IP addresses with class instances
+static
int login_fd, char_fd;
+static
char userid[24];
+static
char passwd[24];
+static
char server_name[20];
+static
char wisp_server_name[24] = "Server";
+static
char login_ip_str[16];
+static
int login_ip;
+static
int login_port = 6900;
+static
char char_ip_str[16];
+static
int char_ip;
+static
int char_port = 6121;
+static
int char_maintenance;
+static
int char_new;
+static
int email_creation = 0; // disabled by default
+static
char char_txt[1024];
+static
char unknown_char_name[1024] = "Unknown";
+static
char char_log_filename[1024] = "log/char.log";
//Added for lan support
+static
char lan_map_ip[128];
+static
int subneti[4];
+static
int subnetmaski[4];
+static
int name_ignoring_case = 0; // Allow or not identical name for characters but with a different case by [Yor]
+static
int char_name_option = 0; // Option to know which letters/symbols are authorised in the name of a character (0: all, 1: only those in char_name_letters, 2: all EXCEPT those in char_name_letters) by [Yor]
+static
char char_name_letters[1024] = ""; // list of letters/symbols authorised (or not) in a character name. by [Yor]
struct char_session_data
@@ -76,6 +104,7 @@ struct char_session_data
};
#define AUTH_FIFO_SIZE 256
+static
struct
{
int account_id, char_id, login_id1, login_id2, ip, char_pos, delflag,
@@ -83,36 +112,57 @@ struct
unsigned short packet_tmw_version;
time_t connect_until_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
} auth_fifo[AUTH_FIFO_SIZE];
+static
int auth_fifo_pos = 0;
+static
int check_ip_flag = 1; // It's to check IP of a player between char-server and other servers (part of anti-hacking system)
+static
int char_id_count = 150000;
+static
struct mmo_charstatus *char_dat;
+static
int char_num, char_max;
+static
int max_connect_user = 0;
int autosave_interval = DEFAULT_AUTOSAVE_INTERVAL;
+static
int start_zeny = 500;
+static
int start_weapon = 1201;
+static
int start_armor = 1202;
// Initial position (it's possible to set it in conf file)
+static
struct point start_point = { "new_1-1.gat", 53, 111 };
+static
struct gm_account *gm_account = NULL;
+static
int GM_num = 0;
// online players by [Yor]
+static
char online_txt_filename[1024] = "online.txt";
+static
char online_html_filename[1024] = "online.html";
+static
int online_sorting_option = 0; // sorting option to display online players in online files
+static
int online_display_option = 1; // display options: to know which columns must be displayed
+static
int online_refresh_html = 20; // refresh time (in sec) of the html file in the explorer
+static
int online_gm_display_min_level = 20; // minimum GM level to display 'GM' when we want to display it
+static
int *online_chars; // same size of char_dat, and id value of current server (or -1)
+static
time_t update_online; // to update online files when we receiving information from a server (not less than 8 seconds)
+static
pid_t pid = 0; // For forked DB writes
//------------------------------
@@ -2955,6 +3005,7 @@ void parse_char(int fd)
break;
}
}
+ break;
case 0x68: // delete char //Yor's Fix
if (!sd || RFIFOREST(fd) < 46)
diff --git a/src/char/char.hpp b/src/char/char.hpp
index 5c66dd4..3c0c865 100644
--- a/src/char/char.hpp
+++ b/src/char/char.hpp
@@ -29,8 +29,8 @@ int mapif_send(int fd, const uint8_t *buf, unsigned int len);
void char_log(const_string line);
-#define CHAR_LOG(fmt, args...) \
- char_log(static_cast<const std::string&>(STRPRINTF(fmt, ## args)))
+#define CHAR_LOG(fmt, ...) \
+ char_log(static_cast<const std::string&>(STRPRINTF(fmt, ## __VA_ARGS__)))
extern int autosave_interval;
diff --git a/src/char/inter.cpp b/src/char/inter.cpp
index 589a250..5262cca 100644
--- a/src/char/inter.cpp
+++ b/src/char/inter.cpp
@@ -23,6 +23,7 @@
char inter_log_filename[1024] = "log/inter.log";
+static
char accreg_txt[1024] = "save/accreg.txt";
static
struct dbt *accreg_db = NULL;
@@ -35,20 +36,8 @@ struct accreg
int party_share_level = 10;
-// 送信パケット長リスト
-int inter_send_packet_length[] = {
- -1, -1, 27, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- -1, 7, 0, 0, 0, 0, 0, 0, -1, 11, 0, 0, 0, 0, 0, 0,
- 35, -1, 11, 15, 34, 29, 7, -1, 0, 0, 0, 0, 0, 0, 0, 0,
- 10, -1, 15, 0, 79, 19, 7, -1, 0, -1, -1, -1, 14, 67, 186, -1,
- 9, 9, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 11, -1, 7, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
// 受信パケット長リスト
+static
int inter_recv_packet_length[] = {
-1, -1, 7, -1, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
6, -1, 0, 0, 0, 0, 0, 0, 10, -1, 0, 0, 0, 0, 0, 0,