Skip to content

Commit

Permalink
Merge pull request #13 from LowFire/main
Browse files Browse the repository at this point in the history
Implement P2P Interface
  • Loading branch information
3ddelano committed Nov 23, 2023
2 parents 03d993c + d7e7530 commit 83d322c
Show file tree
Hide file tree
Showing 16 changed files with 2,379 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "godot-cpp"]
path = godot-cpp
url = https://github.com/godotengine/godot-cpp
branch = 4.1
2 changes: 1 addition & 1 deletion godot-cpp
Submodule godot-cpp updated 73 files
+71 −0 .github/ISSUE_TEMPLATE/bug_report.yml
+14 −0 .github/ISSUE_TEMPLATE/config.yml
+55 −4 .github/workflows/ci.yml
+1 −1 .github/workflows/static_checks.yml
+1 −1 .gitignore
+22 −6 CMakeLists.txt
+29 −16 README.md
+17 −222 SConstruct
+170 −71 binding_generator.py
+8,099 −781 gdextension/extension_api.json
+1,877 −216 gdextension/gdextension_interface.h
+62 −0 include/godot_cpp/classes/editor_plugin_registration.hpp
+10 −24 include/godot_cpp/classes/ref.hpp
+127 −88 include/godot_cpp/classes/wrapped.hpp
+3 −3 include/godot_cpp/core/binder_common.hpp
+27 −11 include/godot_cpp/core/class_db.hpp
+5 −5 include/godot_cpp/core/engine_ptrcall.hpp
+2 −2 include/godot_cpp/core/memory.hpp
+2 −2 include/godot_cpp/core/method_bind.hpp
+5 −6 include/godot_cpp/core/method_ptrcall.hpp
+12 −6 include/godot_cpp/core/object.hpp
+2 −2 include/godot_cpp/core/type_info.hpp
+144 −7 include/godot_cpp/godot.hpp
+21 −11 include/godot_cpp/templates/cowdata.hpp
+1 −1 include/godot_cpp/templates/list.hpp
+3 −3 include/godot_cpp/templates/rid_owner.hpp
+4 −4 include/godot_cpp/templates/thread_work_pool.hpp
+79 −50 include/godot_cpp/variant/char_string.hpp
+14 −6 include/godot_cpp/variant/variant.hpp
+8 −0 include/godot_cpp/variant/vector3.hpp
+8 −0 include/godot_cpp/variant/vector3i.hpp
+8 −0 include/godot_cpp/variant/vector4.hpp
+8 −0 include/godot_cpp/variant/vector4i.hpp
+61 −0 src/classes/editor_plugin_registration.cpp
+5 −5 src/classes/low_level.cpp
+32 −3 src/classes/wrapped.cpp
+32 −11 src/core/class_db.cpp
+4 −4 src/core/error_macros.cpp
+6 −6 src/core/memory.cpp
+1 −1 src/core/method_bind.cpp
+30 −0 src/core/object.cpp
+358 −16 src/godot.cpp
+127 −118 src/variant/char_string.cpp
+42 −42 src/variant/packed_arrays.cpp
+44 −41 src/variant/variant.cpp
+16 −1 test/CMakeLists.txt
+1 −4 test/README.md
+2 −2 test/SConstruct
+0 −80 test/demo/main.gd
+0 −0 test/project/bin/libgdexample.osx.template_debug.framework/Resources/Info.plist
+0 −0 test/project/bin/libgdexample.osx.template_release.framework/Resources/Info.plist
+1 −1 test/project/default_env.tres
+3 −0 test/project/example.gdextension
+ test/project/icon.png
+1 −1 test/project/icon.png.import
+175 −0 test/project/main.gd
+2 −2 test/project/main.tscn
+1 −1 test/project/project.godot
+59 −0 test/project/test_base.gd
+24 −0 test/run-tests.sh
+136 −31 test/src/example.cpp
+34 −1 test/src/example.h
+2 −2 test/src/register_types.cpp
+3 −1 tools/android.py
+333 −0 tools/godotcpp.py
+31 −6 tools/ios.py
+0 −26 tools/ios_osxcross.py
+2 −0 tools/linux.py
+28 −6 tools/macos.py
+0 −28 tools/macos_osxcross.py
+67 −15 tools/targets.py
+23 −24 tools/web.py
+31 −11 tools/windows.py
20 changes: 20 additions & 0 deletions sample/addons/epic-online-services-godot/eos.gd
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,26 @@ class P2P:

enum RelayControl { NoRelays = 0, AllowRelays = 1, ForceRelays = 2 }

enum NetworkType { NoConnection = 0, DirectConnection = 1, RelayedConnection = 2 }

enum Mode { None = 0, Server = 1, Client = 2, Mesh = 3 }

enum ConnectionStatus { Disconnected = 0, Connecting = 1, Connected = 2 }

class SetPortRangeOptions extends BaseClass:
func _init():
super._init("SetPortRangeOptions")

var port : int
var max_additional_ports_to_try : int

class SetPacketQueueSizeOptions extends BaseClass:
func _init():
super._init("SetPacketQueueSizeOptions")

var incoming_packet_queue_max_size_bytes : int
var outgoing_packet_queue_max_size_bytes : int




Expand Down
1 change: 1 addition & 0 deletions sample/addons/epic-online-services-godot/eosg.gdextension
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[configuration]

entry_symbol = "eosg_library_init"
compatibility_minimum = 4.1

[libraries]
linux.x86_64.debug = "bin/libeosg.linux.template_debug.dev.x86_64.so"
Expand Down
6 changes: 5 additions & 1 deletion sample/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ config_version=5

config/name="Epic Online Services Godot 4.x"
run/main_scene="res://Main.tscn"
config/features=PackedStringArray("4.0")
config/features=PackedStringArray("4.1")
config/icon="res://logo.png"

[autoload]
Expand All @@ -21,6 +21,10 @@ Env="*res://scripts/Env.gd"
Store="*res://scripts/Store.gd"
EOS_tick="*res://addons/epic-online-services-godot/tick.gd"

[dotnet]

project/assembly_name="Epic Online Services Godot 4.x"

[editor_plugins]

enabled=PackedStringArray("res://addons/epic-online-services-godot/plugin.cfg")
Expand Down
2 changes: 1 addition & 1 deletion src/auth_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void IEOS::auth_interface_login(Ref<RefCounted> p_options) {
ret["local_user_id"] = eosg_epic_account_id_to_string(data->LocalUserId);
ret["pin_grant_info"] = eosg_auth_pin_grant_info_to_dict(data->PinGrantInfo);
ret["continuance_token"] = eosg_continuance_token_to_wrapper(data->ContinuanceToken);
ret["account_feature_restricted_info"] = eosg_auth_account_feature_restricted_info_to_dict(data->AccountFeatureRestrictedInfo);
ret["account_feature_restricted_info"] = eosg_auth_account_feature_restricted_info_to_dict(data->AccountFeatureRestrictedInfo_DEPRECATED); //This should change at some point
ret["selected_account_id"] = eosg_epic_account_id_to_string(data->SelectedAccountId);

if (data->ResultCode == EOS_EResult::EOS_Success) {
Expand Down
6 changes: 5 additions & 1 deletion src/connect_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ void IEOS::connect_interface_login(Ref<RefCounted> p_options) {
memset(&credentials, 0, sizeof(EOS_Connect_Credentials));
credentials.ApiVersion = EOS_CONNECT_CREDENTIALS_API_LATEST;
credentials.Type = static_cast<EOS_EExternalCredentialType>((int)p_credentials->get("type"));
credentials.Token = token.get_data();
if (credentials.Type == EOS_EExternalCredentialType::EOS_ECT_DEVICEID_ACCESS_TOKEN) {
credentials.Token = nullptr; //It needs to be nullptr for deviceid, otherwise login will fail
} else {
credentials.Token = token.get_data();
}

EOS_Connect_UserLoginInfo userLoginInfo;
memset(&userLoginInfo, 0, sizeof(EOS_Connect_LoginOptions));
Expand Down
Loading

0 comments on commit 83d322c

Please sign in to comment.