Przeglądaj źródła

> Hercules merges:
* 0241d01:
Introducing account-dependent character slot count.
Available player slots can be limited in the `character_slots` column of `login`.
Existent characters on slots above the limit will still be accessible but will have a red "premium service" in the background.

* 5d6c1c5:
Updated values for first levels in exp.txt and exp_guild.txt.
Updated Renewal item database with new healing items.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17176 54d463be-8e91-2dee-dedb-b68131a5f0ec

euphyy 12 lat temu
rodzic
commit
d238a8ae67

Plik diff jest za duży
+ 0 - 0
db/re/exp.txt


+ 1 - 0
db/re/exp_guild.txt

@@ -1,4 +1,5 @@
 // Guild LvUp experience value table
+100000
 400000
 900000
 1600000

+ 21 - 8
db/re/item_db.txt

@@ -5087,15 +5087,26 @@
 11532,Nasi_Goreng,Nasi Goreng,0,15,,20,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(17,23),0; },{},{}
 11533,Satay,Satay,0,15,,20,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(17,23),0; },{},{}
 11534,Coco_Juice,Coconut Juice,0,20,,50,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(17,23),0; },{},{}
-//
-11536,Cat_Hard_Biscuit,Cat Biscuit,0,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(70,110),0; },{},{}
-//
+11535,Almond_Chocolate,Almond Chocolate,0,190,,200,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal 0,rand(8,16); },{},{}
+11536,Cat_Hard_Biscuit,Cat Biscuit,0,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(70,110),0; },{},{}
+11537,Rice_Weevil_Bug,Rice Weevil Bug,0,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(100,150),0; },{},{}
 11538,Fresh_Octopus_Legs,Fresh Octopus Legs,0,20,,30,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(35,60),rand(5,10); },{},{}
-//
-11547,Siege_Purple_Potion,Siege Purple Potion,0,20,,120,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(500,600),rand(60,80); },{},{}
-11548,Siege_White_Potion,Siege White Potion,0,20,,80,,,,,0xFFFFFFFF,7,2,,,,,,{ percentheal 10,0; },{},{}
-11549,Siege_Blue_Potion,Siege Blue Potion,0,20,,80,,,,,0xFFFFFFFF,7,2,,,,,,{ percentheal 0,10; },{},{}
-11550,Pumpkin_Cake,Pumpkin Cake,0,20,,40,,,,,0xFFFFFFFF,7,2,,,,,,{ percentheal 5,5; },{},{}
+11539,Athale_Choco,Athale Choco,0,1,,80,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal 50,50; },{},{}
+11540,Shyai_Choco,Shyai Choco,0,1,,80,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal 50,50; },{},{}
+11541,Mid_Choco,Mid Choco,0,1,,80,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal 50,50; },{},{}
+11542,Zonda_Choco,Zonda Choco,0,1,,80,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal 50,50; },{},{}
+11543,Goedo_Choco,Goedo Choco,0,1,,80,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal 50,50; },{},{}
+11544,Huike_Choco,Huike Choco,0,1,,80,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal 50,50; },{},{}
+11545,Rune_Choco,Rune Choco,0,1,,80,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal 50,50; },{},{}
+11546,Pope_Choco,Pope Choco,0,1,,80,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal 50,50; },{},{}
+11547,Siege_Purple_Potion,Siege Purple Potion,0,0,,120,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(500,600),rand(60,80); },{},{}
+11548,Siege_White_Potion,Siege White Potion,0,0,,80,,,,,0xFFFFFFFF,7,2,,,,,,{ percentheal 10,0; },{},{}
+11549,Siege_Blue_Potion,Siege Blue Potion,0,0,,80,,,,,0xFFFFFFFF,7,2,,,,,,{ percentheal 0,10; },{},{}
+11550,Pumpkin_Cake,Pumpkin Cake,0,10,,80,,,,,0xFFFFFFFF,7,2,,,,,,{ percentheal 5,5; },{},{}
+11551,Savory_Herb_Salad,Savory Herb Salad,0,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ percentheal rand(20,30),0; },{},{}
+11552,Apple_Carrot_Salad,Apple Carrot Salad,0,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ percentheal rand(20,30),0; },{},{}
+11553,Casual_Stew,Casual Stew,0,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ percentheal rand(20,30),0; },{},{}
+11554,Golden_Roasted_Apple,Golden Roasted Apple,0,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ percentheal rand(20,30),0; },{},{}
 //
 11701,Girl_Bunch_Of_Flower,Girl's Bouquet,0,20,,50,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(105,145),0; },{},{}
 11702,Moon_Cookie,Moon Cookie,0,0,,300,,,,,0xFFFFFFFF,7,2,,,,,,{ },{},{}
@@ -5109,6 +5120,8 @@
 11710,Sakura_Mist,Sakura Mist,0,800,,100,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(50,70),rand(10,12); },{},{}
 11711,Sakura_Milk_Tea,Sakura Milk Tea,0,800,,100,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(50,70),rand(10,12); },{},{}
 11712,First_Leaf_Tea,Flower,0,800,,100,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(50,70),rand(10,12); },{},{}
+11713,Julia's_Candy,Julia's Candy,0,0,,30,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(40,45),0; },{},{}
+//
 12000,Cold_Scroll_2_5,Level 5 Frost Diver,11,2000,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ itemskill "MG_FROSTDIVER",5; },{},{}
 12001,Holy_Scroll_1_3,Level 3 Heal,11,2000,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ itemskill "AL_HEAL",3; },{},{}
 12002,Holy_Scroll_1_5,Level 5 Heal,11,2000,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ itemskill "AL_HEAL",5; },{},{}

+ 21 - 8
sql-files/item_db_re.sql

@@ -5118,15 +5118,26 @@ REPLACE INTO `item_db_re` VALUES (11531,'Coffee','Coffee',0,10,NULL,100,NULL,NUL
 REPLACE INTO `item_db_re` VALUES (11532,'Nasi_Goreng','Nasi Goreng',0,15,NULL,20,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal rand(17,23),0;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (11533,'Satay','Satay',0,15,NULL,20,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal rand(17,23),0;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (11534,'Coco_Juice','Coconut Juice',0,20,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal rand(17,23),0;',NULL,NULL);
-#
-REPLACE INTO `item_db_re` VALUES (11536,'Cat_Hard_Biscuit','Cat Biscuit',0,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal rand(70,110),0;',NULL,NULL);
-#
+REPLACE INTO `item_db_re` VALUES (11535,'Almond_Chocolate','Almond Chocolate',0,190,NULL,200,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal 0,rand(8,16);',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11536,'Cat_Hard_Biscuit','Cat Biscuit',0,0,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal rand(70,110),0;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11537,'Rice_Weevil_Bug','Rice Weevil Bug',0,0,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal rand(100,150),0;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (11538,'Fresh_Octopus_Legs','Fresh Octopus Legs',0,20,NULL,30,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal rand(35,60),rand(5,10);',NULL,NULL);
-#
-REPLACE INTO `item_db_re` VALUES (11547,'Siege_Purple_Potion','Siege Purple Potion',0,20,NULL,120,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal rand(500,600),rand(60,80);',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (11548,'Siege_White_Potion','Siege White Potion',0,20,NULL,80,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 10,0;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (11549,'Siege_Blue_Potion','Siege Blue Potion',0,20,NULL,80,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 0,10;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (11550,'Pumpkin_Cake','Pumpkin Cake',0,20,NULL,40,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 5,5;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11539,'Athale_Choco','Athale Choco',0,1,NULL,80,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal 50,50;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11540,'Shyai_Choco','Shyai Choco',0,1,NULL,80,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal 50,50;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11541,'Mid_Choco','Mid Choco',0,1,NULL,80,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal 50,50;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11542,'Zonda_Choco','Zonda Choco',0,1,NULL,80,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal 50,50;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11543,'Goedo_Choco','Goedo Choco',0,1,NULL,80,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal 50,50;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11544,'Huike_Choco','Huike Choco',0,1,NULL,80,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal 50,50;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11545,'Rune_Choco','Rune Choco',0,1,NULL,80,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal 50,50;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11546,'Pope_Choco','Pope Choco',0,1,NULL,80,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal 50,50;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11547,'Siege_Purple_Potion','Siege Purple Potion',0,0,NULL,120,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal rand(500,600),rand(60,80);',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11548,'Siege_White_Potion','Siege White Potion',0,0,NULL,80,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 10,0;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11549,'Siege_Blue_Potion','Siege Blue Potion',0,0,NULL,80,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 0,10;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11550,'Pumpkin_Cake','Pumpkin Cake',0,10,NULL,80,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 5,5;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11551,'Savory_Herb_Salad','Savory Herb Salad',0,0,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal rand(20,30),0;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11552,'Apple_Carrot_Salad','Apple Carrot Salad',0,0,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal rand(20,30),0;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11553,'Casual_Stew','Casual Stew',0,0,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal rand(20,30),0;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11554,'Golden_Roasted_Apple','Golden Roasted Apple',0,0,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal rand(20,30),0;',NULL,NULL);
 #
 REPLACE INTO `item_db_re` VALUES (11701,'Girl_Bunch_Of_Flower','Girl\'s Bouquet',0,20,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal rand(105,145),0;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (11702,'Moon_Cookie','Moon Cookie',0,NULL,NULL,300,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL);
@@ -5140,6 +5151,8 @@ REPLACE INTO `item_db_re` VALUES (11709,'Fanta_Zero_Lemon','Fanta Zero Lemon',0,
 REPLACE INTO `item_db_re` VALUES (11710,'Sakura_Mist','Sakura Mist',0,800,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal rand(50,70),rand(10,12);',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (11711,'Sakura_Milk_Tea','Sakura Milk Tea',0,800,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal rand(50,70),rand(10,12);',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (11712,'First_Leaf_Tea','Flower',0,800,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal rand(50,70),rand(10,12);',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (11713,'Julia\'s_Candy','Julia\'s Candy',0,0,NULL,30,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal rand(40,45),0;',NULL,NULL);
+#
 REPLACE INTO `item_db_re` VALUES (12000,'Cold_Scroll_2_5','Level 5 Frost Diver',11,2000,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemskill "MG_FROSTDIVER",5;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (12001,'Holy_Scroll_1_3','Level 3 Heal',11,2000,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemskill "AL_HEAL",3;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (12002,'Holy_Scroll_1_5','Level 5 Heal',11,2000,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemskill "AL_HEAL",5;',NULL,NULL);

+ 1 - 0
sql-files/main.sql

@@ -438,6 +438,7 @@ CREATE TABLE IF NOT EXISTS `login` (
   `lastlogin` datetime NOT NULL default '0000-00-00 00:00:00',
   `last_ip` varchar(100) NOT NULL default '',
   `birthdate` DATE NOT NULL DEFAULT '0000-00-00',
+  `character_slots` tinyint(3) unsigned NOT NULL default '0',
   PRIMARY KEY  (`account_id`),
   KEY `name` (`userid`)
 ) ENGINE=MyISAM AUTO_INCREMENT=2000000; 

+ 1 - 0
sql-files/upgrades/upgrade_svn17176.sql

@@ -0,0 +1 @@
+ALTER TABLE `login` ADD `character_slots` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0';

+ 27 - 15
src/char/char.c

@@ -126,6 +126,7 @@ struct char_session_data {
 	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; // permission
+	uint8 char_slots;
 	uint32 version;
 	uint8 clienttype;
 	char new_name[NAME_LENGTH];
@@ -1489,14 +1490,18 @@ int make_new_char_sql(struct char_session_data* sd, char* name_, int str, int ag
 
 	//check other inputs
 #if PACKETVER >= 20120307
-	if(slot >= MAX_CHARS)
+	if(slot >= sd->char_slots)
 #else
-	if((slot >= MAX_CHARS) // slots
+	if((slot >= sd->char_slots) // slots
 	|| (str + agi + vit + int_ + dex + luk != 6*5 ) // stats
 	|| (str < 1 || str > 9 || agi < 1 || agi > 9 || vit < 1 || vit > 9 || int_ < 1 || int_ > 9 || dex < 1 || dex > 9 || luk < 1 || luk > 9) // individual stat values
 	|| (str + int_ != 10 || agi + luk != 10 || vit + dex != 10) ) // pairs
 #endif
+#if PACKETVER >= 20100413
+		return -4; // invalid slot
+#else
 		return -2; // invalid input
+#endif
 
 
 	// check the number of already existing chars in this account
@@ -1861,8 +1866,8 @@ int mmo_char_send006b(int fd, struct char_session_data* sd)
 	WFIFOW(fd,0) = 0x6b;
 #if PACKETVER >= 20100413
 	WFIFOB(fd,4) = MAX_CHARS; // Max slots.
-	WFIFOB(fd,5) = MAX_CHARS; // Available slots.
-	WFIFOB(fd,6) = MAX_CHARS; // Premium slots.
+	WFIFOB(fd,5) = sd->char_slots; // Available slots. (PremiumStartSlot)
+	WFIFOB(fd,6) = MAX_CHARS; // Premium slots. (Any existent chars past sd->char_slots but within MAX_CHARS will show a 'Premium Service' in red)
 #endif
 	memset(WFIFOP(fd,4 + offset), 0, 20); // unknown bytes
 	j+=mmo_chars_fromsql(sd, WFIFOP(fd,j));
@@ -2142,7 +2147,7 @@ int parse_fromlogin(int fd) {
 		break;
 
 		case 0x2717: // account data
-			if (RFIFOREST(fd) < 62)
+			if (RFIFOREST(fd) < 63)
 				return 0;
 
 			// find the authenticated session with this account id
@@ -2153,7 +2158,13 @@ int parse_fromlogin(int fd) {
 				memcpy(sd->email, RFIFOP(fd,6), 40);
 				sd->expiration_time = (time_t)RFIFOL(fd,46);
 				sd->group_id = RFIFOB(fd,50);
-				safestrncpy(sd->birthdate, (const char*)RFIFOP(fd,51), sizeof(sd->birthdate));
+				sd->char_slots = RFIFOB(fd,51);
+				if( sd->char_slots > MAX_CHARS ) {
+					ShowError("Account '%d' `character_slots` column is higher than supported MAX_CHARS (%d), update MAX_CHARS in mmo.h! capping to MAX_CHARS...\n",sd->account_id,sd->char_slots);
+					sd->char_slots = MAX_CHARS;/* cap to maximum */
+				} else if ( !sd->char_slots )/* no value aka 0 in sql */
+					sd->char_slots = MAX_CHARS;/* cap to maximum */
+				safestrncpy(sd->birthdate, (const char*)RFIFOP(fd,52), sizeof(sd->birthdate));
 				ARR_FIND( 0, ARRAYLENGTH(server), server_id, server[server_id].fd > 0 && server[server_id].map[0] );
 				// continued from char_auth_ok...
 				if( server_id == ARRAYLENGTH(server) || //server not online, bugreport:2359
@@ -2179,7 +2190,7 @@ int parse_fromlogin(int fd) {
 #endif
 				}
 			}
-			RFIFOSKIP(fd,62);
+			RFIFOSKIP(fd,63);
 		break;
 
 		// login-server alive packet
@@ -3901,19 +3912,20 @@ int parse_char(int fd)
 #endif
 
 			//'Charname already exists' (-1), 'Char creation denied' (-2) and 'You are underaged' (-3)
-			if (i < 0)
-			{
+			if (i < 0) {
 				WFIFOHEAD(fd,3);
 				WFIFOW(fd,0) = 0x6e;
+				/* Others I found [Ind] */
+				/* 0x02 = Symbols in Character Names are forbidden */
+				/* 0x03 = You are not elegible to open the Character Slot. */
 				switch (i) {
-				case -1: WFIFOB(fd,2) = 0x00; break;
-				case -2: WFIFOB(fd,2) = 0xFF; break;
-				case -3: WFIFOB(fd,2) = 0x01; break;
+					case -1: WFIFOB(fd,2) = 0x00; break;
+					case -2: WFIFOB(fd,2) = 0xFF; break;
+					case -3: WFIFOB(fd,2) = 0x01; break;
+					case -4: WFIFOB(fd,2) = 0x03; break;
 				}
 				WFIFOSET(fd,3);
-			}
-			else
-			{
+			} else {
 				int len;
 				// retrieve data
 				struct mmo_charstatus char_dat;

+ 1 - 0
src/login/account.h

@@ -42,6 +42,7 @@ struct mmo_account
 	char sex;               // gender (M/F/S)
 	char email[40];         // e-mail (by default: a@a.com)
 	int group_id;           // player group id
+	uint8 char_slots;       // this accounts maximum character slots (maximum is limited to MAX_CHARS define in char server)
 	unsigned int state;     // packet 0x006a value + 1 (0: compte OK)
 	time_t unban_time;      // (timestamp): ban time limit of the account (0 = no ban)
 	time_t expiration_time; // (timestamp): validity limit of the account (0 = unlimited)

+ 6 - 3
src/login/account_sql.c

@@ -522,7 +522,7 @@ static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int acc
 
 	// retrieve login entry for the specified account
 	if( SQL_ERROR == Sql_Query(sql_handle,
-	    "SELECT `account_id`,`userid`,`user_pass`,`sex`,`email`,`group_id`,`state`,`unban_time`,`expiration_time`,`logincount`,`lastlogin`,`last_ip`,`birthdate` FROM `%s` WHERE `account_id` = %d",
+	    "SELECT `account_id`,`userid`,`user_pass`,`sex`,`email`,`group_id`,`state`,`unban_time`,`expiration_time`,`logincount`,`lastlogin`,`last_ip`,`birthdate`,`character_slots` FROM `%s` WHERE `account_id` = %d",
 		db->account_db, account_id )
 	) {
 		Sql_ShowDebug(sql_handle);
@@ -548,6 +548,7 @@ static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int acc
 	Sql_GetData(sql_handle, 10, &data, NULL); safestrncpy(acc->lastlogin, data, sizeof(acc->lastlogin));
 	Sql_GetData(sql_handle, 11, &data, NULL); safestrncpy(acc->last_ip, data, sizeof(acc->last_ip));
 	Sql_GetData(sql_handle, 12, &data, NULL); safestrncpy(acc->birthdate, data, sizeof(acc->birthdate));
+	Sql_GetData(sql_handle, 13, &data, NULL); acc->char_slots = atoi(data);
 
 	Sql_FreeResult(sql_handle);
 
@@ -596,7 +597,7 @@ static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, boo
 	if( is_new )
 	{// insert into account table
 		if( SQL_SUCCESS != SqlStmt_Prepare(stmt,
-			"INSERT INTO `%s` (`account_id`, `userid`, `user_pass`, `sex`, `email`, `group_id`, `state`, `unban_time`, `expiration_time`, `logincount`, `lastlogin`, `last_ip`, `birthdate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
+			"INSERT INTO `%s` (`account_id`, `userid`, `user_pass`, `sex`, `email`, `group_id`, `state`, `unban_time`, `expiration_time`, `logincount`, `lastlogin`, `last_ip`, `birthdate`, `character_slots`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
 			db->account_db)
 		||  SQL_SUCCESS != SqlStmt_BindParam(stmt,  0, SQLDT_INT,    (void*)&acc->account_id,      sizeof(acc->account_id))
 		||  SQL_SUCCESS != SqlStmt_BindParam(stmt,  1, SQLDT_STRING, (void*)acc->userid,           strlen(acc->userid))
@@ -611,6 +612,7 @@ static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, boo
 		||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 10, SQLDT_STRING, (void*)&acc->lastlogin,       strlen(acc->lastlogin))
 		||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 11, SQLDT_STRING, (void*)&acc->last_ip,         strlen(acc->last_ip))
 		||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 12, SQLDT_STRING, (void*)&acc->birthdate,       strlen(acc->birthdate))
+		||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 13, SQLDT_UCHAR,  (void*)&acc->char_slots,      sizeof(acc->char_slots))
 		||  SQL_SUCCESS != SqlStmt_Execute(stmt)
 		) {
 			SqlStmt_ShowDebug(stmt);
@@ -619,7 +621,7 @@ static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, boo
 	}
 	else
 	{// update account table
-		if( SQL_SUCCESS != SqlStmt_Prepare(stmt, "UPDATE `%s` SET `userid`=?,`user_pass`=?,`sex`=?,`email`=?,`group_id`=?,`state`=?,`unban_time`=?,`expiration_time`=?,`logincount`=?,`lastlogin`=?,`last_ip`=?,`birthdate`=? WHERE `account_id` = '%d'", db->account_db, acc->account_id)
+		if( SQL_SUCCESS != SqlStmt_Prepare(stmt, "UPDATE `%s` SET `userid`=?,`user_pass`=?,`sex`=?,`email`=?,`group_id`=?,`state`=?,`unban_time`=?,`expiration_time`=?,`logincount`=?,`lastlogin`=?,`last_ip`=?,`birthdate`=?,`character_slots`=? WHERE `account_id` = '%d'", db->account_db, acc->account_id)
 		||  SQL_SUCCESS != SqlStmt_BindParam(stmt,  0, SQLDT_STRING, (void*)acc->userid,           strlen(acc->userid))
 		||  SQL_SUCCESS != SqlStmt_BindParam(stmt,  1, SQLDT_STRING, (void*)acc->pass,             strlen(acc->pass))
 		||  SQL_SUCCESS != SqlStmt_BindParam(stmt,  2, SQLDT_ENUM,   (void*)&acc->sex,             sizeof(acc->sex))
@@ -632,6 +634,7 @@ static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, boo
 		||  SQL_SUCCESS != SqlStmt_BindParam(stmt,  9, SQLDT_STRING, (void*)&acc->lastlogin,       strlen(acc->lastlogin))
 		||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 10, SQLDT_STRING, (void*)&acc->last_ip,         strlen(acc->last_ip))
 		||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 11, SQLDT_STRING, (void*)&acc->birthdate,       strlen(acc->birthdate))
+		||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 12, SQLDT_UCHAR,  (void*)&acc->char_slots,      sizeof(acc->char_slots))
 		||  SQL_SUCCESS != SqlStmt_Execute(stmt)
 		) {
 			SqlStmt_ShowDebug(stmt);

+ 10 - 6
src/login/login.c

@@ -559,6 +559,7 @@ int parse_fromchar(int fd)
 			struct mmo_account acc;
 			time_t expiration_time = 0;
 			char email[40] = "";
+			uint8 char_slots = 0;
 			int group_id = 0;
 			char birthdate[10+1] = "";
 
@@ -567,22 +568,23 @@ int parse_fromchar(int fd)
 
 			if( !accounts->load_num(accounts, &acc, account_id) )
 				ShowNotice("Char-server '%s': account %d NOT found (ip: %s).\n", server[id].name, account_id, ip);
-			else
-			{
+			else {
 				safestrncpy(email, acc.email, sizeof(email));
 				expiration_time = acc.expiration_time;
 				group_id = acc.group_id;
+				char_slots = acc.char_slots;
 				safestrncpy(birthdate, acc.birthdate, sizeof(birthdate));
 			}
 
-			WFIFOHEAD(fd,62);
+			WFIFOHEAD(fd,63);
 			WFIFOW(fd,0) = 0x2717;
 			WFIFOL(fd,2) = account_id;
 			safestrncpy((char*)WFIFOP(fd,6), email, 40);
 			WFIFOL(fd,46) = (uint32)expiration_time;
-			WFIFOB(fd,50) = group_id;
-			safestrncpy((char*)WFIFOP(fd,51), birthdate, 10+1);
-			WFIFOSET(fd,62);
+			WFIFOB(fd,50) = (unsigned char)group_id;
+			WFIFOB(fd,51) = char_slots;
+			safestrncpy((char*)WFIFOP(fd,52), birthdate, 10+1);
+			WFIFOSET(fd,63);
 		}
 		break;
 
@@ -960,6 +962,8 @@ int mmo_auth_new(const char* userid, const char* pass, const char sex, const cha
 	safestrncpy(acc.last_ip, last_ip, sizeof(acc.last_ip));
 	safestrncpy(acc.birthdate, "0000-00-00", sizeof(acc.birthdate));
 
+	acc.char_slots = 0;
+
 	if( !accounts->create(accounts, &acc) )
 		return 0;
 

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików