summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
authorglighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-10-29 06:33:43 +0000
committerglighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-10-29 06:33:43 +0000
commit07ff4adffb312e138502a83316dff13287a8d153 (patch)
tree4e4a9d6f582d20ea6ba1490fc31b2085453b9e1f /src/char
parent08080a5fc10eb6a9fdc2f1285ba32fda57684d29 (diff)
downloadhercules-07ff4adffb312e138502a83316dff13287a8d153.tar.gz
hercules-07ff4adffb312e138502a83316dff13287a8d153.tar.bz2
hercules-07ff4adffb312e138502a83316dff13287a8d153.tar.xz
hercules-07ff4adffb312e138502a83316dff13287a8d153.zip
-Add some src basic documentation.
-Change some remaining -1 for status ending timer. -Move some hardcoded msg in msg_athena -Small optimisation on battle_attr_fix git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16835 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char')
-rw-r--r--src/char/char.c10
-rw-r--r--src/char/int_guild.c16
-rw-r--r--src/char/int_party.c57
-rw-r--r--src/char/inter.c8
4 files changed, 52 insertions, 39 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 61e0adaf5..09d8dbcc6 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -126,7 +126,7 @@ struct char_session_data {
int found_char[MAX_CHARS]; // ids of chars on this account
char email[40]; // e-mail (default: a@a.com) by [Yor]
time_t expiration_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
- int group_id;
+ int group_id; // permission
uint32 version;
uint8 clienttype;
char new_name[NAME_LENGTH];
@@ -3367,7 +3367,7 @@ int search_mapserver(unsigned short map, uint32 ip, uint16 port)
return -1;
}
-// char_mapifの初期化処理(現在はinter_mapif初期化のみ)
+// Initialization process (currently only initialization inter_mapif)
static int char_mapif_init(int fd)
{
return inter_mapif_init(fd);
@@ -4728,7 +4728,7 @@ int do_init(int argc, char **argv)
ShowInfo("Finished reading the char-server configuration.\n");
- inter_init_sql((argc > 2) ? argv[2] : inter_cfgName); // inter server テハア篳ュ
+ inter_init_sql((argc > 2) ? argv[2] : inter_cfgName); // inter server configuration
ShowInfo("Finished reading the inter-server configuration.\n");
ShowInfo("Initializing char server.\n");
@@ -4764,10 +4764,10 @@ int do_init(int argc, char **argv)
add_timer_func_list(broadcast_user_count, "broadcast_user_count");
add_timer_interval(gettick() + 1000, broadcast_user_count, 0, 0, 5 * 1000);
- // ???
+ // Timer to clear (online_char_db)
add_timer_func_list(chardb_waiting_disconnect, "chardb_waiting_disconnect");
- // ???
+ // Online Data timers (checking if char still connected)
add_timer_func_list(online_data_cleanup, "online_data_cleanup");
add_timer_interval(gettick() + 1000, online_data_cleanup, 0, 0, 600 * 1000);
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index a4d91ecd6..b07a1933f 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -1142,7 +1142,7 @@ int mapif_guild_castle_dataload(int fd, int sz, int *castle_ids)
// Packet received from map server
-// ギルド作成要求
+// Guild creation request
int mapif_parse_CreateGuild(int fd,int account_id,char *name,struct guild_member *master)
{
struct guild *g;
@@ -1837,11 +1837,13 @@ int mapif_parse_GuildMasterChange(int fd, int guild_id, const char* name, int le
return mapif_guild_master_changed(g, g->member[0].account_id, g->member[0].char_id);
}
-// map server からの通信
-// ・1パケットのみ解析すること
-// ・パケット長データはinter.cにセットしておくこと
-// ・パケット長チェックや、RFIFOSKIPは呼び出し元で行われるので行ってはならない
-// ・エラーなら0(false)、そうでないなら1(true)をかえさなければならない
+// Communication from the map server
+// - Can analyzed only one by one packet
+// Data packet length that you set to inter.c
+//- Shouldn't do checking and packet length, RFIFOSKIP is done by the caller
+// Must Return
+// 1 : ok
+// 0 : error
int inter_guild_parse_frommap(int fd)
{
RFIFOHEAD(fd);
@@ -1871,7 +1873,7 @@ int inter_guild_parse_frommap(int fd)
return 1;
}
-// サーバーから脱退要求(キャラ削除用)
+//Leave request from the server (for deleting character from guild)
int inter_guild_leave(int guild_id, int account_id, int char_id)
{
return mapif_parse_GuildLeave(-1, guild_id, account_id, char_id, 0, "** Character Deleted **");
diff --git a/src/char/int_party.c b/src/char/int_party.c
index 7d0dd0b75..a88e5c586 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -324,9 +324,10 @@ int party_check_empty(struct party_data *p)
}
//-------------------------------------------------------------------
-// map serverへの通信
+// Communication to the map server
-// パーティ作成可否
+
+// Create a party whether or not
int mapif_party_created(int fd,int account_id,int char_id,struct party *p)
{
WFIFOHEAD(fd, 39);
@@ -348,7 +349,7 @@ int mapif_party_created(int fd,int account_id,int char_id,struct party *p)
return 0;
}
-// パーティ情報見つからず
+//Party information not found
static void mapif_party_noinfo(int fd, int party_id, int char_id)
{
WFIFOHEAD(fd, 12);
@@ -359,7 +360,8 @@ static void mapif_party_noinfo(int fd, int party_id, int char_id)
WFIFOSET(fd,12);
ShowWarning("int_party: info not found (party_id=%d char_id=%d)\n", party_id, char_id);
}
-// パーティ情報まとめ送り
+
+//Digest party information
static void mapif_party_info(int fd, struct party* p, int char_id)
{
unsigned char buf[8 + sizeof(struct party)];
@@ -373,7 +375,8 @@ static void mapif_party_info(int fd, struct party* p, int char_id)
else
mapif_send(fd,buf,WBUFW(buf,2));
}
-// パーティメンバ追加可否
+
+//Whether or not additional party members
int mapif_party_memberadded(int fd, int party_id, int account_id, int char_id, int flag) {
WFIFOHEAD(fd, 15);
WFIFOW(fd,0) = 0x3822;
@@ -386,7 +389,7 @@ int mapif_party_memberadded(int fd, int party_id, int account_id, int char_id, i
return 0;
}
-// パーティ設定変更通知
+// Party setting change notification
int mapif_party_optionchanged(int fd,struct party *p,int account_id,int flag)
{
unsigned char buf[16];
@@ -403,7 +406,7 @@ int mapif_party_optionchanged(int fd,struct party *p,int account_id,int flag)
return 0;
}
-// パーティ脱退通知
+//Withdrawal notification party
int mapif_party_withdraw(int party_id,int account_id, int char_id) {
unsigned char buf[16];
@@ -415,7 +418,7 @@ int mapif_party_withdraw(int party_id,int account_id, int char_id) {
return 0;
}
-// パーティマップ更新通知
+//Party map update notification
int mapif_party_membermoved(struct party *p,int idx)
{
unsigned char buf[20];
@@ -431,7 +434,7 @@ int mapif_party_membermoved(struct party *p,int idx)
return 0;
}
-// パーティ解散通知
+//Dissolution party notification
int mapif_party_broken(int party_id,int flag)
{
unsigned char buf[16];
@@ -442,7 +445,8 @@ int mapif_party_broken(int party_id,int flag)
//printf("int_party: broken %d\n",party_id);
return 0;
}
-// パーティ内発言
+
+//Remarks in the party
int mapif_party_message(int party_id,int account_id,char *mes,int len, int sfd)
{
unsigned char buf[512];
@@ -456,7 +460,7 @@ int mapif_party_message(int party_id,int account_id,char *mes,int len, int sfd)
}
//-------------------------------------------------------------------
-// map serverからの通信
+// Communication from the map server
// Create Party
@@ -507,7 +511,8 @@ int mapif_parse_CreateParty(int fd, char *name, int item, int item2, struct part
return 0;
}
-// パーティ情報要求
+
+// Party information request
static void mapif_parse_PartyInfo(int fd, int party_id, int char_id)
{
struct party_data *p;
@@ -518,7 +523,8 @@ static void mapif_parse_PartyInfo(int fd, int party_id, int char_id)
else
mapif_party_noinfo(fd, party_id, char_id);
}
-// パーティ追加要求
+
+// Add a player to party request
int mapif_parse_PartyAddMember(int fd, int party_id, struct party_member *member)
{
struct party_data *p;
@@ -556,7 +562,7 @@ int mapif_parse_PartyAddMember(int fd, int party_id, struct party_member *member
return 0;
}
-// パーティー設定変更要求
+//Party setting change request
int mapif_parse_PartyChangeOption(int fd,int party_id,int account_id,int exp,int item)
{
struct party_data *p;
@@ -576,7 +582,8 @@ int mapif_parse_PartyChangeOption(int fd,int party_id,int account_id,int exp,int
inter_party_tosql(&p->party, PS_BASIC, 0);
return 0;
}
-// パーティ脱退要求
+
+//Request leave party
int mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id)
{
struct party_data *p;
@@ -684,7 +691,7 @@ int mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, int char_id
return 0;
}
-// パーティ解散要求
+//Request party dissolution
int mapif_parse_BreakParty(int fd,int party_id)
{
struct party_data *p;
@@ -697,7 +704,8 @@ int mapif_parse_BreakParty(int fd,int party_id)
mapif_party_broken(fd,party_id);
return 0;
}
-// パーティメッセージ送信
+
+//Party sending the message
int mapif_parse_PartyMessage(int fd,int party_id,int account_id,char *mes,int len)
{
return mapif_party_message(party_id,account_id,mes,len, fd);
@@ -727,11 +735,14 @@ int mapif_parse_PartyLeaderChange(int fd,int party_id,int account_id,int char_id
return 1;
}
-// map server からの通信
-// ・1パケットのみ解析すること
-// ・パケット長データはinter.cにセットしておくこと
-// ・パケット長チェックや、RFIFOSKIPは呼び出し元で行われるので行ってはならない
-// ・エラーなら0(false)、そうでないなら1(true)をかえさなければならない
+
+// Communication from the map server
+//-Analysis that only one packet
+// Data packet length is set to inter.c that you
+// Do NOT go and check the packet length, RFIFOSKIP is done by the caller
+// Return :
+// 0 : error
+// 1 : ok
int inter_party_parse_frommap(int fd)
{
RFIFOHEAD(fd);
@@ -751,7 +762,7 @@ int inter_party_parse_frommap(int fd)
return 1;
}
-// サーバーから脱退要求(キャラ削除用)
+//Leave request from the server (for delete character)
int inter_party_leave(int party_id,int account_id, int char_id)
{
return mapif_parse_PartyLeave(-1,party_id,account_id, char_id);
diff --git a/src/char/inter.c b/src/char/inter.c
index 7961b479d..8b66514e9 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -28,8 +28,8 @@
#include <sys/stat.h> // for stat/lstat/fstat - [Dekamaster/Ultimate GM Tool]
-#define WISDATA_TTL (60*1000) // Wisデータの生存時間(60秒)
-#define WISDELLIST_MAX 256 // Wisデータ削除リストの要素数
+#define WISDATA_TTL (60*1000) //Wis data Time To Live (60 seconds)
+#define WISDELLIST_MAX 256 // Number of elements in the list Delete data Wis
Sql* sql_handle = NULL;
@@ -1203,11 +1203,11 @@ int inter_parse_frommap(int fd)
int cmd;
int len = 0;
cmd = RFIFOW(fd,0);
- // inter鯖管轄かを調べる
+ // Check is valid packet entry
if(cmd < 0x3000 || cmd >= 0x3000 + ARRAYLENGTH(inter_recv_packet_length) || inter_recv_packet_length[cmd - 0x3000] == 0)
return 0;
- // パケット長を調べる
+ // Check packet length
if((len = inter_check_length(fd, inter_recv_packet_length[cmd - 0x3000])) == 0)
return 2;