Difference between revisions of "LlKeysKeyValue/ja"

From Second Life Wiki
Jump to navigation Jump to search
m
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
[[Category:Experience Tools/ja]]
[[Category:Experience Tools/ja]]
{{LSL_Function/ja
{{LSL_Function
|inject-2={{LSL Function/KeyValue|dl_name=keys
|inject-2={{LSL Function/KeyValue/ja|dl_name=keys
|dl_desc=A list of keys ([[String|strings]]) used in the key-value store
|dl_desc=キーと値のストアで使用されているキーのリスト([[String|文字列]]
|dl_hover=A list of keys (strings) used in the key-value store}}
|dl_hover=キーと値のストアで使用されているキーのリスト(文字列)}}
{{LSL_Function/Experience|true}}
{{LSL_Function/Experience/ja|true}}
|func=llKeysKeyValue
|func=llKeysKeyValue
|func_desc=Start an asynchronous transaction to request a number of keys from the script's {{LSLGC|Experience}}.
|func_desc=Start an asynchronous transaction to request a number of keys from the script's {{LSLGC|Experience}}.
|func_footnote=
|func_footnote=
This function will attempt to retrieve the number of keys requested but may return less if there are not enough to fulfill the full amount requested or if the list is too large. The length of the returned list is limited to 4097 characters (the success flag "1" and 4096 characters).  The order keys are returned is not guaranteed but is stable between subsequent calls as long as no keys are added or removed.<br/>
この関数は、要求されたキーの数を取得しようとしますが、要求数が満たされない場合やリストが大きすぎる場合は、満たすことができないかもしれません。返されるリストの長さは4097文字まで制限されています(成功フラグ「1」と4096文字)。
The error [[XP_ERROR_KEY_NOT_FOUND]] is returned if there index given is greater than or equal to the number of keys.
返されるキーの順序は保証されませんが、キーが追加または削除されていない限り、連続する呼び出しの間で安定しています。<br/>
エラー[[XP_ERROR_KEY_NOT_FOUND]]は、指定されたインデックスがキーの数以上である場合に返されます。
|return_type=key|return_subtype=handle
|return_type=key|return_subtype=handle
|return_text=that can be used to identify the corresponding [[dataserver/ja]] event to determine if this command succeeded or failed.
|return_text=これを使用して、このコマンドが成功したか失敗したかを判断し、結果を知るための対応する[[dataserver]]イベントを識別できます。
|p1_type=integer|p1_name=first|p1_desc=Zero-based index of the first key to retrieve
|p1_type=integer|p1_name=first|p1_desc=取得する最初のキーのゼロベースのインデックス
|p2_type=integer|p2_name=count|p2_desc=Number of keys to retriever
|p2_type=integer|p2_name=count|p2_desc=取得するキーの数
|also_functions=
|also_functions=
*[[llGetExperienceErrorMessage/ja]]
*[[llGetExperienceErrorMessage/ja]]
Line 58: Line 59:
|cat2=Dataserver
|cat2=Dataserver
|cat3=Experience/Data
|cat3=Experience/Data
|caveats=* It is recommended that keys do not contain commas due to this function returning keys in CSV format.
|caveats=* この関数はキーをCSV形式で返すため、キーにはカンマを含めないことが推奨されます。
}}
}}

Latest revision as of 14:19, 22 November 2023

Summary

Function: key llKeysKeyValue( integer first, integer count );

Start an asynchronous transaction to request a number of keys from the script's Experience.
Returns a handle (a key) これを使用して、このコマンドが成功したか失敗したかを判断し、結果を知るための対応するdataserverイベントを識別できます。

• integer first 取得する最初のキーのゼロベースのインデックス
• integer count 取得するキーの数

この関数は、要求されたキーの数を取得しようとしますが、要求数が満たされない場合やリストが大きすぎる場合は、満たすことができないかもしれません。返されるリストの長さは4097文字まで制限されています(成功フラグ「1」と4096文字)。 返されるキーの順序は保証されませんが、キーが追加または削除されていない限り、連続する呼び出しの間で安定しています。
エラーXP_ERROR_KEY_NOT_FOUNDは、指定されたインデックスがキーの数以上である場合に返されます。

これfunctionを行なうには、スクリプト Experience でコンパイルする必要があります。

Specification

Dataserver

dataserverコールバックのパラメータは次のとおりです:

文字列のコンポーネント
• integer success トランザクションが成功した場合は1、失敗した場合は0を指定するブール値。
• integer error 操作が失敗した理由を説明するXP_ERROR_*フラグ。
• list keys キーと値のストアで使用されているキーのリスト(文字列

Caveats

  • 以前に体験に関連付けられていたスクリプトを体験のコンパイル機能を持たないクライアントで再コンパイルすると、スクリプトは関連する体験を失います。
  • この関数はキーをCSV形式で返すため、キーにはカンマを含めないことが推奨されます。
All Issues ~ Search JIRA for related Bugs

Examples

key trans;
default
{
    state_entry()
    {
        // retrieve the first 10 keys
        trans = llKeysKeyValue(0, 10);
    }

    dataserver(key t, string value)
    {
        if (t == trans)
        {
            // our llKeysKeyValue transaction is done
            list result = llCSV2List(value);
            if (llList2Integer(result, 0) == 1)
            {
                llSay(0, "Keys retrieved: "+(string)llGetSubString(value, 2, -1));
            }
            else if (llList2Integer(result, 1) == XP_ERROR_KEY_NOT_FOUND)
            {
                // no more keys
                llSay(0, "No more keys" );
            }
            else
            {
                // keys request failed
                llSay(0, "Key-value failed to request keys: " + llGetExperienceErrorMessage(llList2Integer(result, 1)) );
            }
        } 
    }
}

Notes

コンパイル

スクリプトが Experience に関連するようにするには...

  • 体験をサポートしたクライアントでコンパイルされている必要があります
  • "体験を使用" チェックボックスをチェックする
  • 体験キーの一つを選択する
KBcaution.png 重要 すべての TPV にこの機能があるわけではありません。

Deep Notes

Search JIRA for related Issues

Signature

function key llKeysKeyValue( integer first, integer count );