Started working on Hetzner API
This commit is contained in:
parent
8f62d9bf83
commit
9d21b47e28
5 changed files with 62 additions and 0 deletions
19
MyObsidianVault/AWA/01a_Hetzner/ssh login and setup.md
Normal file
19
MyObsidianVault/AWA/01a_Hetzner/ssh login and setup.md
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
ssh -i /home/tschneider/.ssh/hetzner_id_rsa root@167.235.131.137
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
wget https://www.zauberturm.de/awa/downloads/master_server.x86_64
|
||||||
|
wget https://www.zauberturm.de/awa/downloads/scene_server.x86_64
|
||||||
|
chmod +x master_server.x86_64 scene_server.x86_64
|
||||||
|
|
||||||
|
./master_server.x86_64 --headless > master_log.txt &
|
||||||
|
./scene_server.x86_64 --headless > scene_log.txt & # TODO: Set unique log name
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
VServer self-discover IPV4 address:
|
||||||
|
```bash
|
||||||
|
root@ubuntu-2gb-nbg1-1:~# curl -s http://169.254.169.254/hetzner/v1/metadata|grep public-ipv4|awk -F ': ' '{print $2}'
|
||||||
|
167.235.131.137
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
```python
|
||||||
|
func _ready() -> void:
|
||||||
|
var gem_scene := preload("gem.tscn")
|
||||||
|
var gem_instance := gem_scene.instantiate()
|
||||||
|
add_child(gem_instance)
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
```python
|
||||||
|
random_item_scene: PackedScene = item_scenes.pick_random()
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
```python
|
||||||
|
extends Node2D
|
||||||
|
|
||||||
|
var item_scenes := [
|
||||||
|
preload("gem.tscn"),
|
||||||
|
preload("health_pack.tscn")
|
||||||
|
]
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
get_node("Timer").timeout.connect(_on_timer_timeout)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
func _on_timer_timeout() -> void:
|
||||||
|
|
||||||
|
var random_item_scene: PackedScene = item_scenes.pick_random()
|
||||||
|
var item_instance = random_item_scene.instantiate()
|
||||||
|
add_child(item_instance)
|
||||||
|
|
||||||
|
var viewport_size = get_viewport_rect().size
|
||||||
|
var random_position := Vector2(0,0)
|
||||||
|
random_position.x = randf_range(0, viewport_size.x)
|
||||||
|
random_position.y = randf_range(0, viewport_size.y)
|
||||||
|
item_instance.position = random_position
|
||||||
|
```
|
||||||
5
MyObsidianVault/AWA/Godot/Snippets/Timers.md
Normal file
5
MyObsidianVault/AWA/Godot/Snippets/Timers.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
|
||||||
|
Connecting the timeout signal of timer to a local function
|
||||||
|
```python
|
||||||
|
get_node("Timer").timeout.connect(_on_timer_timeout)
|
||||||
|
```
|
||||||
Loading…
Add table
Add a link
Reference in a new issue