summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-21 14:52:23 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-21 14:52:23 +0000
commiteb3546a33a9689a745e6497fc9e781f4e7f9b3c1 (patch)
tree27d1ce4e1aab84a20c171ba4bc33b47baf227dfc
parente85f5bc390679728f16264908755a5b594055f8b (diff)
downloadhercules-eb3546a33a9689a745e6497fc9e781f4e7f9b3c1.tar.gz
hercules-eb3546a33a9689a745e6497fc9e781f4e7f9b3c1.tar.bz2
hercules-eb3546a33a9689a745e6497fc9e781f4e7f9b3c1.tar.xz
hercules-eb3546a33a9689a745e6497fc9e781f4e7f9b3c1.zip
- Added define MAX_CHARS so you can easily mod the server to support a different amount of characters per account (however, there is still the issue of hexing the client to support this change)
- Updated msg_athena.conf so it no longer uses broken english on several entries. Thanks to Scerez for the updated file. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10044 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt6
-rw-r--r--conf-tmpl/msg_athena.conf90
-rw-r--r--src/char/char.c30
-rw-r--r--src/char_sql/char.c18
-rw-r--r--src/char_sql/int_guild.c2
-rw-r--r--src/common/mmo.h2
6 files changed, 78 insertions, 70 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 34c00bb9f..adbca472b 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,6 +3,12 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+2007/03/22
+ * Added define MAX_CHARS so you can easily mod the server to support a
+ different amount of characters per account (however, there is still the
+ issue of hexing the client to support this change)
+ * Updated msg_athena.conf so it no longer uses broken english on several
+ entries. Thanks to Scerez for the updated file.
2007/03/21
* getpetinfo 5 will now return the pet's rename flag.
* Autoloot will now only work on items dropped a certain distance from the
diff --git a/conf-tmpl/msg_athena.conf b/conf-tmpl/msg_athena.conf
index a5bb16694..4f20f9002 100644
--- a/conf-tmpl/msg_athena.conf
+++ b/conf-tmpl/msg_athena.conf
@@ -23,7 +23,7 @@
3: Character not found.
4: Jump to %s
5: Jump to %d %d
-6: Character data respawn point saved.
+6: Character respawn point saved.
7: Warping to respawn point.
8: Speed changed.
9: Options changed.
@@ -32,7 +32,7 @@
12: Your job has been changed.
13: You've died.
14: Character killed.
-15: Player warped (message sends to player too).
+15: Player warped (message sent to player too).
16: You've been revived!
17: HP, SP recovered.
18: Item created.
@@ -53,10 +53,10 @@
33: GvG: Off.
34: GvG: On.
35: You can't use this command with this class.
-36: Appearence changed.
+36: Appearance changed.
37: An invalid number was specified.
38: Invalid location number or name.
-39: All monster summoned!
+39: All monsters summoned!
40: Invalid monster ID or name.
41: Impossible to decrease the number/value.
42: Stat changed.
@@ -79,7 +79,7 @@
59: Night Mode Activated.
60: Day Mode Activated.
61: The holy messenger has given judgement.
-62: Judgement was made.
+62: Judgement has passed.
63: Mercy has been shown.
64: Mercy has been granted.
65: Character's base level raised.
@@ -90,7 +90,7 @@
70: You have learned the skill.
71: You have forgotten the skill.
72: Guild siege warfare start!
-73: Already it has started siege warfare.
+73: Guild siege warfare has already started.
74: Guild siege warfare end!
75: Siege warfare hasn't started yet.
76: You have received all skills.
@@ -98,14 +98,14 @@
78: %s: %d
79: It is %d affair above.
80: Give a display name and monster name/id please.
-81: Your GM level don't authorize you to do this action on this player.
+81: Your GM level doesn't authorize you to do this action on this player.
82: Please, use one of this number/name:
83: Cannot spawn emperium.
84: All stats changed!
85: Invalid time for ban command.
86: Sorry, but a player name have at least 4 characters.
-87: Sorry, but a player name have 23 characters maximum.
-88: Character name sends to char-server to ask it.
+87: Sorry, but a player name has 23 characters maximum.
+88: Character name sent to char-server to ask it.
89: Sorry, it's already the night. Impossible to execute the command.
90: Sorry, it's already the day. Impossible to execute the command.
91: Character's base level can't go any higher.
@@ -127,26 +127,26 @@
107: All items have been repaired.
108: No item need to be repaired.
109: Player has been nuked!
-110: Npc Enabled.
+110: NPC Enabled.
111: This NPC doesn't exist.
-112: Npc Disabled.
+112: NPC Disabled.
113: %d item(s) removed by a GM.
114: %d item(s) removed from the player.
115: %d item(s) removed. Player had only %d on %d items.
116: Character does not have the item.
-117: GM has jailed you.
-118: Player jailed.
-119: This player is not jailed.
-120: GM has discharge you.
+117: GM has sent you to jail.
+118: Player warped to jail.
+119: This player is not in jail.
+120: A GM has discharged you.
121: Player unjailed.
122: Disguise applied.
-123: Monster/NPC name/id hasn't been found.
+123: Monster/NPC name/ID hasn't been found.
124: Undisguise applied.
125: You're not disguised.
//Clone Messages
126: Cannot clone a player of higher GM level than yourself.
127: You've reached your slave clones limit.
-128: Evil Clone spawned.
+128: Evil clone spawned.
129: Unable to spawn evil clone.
130: Clone spawned.
131: Unable to spawn clone.
@@ -157,11 +157,11 @@
141: Character's undisguise applied.
142: Character is not disguised.
143: Commands are disabled on this map.
-144: Invalid actual E-mail. If you have default E-mail, type a@a.com.
-145: Invalid new E-mail. Please enter a real E-mail.
-146: New E-mail must be a real E-mail.
-147: New E-mail must be different of the actual E-mail.
-148: Information sended to login-server via char-server.
+144: Invalid e-mail. If you have default e-mail, type a@a.com.
+145: Invalid new e-mail. Please enter a real e-mail.
+146: New e-mail must be a real e-mail.
+147: New e-mail must be different from the current e-mail.
+148: Information sent to login-server via char-server.
149: Impossible to increase the number/value.
150: No GM found.
151: 1 GM found.
@@ -193,13 +193,13 @@
177: Impossible to decrease a stat.
178: Impossible to increase a stat.
179: Guild level changed.
-180: The monter/egg name/id doesn't exist.
+180: The monter/egg name/ID doesn't exist.
181: You already have a pet.
182: Pet friendly value changed!
-183: Pet friendly is already the good value.
+183: Pet friendly is already in the good value.
184: Sorry, but you have no pet.
185: Pet hungry value changed!
-186: Pet hungry is already the good value.
+186: Pet hungry is already in the good value.
187: You can now rename your pet.
188: You can already rename your pet.
189: This player can now rename his/her pet.
@@ -229,9 +229,9 @@
213: You can not mount a peco with your job.
214: Unmounted Peco.
215: This player cannot mount a Peco while in disguise.
-216: Now, this player mounts a peco.
-217: This player can not mount a peco with his/her job.
-218: Now, this player has not more peco.
+216: This player mounted a peco.
+217: This player cannot mount a peco with his/her job.
+218: Now, this player no longer has a peco.
219: %d day
220: %d days
221: %s %d hour
@@ -242,13 +242,13 @@
226: %s and %d seconds
227: Party modification is disabled on this map.
228: Guild modification is disabled on this map.
-229: Your Effect Has Changed.
+229: Your effect has changed.
230: Server time (normal time): %A, %B %d %Y %X.
231: Game time: The game is in permanent daylight.
232: Game time: The game is in permanent night.
-233: Game time: The game is actualy in night for %s.
+233: Game time: The game is in night for %s.
234: Game time: After, the game will be in permanent daylight.
-235: Game time: The game is actualy in daylight for %s.
+235: Game time: The game is in daylight for %s.
236: Game time: After, the game will be in permanent night.
237: Game time: After, the game will be in night for %s.
238: Game time: A day cycle has a normal duration of %s.
@@ -259,7 +259,7 @@
243: Map skills are off
244: Map skills are on
245: Server Uptime: %ld days, %ld hours, %ld minutes, %ld seconds.
-246: Your GM level don't authorize you to do this action.
+246: Your GM level doesn't authorize you to do this action.
247: You are not authorized to warp to this map.
248: You are not authorized to warp from your current map.
249: You are not authorized to warp to your save map.
@@ -267,7 +267,7 @@
251: You have already opened your guild storage. Close it first.
252: You are not in a guild.
253: You are not authorized to memo this map.
-254: GM commands configuration reloaded.
+254: GM command configuration reloaded.
255: Battle configuration reloaded.
256: Status database reloaded.
257: Player database reloaded.
@@ -360,21 +360,21 @@
338: | Location: %s %d %d
// @duel (part 1)
-350: Duel: You can't use @invite. You aren't a duellist.
-351: Duel: The limit of players is reached.
+350: Duel: You can't use @invite. You aren't a duelist.
+351: Duel: The limit of players has been reached.
352: Duel: Player name not found.
353: Duel: The Player is in the duel already.
-354: Duel: Duel invitation has been sent.
+354: Invitation has been sent.
355: Duel: You can't use @duel without @reject.
356: Duel: You can take part in duel once per %d minutes.
357: Duel: Invalid value.
-358: Duel: You can't use @leave. You aren't a duellist.
+358: Duel: You can't use @leave. You aren't a duelist.
359: Duel: You've left the duel.
360: Duel: You can't use @accept without a duel invitation.
361: Duel: The duel invitation has been accepted.
362: Duel: You can't use @reject without a duel invitation.
363: Duel: The duel invitation has been rejected.
-364: Duel: You can't invite %s because he isn't on the same map.
+364: Duel: You can't invite %s because he/she isn't on the same map.
// @duel (part 2)
370: -- Duels: %d/%d, Members: %d/%d, Max players: %d --
371: -- Duels: %d/%d, Members: %d/%d --
@@ -409,15 +409,15 @@
402: %s in jail for %d years, %d months, %d days, %d hours and %d minutes
// Homunculus messages
-450: You already have an homunculus
+450: You already have a homunculus
// Messages of others (not for GM commands)
// ----------------------------------------
500: Night Mode is already active
501: Your account time limit is: %d-%m-%Y %H:%M:%S.
-502: Day Mode is Activated
-503: Night Mode is Activated
+502: Day Mode is activated
+503: Night Mode is activated
//Supernovice's Guardian Angel
//actually.. new client msgtxt file contains these 3 lines... [Lupus]
@@ -454,11 +454,11 @@
// Bot detect messages (currently unused)
535: Possible use of BOT (99%% of chance) or modified client by '%s' (account: %d, char_id: %d). This player ask your name when you are hidden.
-536: Character '%s' (account: %d) try to use a bot (it tries to detect a fake player).
-537: Character '%s' (account: %d) try to use a bot (it tries to detect a fake mob).
+536: Character '%s' (account: %d) is trying to use a bot (it tries to detect a fake player).
+537: Character '%s' (account: %d) is trying to use a bot (it tries to detect a fake mob).
// Trade Spoof Messages
538: Hack on trade: character '%s' (account: %d) try to trade more items that he has.
-539: This player has %d of a kind of item (id: %d), and try to trade %d of them.
+539: This player has %d of a kind of item (id: %d), and tried to trade %d of them.
540: This player has been definitivly blocked.
// Rare Items Drop/Steal announce
541: '%s' won %s's %s (chance: %0.02f%%)
@@ -473,7 +473,7 @@
547: Away automessage has been disabled.
548: Usage: @away,@aw <message>. Enter empty message for disable it.
// @Autotrade
-549: You should be vending to use @Autotrade.
+549: You should be vending to use @autotrade.
//550 -> 650: Job Names
550: Novice
diff --git a/src/char/char.c b/src/char/char.c
index ec4d24caf..92286bea8 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -99,7 +99,7 @@ int log_inter = 1; // loggin inter or not [devil]
struct char_session_data{
int account_id, login_id1, login_id2, sex;
- int found_char[9];
+ int found_char[MAX_CHARS];
char email[40]; // e-mail (default: a@a.com) by [Yor]
time_t connect_until_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
};
@@ -1145,7 +1145,7 @@ int make_new_char(int fd, unsigned char *dat) {
} // else, all letters/symbols are authorised (except control char removed before)
if (dat[24] + dat[25] + dat[26] + dat[27] + dat[28] + dat[29] != 5*6 || // stats
- dat[30] >= 9 || // slots (dat[30] can not be negativ)
+ dat[30] >= MAX_CHARS || // slots (dat[30] can not be negativ)
dat[33] <= 0 || dat[33] >= 24 || // hair style
dat[31] >= 9) { // hair color (dat[31] can not be negativ)
char_log("Make new char error (invalid values): (connection #%d, account: %d) slot %d, name: %s, stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d" RETCODE,
@@ -1731,11 +1731,11 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
for(i = 0; i < char_num; i++) {
if (char_dat[i].status.account_id == sd->account_id) {
sd->found_char[found_num] = i;
- if( ++found_num == 9 )
+ if( ++found_num == MAX_CHARS )
break;
}
}
- for(i = found_num; i < 9; i++)
+ for(i = found_num; i < MAX_CHARS; i++)
sd->found_char[i] = -1;
@@ -2295,7 +2295,7 @@ int parse_tologin(int fd) {
for (j = 0; j < fd_max; j++) {
if (session[j] && (sd2 = (struct char_session_data*)session[j]->session_data) &&
sd2->account_id == char_dat[char_num-1].status.account_id) {
- for (k = 0; k < 9; k++) {
+ for (k = 0; k < MAX_CHARS; k++) {
if (sd2->found_char[k] == char_num-1) {
sd2->found_char[k] = i;
break;
@@ -3477,10 +3477,10 @@ int parse_char(int fd) {
break;
}
// otherwise, load the character
- for (ch = 0; ch < 9; ch++)
+ for (ch = 0; ch < MAX_CHARS; ch++)
if (sd->found_char[ch] >= 0 && char_dat[sd->found_char[ch]].status.char_num == char_num)
break;
- if (ch == 9)
+ if (ch == MAX_CHARS)
{ //Not found?? May be forged packet.
break;
}
@@ -3628,7 +3628,7 @@ int parse_char(int fd) {
WFIFOSET(fd,len);
RFIFOSKIP(fd,37);
}
- for(ch = 0; ch < 9; ch++) {
+ for(ch = 0; ch < MAX_CHARS; ch++) {
if (sd->found_char[ch] == -1) {
sd->found_char[ch] = i;
break;
@@ -3657,7 +3657,7 @@ int parse_char(int fd) {
break;
}
// we change the packet to set it like selection.
- for (i = 0; i < 9; i++)
+ for (i = 0; i < MAX_CHARS; i++)
if (sd->found_char[i] != -1 && char_dat[sd->found_char[i]].status.char_id == cid) {
// we save new e-mail
memcpy(sd->email, email, 40);
@@ -3673,7 +3673,7 @@ int parse_char(int fd) {
// not send packet, it's modify of actual packet
break;
}
- if (i == 9) {
+ if (i == MAX_CHARS) {
WFIFOW(fd, 0) = 0x70;
WFIFOB(fd, 2) = 0; // 00 = Incorrect Email address
WFIFOSET(fd, 3);
@@ -3687,11 +3687,11 @@ int parse_char(int fd) {
WFIFOSET(fd, 3);
break;
}
- for (i = 0; i < 9; i++) {
+ for (i = 0; i < MAX_CHARS; i++) {
if (sd->found_char[i] == -1) continue;
if (char_dat[sd->found_char[i]].status.char_id == cid) break;
}
- if (i == 9) {
+ if (i == MAX_CHARS) {
WFIFOW(fd,0) = 0x70;
WFIFOB(fd,2) = 0;
WFIFOSET(fd,3);
@@ -3708,7 +3708,7 @@ int parse_char(int fd) {
for (j = 0; j < fd_max; j++) {
if (session[j] && (sd2 = (struct char_session_data*)session[j]->session_data) &&
sd2->account_id == char_dat[char_num-1].status.account_id) {
- for (k = 0; k < 9; k++) {
+ for (k = 0; k < MAX_CHARS; k++) {
if (sd2->found_char[k] == char_num-1) {
sd2->found_char[k] = sd->found_char[i];
break;
@@ -3719,9 +3719,9 @@ int parse_char(int fd) {
}
}
char_num--;
- for(ch = i; ch < 9-1; ch++)
+ for(ch = i; ch < MAX_CHARS-1; ch++)
sd->found_char[ch] = sd->found_char[ch+1];
- sd->found_char[8] = -1;
+ sd->found_char[MAX_CHARS-1] = -1;
WFIFOW(fd,0) = 0x6f;
WFIFOSET(fd,2);
break;
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index afc65c677..4f9ef962f 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -128,7 +128,7 @@ static int online_check = 1; //If one, it won't let players connect when their a
struct char_session_data{
int account_id, login_id1, login_id2,sex;
- int found_char[9];
+ int found_char[MAX_CHARS];
char email[40]; // e-mail (default: a@a.com) by [Yor]
time_t connect_until_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
};
@@ -1298,7 +1298,7 @@ int make_new_char_sql(int fd, unsigned char *dat) {
//check stat error
if ((dat[24]+dat[25]+dat[26]+dat[27]+dat[28]+dat[29]!=6*5 ) || // stats
- (dat[30] >= 9) || // slots (dat[30] can not be negativ)
+ (dat[30] >= MAX_CHARS) || // slots (dat[30] can not be negativ)
(dat[33] <= 0) || (dat[33] >= 24) || // hair style
(dat[31] >= 9)) { // hair color (dat[31] can not be negativ)
if (log_char) {
@@ -1746,7 +1746,7 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
set_char_online(-1, 99,sd->account_id);
//search char.
- sprintf(tmp_sql, "SELECT `char_id` FROM `%s` WHERE `account_id` = '%d' AND `char_num` < '9'",char_db, sd->account_id);
+ sprintf(tmp_sql, "SELECT `char_id` FROM `%s` WHERE `account_id` = '%d' AND `char_num` < '%d'",char_db, sd->account_id, MAX_CHARS);
if (mysql_query(&mysql_handle, tmp_sql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
@@ -1763,7 +1763,7 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
mysql_free_result(sql_res);
}
- for(i = found_num; i < 9; i++)
+ for(i = found_num; i < MAX_CHARS; i++)
sd->found_char[i] = -1;
if (save_log)
@@ -3442,7 +3442,7 @@ int parse_char(int fd) {
RFIFOSKIP(fd, 37);
}
//to do
- for(ch = 0; ch < 9; ch++) {
+ for(ch = 0; ch < MAX_CHARS; ch++) {
if (sd->found_char[ch] == -1) {
sd->found_char[ch] = char_dat.char_id;
break;
@@ -3470,17 +3470,17 @@ int parse_char(int fd) {
break;
}
- for(i = 0; i < 9; i++) {
+ for(i = 0; i < MAX_CHARS; i++) {
if (sd->found_char[i] == cid) {
- for(ch = i; ch < 9-1; ch++)
+ for(ch = i; ch < MAX_CHARS-1; ch++)
sd->found_char[ch] = sd->found_char[ch+1];
- sd->found_char[8] = -1;
+ sd->found_char[MAX_CHARS-1] = -1;
break;
}
}
/* Such a character does not exist in the account */
/* If so, you are so screwed. */
- if (i == 9) {
+ if (i == MAX_CHARS) {
WFIFOW(fd, 0) = 0x70;
WFIFOB(fd, 2) = 0;
WFIFOSET(fd, 3);
diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c
index 4ad3ea070..9b29befb3 100644
--- a/src/char_sql/int_guild.c
+++ b/src/char_sql/int_guild.c
@@ -31,7 +31,7 @@
#define GUILD_ALLIANCE_TYPE_MASK 0x01
#define GUILD_ALLIANCE_REMOVE 0x08
-static char dataToHex[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+static const char dataToHex[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
#ifndef TXT_SQL_CONVERT
//Guild cache
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 2b25725d1..b780a78c5 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -20,6 +20,8 @@
#define MAX_MAP_PER_SERVER 1024
#define MAX_INVENTORY 100
+//Max number of characters per account. Note that changing this setting alone is not enough if the client is not hexed to support more chafacters as well.
+#define MAX_CHARS 9
//Number of slots carded equipment can have. Never set to less than 4 as they are also used to keep the data of forged items/equipment. [Skotlex]
//Note: The client seems unable to receive data for more than 4 slots due to all related packets having a fixed size.
#define MAX_SLOTS 4