From ca249eef3a971b54f25cb4e82b71088a562b0a6d Mon Sep 17 00:00:00 2001 From: Coder12a <38924418+Coder12a@users.noreply.github.com> Date: Mon, 13 May 2019 14:35:10 -0500 Subject: [PATCH] Update: readme file --- README.md | 66 ------------------------------------------------------- 1 file changed, 66 deletions(-) diff --git a/README.md b/README.md index c949a2e..59d57a1 100644 --- a/README.md +++ b/README.md @@ -44,72 +44,6 @@ coldbase.remove("MyKeyAndValue") ```lua coldbase.add_to_mem_pool = true ``` -7. returns the amount of entries from the entry file. -```lua -coldbase.get_entry_file_count(name, tag_name) -``` -8. iterates through the entry file(breaks and ends if it reaches the end of the file). -```lua -coldbase.iterate_entry_file(name, begin_func, func_on_iterate, end_func, args, tag_name) -``` -9. adds a folder which can be used in other functions that have tag_name arg. -```lua -coldbase.add_tag("Extra_Folder", {"Extra", "Folder"}) -``` -10. returns the tag name if the tag does not exists it creates one. -```lua -coldbase.get_or_add_tag("Extra_Folder", {"Extra", "Folder"}, no_new_path) -``` -11. remove tag by name. -```lua -coldbase.remove_tag("Extra_Folder") -``` - -Quick Look -=========== - -```lua --- create an directory(watchlist) and link it as a database. -ip_db = colddb.Colddb("watchlist") - --- When ever a player join's his/her ip address is recorded to the database by player name. -minetest.register_on_prejoinplayer(function(name, ip) - ip_db.set(name, ip, ip_db.get_or_add_tag("ips", "ips")) -end) - -minetest.register_chatcommand("ip", { - params = "", - description = "Get an player's ip address.", - func = function(name, param) - -- Get the ip record asynchronously. - ip_db.get(param, ip_db.get_or_add_tag("ips", "ips"), function(record) - -- If record is contains data send it to the player. - if record then - minetest.chat_send_player(name, string.format("%s:%s", param, record)) - else - -- No record was found. - minetest.chat_send_player(name, "Can not find ip record.") - end - end) - end -}) - -minetest.register_chatcommand("clear", { - params = "", - description = "Clear out the ip database.", - func = function(name, param) - ip_db.remove_tag(ip_db.get_or_add_tag("ips", "ips")) - minetest.chat_send_player(name, "Ip Database Cleared!") - end -}) - -``` - -Quick Look Notes -=========== - -In the example above we could also create a more complex ip database using tags. Creating tags named after the player then assigning the ip files to them.
-This way we could store many ips associated with the player instead of just one ip. License ===========