Difference between revisions of "User:Void Singer/Tea Strainer"
Void Singer (talk | contribs) m (just a small utility script) |
Void Singer (talk | contribs) m (~corrections) |
||
Line 18: | Line 18: | ||
|content= | |content= | ||
=== Tea Strainer === | === Tea Strainer === | ||
* | * Save in a [[Mono#How_to_use_Mono|MONO]] script named "'''Tea Strainer v0.3.1'''" | ||
<lsl>/*( Teacup Traffic Monitor v0.3.1 )*/ | <lsl>/*( Teacup Traffic Monitor v0.3.1 )*/ | ||
Line 29: | Line 29: | ||
link_message( integer vIntSrc, integer vIntDta, string vStrDta, key vKeyDta ){ | link_message( integer vIntSrc, integer vIntDta, string vStrDta, key vKeyDta ){ | ||
if (vKeyDta){ | if (vKeyDta){ | ||
if (~gIntAct = llListFindList( [204, 202, 201, 200, 100 | if (~gIntAct = llListFindList( [204, 202, 201, 200, 100, 404, 418], [vIntDta] )){ | ||
if (4 & gIntAct){ if (2 & gIntAct){ if (1 & gIntAct){ | if (4 & gIntAct){ if (2 & gIntAct){/*if (1 & gIntAct){ | ||
}else*/{ | |||
llOwnerSay( (string)(++gIntCnt) + ": ‘" + (string)vKeyDta + "’ Server Query: 418 “" + llGetSubString( vStrDta, 0, 35 ) + llList2String( ["”…", "”"], llStringLength( vStrDta ) < 37 ) ); | llOwnerSay( (string)(++gIntCnt) + ": ‘" + (string)vKeyDta + "’ Server Query: 418 “" + llGetSubString( vStrDta, 0, 35 ) + llList2String( ["”…", "”"], llStringLength( vStrDta ) < 37 ) ); | ||
}else{ | }}else if (1 & gIntAct){ | ||
llOwnerSay( (string)(++gIntCnt) + ": ‘" + (string)vKeyDta + "’ Service Reply: 404 'Not Found'" ); | llOwnerSay( (string)(++gIntCnt) + ": ‘" + (string)vKeyDta + "’ Service Reply: 404 'Not Found'" ); | ||
}else{ | }else{ | ||
llOwnerSay( (string)(++gIntCnt) + ": ‘" + (string)vKeyDta + "’ Service Reply: 100 'Continue'" ); | llOwnerSay( (string)(++gIntCnt) + ": ‘" + (string)vKeyDta + "’ Service Reply: 100 'Continue'" ); | ||
Line 53: | Line 52: | ||
} | } | ||
}else if (NULL_KEY == (string)vKeyDta){ | }else if (NULL_KEY == (string)vKeyDta){ | ||
if (~gIntAct = llListFindList( [418, | if (~gIntAct = llListFindList( [418, 600, 601], [vIntDta] )){ | ||
if (2 & gIntAct){ /*if (1 & gIntAct){ | if (2 & gIntAct){ /*if (1 & gIntAct){ | ||
//-- unused | //-- unused | ||
}else*/{ | }else*/{ | ||
llOwnerSay( (string)(++gIntCnt) + ": " + "File Service: | llOwnerSay( (string)(++gIntCnt) + ": " + "File Service: 601 'File Added' “" + vStrDta + "”" ); | ||
}}else if (1 & gIntAct){ | }}else if (1 & gIntAct){ | ||
llOwnerSay( (string)(++gIntCnt) + ": " + "File Service: | llOwnerSay( (string)(++gIntCnt) + ": " + "File Service: 600 'File Removed' “" + vStrDta + "”" ); | ||
}else{ | }else{ | ||
if ("Teacup URL changed" == vStrDta){ | if ("Teacup URL changed" == vStrDta){ | ||
Line 92: | Line 91: | ||
|title=Notes | |title=Notes | ||
|content= | |content= | ||
=== Compatible Servers, File Systems, and Extensions === | |||
---- | |||
* [[User:Void_Singer/Teacup|Teacup]] - [[Server_In_a_Prim|SIP]] front end | |||
* [[User:Void_Singer/Red_Tea|Red Tea]] - A very simple [[Server_In_a_Prim|SIP]] back end File Service for a starting point. | |||
* [[User:Void_Singer/Saucer|Saucer]] - Optional Fast 404 Extension for preventing long timeouts for missing/bad pages | |||
=== Known Bugs === | === Known Bugs === | ||
---- | ---- | ||
Line 98: | Line 103: | ||
=== Requested Feature Upgrades === | === Requested Feature Upgrades === | ||
---- | ---- | ||
* If you add an extension for Teacup and it has any messages not covered, add a note here and I'll see about adding it. All additions must comply with current protocol limitations as noted for | * If you add an extension for Teacup and it has any messages not covered, add a note here and I'll see about adding it. All additions must comply with current [[User:Void_Singer/Teacup#Protocols|protocol]] limitations as noted for Teacup server | ||
=== Change Log / Old Versions === | === Change Log / Old Versions === | ||
---- | ---- | ||
Most Recent Changes are at the top, old version links below. | Most Recent Changes are at the top, old version links below. | ||
* v0.03.1 | * Version will be considered stable when it reaches 1.0 | ||
* Tea Strainer v0.03.1 | |||
** Initial Public Release | ** Initial Public Release | ||
:[[User:Void Singer/Tea_Strainer#Return_to_Void_Singers_user_page|Return to top]] | :[[User:Void Singer/Tea_Strainer#Return_to_Void_Singers_user_page|Return to top]] |
Revision as of 18:34, 24 April 2011
Tea Strainer
What is it?
Tea Strainer is a small utility script to debug the messages being passed to and from Teacup.
How Does it Work?
By intercepting the link message traffic in the prim Teacup resides in, it checks for messages that Teacup and it's components are passing back and forth to and outputs them as llOwnerSay messages. All currently known protocols are properly parsed, and unknown messages are labeled and output in condensed format as well.Code
Tea Strainer
- Save in a MONO script named "Tea Strainer v0.3.1"
<lsl>/*( Teacup Traffic Monitor v0.3.1 )*/
//-- Code optimized for Speed, NOT Size
integer gIntAct; //-- pre-declaration for speed integer gIntCnt; //-- Allow visual tracking since last reset
default{
link_message( integer vIntSrc, integer vIntDta, string vStrDta, key vKeyDta ){ if (vKeyDta){ if (~gIntAct = llListFindList( [204, 202, 201, 200, 100, 404, 418], [vIntDta] )){ if (4 & gIntAct){ if (2 & gIntAct){/*if (1 & gIntAct){ }else*/{llOwnerSay( (string)(++gIntCnt) + ": ‘" + (string)vKeyDta + "’ Server Query: 418 “" + llGetSubString( vStrDta, 0, 35 ) + llList2String( ["”…", "”"], llStringLength( vStrDta ) < 37 ) );
else if (1 & gIntAct){
llOwnerSay( (string)(++gIntCnt) + ": ‘" + (string)vKeyDta + "’ Service Reply: 404 'Not Found'" ); }else{ llOwnerSay( (string)(++gIntCnt) + ": ‘" + (string)vKeyDta + "’ Service Reply: 100 'Continue'" ); }}else if (2 & gIntAct){ if (1 & gIntAct){ llOwnerSay( (string)(++gIntCnt) + ": ‘" + (string)vKeyDta + "’ Service Reply: 200 'Success'" ); }else{ llOwnerSay( (string)(++gIntCnt) + ": ‘" + (string)vKeyDta + "’ Service Reply: 201 'Created'" ); }}else if (1 & gIntAct){ llOwnerSay( (string)(++gIntCnt) + ": ‘" + (string)vKeyDta + "’ Service Reply: 202 'Accepted'" ); }else{ llOwnerSay( (string)(++gIntCnt) + ": ‘" + (string)vKeyDta + "’ Service Reply: 204 'No Content'" ); } }else{ llOwnerSay( "Received unknown message from link (" + (string)vIntSrc + ")“" + llGetLinkName( vIntSrc ) +"”\n{(" + (string)vIntDta + "), “" + llGetSubString( vStrDta, 0, 35 ) + llList2String( ["”…, ‘", "”, ‘"], llStringLength( vStrDta ) < 37 ) + (string)vKeyDta + "’}" ); } }else if (NULL_KEY == (string)vKeyDta){ if (~gIntAct = llListFindList( [418, 600, 601], [vIntDta] )){ if (2 & gIntAct){ /*if (1 & gIntAct){ //-- unused }else*/{ llOwnerSay( (string)(++gIntCnt) + ": " + "File Service: 601 'File Added' “" + vStrDta + "”" ); }}else if (1 & gIntAct){ llOwnerSay( (string)(++gIntCnt) + ": " + "File Service: 600 'File Removed' “" + vStrDta + "”" ); }else{ if ("Teacup URL changed" == vStrDta){ vStrDta += "”\n“ " + llList2String( llGetPrimitiveParams( [PRIM_TEXT] ), 0 ) + " "; gIntCnt = 0; } llOwnerSay( (string)(++gIntCnt) + ": " + "General Advertisement: “" + vStrDta + "”" ); } }else{ llOwnerSay( "Received unknown message from link (" + (string)vIntSrc + ")“" + llGetLinkName( vIntSrc ) +"”\n{(" + (string)vIntDta + "), “" + llGetSubString( vStrDta, 0, 35 ) + llList2String( ["”…, ‘", "”, ‘"], llStringLength( vStrDta ) < 37 ) + (string)vKeyDta + "’}" ); } }else{ llOwnerSay( "Received unknown message from link (" + (string)vIntSrc + ")“" + llGetLinkName( vIntSrc ) +"”\n{(" + (string)vIntDta + "), “" + llGetSubString( vStrDta, 0, 35 ) + llList2String( ["”…, ‘", "”, ‘"], llStringLength( vStrDta ) < 37 ) + llGetSubString( vKeyDta, 0, 35 ) + llList2String( ["’…}", "’}"], llStringLength( vKeyDta ) < 37 ) ); } }
} /*//-- License Text --//*/ /*// Free to copy, use, modify, distribute, or sell, with attribution. //*/ /*// (C)2011 (CC-BY) [ http://creativecommons.org/licenses/by/3.0 ] //*/ /*// Void Singer [ https://wiki.secondlife.com/wiki/User:Void_Singer ] //*/ /*// All usages must contain a plain text copy of the previous 2 lines. //*/ /*//-- --//*/</lsl>
}}
Notes
Compatible Servers, File Systems, and Extensions
- Teacup - SIP front end
- Red Tea - A very simple SIP back end File Service for a starting point.
- Saucer - Optional Fast 404 Extension for preventing long timeouts for missing/bad pages
Known Bugs
- None
Requested Feature Upgrades
- If you add an extension for Teacup and it has any messages not covered, add a note here and I'll see about adding it. All additions must comply with current protocol limitations as noted for Teacup server
Change Log / Old Versions
Most Recent Changes are at the top, old version links below.
- Version will be considered stable when it reaches 1.0
- Tea Strainer v0.03.1
- Initial Public Release