added invite variables
This commit is contained in:
5
.vscode/c_cpp_properties.json
vendored
5
.vscode/c_cpp_properties.json
vendored
@@ -3,7 +3,10 @@
|
|||||||
{
|
{
|
||||||
"name": "Win32",
|
"name": "Win32",
|
||||||
"includePath": [
|
"includePath": [
|
||||||
"${default}"
|
"${default}",
|
||||||
|
"${workspaceFolder}/src/lib/godot-cpp/gen/include",
|
||||||
|
"${workspaceFolder}/src/lib/godot-cpp/include",
|
||||||
|
"${workspaceFolder}/src/lib/godot-cpp/gdextension"
|
||||||
],
|
],
|
||||||
"defines": [
|
"defines": [
|
||||||
"_DEBUG",
|
"_DEBUG",
|
||||||
|
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@@ -1,8 +1,7 @@
|
|||||||
{
|
{
|
||||||
"C_Cpp.default.includePath": [
|
"C_Cpp.default.includePath": [
|
||||||
"src/lib/godot-cpp/include",
|
"${workspaceFolder}/src/lib/godot-cpp/gen/include",
|
||||||
"src/lib/godot-cpp/gen/include",
|
"${workspaceFolder}/src/lib/godot-cpp/include"
|
||||||
"src/lib/godot-cpp/gdextension"
|
|
||||||
],
|
],
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"xlocbuf": "cpp"
|
"xlocbuf": "cpp"
|
||||||
|
Binary file not shown.
Binary file not shown.
@@ -10,6 +10,13 @@ func _ready():
|
|||||||
discord_sdk.small_image = "boss"
|
discord_sdk.small_image = "boss"
|
||||||
discord_sdk.small_image_text = "Fighting the end boss! D:"
|
discord_sdk.small_image_text = "Fighting the end boss! D:"
|
||||||
|
|
||||||
|
discord_sdk.party_id = "my-random-id-can-be-everything"
|
||||||
|
discord_sdk.current_party_size = 1
|
||||||
|
discord_sdk.max_party_size = 4
|
||||||
|
discord_sdk.match_secret = "my-random-match-secret"
|
||||||
|
discord_sdk.join_secret = "my-random-join-secret"
|
||||||
|
discord_sdk.spectate_secret = "my-random-spectate-secret"
|
||||||
|
|
||||||
#discord_sdk.start_timestamp = int(Time.get_unix_time_from_system())
|
#discord_sdk.start_timestamp = int(Time.get_unix_time_from_system())
|
||||||
discord_sdk.end_timestamp = int(Time.get_unix_time_from_system()) + 3600 # +1 hour in unix time
|
discord_sdk.end_timestamp = int(Time.get_unix_time_from_system()) + 3600 # +1 hour in unix time
|
||||||
|
|
||||||
|
@@ -49,8 +49,33 @@ void discord_sdk::_bind_methods()
|
|||||||
ClassDB::bind_method(D_METHOD("set_end_timestamp", "end_timestamp"), &discord_sdk::set_end_timestamp);
|
ClassDB::bind_method(D_METHOD("set_end_timestamp", "end_timestamp"), &discord_sdk::set_end_timestamp);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "end_timestamp"), "set_end_timestamp", "get_end_timestamp");
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "end_timestamp"), "set_end_timestamp", "get_end_timestamp");
|
||||||
|
|
||||||
|
ClassDB::bind_method(D_METHOD("get_party_id"), &discord_sdk::get_party_id);
|
||||||
|
|
||||||
|
ClassDB::bind_method(D_METHOD("set_party_id", "party_id"), &discord_sdk::set_party_id);
|
||||||
|
ADD_PROPERTY(PropertyInfo(Variant::STRING, "party_id"), "set_party_id", "get_party_id");
|
||||||
|
|
||||||
|
ClassDB::bind_method(D_METHOD("get_current_party_size"), &discord_sdk::get_current_party_size);
|
||||||
|
ClassDB::bind_method(D_METHOD("set_current_party_size", "current_party_size"), &discord_sdk::set_current_party_size);
|
||||||
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "current_party_size"), "set_current_party_size", "get_current_party_size");
|
||||||
|
ClassDB::bind_method(D_METHOD("get_max_party_size"), &discord_sdk::get_max_party_size);
|
||||||
|
ClassDB::bind_method(D_METHOD("set_max_party_size", "max_party_size"), &discord_sdk::set_max_party_size);
|
||||||
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "max_party_size"), "set_max_party_size", "get_max_party_size");
|
||||||
|
|
||||||
|
ClassDB::bind_method(D_METHOD("get_match_secret"), &discord_sdk::get_match_secret);
|
||||||
|
ClassDB::bind_method(D_METHOD("set_match_secret", "match_secret"), &discord_sdk::set_match_secret);
|
||||||
|
ADD_PROPERTY(PropertyInfo(Variant::STRING, "match_secret"), "set_match_secret", "get_match_secret");
|
||||||
|
ClassDB::bind_method(D_METHOD("get_join_secret"), &discord_sdk::get_join_secret);
|
||||||
|
ClassDB::bind_method(D_METHOD("set_join_secret", "join_secret"), &discord_sdk::set_join_secret);
|
||||||
|
ADD_PROPERTY(PropertyInfo(Variant::STRING, "join_secret"), "set_join_secret", "get_join_secret");
|
||||||
|
ClassDB::bind_method(D_METHOD("get_spectate_secret"), &discord_sdk::get_spectate_secret);
|
||||||
|
ClassDB::bind_method(D_METHOD("set_spectate_secret", "spectate_secret"), &discord_sdk::set_spectate_secret);
|
||||||
|
ADD_PROPERTY(PropertyInfo(Variant::STRING, "spectate_secret"), "set_spectate_secret", "get_spectate_secret");
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("refresh"), &discord_sdk::refresh);
|
ClassDB::bind_method(D_METHOD("refresh"), &discord_sdk::refresh);
|
||||||
|
|
||||||
|
ClassDB::bind_method(D_METHOD("register_command"), &discord_sdk::register_command);
|
||||||
|
ClassDB::bind_method(D_METHOD("register_steam"), &discord_sdk::register_steam);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_is_discord_working"), &discord_sdk::get_is_discord_working);
|
ClassDB::bind_method(D_METHOD("get_is_discord_working"), &discord_sdk::get_is_discord_working);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_result_int"), &discord_sdk::get_result_int);
|
ClassDB::bind_method(D_METHOD("get_result_int"), &discord_sdk::get_result_int);
|
||||||
@@ -197,6 +222,72 @@ int64_t discord_sdk::get_end_timestamp()
|
|||||||
return activity.GetTimestamps().GetEnd();
|
return activity.GetTimestamps().GetEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void discord_sdk::set_party_id(String value)
|
||||||
|
{
|
||||||
|
party_id = value;
|
||||||
|
activity.GetParty().SetId(value.utf8().get_data());
|
||||||
|
}
|
||||||
|
String discord_sdk::get_party_id()
|
||||||
|
{
|
||||||
|
return party_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
void discord_sdk::set_current_party_size(int32_t value)
|
||||||
|
{
|
||||||
|
current_party_size = value;
|
||||||
|
activity.GetParty().GetSize().SetCurrentSize(value);
|
||||||
|
}
|
||||||
|
int32_t discord_sdk::get_current_party_size()
|
||||||
|
{
|
||||||
|
return current_party_size;
|
||||||
|
}
|
||||||
|
void discord_sdk::set_max_party_size(int32_t value)
|
||||||
|
{
|
||||||
|
max_party_size = value;
|
||||||
|
activity.GetParty().GetSize().SetMaxSize(value);
|
||||||
|
}
|
||||||
|
int32_t discord_sdk::get_max_party_size()
|
||||||
|
{
|
||||||
|
return max_party_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
void discord_sdk::set_match_secret(String value)
|
||||||
|
{
|
||||||
|
match_secret = value;
|
||||||
|
activity.GetSecrets().SetMatch(value.utf8().get_data());
|
||||||
|
}
|
||||||
|
String discord_sdk::get_match_secret()
|
||||||
|
{
|
||||||
|
return match_secret;
|
||||||
|
}
|
||||||
|
void discord_sdk::set_join_secret(String value)
|
||||||
|
{
|
||||||
|
join_secret = value;
|
||||||
|
activity.GetSecrets().SetJoin(value.utf8().get_data());
|
||||||
|
}
|
||||||
|
String discord_sdk::get_join_secret()
|
||||||
|
{
|
||||||
|
return join_secret;
|
||||||
|
}
|
||||||
|
void discord_sdk::set_spectate_secret(String value)
|
||||||
|
{
|
||||||
|
spectate_secret = value;
|
||||||
|
activity.GetSecrets().SetSpectate(value.utf8().get_data());
|
||||||
|
}
|
||||||
|
String discord_sdk::get_spectate_secret()
|
||||||
|
{
|
||||||
|
return spectate_secret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void discord_sdk::register_command(String value)
|
||||||
|
{
|
||||||
|
register_command(value.utf8().get_data());
|
||||||
|
}
|
||||||
|
void discord_sdk::register_steam(int32_t value)
|
||||||
|
{
|
||||||
|
register_steam(value);
|
||||||
|
}
|
||||||
|
|
||||||
bool discord_sdk::get_is_discord_working()
|
bool discord_sdk::get_is_discord_working()
|
||||||
{
|
{
|
||||||
return result == discord::Result::Ok && app_id > 0;
|
return result == discord::Result::Ok && app_id > 0;
|
||||||
|
@@ -31,8 +31,16 @@ private:
|
|||||||
int64_t start_timestamp;
|
int64_t start_timestamp;
|
||||||
int64_t end_timestamp;
|
int64_t end_timestamp;
|
||||||
|
|
||||||
|
String party_id;
|
||||||
|
int32_t current_party_size;
|
||||||
|
int32_t max_party_size;
|
||||||
|
String match_secret;
|
||||||
|
String join_secret;
|
||||||
|
String spectate_secret;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static discord_sdk *get_singleton();
|
static discord_sdk *
|
||||||
|
get_singleton();
|
||||||
|
|
||||||
discord_sdk();
|
discord_sdk();
|
||||||
~discord_sdk();
|
~discord_sdk();
|
||||||
@@ -42,7 +50,6 @@ public:
|
|||||||
void refresh();
|
void refresh();
|
||||||
|
|
||||||
int64_t get_app_id();
|
int64_t get_app_id();
|
||||||
|
|
||||||
void set_app_id(int64_t value);
|
void set_app_id(int64_t value);
|
||||||
String get_state();
|
String get_state();
|
||||||
void set_state(String value);
|
void set_state(String value);
|
||||||
@@ -63,6 +70,23 @@ public:
|
|||||||
int64_t get_end_timestamp();
|
int64_t get_end_timestamp();
|
||||||
void set_end_timestamp(int64_t value);
|
void set_end_timestamp(int64_t value);
|
||||||
|
|
||||||
|
String get_party_id();
|
||||||
|
void set_party_id(String value);
|
||||||
|
|
||||||
|
int32_t get_current_party_size();
|
||||||
|
void set_current_party_size(int32_t value);
|
||||||
|
int32_t get_max_party_size();
|
||||||
|
void set_max_party_size(int32_t value);
|
||||||
|
String get_match_secret();
|
||||||
|
void set_match_secret(String value);
|
||||||
|
String get_join_secret();
|
||||||
|
void set_join_secret(String value);
|
||||||
|
String get_spectate_secret();
|
||||||
|
void set_spectate_secret(String value);
|
||||||
|
|
||||||
|
void register_command(String value);
|
||||||
|
void register_steam(int32_t value);
|
||||||
|
|
||||||
bool get_is_discord_working();
|
bool get_is_discord_working();
|
||||||
int get_result_int();
|
int get_result_int();
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user