Merge pull request #55960 from timothyqiu/xml-indents-3.x

This commit is contained in:
Rémi Verschelde 2021-12-15 16:27:07 +01:00 committed by GitHub
commit ef52ac6c25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 42 deletions

View File

@ -5,7 +5,7 @@
</brief_description> </brief_description>
<description> <description>
Base resource for [AnimationTree] nodes. In general, it's not used directly, but you can create custom ones with custom blending formulas. Base resource for [AnimationTree] nodes. In general, it's not used directly, but you can create custom ones with custom blending formulas.
Inherit this when creating nodes mainly for use in [AnimationNodeBlendTree], otherwise [AnimationRootNode] should be used instead. Inherit this when creating nodes mainly for use in [AnimationNodeBlendTree], otherwise [AnimationRootNode] should be used instead.
</description> </description>
<tutorials> <tutorials>
<link>$DOCS_URL/tutorials/animation/animation_tree.html</link> <link>$DOCS_URL/tutorials/animation/animation_tree.html</link>

View File

@ -5,49 +5,49 @@
</brief_description> </brief_description>
<description> <description>
The HMACContext class is useful for advanced HMAC use cases, such as streaming the message as it supports creating the message over time rather than providing it all at once. The HMACContext class is useful for advanced HMAC use cases, such as streaming the message as it supports creating the message over time rather than providing it all at once.
[codeblock] [codeblock]
extends Node extends Node
var ctx = HMACContext.new() var ctx = HMACContext.new()
func _ready(): func _ready():
var key = "supersecret".to_utf8() var key = "supersecret".to_utf8()
var err = ctx.start(HashingContext.HASH_SHA256, key) var err = ctx.start(HashingContext.HASH_SHA256, key)
assert(err == OK) assert(err == OK)
var msg1 = "this is ".to_utf8() var msg1 = "this is ".to_utf8()
var msg2 = "vewy vewy secret".to_utf8() var msg2 = "vewy vewy secret".to_utf8()
err = ctx.update(msg1) err = ctx.update(msg1)
assert(err == OK) assert(err == OK)
err = ctx.update(msg2) err = ctx.update(msg2)
assert(err == OK) assert(err == OK)
var hmac = ctx.finish() var hmac = ctx.finish()
print(hmac.hex_encode()) print(hmac.hex_encode())
[/codeblock] [/codeblock]
And in C# we can use the following. And in C# we can use the following.
[codeblock] [codeblock]
using Godot; using Godot;
using System; using System;
using System.Diagnostics; using System.Diagnostics;
public class CryptoNode : Node public class CryptoNode : Node
{ {
private HMACContext ctx = new HMACContext(); private HMACContext ctx = new HMACContext();
public override void _Ready() public override void _Ready()
{ {
PoolByteArray key = String("supersecret").to_utf8(); PoolByteArray key = String("supersecret").to_utf8();
Error err = ctx.Start(HashingContext.HASH_SHA256, key); Error err = ctx.Start(HashingContext.HASH_SHA256, key);
GD.Assert(err == OK); GD.Assert(err == OK);
PoolByteArray msg1 = String("this is ").to_utf8(); PoolByteArray msg1 = String("this is ").to_utf8();
PoolByteArray msg2 = String("vewy vew secret").to_utf8(); PoolByteArray msg2 = String("vewy vew secret").to_utf8();
err = ctx.Update(msg1); err = ctx.Update(msg1);
GD.Assert(err == OK); GD.Assert(err == OK);
err = ctx.Update(msg2); err = ctx.Update(msg2);
GD.Assert(err == OK); GD.Assert(err == OK);
PoolByteArray hmac = ctx.Finish(); PoolByteArray hmac = ctx.Finish();
GD.Print(hmac.HexEncode()); GD.Print(hmac.HexEncode());
} }
} }
[/codeblock] [/codeblock]
[b]Note:[/b] Not available in HTML5 exports. [b]Note:[/b] Not available in HTML5 exports.
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>

View File

@ -325,7 +325,6 @@
<argument index="0" name="body" type="RID" /> <argument index="0" name="body" type="RID" />
<description> <description>
Returns the physics layer or layers a body can collide with. Returns the physics layer or layers a body can collide with.
-
</description> </description>
</method> </method>
<method name="body_get_direct_state"> <method name="body_get_direct_state">