implemented the whole relationship manager
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
extends Node
|
||||
|
||||
func _ready() -> void:
|
||||
print(discord_sdk.get_current_user())
|
||||
set_activity()
|
||||
discord_sdk.connect("activity_join_request",_on_activity_join_request)
|
||||
discord_sdk.connect("activity_join",_on_activity_join)
|
||||
discord_sdk.connect("activity_spectate",_on_activity_spectate)
|
||||
discord_sdk.connect("relationships_init",_on_relationship_init)
|
||||
discord_sdk.connect("updated_relationship", _on_updated_relationship)
|
||||
|
||||
func set_activity() -> void:
|
||||
discord_sdk.clear()
|
||||
@@ -19,8 +20,8 @@ func set_activity() -> void:
|
||||
discord_sdk.small_image_text = "Fighting the end boss! D:"
|
||||
discord_sdk.end_timestamp = int(Time.get_unix_time_from_system()) + 3600 # +1 hour in unix time
|
||||
|
||||
# It is NOT recommended to manage secrets locally! It's meant to be a payload wich the server
|
||||
# understands and returns the other variables like current_party_size, party_id etc. Most of the values must differ from the others.
|
||||
# It is NOT recommended to manage secrets locally! It's meant to be a payload wich the server understands and
|
||||
# returns the other variables like current_party_size, party_id etc. Most of the values must differ from the others.
|
||||
var my_secret: String = str(randi_range(0,999999))
|
||||
|
||||
discord_sdk.party_id = "mylobbycanbeeverything_" + my_secret
|
||||
@@ -53,3 +54,10 @@ func _on_activity_join(secret) -> void:
|
||||
|
||||
func _on_activity_spectate(secret) -> void:
|
||||
print(secret)
|
||||
|
||||
func _on_relationship_init():
|
||||
print("initialized")
|
||||
|
||||
func _on_updated_relationship(relationship):
|
||||
print(relationship)
|
||||
|
||||
|
Reference in New Issue
Block a user