diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-02-28 19:06:40 +0100 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-02-28 19:06:40 +0100 |
commit | b89e404f85358f2e3ff87d7731376dbeacdf9778 (patch) | |
tree | e391237c46bb6fb3cfe184f65a306af54138dddb | |
parent | 7a75bd8b0215a3d8ad1e6be7baf5e6a056d1607a (diff) | |
parent | 626e4c98353f2111ae21123756396fc845447b57 (diff) | |
download | manaserv-b89e404f85358f2e3ff87d7731376dbeacdf9778.tar.gz manaserv-b89e404f85358f2e3ff87d7731376dbeacdf9778.tar.bz2 manaserv-b89e404f85358f2e3ff87d7731376dbeacdf9778.tar.xz manaserv-b89e404f85358f2e3ff87d7731376dbeacdf9778.zip |
Merge branch 'master' into lpc2012
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | docs/scripting.txt | 69 | ||||
-rw-r--r-- | docs/serverdata.txt | 20 | ||||
-rw-r--r-- | docs/stats.txt | 24 | ||||
-rw-r--r-- | src/game-server/monster.h | 2 | ||||
-rw-r--r-- | src/utils/logger.h | 34 |
6 files changed, 35 insertions, 115 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 30124fb5..411a7ed9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,4 +53,5 @@ ELSE (WIN32) ENDIF (WIN32) ADD_SUBDIRECTORY(libs/enet) +ADD_SUBDIRECTORY(scripts) ADD_SUBDIRECTORY(src) diff --git a/docs/scripting.txt b/docs/scripting.txt deleted file mode 100644 index 4f91c74a..00000000 --- a/docs/scripting.txt +++ /dev/null @@ -1,69 +0,0 @@ -Mana Scripting Specification - DRAFT v0.2 - -Generic scripting interfaces for various in-game objects. - -Functions Library - provided by server scripting bindings. -Public Interface - public interface provided by script. -Public Variables - public variables provided by script. -Persistent Variabls - Variables which persist. - -All prototypes are in a C like syntax. - -Global Function Library (accessible by all script types): - string getName(void) - Get name of player. - uint getX(void) - Get X position of player. - uint getY(void) - Get Y position of player. - string getMap(void) - Get map name. - uint getLevel(void) - Get player level. - uint getHealth(void) - Get current health of player using item. - uint getMaxHealth(void) - Get maximum health player can have. - uint getAttack(void) - Get attack stats of player. - uint getDefense(void) - Get defense stats of player. - uint getLuck(void) - Get luck stats of player. - uint getVitality(void) - Get vitality stats of player. - - void setHealth(uint hp) - Set player health points. - - void createItem(uint id) - Spawn/create item at player position. - void createBeing(uint id) - Spawn/create being at player position. - - -Item Scripting: - Function Library: - Public Interface: - void use(void) - Called when player uses the item. - - Public Variables: - string name - Name of item. - int type - Type of item (weapon, armor, usable, etc.) - - *Special Properties* - int attack - Attack addition. - int defense - Defense addition. - int luck - Luck addition. - int vitality- Vitality addition. - (These will add to the players statistical properties when equipped. - Note that they are not unsigned allowing negative properties.) - ... - - Persistent Variables: - - -Skill Scripting: - Function Library: - uint getSkillLevel(void) - Get level of skill. - - Public Interface: - void use(void) - Called when player uses skill. - - Public Variables: - Persistent Variables: - -Being Scripting: - Function Library: - Public Interface: - Public Variables: - Persistent Variables: - - -- nym diff --git a/docs/serverdata.txt b/docs/serverdata.txt deleted file mode 100644 index 161ef296..00000000 --- a/docs/serverdata.txt +++ /dev/null @@ -1,20 +0,0 @@ -As per Elven's request, I'm making this document to contain the information -relevant to server development as far as my understanding goes. This file -contains the following: - - Information that will be stored in Player Account - - - -1. Information stored in a Player Account - - Inventory - an array of 110 item IDs (the last 10 slots or so are current - equipment) - - Position - the place where the player is in worldspace (3 ints, x, y, map) - - Estate - stored as an array of Tiled maps, the same way any map is. - - Skills - an array of 100 Skill structures - - Quest Info - an array of X short integers, specifying the player's position - in or accomplishment of the game quests. (X is the number of - quests) - - Pet Status - pets are stored as an array of skills and some general - information (age, type of monster, loyalty, equipment, etc.) - You can have up to 3 pets at once. - diff --git a/docs/stats.txt b/docs/stats.txt deleted file mode 100644 index b5cbedc3..00000000 --- a/docs/stats.txt +++ /dev/null @@ -1,24 +0,0 @@ -Mana Statistics Specification - DRAFT v0.1 - -Currently this work is derived from work done on Wiki. This system -is simplified. Each being has core statistics which are used to -calculate the actual statistics which will be used when performing -actions in-game. - -Core Being Statistics: - level - - strength - - vitality - - dexterity - - intelligence - - luck - - -Being Derived Statistics: - health - 20 + (20 * vitality) - attack - 10 + strength + equipped weapon skill - defense - 10 + strength + equipped weapon skill + equipment defense bonuses - magic - 10 + intelligence + magic skill level + equipment magic bonuses - accuracy - 50 + dexterity - speed - dexterity + running skill - --nym diff --git a/src/game-server/monster.h b/src/game-server/monster.h index b924b371..6bf06d2b 100644 --- a/src/game-server/monster.h +++ b/src/game-server/monster.h @@ -371,8 +371,6 @@ class Monster : public Being Timeout mKillStealProtectedTimeout; /** Time until dead monster is removed */ Timeout mDecayTimeout; - - friend struct MonsterTargetEventDispatch; }; #endif // MONSTER_H diff --git a/src/utils/logger.h b/src/utils/logger.h index 65846be5..c9ca9d80 100644 --- a/src/utils/logger.h +++ b/src/utils/logger.h @@ -24,6 +24,7 @@ #include <iosfwd> #include <sstream> +#include <iostream> namespace utils { @@ -192,6 +193,32 @@ class Logger static void switchLogs(); }; +/** + * Class for temporarily debugging things that are actually not interesting + * to include in the log. + * + * It is used for automatically ending with a newline, putting spaces in + * between different parameters and quoting strings. + */ +class Debug +{ +public: + ~Debug() { std::cout << std::endl; } + + template <class T> + Debug &operator << (T t) + { + std::cout << t << " "; + return *this; + } +}; + +template <> +inline Debug &Debug::operator << (const std::string &t) +{ + std::cout << "\"" << t << "\" "; + return *this; +} } // namespace utils @@ -210,4 +237,11 @@ class Logger #define LOG_ERROR(msg) LOG(Error, msg) #define LOG_FATAL(msg) LOG(Fatal, msg) +/** + * Returns an instance of the debug class for printing out a line. + * + * Usage: debug() << "testing" << a << b; + */ +inline ::utils::Debug debug() { return ::utils::Debug(); } + #endif // LOGGER_H |