aboutsummaryrefslogtreecommitdiff
path: root/src/util
Commit message (Expand)AuthorAge
* Formspecs: Add state-selection to style elements (#9378)Hugues Ross2020-04-11
* GUIHyperText: Fix bug with UTF8 chars in action name + simplify UTF8 stringw ...Jean-Patrick Guerrero2020-03-07
* EnrichedString: Fix substr segfault caused by non-formatted textSmallJoker2020-01-24
* EnrichedString: Fix uninitialized variable m_default_lengthSmallJoker2020-01-23
* StaticText/EnrichedString: Styling support (#9187)SmallJoker2020-01-22
* Android: fix cyrillic characters, update iconv lib (#9117)Maksim2020-01-13
* Formspec: add hypertext elementPierre-Yves Rollo2019-11-03
* Move Quicktune code to util/ (#8871)ANAND2019-09-29
* Fix AreaStore's IDs persistence (#8888)SmallJoker2019-09-21
* util/hex.h: Remove whitespace-only line (#8460)ANAND2019-04-08
* util/hex.h: Reserve result space in hex_encode()starling132019-04-07
* numeric: Fix clang, broken since d5456daSmallJoker2019-02-09
* Use true pitch/yaw/roll rotations without loss of precision by pgimeno (#8019)Paul Ouellette2019-02-07
* DragonFly BSD is somewhat identical to FreeBSD (#8159)Leonid Bobrov2019-02-03
* Drop libgmp on Android and use mini-gmp (#8047)Loïc Blot2019-01-04
* Proselytize the network. Use IEEE F32 (#8030)SmallJoker2019-01-03
* ieee_float: Silence compiler warningSmallJoker2018-12-18
* Network: Send IEEE floats (#7768)SmallJoker2018-12-13
* Add Lua methods 'set_rotation()' and 'get_rotation()' (#7395)CoderForTheBetter2018-11-28
* Light curve: Simplify and improve code, fix darkened daytime sky (#7693)Vitaliy2018-09-16
* Raycast: export exact pointing location (#6304)Dániel Juhász2018-08-16
* Replace auth.txt with SQLite auth database (#7279)Ben Deutsch2018-08-05
* Smoothed yaw rotation for objects (#6825)SmallJoker2018-08-02
* Fix build on gcc 5.0 (#7586)zeuner2018-07-26
* Fix memory leak in guiConfirmRegistrationHybridDog2018-07-06
* Fix buffer overrun in SRP (#7484)red-0012018-06-26
* Fix MurmurHash implementation to really be unaligned (#7482)sfan52018-06-26
* Use server's zoom fov for distant world loading.Lars Hofhansl2018-05-15
* Formspecs: Allow setting alpha value for the box[] elementThomas--S2018-04-23
* Zoom adjustDist(): Improve variable name (#7208)Paramat2018-04-05
* Fix last performance-type-promotion-in-math-fn problemsLoic Blot2018-04-04
* Optimize a little bit isBlockInSight, adjustDist & collisions (#7193)Loïc Blot2018-04-04
* Fix last clang-tidy reported problems for performance-type-promotion-in-math-fnLoic Blot2018-04-03
* Fix various clang-tidy reported performance-type-promotion-in-math-fnLoïc Blot2018-04-03
* Revert "Add an active object step time budget #6721"Lars Hofhansl2018-01-12
* Fix Wstringop-overflow warning from util/srp.cpp (#6855)you2018-01-04
* Fix rounding error in g/set_node caused by truncation to floatrubenwardy2017-12-26
* directiontables: Fix MSVC compiler error (#6785)adrido2017-12-14
* Add an active object step time budget #6721Lars Hofhansl2017-12-06
* Allow zoom to actually show more data.Lars Hofhansl2017-11-15
* Move files to subdirectories (#6599)Vitaliy2017-11-08
* directiontables.cpp: fix a warning reported by VS2017Loic Blot2017-10-17
* Real global textures (#6105)Vitaliy2017-10-15
* Use a Buffer instead of SharedBuffer in ConnectionCommandLoic Blot2017-09-05
* Remove DSTACK support (#6346)Loïc Blot2017-08-30
* Network cleanup (#6310)Loïc Blot2017-08-25
* Translations: prevent remote crash with invalid translationsEkdohibs2017-08-25
* Add clientside translations.Ekdohibs2017-08-24
* serialize: use a temporary for SerializeExceptionLoïc Blot2017-08-21
* Change BS constant from implicit double to float (#6286)Jens Rottmann2017-08-20
kwa">case DETACHED: return (name == other.name); } return false; } bool operator!=(const InventoryLocation &other) const { return !(*this == other); } void applyCurrentPlayer(const std::string &name_) { if(type == CURRENT_PLAYER) setPlayer(name_); } std::string dump() const; void serialize(std::ostream &os) const; void deSerialize(std::istream &is); void deSerialize(std::string s); }; struct InventoryAction; class InventoryManager { public: InventoryManager(){} virtual ~InventoryManager(){} // Get an inventory (server and client) virtual Inventory* getInventory(const InventoryLocation &loc){return NULL;} // Set modified (will be saved and sent over network; only on server) virtual void setInventoryModified(const InventoryLocation &loc, bool playerSend = true){} // Send inventory action to server (only on client) virtual void inventoryAction(InventoryAction *a){} }; #define IACTION_MOVE 0 #define IACTION_DROP 1 #define IACTION_CRAFT 2 struct InventoryAction { static InventoryAction * deSerialize(std::istream &is); virtual u16 getType() const = 0; virtual void serialize(std::ostream &os) const = 0; virtual void apply(InventoryManager *mgr, ServerActiveObject *player, IGameDef *gamedef) = 0; virtual void clientApply(InventoryManager *mgr, IGameDef *gamedef) = 0; virtual ~InventoryAction() {}; }; struct IMoveAction : public InventoryAction { // count=0 means "everything" u16 count; InventoryLocation from_inv; std::string from_list; s16 from_i; InventoryLocation to_inv; std::string to_list; s16 to_i; bool move_somewhere; // treat these as private // related to movement to somewhere bool caused_by_move_somewhere; u32 move_count; IMoveAction() { count = 0; from_i = -1; to_i = -1; move_somewhere = false; caused_by_move_somewhere = false; move_count = 0; } IMoveAction(std::istream &is, bool somewhere); u16 getType() const { return IACTION_MOVE; } void serialize(std::ostream &os) const { if (!move_somewhere) os << "Move "; else os << "MoveSomewhere "; os << count << " "; os << from_inv.dump() << " "; os << from_list << " "; os << from_i << " "; os << to_inv.dump() << " "; os << to_list; if (!move_somewhere) os << " " << to_i; } void apply(InventoryManager *mgr, ServerActiveObject *player, IGameDef *gamedef); void clientApply(InventoryManager *mgr, IGameDef *gamedef); }; struct IDropAction : public InventoryAction { // count=0 means "everything" u16 count; InventoryLocation from_inv; std::string from_list; s16 from_i; IDropAction() { count = 0; from_i = -1; } IDropAction(std::istream &is); u16 getType() const { return IACTION_DROP; } void serialize(std::ostream &os) const { os<<"Drop "; os<<count<<" "; os<<from_inv.dump()<<" "; os<<from_list<<" "; os<<from_i; } void apply(InventoryManager *mgr, ServerActiveObject *player, IGameDef *gamedef); void clientApply(InventoryManager *mgr, IGameDef *gamedef); }; struct ICraftAction : public InventoryAction { // count=0 means "everything" u16 count; InventoryLocation craft_inv; ICraftAction() { count = 0; } ICraftAction(std::istream &is); u16 getType() const { return IACTION_CRAFT; } void serialize(std::ostream &os) const { os<<"Craft "; os<<count<<" "; os<<craft_inv.dump()<<" "; } void apply(InventoryManager *mgr, ServerActiveObject *player, IGameDef *gamedef); void clientApply(InventoryManager *mgr, IGameDef *gamedef); }; // Crafting helper bool getCraftingResult(Inventory *inv, ItemStack& result, std::vector<ItemStack> &output_replacements, bool decrementInput, IGameDef *gamedef); #endif