Jump to content

niralijoshi

Resident
  • Posts

    7
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi Freya, I have tired according to your way which you have suggested and now it's all working fine with website. But , how to transfer money from destination avatar account to owner account ? I.e if i have a balance of 1000L$ in website . and my destination avatar have a 10L$ and owner avatar have a 20 L$. Now, i am transferring 1L$ from site to game. so, now i have balance a 999L$ and on game destination avar have a 11L$ and owner avatar have a 19L$ now, when i am checking ip and if ip is wrong then balance will manage for website account and my account have 1000L$. Now, I need to transfer a 1L$ from destination avatar to owner avatar. so, how do i do that? I have tried with llGiveMoney and llTransferLindenDollars function but it's transferring money from owner avtar to destination avatar. Note: i need to pass a code in http_response method in lsl script. Thanks.
  2. Hi Freya, I need your help in one query. I am transferring fund from our website to game so, we have placed one function transaction_result(). using this we are getting status about transaction like is succes or LINDENDOLLAR_INSUFFICIENTFUNDS something like this. Now, when ip of liden Lab Server and ip which we have saved in our database, both are not match then do we need to check manually i mean do we need to write code for it. or If transaction_result() function will return any Error Tag regarding Linden Lab Server IP Address so, using that i can we manage our transaction? Thanks.
  3. Thanks Freya, We got the IP Address from php script.
  4. Hi Freya. Thanks for your reply. let me check whole thing once.
  5. Hi, How do i get Secondlife Network IP? In Secondlife there are sims and all sims are connected with Secondlife Network. Let say for Example in secondlife there are 5 sims and each sim have 10 atm objects. now, i am requesting for transafer funds or depite the fund in my account. so, at that time secondlife network accept the request and give the response. We need to get Secondlife network IP for that perticular sim from where request was passed. Thanks.
  6. okay. thanks for your suggestion. If you have link of LSL scripting subform then can you please pass it to me?
  7. Hi, In Our system we are transferring fund from secondlife game to our website and visa versa. Now, we have created one Object which have communicator script( this script is a mediator between debit prim script and php script) and debit prim script( this is a script where our code of debit prim is located like using llTransaferFnds we are transferring funds form game to site or site to game). It's all working perfectly until the sim is reset. When the sim is rest we are getting new url like http://sim9736.agni.lindenlab.com:12046/cap/1351c161-06ee-44cb-3113-f78a489dca43 using llResetURL() function. But, we are not able to Get Avatar Details and Owner Details. Here, is the code to Get server url,owner and avatar details. And we have placed this code in changed() function We have placed two files 1) Communicator script. default { // calling the function setup. state_entry() { llRequestURL(); } changed(integer c) { // Calling the function setup at the time of "CHANGED_REGION" and "CHANGED_TELEPORT" if (c & (CHANGED_REGION | CHANGED_TELEPORT) ) { llRequestURL(); } // // sending the Request URL(http://sim8890.agni.lindenlab.com:12046/cap/0c885b4d-8c15-ba9b-657a-abb95ae86e33) to Site. // if (c & (CHANGED_REGION_START)) { http_url_withdrawal = "http://" + http_host + http_path_withdrawal; llInstantMessage(llGetOwner(),"REGION RESTARTED AT "+(string)llGetTime()+" - at timestamp "+(string)llGetUnixTime()); llInstantMessage(llGetOwner(),"MESSAGE1"+(string)http_url_withdrawal); llRequestURL(); ok = TRUE; http_withdrawal_body += "&" + llEscapeURL("avatar_name") + "=" + llEscapeURL((string)llKey2Name(llGetOwner())); http_withdrawal_body += "&" + llEscapeURL("avatar_key") + "=" + llEscapeURL((string)llGetOwner()); http_withdrawal_body += "&" + llEscapeURL("server_key") + "=" + llEscapeURL((string)llGetKey()); http_withdrawal_body += "&" + llEscapeURL("server_url") + "=" + llEscapeURL(llRequestURL()); http_request_withdrawal_id = llHTTPRequest(http_url_withdrawal, http_post_parameters, http_withdrawal_body); } } touch_start(integer n) { } // the script receives a link message that was sent by a call to llMessageLinked link_message(integer sender_number, integer number, string message, key id) { list terminal = llParseString2List(message, ["&"], [""]); list option = llParseString2List((string) llList2String(terminal, 7), ["="], [""]); http_url_withdrawal = "http://" + http_host + http_path_withdrawal; if (DEBUG) llSay(DEBUG_CHANNEL, (string) http_url_withdrawal); site_url = http_url_withdrawal; if (number == MY_ACCOUNT_RQ) { string text = (string) id + (string) llGetKey() + (string) llGetOwner() + (string) ((integer) message); reqId = llHTTPRequest(SERVER_URL + "?avkey=" + (string) id + "&amount=" + message + "&url=" + site_url + "&hash=" + (string) HASHKEY, [], ""); } } // // Checking the state i.e. URL_REQUEST_DENIED,URL_REQUEST_GRANTED . // http_request(key id, string method, string body) { if (method == URL_REQUEST_GRANTED) { llInstantMessage(llGetOwner(),"request body....."+body); url = body; ok = TRUE; } else if (method == URL_REQUEST_DENIED) { llSay(0, "Something went wrong, no url. " + body); } else { llHTTPResponse(id,405,"Method unsupported"); } } // // getting the response from the site. // http_response(key request_id, integer status, list metadata, string body) { llSay(0,body); if (request_id == http_request_hashkey_id) { HASHKEY = (integer) body; } if (request_id == reqId){ reqId = NULL_KEY; if (status == 200) { list Data = llParseStringKeepNulls(body, ["|"], []); if ((llList2Key(Data, 0) == llGetKey()) && (llMD5String((string) llGetOwner() + (string) llGetKey() + llList2String(Data, 1), HASHKEY) == llList2String(Data, 2))) llMessageLinked(LINK_SET, MY_ACCOUNT_ANS, llList2String(Data, 1), NULL_KEY); else llMessageLinked(LINK_SET, MY_ACCOUNT_ANS, llList2String(Data, 1), NULL_KEY); } else if (status != 200) { llMessageLinked(LINK_SET, MY_ACCOUNT_ANS, body, NULL_KEY); } } } } 2) Debit Prim Script // // sending the Transaction Result to Site. // withdraw_transaction_result(key id, integer success, string message) { http_url_transaction_result = "http://abc.com/xyz/components/com_terminal/transaction_result.php"; http_transaction_result_body+= "&" + llEscapeURL("avatar_name") + "=" + llEscapeURL(llKey2Name(id)); http_transaction_result_body+= "&" + llEscapeURL("avatar_key") + "=" + llEscapeURL((string) id); http_transaction_result_body+= "&" + llEscapeURL("terminal_key") + "=" + llEscapeURL((string) llGetKey()); http_transaction_result_body+= "&" + llEscapeURL("message") + "=" + llEscapeURL(message); http_transaction_result_body+= "&" + llEscapeURL("amount") + "=" + llEscapeURL((string) Amount); http_transaction_result_body+= "&" + llEscapeURL("success") + "=" + llEscapeURL((string) success); http_transaction_result_body+= "&" + llEscapeURL("option") + "=" + llEscapeURL("transaction_result"); http_request_transaction_result_id = llHTTPRequest(http_url_transaction_result, http_post_parameters, http_transaction_result_body); } // // Function is used to send Request to site for withdrawing money. // debit_prime(string url){ owner_name = llEscapeURL((string) llKey2Name(llGetOwner())); http_withdrawal_body += "&" + llEscapeURL("module_name") + "=" + llEscapeURL(module_name); http_withdrawal_body += "&" + llEscapeURL("avatar_name") + "=" + owner_name; http_withdrawal_body += "&" + llEscapeURL("avatar_key") + "=" + llEscapeURL((string) llGetOwner()); http_withdrawal_body += "&" + llEscapeURL("server_key") + "=" + llEscapeURL((string) llGetKey()); http_withdrawal_body += "&" + llEscapeURL("server_url") + "=" + llEscapeURL((string) url); http_withdrawal_body += "&" + llEscapeURL("owner_name") + "=" + llEscapeURL(llKey2Name(llGetOwner())); http_withdrawal_body += "&" + llEscapeURL("owner_key") + "=" + llEscapeURL(llGetOwner()); http_withdrawal_body += "&" + llEscapeURL("creator_name") + "=" + llEscapeURL(llKey2Name(llGetCreator())); http_withdrawal_body += "&" + llEscapeURL("creator_key") + "=" + llEscapeURL(llGetCreator()); http_withdrawal_body += "&" + llEscapeURL("option") + "=" + llEscapeURL("debit_prime"); llMessageLinked(LINK_SET, MY_ACCOUNT_RQ, http_withdrawal_body, id); } default { // // Rest the Script When Object is Rezzed // on_rez(integer start_param){ llResetScript(); } state_entry() { state banker; } // // Resetting the Secript at the time of CHANGED_REGION or CHANGED_TELEPORT // changed(integer change) { if (change & (CHANGED_REGION | CHANGED_TELEPORT)) { llResetScript(); } } } state banker { // // Allowing the Permission Debit . // state_entry() { llRequestPermissions(llGetOwner(), PERMISSION_DEBIT); stopped = FALSE; if (curuser == NULL_KEY) { llMessageLinked(LINK_THIS, 5, "", NULL_KEY); state default; } listenhandle = llListen(40, "", curuser, ""); if (creator_uuid == "") creator_uuid = llGetCreator(); check_timeout = llGetUnixTime() + llFloor(check_time); llSetTimerEvent(timer_rate); llSetTimerEvent(15.0); llRequestURL(); } // //Set the Run time permission. // run_time_permissions (integer perm) { if (perm & PERMISSION_DEBIT) DebitPerms = TRUE; } // // Setting the avatar name,Recipient,avtar id etc. When Object touched. // touch_start(integer start) { avatar_name = llDetectedName(0); Recipient = avatar_name; avatar_id = llDetectedKey(0); debit_prime(server_url); llRequestURL(); } // // listening the response from server. // listen( integer channel, string name, key id, string message ) { debit_prime(server_url); llMessageLinked(LINK_THIS, 5, "", NULL_KEY); state banker; } http_response(key request_id, integer status, list metadata, string body) { if (request_id == http_request_transaction_result_id) { } } // // Function used to get the transaction result. // transaction_result(key id, integer success, string data) { if (id != TransactionID) return; if (success) { t_result = data; llOwnerSay("Transfer of L$ to " + Recipient + " was successful"); llSleep(1.0); } else { t_result = data; llOwnerSay("Transfer of L$ failed"); } withdraw_transaction_result(id, success, data); } // // sending the request for llTransferLindenDollars. // http_request(key id, string method, string body) { list withdrawal = llParseString2List(body, [","], []); if ((method == URL_REQUEST_GRANTED)) { server_url = body; } else if (method == "POST") { if (!DebitPerms) return; // Cannot proceed - debit permissions not granted Amount = llList2Integer(withdrawal, 1); TransactionID = llTransferLindenDollars(llList2Key(withdrawal, 0), llList2Integer(withdrawal, 1)); body+=t_result; llHTTPResponse(id, status_code, body); } } // //set timer event. (old script code) // timer() { llGetNextEmail("", ""); } // // set the email function (old script code) // email( string time, string address, string subject, string message, integer num_left ) { if (subject == withdrawal_subject) { list Inventory = llParseString2List(llStringTrim(message, STRING_TRIM), [","], []); llGiveMoney(llList2Key(Inventory, 0), llList2Integer(Inventory, 1)); if (DEBUG) llSay(DEBUG_CHANNEL, (string) llList2Key(Inventory, 0)); if (DEBUG) llSay(DEBUG_CHANNEL, llList2String(Inventory, 1)); } if (num_left) llGetNextEmail("", ""); } // // linking the result with script When site sending response. // link_message(integer sender_num, integer num, string str, key id) { if (num == 99) { state default; } if (num == MY_ACCOUNT_ANS) { if (str == "") llOwnerSay("There was an error"); else { llSay(0, str); } } } } We are updating the details( server url, owner name,owner key,avatar name and avatar key) in database after sim is reset. so, user will able to transfer money after sim is rest. with reseting debit prim object by owner manually. because owner will not know When sim is reset and When he/she need to reset demit prim. Is there any way to get complete details ( server url, owner name,owner key,avatar name and avatar key) at the time of sim rest please help us. and is there any changes in above script please correct us. Thanks.
×
×
  • Create New...