xxxxxxxxxx
extends CharacterBody2D
class_name Enemy
var speed := 50.0 # can be anything
@onready var nav: NavigationAgent2D = $NavigationAgent2D # change if needed
@onready var player: CharacterBody2D = %Player # change if needed
func _ready() -> void:
actor_setup.call_deferred()
nav.velocity_computed.connect(_velocity_computed)
func actor_setup():
# Wait for the first physics frame so the NavigationServer can sync.
await get_tree().physics_frame
# Now that the navigation map is no longer empty, set the movement target.
set_movement_target(player.position)
func set_movement_target(movement_target: Vector2):
nav.target_position = movement_target
func _physics_process(delta: float) -> void:
_move_towards_player()
func _move_towards_player():
pass
xxxxxxxxxx
const { authenticate } = require('ldap-authentication')
async function auth() {
// auth with admin
let options = {
ldapOpts: {
url: 'ldap://ldap.forumsys.com',
// tlsOptions: { rejectUnauthorized: false }
},
adminDn: 'cn=read-only-admin,dc=example,dc=com',
adminPassword: 'password',
userPassword: 'password',
userSearchBase: 'dc=example,dc=com',
usernameAttribute: 'uid',
username: 'gauss',
// starttls: false
}
let user = await authenticate(options)
console.log(user)
// auth with regular user
options = {
ldapOpts: {
url: 'ldap://ldap.forumsys.com',
// tlsOptions: { rejectUnauthorized: false }
},
userDn: 'uid=einstein,dc=example,dc=com',
userPassword: 'password',
userSearchBase: 'dc=example,dc=com',
usernameAttribute: 'uid',
username: 'einstein',
// starttls: false
}
user = await authenticate(options)
console.log(user)
}
auth()