Template:Osslfunc

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m
 
(29 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
If you wish to change the template, Please read [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions].
 
If you wish to change the template, Please read [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions].
 
And note that osFunctions specification is still in development and may have big change. Don't create too severe format to put them into existing specification.  
 
And note that osFunctions specification is still in development and may have big change. Don't create too severe format to put them into existing specification.  
--></noinclude><includeonly>{{quicklinks}}
+
--></noinclude><includeonly>{{quicklinks}}[[Category:OSSL Functions]]
 
{|  width="100%" style="border: thin solid black"
 
{|  width="100%" style="border: thin solid black"
| colspan="2" align="center" style=background:orange | '''{{SUBPAGENAME}}'''
+
|colspan="2"|{{#if:{{{function_syntax|}}}|<div style="font-size:18px;margin-bottom:5px;">{{{function_syntax|)}}}{{#if:{{{csharp_syntax|}}}|<br /><span style="font-size:12px;">C#: {{{csharp_syntax|)}}}</span>|}}
 +
</div>|''No function syntax provided'' [[Category:OSSL_functions_without_function_syntax]]}}
 
|- valign="top"
 
|- valign="top"
|'''Threat Level''' || {{#switch:{{{threat_level|NotSpecified}}}
+
|colspan="2"|{{#if:{{{description|}}}|{{{description}}}|''No descriptions provided'' [[Category:OSSL_functions_without_descriptions]]}}
| None = '''None'''[[Category:OSSL Functions/ThreatLevel:None]]
+
| Nuisance = <font color='#220000'>'''Nuisance'''</font>[[Category:OSSL Functions/ThreatLevel:Nuisance]]
+
| VeryLow = <font color='#440000'>'''VeryLow'''</font>[[Category:OSSL Functions/ThreatLevel:VeryLow]]
+
| Low = <font color='#660000'>'''Low'''</font>[[Category:OSSL Functions/ThreatLevel:Low]]
+
| Moderate = <font color='#880000'>'''Moderate'''</font>[[Category:OSSL Functions/ThreatLevel:Moderate]]
+
| High = <font color='#aa0000'>'''High'''</font>[[Category:OSSL Functions/ThreatLevel:High]]
+
| VeryHigh = <font color='#cc0000'>'''VeryHigh'''</font>[[Category:OSSL Functions/ThreatLevel:VeryHigh]]
+
| Severe = <font color='#ff0000'>'''Severe'''</font>[[Category:OSSL Functions/ThreatLevel:Severe]]
+
| NotSpecified = ''No threat level specified'' [[Category:OSSL_functions_without_threat_level]]
+
| = ''No threat level specified'' [[Category:OSSL_functions_without_threat_level]]
+
| #default = {{{threat_level}}}
+
}}
+
 
+
 
|- valign="top"
 
|- valign="top"
|'''Function Syntax''' ||  
+
|width="100"|'''Threat Level'''||{{#if:{{{threat_level|}}}|{{#switch:{{{threat_level|}}}
{{#ifeq: {{{function_syntax}}} | | ''No function syntax provided'' [[Category:OSSL_functions_without_function_syntax]] | {{{function_syntax}}}}}
+
| ignored = This function does not do a threat level check
|- valign="top"
+
| None
|'''Example(s)||  
+
| Nuisance
{{#ifeq: {{{ossl_example}}} | | ''No OSSL code example provided'' [[Category:OSSL_functions_without_example]] | {{{ossl_example}}}}}
+
| VeryLow
 +
| Low
 +
| Moderate
 +
| High
 +
| VeryHigh
 +
| Severe = {{{threat_level}}}
 +
| #default = {{{threat_level}}} is unknown threat level }}|''No threat level specified'' [[Category:OSSL_functions_without_threat_level]] }}
 +
{{!}}- valign="top"
 +
|'''Permissions'''||{{#if:{{{permissions|}}}|{{#switch:{{{permissions|}}}
 +
| true  = Use of this function is always allowed by default
 +
| false = Use of this function is always disabled by default
 +
| #default = {{{permissions}}} }}|''No permissions specified'' [[Category:OSSL_functions_without_permissions]]}}
 +
{{!}}- valign="top"
 +
|'''Extra Delay'''||{{#if:{{{delay|}}}|{{{delay}}} seconds|''No function delay specified''}}
 +
{{#if:{{{ossl_example|}}}|
 +
{{!}}- valign="top"
 +
{{!}}colspan="2"{{!}}'''Example(s)'''
 +
{{!}}- valign="top"
 +
{{!}}colspan="2"{{!}}{{{ossl_example}}}|[[Category:OSSL_functions_without_example]]}}
 +
{{#if:{{{additional_info|}}}|
 +
{{!}}- valign="top"
 +
{{!}}colspan="2"{{!}}'''Notes'''
 +
{{!}}- valign="top"
 +
{{!}}colspan="2"{{!}}{{{additional_info}}}|}}
 
|}
 
|}
 
+
{{#switch:{{{threat_level|}}}
{{#ifeq: {{{additional_info}}} | | ''No additional info was provided'' [[Category:OSSL_functions_without_notes]]| {{{additional_info}}}}}
+
| None = [[Category:OSSL Functions/ThreatLevel:None]]
[[Category:OSSL Functions]]
+
| Nuisance = [[Category:OSSL Functions/ThreatLevel:Nuisance]]
 +
| VeryLow = [[Category:OSSL Functions/ThreatLevel:VeryLow]]
 +
| Low = [[Category:OSSL Functions/ThreatLevel:Low]]
 +
| Moderate = [[Category:OSSL Functions/ThreatLevel:Moderate]]
 +
| High = [[Category:OSSL Functions/ThreatLevel:High]]
 +
| VeryHigh = [[Category:OSSL Functions/ThreatLevel:VeryHigh]]
 +
| Severe = [[Category:OSSL Functions/ThreatLevel:Severe]]
 +
}}
 
</includeonly>
 
</includeonly>
 
<noinclude>
 
<noinclude>
 
This template is to be used as follows (copy and paste the following into a new page):
 
This template is to be used as follows (copy and paste the following into a new page):
  
<nowiki>{{osslfunc|</nowiki>
+
<pre>
threat_level = THREAT LEVEL
+
{{osslfunc
|
+
|function_syntax=
function_syntax = FUNCTION SYNTAX
+
|csharp_syntax=
|
+
|description=
ossl_example = EXAMPLE CODE
+
|threat_level=
|  
+
|permissions=
additional_info = ANY ADDITIONAL INFO AND NOTES
+
|delay=
|
+
|ossl_example=
}}
+
|additional_info=
 +
}}
 +
</pre>
  
Then replace the text in upper caps with the relevant information. Remove the text in upper caps and leave empty IF the info is unavailable. The template will automatically insert a text, saying that the information is missing.
+
{|border="1" cellspacing="0" width="80%"
 +
|- style="background-color:#DDDDFF;"
 +
|Property||Description||Required
 +
|-
 +
|function_syntax||syntax in LSL||Yes
 +
|-
 +
|csharp_syntax||syntax in C#||No
 +
|-
 +
|description||definitions or descriptions||Yes
 +
|-
 +
|threat_level||[[Threat level]]&nbsp;&nbsp;&nbsp;(Use ignored for functions that do not check threat level)||No
 +
|-
 +
|permissions||who may use this OSSL function&nbsp;&nbsp;&nbsp;(Use true for a function that is available to everyone) ||No
 +
|-
 +
|delay||any penalty (delay in seconds) for using this function||No
 +
|-
 +
|ossl_example||sample codes||No
 +
|-
 +
|additional_info||notes, hints or so||No
 +
|}
 +
 
 +
You can find some infomation about OSSL functions within IOSSL_Api.cs or OSSL_Api.cs. If you unsure what to fill in, feel free to leave it empty and wait for experts shown up:)
 +
 
 +
If you have added some additional common facilities like threat level, feel free to add it to this template.
  
 
Features of this template:
 
Features of this template:
 
* Includes the <nowiki>{{quicklinks}}</nowiki> template
 
* Includes the <nowiki>{{quicklinks}}</nowiki> template
 
* Automatically adds the article to all the relevant categories
 
* Automatically adds the article to all the relevant categories
* Displays a placeholder text when certain information is missing, and adds the article to the relevant "missing" category/categories.
+
* Displays a placeholder text when required information is missing, and adds the article to the relevant "missing" category/categories.
  
 
For deprecated functions, use [[:Template:Osslfunc/Deprecated]] instead of this template.
 
For deprecated functions, use [[:Template:Osslfunc/Deprecated]] instead of this template.
 
 
</noinclude>
 
</noinclude>

Latest revision as of 08:37, 28 April 2021


This template is to be used as follows (copy and paste the following into a new page):

{{osslfunc
|function_syntax=
|csharp_syntax=
|description=
|threat_level=
|permissions=
|delay=
|ossl_example=
|additional_info=
}}
Property Description Required
function_syntax syntax in LSL Yes
csharp_syntax syntax in C# No
description definitions or descriptions Yes
threat_level Threat level   (Use ignored for functions that do not check threat level) No
permissions who may use this OSSL function   (Use true for a function that is available to everyone) No
delay any penalty (delay in seconds) for using this function No
ossl_example sample codes No
additional_info notes, hints or so No

You can find some infomation about OSSL functions within IOSSL_Api.cs or OSSL_Api.cs. If you unsure what to fill in, feel free to leave it empty and wait for experts shown up:)

If you have added some additional common facilities like threat level, feel free to add it to this template.

Features of this template:

  • Includes the {{quicklinks}} template
  • Automatically adds the article to all the relevant categories
  • Displays a placeholder text when required information is missing, and adds the article to the relevant "missing" category/categories.

For deprecated functions, use Template:Osslfunc/Deprecated instead of this template.

Personal tools
General
About This Wiki