aboutsummaryrefslogtreecommitdiff
path: root/builtin/item.lua
Commit message (Expand)AuthorAge
* Return an ItemStack in minetest.item_place() if nodes' on rightclick doesnt r...PilzAdam2013-04-02
* Fix node replacement in not-quite-loaded chunks0gb.us2013-03-29
* Drop nodes as items when dugged and no room in inventory and dont remove drop...PilzAdam2013-02-21
* Dont drop tools on rightclickPilzAdam2013-02-19
* Fix minetest.item_place_node() and minetest.item_drop() to always return an I...PilzAdam2013-02-13
* Fix to on_rightclick not able to change wielded_itemRealBadAngel2013-02-13
* Dont call on_rightclick() if sneak is pressedPilzAdam2013-01-27
* Add on_rightclick(pos, node, clicker) callback for nodesPilzAdam2013-01-04
* Add ability to change the itemstack in placenode callbacksPilzAdam2012-12-17
* Fix minetest.get_node_drops(). It should always return list of item names, no...Ilya Zhuravlev2012-12-02
* Only check attachment for nodes with group attached_nodePilzAdam2012-12-01
* Add the group attached_nodePilzAdam2012-12-01
* Add overridable function for handling dropped items from nodesPerttu Ahola2012-09-02
* Fix github issue #213: Dropping unknown items crashes the gamePerttu Ahola2012-08-19
* Allow digging of unknown nodesMatthew I2012-08-12
* Remove special handling of creative modePerttu Ahola2012-07-25
* Detached inventory callbacks and reworked node metadata callbacksPerttu Ahola2012-07-25
* builtin/item.lua: callbacks with copies of positions and nodes rather than re...Perttu Ahola2012-07-24
* Add oldnode parameter to minetest.register_on_placenode callbackPerttu Ahola2012-07-23
* Fix building on top of (pointable && buildable_to) nodesPerttu Ahola2012-07-23
* Actually fix facedir-rotated nodes placed using minetest.env:place_node()Perttu Ahola2012-07-21
* Handle nil placer as it might occur when using minetest.env:place_node. (Uberi)darkrose2012-07-21
* Remove tiles and special_tiles from node definition prototype because otherwi...Perttu Ahola2012-06-16
* Update field names to non-deprecated ones in node definition prototypePerttu Ahola2012-06-16
* Node placement client-side predictionPerttu Ahola2012-06-10
* place_node, dig_node and punch_node; an in-game tester tool; remove old codePerttu Ahola2012-06-05
* Add can_dig callbackdarkrose2012-06-03
* Implement locked chest; add after_place_node and after_dig_node node callbacksPerttu Ahola2012-06-03
* on_metadata_inventory_{move,offer,take}Perttu Ahola2012-06-03
* Random node metadata thingsPerttu Ahola2012-06-03
* Attempt to begin to implement chests and furnace in Lua (with problems)Perttu Ahola2012-06-03
* Allow redefining minetest.item_place and the likePerttu Ahola2012-04-09
* Implement dropped items as LuaEntities; leave the old ones as is for compatib...Perttu Ahola2012-04-01
* Split builtin.lua to multiple filesPerttu Ahola2012-04-01
hl opt">{ /*SRP_SHA1,*/ /*SRP_SHA224,*/ SRP_SHA256, /*SRP_SHA384, SRP_SHA512*/ } SRP_HashAlgorithm; typedef enum { SRP_ERR, SRP_OK, } SRP_Result; // clang-format off /* Sets the memory functions used by srp. * Note: this doesn't set the memory functions used by gmp, * but it is supported to have different functions for srp and gmp. * Don't call this after you have already allocated srp structures. */ void srp_set_memory_functions( void *(*new_srp_alloc) (size_t), void *(*new_srp_realloc) (void *, size_t), void (*new_srp_free) (void *)); /* Out: bytes_v, len_v * * The caller is responsible for freeing the memory allocated for bytes_v * * The n_hex and g_hex parameters should be 0 unless SRP_NG_CUSTOM is used for ng_type. * If provided, they must contain ASCII text of the hexidecimal notation. * * If bytes_s == NULL, it is filled with random data. * The caller is responsible for freeing. * * Returns SRP_OK on success, and SRP_ERR on error. * bytes_s might be in this case invalid, don't free it. */ SRP_Result srp_create_salted_verification_key(SRP_HashAlgorithm alg, SRP_NGType ng_type, const char *username_for_verifier, const unsigned char *password, size_t len_password, unsigned char **bytes_s, size_t *len_s, unsigned char **bytes_v, size_t *len_v, const char *n_hex, const char *g_hex); /* Out: bytes_B, len_B. * * On failure, bytes_B will be set to NULL and len_B will be set to 0 * * The n_hex and g_hex parameters should be 0 unless SRP_NG_CUSTOM is used for ng_type * * If bytes_b == NULL, random data is used for b. * * Returns pointer to SRPVerifier on success, and NULL on error. */ struct SRPVerifier* srp_verifier_new(SRP_HashAlgorithm alg, SRP_NGType ng_type, const char *username, const unsigned char *bytes_s, size_t len_s, const unsigned char *bytes_v, size_t len_v, const unsigned char *bytes_A, size_t len_A, const unsigned char *bytes_b, size_t len_b, unsigned char** bytes_B, size_t *len_B, const char* n_hex, const char* g_hex); // clang-format on void srp_verifier_delete(struct SRPVerifier *ver); // srp_verifier_verify_session must have been called before int srp_verifier_is_authenticated(struct SRPVerifier *ver); const char *srp_verifier_get_username(struct SRPVerifier *ver); /* key_length may be null */ const unsigned char *srp_verifier_get_session_key( struct SRPVerifier *ver, size_t *key_length); size_t srp_verifier_get_session_key_length(struct SRPVerifier *ver); /* Verifies session, on success, it writes bytes_HAMK. * user_M must be exactly srp_verifier_get_session_key_length() bytes in size */ void srp_verifier_verify_session( struct SRPVerifier *ver, const unsigned char *user_M, unsigned char **bytes_HAMK); /*******************************************************************************/ /* The n_hex and g_hex parameters should be 0 unless SRP_NG_CUSTOM is used for ng_type */ struct SRPUser *srp_user_new(SRP_HashAlgorithm alg, SRP_NGType ng_type, const char *username, const char *username_for_verifier, const unsigned char *bytes_password, size_t len_password, const char *n_hex, const char *g_hex); void srp_user_delete(struct SRPUser *usr); int srp_user_is_authenticated(struct SRPUser *usr); const char *srp_user_get_username(struct SRPUser *usr); /* key_length may be null */ const unsigned char *srp_user_get_session_key(struct SRPUser *usr, size_t *key_length); size_t srp_user_get_session_key_length(struct SRPUser *usr); // clang-format off /* Output: username, bytes_A, len_A. * If you don't want it get written, set username to NULL. * If bytes_a == NULL, random data is used for a. */ SRP_Result srp_user_start_authentication(struct SRPUser* usr, char **username, const unsigned char *bytes_a, size_t len_a, unsigned char **bytes_A, size_t* len_A); /* Output: bytes_M, len_M (len_M may be null and will always be * srp_user_get_session_key_length() bytes in size) */ void srp_user_process_challenge(struct SRPUser *usr, const unsigned char *bytes_s, size_t len_s, const unsigned char *bytes_B, size_t len_B, unsigned char **bytes_M, size_t *len_M); // clang-format on /* bytes_HAMK must be exactly srp_user_get_session_key_length() bytes in size */ void srp_user_verify_session(struct SRPUser *usr, const unsigned char *bytes_HAMK);