mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-02 02:15:48 -04:00
51 lines
1.8 KiB
Plaintext
51 lines
1.8 KiB
Plaintext
/**
|
|
* cwdm_test2.script
|
|
*
|
|
* Assumes this script is attached to a character
|
|
*/
|
|
|
|
//----------------------------------------------------------
|
|
|
|
include library.utils;
|
|
include library.space_dungeon;
|
|
|
|
//----------------------------------------------------------
|
|
|
|
trigger OnHearSpeech(obj_id objSpeaker, string strText)
|
|
{
|
|
if (strText == "cwdm_doit")
|
|
{
|
|
LOG("***HUY***", "OnHearSpeech() initiating cluster wide data test");
|
|
|
|
// send request off to lock the data
|
|
int requestId = getClusterWideData("dungeon", "Corellian Corvette - Instance 1", true, self);
|
|
LOG("***HUY***", "getClusterWideData() to lock data for initial registration returned request Id (" + requestId + ")");
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnClusterWideDataResponse(string strManagerName, string strElementNameRegex, int requestID, string[] elementNameList, dictionary[] dictionaryList, int lockKey)
|
|
{
|
|
// strManagerName and strElementNameRegex is what was passed in on the request call
|
|
|
|
// requestID is what request ID that was returned from the request call
|
|
|
|
// elementNameList is the list of matching element name
|
|
|
|
// dictionaryList is the list of matching dictionary
|
|
|
|
// if locking was requested, lockKey is the lock key can be used to unlock the locked
|
|
// elements; if no locking was requested or if no match was found, lockKey is 0
|
|
|
|
LOG("***HUY***", "OnClusterWideDataResponse() manager name (" + strManagerName + ") element name regex (" + strElementNameRegex + ") request id (" + requestID + ") match count (" + elementNameList.length + ") lock key (" + lockKey + ")");
|
|
|
|
for (int i = 0; i < elementNameList.length; ++i)
|
|
{
|
|
LOG("***HUY***", "element " + (i+1) + " is (" + elementNameList[i] + ")");
|
|
LOG("***HUY***", "dictionary " + dictionaryList[i].toString());
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|