diff --git a/extensions/community/UserData.json b/extensions/community/UserData.json new file mode 100644 index 000000000..c7e0fc478 --- /dev/null +++ b/extensions/community/UserData.json @@ -0,0 +1,1133 @@ +{ + "author": "", + "category": "Third-party", + "extensionNamespace": "", + "fullName": "User Data", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGc+DQoJPHBhdGggZD0iTTIzLDI4Yy0xLjEsMC0yLjEtMC43LTIuNS0xLjhjMC0wLjEsMC0wLjItMC4xLTAuMmgtOC45YzAsMC4xLDAsMC4yLTAuMSwwLjJDMTEuMSwyNy4zLDEwLjEsMjgsOSwyOGMtMC42LDAtMSwwLjQtMSwxDQoJCXMwLjQsMSwxLDFoMTRjMC42LDAsMS0wLjQsMS0xUzIzLjYsMjgsMjMsMjh6Ii8+DQoJPHBhdGggZD0iTTI3LDNINUMzLjMsMywyLDQuMywyLDZ2MTVjMCwxLjcsMS4zLDMsMywzaDYuOWg4LjFIMjdjMS43LDAsMy0xLjMsMy0zVjZDMzAsNC4zLDI4LjcsMywyNywzeiBNMjEuOCwxOS42DQoJCUMyMS42LDE5LjksMjEuMywyMCwyMSwyMGwtMTAsMGMtMC4zLDAtMC42LTAuMS0wLjgtMC40QzEwLDE5LjQsMTAsMTkuMSwxMCwxOC44YzAuMy0xLjUsMS40LTIuNywyLjgtMy4xYzAuNC0wLjEsMC43LTAuNCwwLjgtMC43DQoJCWMtMC43LTAuNy0xLjItMS43LTEuMi0yLjh2LTEuN2MwLTAuOSwwLjQtMS43LDEuMS0yLjJjMC40LTAuMywwLjgtMC41LDEuMy0wLjVjMC43LTAuNiwxLjYtMSwyLjYtMC45YzEuNywwLjIsMywxLjcsMywzLjV2MQ0KCQljMCwwLjUtMC40LDAuOS0wLjgsMWMwLDEtMC41LDEuOS0xLjIsMi42YzAuMSwwLjMsMC40LDAuNiwwLjcsMC43YzEuNSwwLjQsMi42LDEuNiwyLjksMy4xQzIyLDE5LjEsMjIsMTkuNCwyMS44LDE5LjZ6Ii8+DQo8L2c+DQo8L3N2Zz4NCg==", + "name": "UserData", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Computers and Hardware/48623f02247f1a8cf9d39e706898fcf0208f5a70ee283f1b7d3e72329696ae87_Computers and Hardware_screen_computer_user.svg", + "shortDescription": "This extension introduces expressions designed to retrieve data from users that are currently playing the game. Additionally, it enables retrieving data from an IP address you provided.", + "version": "1.0.0", + "description": [ + "[ Expressions ]", + "", + "UserData::CurrentUserIP()", + "UserData::IP()", + "UserData::Country()", + "UserData::CountryCode()", + "UserData::Region()", + "UserData::RegionName()", + "UserData::City()", + "UserData::Zip()", + "UserData::Timezone()", + "", + "", + "[ Actions ]", + "", + "UserData::SetupIP()", + "", + "", + "[ Info ]", + "", + "This extension works with \"ip-api.com\" and \"api.ipify.org\"" + ], + "tags": [ + "data", + "user-info" + ], + "authorIds": [ + "I40GVpJVNUM8lFZowdJS5fKTycy2", + "0fE0FDJlVHhTNRfwKjxgk1NnEPj2" + ], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Get user ip address.", + "fullName": "Current User ip", + "functionType": "StringExpression", + "name": "CurrentUserIP", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "await": true, + "value": "SendAsyncRequest" + }, + "parameters": [ + "\"https://api.ipify.org/?format=json\"", + "\"\"", + "\"GET\"", + "\"\"", + "user_ip_raw", + "" + ] + }, + { + "type": { + "value": "JSONToVariableStructure" + }, + "parameters": [ + "VariableString(user_ip_raw)", + "user_ip" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "VariableString(user_ip.ip)" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Get user ip address from the provided ip.", + "fullName": "User ip", + "functionType": "StringExpression", + "group": "User", + "name": "IP", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "VariableString(ip_in_use)" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Get user country location.", + "fullName": "User country", + "functionType": "StringExpression", + "group": "User", + "name": "Country", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "await": true, + "value": "SendAsyncRequest" + }, + "parameters": [ + "\"https://api.ipify.org/?format=json\"", + "\"\"", + "\"GET\"", + "\"\"", + "user_ip_raw", + "" + ] + }, + { + "type": { + "value": "JSONToVariableStructure" + }, + "parameters": [ + "VariableString(user_ip_raw)", + "user_ip" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Variable(user_ip.ip)", + "!=", + "0" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "VariableString(user_ip.ip)", + "!=", + "\"\"" + ] + } + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Wait" + }, + "parameters": [ + "1" + ] + }, + { + "type": { + "await": true, + "value": "SendAsyncRequest" + }, + "parameters": [ + "\"http://ip-api.com/json/\" + VariableString(ip_in_use)", + "\"\"", + "\"GET\"", + "\"\"", + "user_info_raw", + "" + ] + }, + { + "type": { + "value": "JSONToVariableStructure" + }, + "parameters": [ + "VariableString(user_info_raw)", + "user_info" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "VariableString(user_info.country)" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Get user country location code (FR, BE, DE, ...).", + "fullName": "User country code", + "functionType": "StringExpression", + "group": "User", + "name": "CountryCode", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "await": true, + "value": "SendAsyncRequest" + }, + "parameters": [ + "\"https://api.ipify.org/?format=json\"", + "\"\"", + "\"GET\"", + "\"\"", + "user_ip_raw", + "" + ] + }, + { + "type": { + "value": "JSONToVariableStructure" + }, + "parameters": [ + "VariableString(user_ip_raw)", + "user_ip" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Variable(user_ip.ip)", + "!=", + "0" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "VariableString(user_ip.ip)", + "!=", + "\"\"" + ] + } + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Wait" + }, + "parameters": [ + "1" + ] + }, + { + "type": { + "await": true, + "value": "SendAsyncRequest" + }, + "parameters": [ + "\"http://ip-api.com/json/\" + VariableString(ip_in_use)", + "\"\"", + "\"GET\"", + "\"\"", + "user_info_raw", + "" + ] + }, + { + "type": { + "value": "JSONToVariableStructure" + }, + "parameters": [ + "VariableString(user_info_raw)", + "user_info" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "VariableString(user_info.countryCode)" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Get user region location.", + "fullName": "User region", + "functionType": "StringExpression", + "group": "User", + "name": "Region", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "await": true, + "value": "SendAsyncRequest" + }, + "parameters": [ + "\"https://api.ipify.org/?format=json\"", + "\"\"", + "\"GET\"", + "\"\"", + "user_ip_raw", + "" + ] + }, + { + "type": { + "value": "JSONToVariableStructure" + }, + "parameters": [ + "VariableString(user_ip_raw)", + "user_ip" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Variable(user_ip.ip)", + "!=", + "0" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "VariableString(user_ip.ip)", + "!=", + "\"\"" + ] + } + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Wait" + }, + "parameters": [ + "1" + ] + }, + { + "type": { + "await": true, + "value": "SendAsyncRequest" + }, + "parameters": [ + "\"http://ip-api.com/json/\" + VariableString(ip_in_use)", + "\"\"", + "\"GET\"", + "\"\"", + "user_info_raw", + "" + ] + }, + { + "type": { + "value": "JSONToVariableStructure" + }, + "parameters": [ + "VariableString(user_info_raw)", + "user_info" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "VariableString(user_info.region)" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Get user region name location.", + "fullName": "User region name", + "functionType": "StringExpression", + "group": "User", + "name": "RegionName", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "await": true, + "value": "SendAsyncRequest" + }, + "parameters": [ + "\"https://api.ipify.org/?format=json\"", + "\"\"", + "\"GET\"", + "\"\"", + "user_ip_raw", + "" + ] + }, + { + "type": { + "value": "JSONToVariableStructure" + }, + "parameters": [ + "VariableString(user_ip_raw)", + "user_ip" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Variable(user_ip.ip)", + "!=", + "0" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "VariableString(user_ip.ip)", + "!=", + "\"\"" + ] + } + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Wait" + }, + "parameters": [ + "1" + ] + }, + { + "type": { + "await": true, + "value": "SendAsyncRequest" + }, + "parameters": [ + "\"http://ip-api.com/json/\" + VariableString(ip_in_use)", + "\"\"", + "\"GET\"", + "\"\"", + "user_info_raw", + "" + ] + }, + { + "type": { + "value": "JSONToVariableStructure" + }, + "parameters": [ + "VariableString(user_info_raw)", + "user_info" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "VariableString(user_info.regionName)" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Get user city location.", + "fullName": "User city", + "functionType": "StringExpression", + "group": "User", + "name": "City", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "await": true, + "value": "SendAsyncRequest" + }, + "parameters": [ + "\"https://api.ipify.org/?format=json\"", + "\"\"", + "\"GET\"", + "\"\"", + "user_ip_raw", + "" + ] + }, + { + "type": { + "value": "JSONToVariableStructure" + }, + "parameters": [ + "VariableString(user_ip_raw)", + "user_ip" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Variable(user_ip.ip)", + "!=", + "0" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "VariableString(user_ip.ip)", + "!=", + "\"\"" + ] + } + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Wait" + }, + "parameters": [ + "1" + ] + }, + { + "type": { + "await": true, + "value": "SendAsyncRequest" + }, + "parameters": [ + "\"http://ip-api.com/json/\" + VariableString(ip_in_use)", + "\"\"", + "\"GET\"", + "\"\"", + "user_info_raw", + "" + ] + }, + { + "type": { + "value": "JSONToVariableStructure" + }, + "parameters": [ + "VariableString(user_info_raw)", + "user_info" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "VariableString(user_info.city)" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Get user zip code.", + "fullName": "User zip", + "functionType": "StringExpression", + "group": "User", + "name": "Zip", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "await": true, + "value": "SendAsyncRequest" + }, + "parameters": [ + "\"https://api.ipify.org/?format=json\"", + "\"\"", + "\"GET\"", + "\"\"", + "user_ip_raw", + "" + ] + }, + { + "type": { + "value": "JSONToVariableStructure" + }, + "parameters": [ + "VariableString(user_ip_raw)", + "user_ip" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Variable(user_ip.ip)", + "!=", + "0" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "VariableString(user_ip.ip)", + "!=", + "\"\"" + ] + } + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Wait" + }, + "parameters": [ + "1" + ] + }, + { + "type": { + "await": true, + "value": "SendAsyncRequest" + }, + "parameters": [ + "\"http://ip-api.com/json/\" + VariableString(ip_in_use)", + "\"\"", + "\"GET\"", + "\"\"", + "user_info_raw", + "" + ] + }, + { + "type": { + "value": "JSONToVariableStructure" + }, + "parameters": [ + "VariableString(user_info_raw)", + "user_info" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "VariableString(user_info.zip)" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Get user timezone location.", + "fullName": "User timezone", + "functionType": "StringExpression", + "group": "User", + "name": "Timezone", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "await": true, + "value": "SendAsyncRequest" + }, + "parameters": [ + "\"https://api.ipify.org/?format=json\"", + "\"\"", + "\"GET\"", + "\"\"", + "user_ip_raw", + "" + ] + }, + { + "type": { + "value": "JSONToVariableStructure" + }, + "parameters": [ + "VariableString(user_ip_raw)", + "user_ip" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Variable(user_ip.ip)", + "!=", + "0" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "VariableString(user_ip.ip)", + "!=", + "\"\"" + ] + } + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Wait" + }, + "parameters": [ + "1" + ] + }, + { + "type": { + "await": true, + "value": "SendAsyncRequest" + }, + "parameters": [ + "\"http://ip-api.com/json/\" + VariableString(ip_in_use)", + "\"\"", + "\"GET\"", + "\"\"", + "user_info_raw", + "" + ] + }, + { + "type": { + "value": "JSONToVariableStructure" + }, + "parameters": [ + "VariableString(user_info_raw)", + "user_info" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "VariableString(user_info.timezone)" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Fill in the IP you want to get data from. If this action isn't set up, the expressions will provide \"0\" as the value. You can also use 'UserData::CurrentUserIp()' to get the IP from the user who is currently playing the game.", + "fullName": "Setup IP", + "functionType": "Action", + "name": "SetupIP", + "sentence": "Get all data from _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarSceneTxt" + }, + "parameters": [ + "ip_in_use", + "=", + "ip" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Ip you want to get the data", + "name": "ip", + "type": "string" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] +} \ No newline at end of file