summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2006-01-08 22:52:59 +0000
committerYohann Ferreira <bertram@cegetel.net>2006-01-08 22:52:59 +0000
commitf7db7a051da79d8deef8b79419ce6772dce16725 (patch)
tree27ff5c5f33ea73d4e52e32ebbc583fa92ba50c87 /src/client.cpp
parentac150f3543caf86fd071c73f53373b4ea243fa24 (diff)
downloadmanaserv-f7db7a051da79d8deef8b79419ce6772dce16725.tar.gz
manaserv-f7db7a051da79d8deef8b79419ce6772dce16725.tar.bz2
manaserv-f7db7a051da79d8deef8b79419ce6772dce16725.tar.xz
manaserv-f7db7a051da79d8deef8b79419ce6772dce16725.zip
Added customization of created character. (That makes previously created db invalid.) Made list of map indexed by map id, instead of map name. This will prevent unsyncing of player's current map when changing a map name. Remember you have now to add a map filename into db before being able to load it. (Default map id is 1, not ZERO, as zero is the not found return value.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp78
1 files changed, 64 insertions, 14 deletions
diff --git a/src/client.cpp b/src/client.cpp
index f98d45d4..8c14e8b4 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -180,7 +180,42 @@ int main(int argc, char *argv[])
std::cout << "Name: ";
std::cin >> line;
msg.writeString(line);
- msg.writeByte(0);
+
+ std::cout << "Hair Style ID (0 - " << MAX_HAIRSTYLE_VALUE << "): ";
+ std::cin >> line;
+ msg.writeByte(atoi(line));
+
+ std::cout << "Hair Color ID (0 - " << MAX_HAIRCOLOR_VALUE << "): ";
+ std::cin >> line;
+ msg.writeByte(atoi(line));
+
+ std::cout << "Gender ID (0 - " << MAX_GENDER_VALUE << "): ";
+ std::cin >> line;
+ msg.writeByte(atoi(line));
+
+ std::cout << "Strength: ";
+ std::cin >> line;
+ msg.writeShort(atoi(line));
+
+ std::cout << "Agility: ";
+ std::cin >> line;
+ msg.writeShort(atoi(line));
+
+ std::cout << "Vitality: ";
+ std::cin >> line;
+ msg.writeShort(atoi(line));
+
+ std::cout << "Intelligence: ";
+ std::cin >> line;
+ msg.writeShort(atoi(line));
+
+ std::cout << "Dexterity: ";
+ std::cin >> line;
+ msg.writeShort(atoi(line));
+
+ std::cout << "Luck: ";
+ std::cin >> line;
+ msg.writeShort(atoi(line));
} break;
case 9:
@@ -488,17 +523,29 @@ int main(int argc, char *argv[])
case CREATE_TOO_MUCH_CHARACTERS:
std::cout << "Character Creation: Too much characters." << std::endl;
break;
- case CREATE_INVALID_HAIR:
- std::cout << "Character Creation: Invalid Hair Value." << std::endl;
+ case CREATE_INVALID_HAIRSTYLE:
+ std::cout << "Character Creation: Invalid Hair Style Value." << std::endl;
+ break;
+ case CREATE_INVALID_HAIRCOLOR:
+ std::cout << "Character Creation: Invalid Hair Color Value." << std::endl;
+ break;
+ case CREATE_INVALID_GENDER:
+ std::cout << "Character Creation: Invalid Gender Value." << std::endl;
break;
case CREATE_INVALID_NAME:
std::cout << "Character Creation: Invalid Name." << std::endl;
break;
- case CREATE_INVALID_SEX:
- std::cout << "Character Creation: Invalid Sex value." << std::endl;
+ case CREATE_RAW_STATS_EQUAL_TO_ZERO:
+ std::cout << "Character Creation: a Statistic is equal to zero." << std::endl;
break;
- case CREATE_INVALID_RAW_STATS:
- std::cout << "TODO: Character Creation: Invalid Raw Stats." << std::endl;
+ case CREATE_RAW_STATS_INVALID_DIFF:
+ std::cout << "Character Creation: Statistics disproportionned." << std::endl;
+ break;
+ case CREATE_RAW_STATS_TOO_HIGH:
+ std::cout << "Character Creation: Statistics too high for level 1." << std::endl;
+ break;
+ case CREATE_RAW_STATS_TOO_LOW:
+ std::cout << "Character Creation: Statistics too low for level 1." << std::endl;
break;
default:
case CREATE_UNKNOWN:
@@ -573,16 +620,19 @@ int main(int argc, char *argv[])
{
std::cout << msg.readString() << ":" << std::endl;
std::cout << "Gender: " << int(msg.readByte()) << ", ";
+ std::cout << "Hair Style: " << int(msg.readByte()) << ", ";
+ std::cout << "Hair Color: " << int(msg.readByte()) << ", "
+ << std::endl;
std::cout << "Level: " << int(msg.readByte()) << ", ";
- std::cout << "Money: " << int(msg.readByte()) << ", "
+ std::cout << "Money: " << int(msg.readShort()) << ", "
<< std::endl;
- std::cout << "Strength: " << int(msg.readByte()) << ", ";
- std::cout << "Agility: " << int(msg.readByte()) << ", ";
- std::cout << "Vitality: " << int(msg.readByte()) << ", "
+ std::cout << "Strength: " << int(msg.readShort()) << ", ";
+ std::cout << "Agility: " << int(msg.readShort()) << ", ";
+ std::cout << "Vitality: " << int(msg.readShort()) << ", "
<< std::endl;
- std::cout << "Intelligence: " << int(msg.readByte()) << ", ";
- std::cout << "Dexterity: " << int(msg.readByte()) << ", ";
- std::cout << "Luck: " << int(msg.readByte()) << ", "
+ std::cout << "Intelligence: " << int(msg.readShort()) << ", ";
+ std::cout << "Dexterity: " << int(msg.readShort()) << ", ";
+ std::cout << "Luck: " << int(msg.readShort()) << ". "
<< std::endl << std::endl;
}
break;