GithubHelp home page GithubHelp logo

drachenfrucht1 / godotcord Goto Github PK

View Code? Open in Web Editor NEW
52.0 4.0 5.0 232 KB

A Discord Game SDK integration for Godot

Home Page: https://drachenfrucht1.github.io/godotcord

License: MIT License

Python 7.48% C++ 90.01% Shell 0.55% Batchfile 0.84% C 0.92% PowerShell 0.20%
godot godot-engine discord-gamesdk godotengine godot-module

godotcord's People

Contributors

drachenfrucht1 avatar jordigcs avatar nathanfranke avatar peatral avatar sairam4123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

godotcord's Issues

3.2.4?

What's your expectation for this compiling successfully into Godot 3.2.4 once it comes out? I can do it, just is there anything you foresee being a problem?

Thanks for this btw. This is going to be a huge time savor for me and my team's project.

Use Signals instead of FuncRefs

I feel like Signals has lots of advantages over function references.

Advantages:

  1. Ability to use yield function.
  2. Lot's of more advantages other than yield, I just forgot them, anyway.

Disadvantages:

  1. Lots of signals in codes. It's taking one line to register a signal. (It's not really a disadvantage though ๐Ÿ˜›)

I don't feel any advantages and disadvantages though. Maybe we could discuss further on it.

Thank you.

[BUG/HELP] Game exits without any error or message in godot output console.

Problem:
When I add the following line to any project with Godotcord and run the project, the game exits without any message or error.
peer.create_lobby(port, public)

Running Machine:
ArchLinux

File Structure:

res://addons/my_path/plugin.gd

tool
extends EditorPlugin

func _enter_tree() -> void:
	add_custom_type(
		"MyCustomServerNode",
		"Node",
		load('res://addons/my_path/server.gd'),
		load('res://addons/my_path/assets/server.png')
	)
	if (not Engine.is_editor_hint()):
		Godotcord.init(902336646891069450, Godotcord.CreateFlags_DEFAULT)

func _process(delta: float) -> void:
	if (not Engine.is_editor_hint()):
		Godotcord.run_callbacks()

func _exit_tree() -> void:
	remove_custom_type(
		"MyCustomServerNode"
	)

res://addons/my_path/server.gd

extends Node

export(int)  var port   : int                           = 8000
export(bool) var public : bool                          = false

var              tree   : SceneTree                     = SceneTree.new()
var              peer   : NetworkedMultiplayerGodotcord = NetworkedMultiplayerGodotcord.new()

func _ready() -> void:
	peer.create_lobby(port, public)
	tree.network_peer = peer

func _exit_tree() -> void:
	peer.close_connection()
	tree.network_peer = null

res://server.tscn
Includes MyCustomServerNode

Terminal Console Output:

Running: /my/custom/godot/path/bin/godot.editor.64 --path /my/project/path --remote-debug 127.0.0.1:6007 --allow_focus_steal_pid 000000 --position 768,420 res://server.tscn

handle_crash: Program crashed with signal 11
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /usr/lib/libc.so.6(+0x3cda0) [0x7fc8839a2da0] (??:0)
[2] discord::LobbyManager::GetLobbyCreateTransaction(discord::LobbyTransaction*) (/my/custom/godot/path/modules/godotcord/discord-files/lobby_manager.cpp:131)
[3] NetworkedMultiplayerGodotcord::create_lobby(int, bool) (/my/custom/godot/path/modules/godotcord/godotcord_network_peer.cpp:38)
[4] MethodBind2R<Error, int, bool>::call(Object*, Variant const**, int, Variant::CallError&) (/my/custom/godot/path/./core/method_bind.gen.inc:1717 (discriminator 12))
[5] Object::call(StringName const&, Variant const**, int, Variant::CallError&) (/another/custom/godot/path/core/object.cpp:921 (discriminator 1))
[6] Variant::call_ptr(StringName const&, Variant const**, int, Variant*, Variant::CallError&) (/another/custom/godot/path/core/variant_call.cpp:1112 (discriminator 1))
[7] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Variant::CallError&, GDScriptFunction::CallState*) (/another/custom/godot/path/modules/gdscript/gdscript_function.cpp:1091)
[8] GDScriptInstance::_ml_call_reversed(GDScript*, StringName const&, Variant const**, int) (/another/custom/godot/path/modules/gdscript/gdscript.cpp:1233)
[9] GDScriptInstance::call_multilevel_reversed(StringName const&, Variant const**, int) (/another/custom/godot/path/modules/gdscript/gdscript.cpp:1242)
[10] Node::_notification(int) (/another/custom/godot/path/scene/main/node.cpp:152)
[11] Node::_notificationv(int, bool) (/another/custom/godot/path/./scene/main/node.h:46 (discriminator 14))
[12] Object::notification(int, bool) (/another/custom/godot/path/core/object.cpp:933)
[13] Node::_propagate_ready() (/another/custom/godot/path/scene/main/node.cpp:197)
[14] Node::_propagate_ready() (/another/custom/godot/path/scene/main/node.cpp:186 (discriminator 3))
[15] Node::_propagate_ready() (/another/custom/godot/path/scene/main/node.cpp:186 (discriminator 3))
[16] Node::_set_tree(SceneTree*) (/another/custom/godot/path/scene/main/node.cpp:2565)
[17] SceneTree::init() (/another/custom/godot/path/scene/main/scene_tree.cpp:464)
[18] OS_X11::run() (/another/custom/godot/path/platform/x11/os_x11.cpp:3237)
[19] /my/custom/godot/path/bin/godot.editor.64(main+0x12d) [0x146f6f3] (/another/custom/godot/path/platform/x11/godot_x11.cpp:57)
[20] /usr/lib/libc.so.6(__libc_start_main+0xd5) [0x7fc88398db25] (??:0)
[21] /my/custom/godot/path/bin/godot.editor.64(_start+0x2e) [0x146f50e] (??:?)

What I Need:
I need either an explanation as to what I am doing wrong, or a patch to fix a possible bug. Thank you.

Improve docs's look with raw file.

Right now, it's really difficult to read docs in raw format.

It would be cool to see some lines that differentiate sections in the docs.

Thank you.

Parse Error: The identifier "Godotcord" isn't declared in the current scope

I have this code in my script:

func _ready():
	Godotcord.init(CLIENT_ID, Godotcord.CreateFlags_NO_REQUIRE_DISCORD)
	var acv = GodotcordActivity.new()
	acv.state = "just"
	acv.details = "a test"
	acv.large_image = "512"
	acv.large_text = "Left Out"
	GodotcordActivityManager.set_activity(acv)

func _process(delta):
	Godotcord.run_callbacks()

When I run the game inside the editor, it works fine, but when I export it, I get this:

Error :(

All the dlls are in the same game's directory.

Use ReadTheDocs to host documentation.

Hey, why not use ReadTheDocs, it's what Godot uses, and I'd recommend using it. Currently, I know you're using GitHub Pages, but it's better to use ReadTheDocs instead.

Error loading shared libraries on Linux

After removing all parts of the GameSDK that use std:: (for example std::int32_t becomes int32_t) and adding using namespace std; to types.h (to fix #20), the engine compiles successfully. But when I try to run an empty scene in an empty project, I get the following error:
image
Even though the file structure is correct:
image

Implement User Manager, Overlays, Storage and Voice.

Hello, I need to use this for production purposes, because I can't find any other discord game sdk wrapper, would you like to implement other stuffs as well?

Thank you very much for your help!

Stuff needs to be implemented in godotcord:

  • Applications Manager #42
  • Lobby Manager (WIP)
  • Storage Manager #44
  • Voice Manager #54

I'm getting this error when I try to join the game using my alt.

This error happens on the main one.

ERROR: Invalid packet received. Unabled to find requested cached node.
   At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
   At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
   At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
   At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
   At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
   At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
   At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
   At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
   At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
   At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
   At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
   At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
   At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
   At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
   At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
   At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
   At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
   At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
   At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
   At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
   At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
   At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
   At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
   At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
   At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
   At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
   At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
   At: core\io\multiplayer_api.cpp:204
ERROR: Invalid packet received. Unabled to find requested cached node.
   At: core\io\multiplayer_api.cpp:265
ERROR: Invalid packet received. Requested node was not found.
   At: core\io\multiplayer_api.cpp:204

And this one happens on the alt one.

ERROR: Node not found: Spatial/Players/1.                                                                                  At: scene\main\node.cpp:1381                                                                                         ERROR: MultiplayerAPI::_process_get_node: Failed to get cached path from RPC: Spatial/Players/1.                           At: core\io\multiplayer_api.cpp:272                                                                                  ERROR: Invalid packet received. Requested node was not found.                                                              At: core\io\multiplayer_api.cpp:204                                                                                  ERROR: Node not found: Spatial/Players/1.                                                                                  At: scene\main\node.cpp:1381                                                                                         ERROR: MultiplayerAPI::_process_get_node: Failed to get cached path from RPC: Spatial/Players/1.                           At: core\io\multiplayer_api.cpp:272                                                                                  ERROR: Invalid packet received. Requested node was not found.                                                              At: core\io\multiplayer_api.cpp:204                                                                                  ERROR: Node not found: Spatial/Players/1.                                                                                  At: scene\main\node.cpp:1381                                                                                         ERROR: MultiplayerAPI::_process_get_node: Failed to get cached path from RPC: Spatial/Players/1.                           At: core\io\multiplayer_api.cpp:272                                                                                  ERROR: Invalid packet received. Requested node was not found.                                                              At: core\io\multiplayer_api.cpp:204                                                                                  ERROR: Node not found: Spatial/Players/1.                                                                                  At: scene\main\node.cpp:1381                                                                                         ERROR: MultiplayerAPI::_process_get_node: Failed to get cached path from RPC: Spatial/Players/1.                           At: core\io\multiplayer_api.cpp:272                                                                                  ERROR: Invalid packet received. Requested node was not found.                                                              At: core\io\multiplayer_api.cpp:204                                                                                  ERROR: Node not found: Spatial/Players/1.                                                                                

Here's the project, if you want to debug.
DiscordMultiplayerGame.zip

Code execution cannot proceed

I'm thinking this is something wrong I did wrong but I figured I mention it here. I've gotten everything working in a 3.2.1 build. In the editor it works like a charm and is real easy to work with but once exported I haven't been able to get it past start up. Godot tosses out a "This code execution cannot proceed because discord_game_sdk.dll was not found." I've built export templates for it that have compiled fine and I've confirmed that the cpp and headers have made it in. Am I missing something?

Game crashes with error

Game crashes with this error.

Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[0] <couldn't map PC to fn name>
[1] <couldn't map PC to fn name>
[2] DiscordVersion
[3] DiscordVersion
[4] DiscordVersion
[5] DiscordVersion
[6] <couldn't map PC to fn name>
[7] <couldn't map PC to fn name>
[8] <couldn't map PC to fn name>
[9] <couldn't map PC to fn name>
[10] <couldn't map PC to fn name>
[11] <couldn't map PC to fn name>
[12] <couldn't map PC to fn name>
[13] <couldn't map PC to fn name>
[14] <couldn't map PC to fn name>
[15] <couldn't map PC to fn name>
[16] <couldn't map PC to fn name>
[17] <couldn't map PC to fn name>
[18] <couldn't map PC to fn name>
[19] <couldn't map PC to fn name>
[20] <couldn't map PC to fn name>
[21] <couldn't map PC to fn name>
[22] BaseThreadInitThunk
-- END OF BACKTRACE --

Can you please help me out?

Edit: Only sometimes.

Game crashes if discord isn't running even using CreateFlags_NO_REQUIRE_DISCORD

If I don't have discord running when I launch the game, I got this:

ERROR: Godotcord::init: Condition "result != discord::Result::Ok" is true. Returned: ERR_CANT_CONNECT
   At: modules\godotcord\godotcord.cpp:45
CrashHandlerException: Program crashed
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[0] <couldn't map PC to fn name>
[1] <couldn't map PC to fn name>
[2] <couldn't map PC to fn name>
[3] <couldn't map PC to fn name>
[4] <couldn't map PC to fn name>
[5] <couldn't map PC to fn name>
[6] <couldn't map PC to fn name>
[7] <couldn't map PC to fn name>
[8] <couldn't map PC to fn name>
[9] <couldn't map PC to fn name>
[10] <couldn't map PC to fn name>
[11] <couldn't map PC to fn name>
[12] <couldn't map PC to fn name>
[13] <couldn't map PC to fn name>
[14] <couldn't map PC to fn name>
[15] <couldn't map PC to fn name>
[16] <couldn't map PC to fn name>
[17] <couldn't map PC to fn name>
[18] <couldn't map PC to fn name>
[19] <couldn't map PC to fn name>
[20] <couldn't map PC to fn name>
[21] <couldn't map PC to fn name>
[22] BaseThreadInitThunk
-- END OF BACKTRACE --

My code is very simple:

func _ready():
	var _transition = tween.interpolate_property(
		transition, "cutoff", 0.0, 1.0, 2.0, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT
	)
	var _start = tween.start()
	
	Godotcord.init(CLIENT_ID, Godotcord.CreateFlags_NO_REQUIRE_DISCORD)
	var acv = GodotcordActivity.new()
	acv.state = "In title screen"
	acv.large_image = "512"
	acv.large_text = "Left Out"
	GodotcordActivityManager.set_activity(acv)

func _process(delta):
	Godotcord.run_callbacks()

Test Godotcord for Godot 3.3 release.

As Godot is reaching 3.3, the current release 3.3rc9 went online 3 days ago, I'd recommend checking if Godotcord works with Godot version 3.3rc9 as well.

Thank you.

compilation problems

I didn't understand how I can compile the library, scons doesn't work, so what is the way to run SCsub?

Game SDK claims 'std' does not name a type (Godot 3.2.4 beta 4)

I'm experiencing errors when trying to compile Godot 3.2.4 with Godotcord on Ubuntu 20.10
image
This is with a fresh clone of both Godot and Godotcord, after running setup.sh
I built with scons -j6 platform=x11 target=release_debug use_lto=yes tools=yes
Could this be an issue with Godotcord or with the Game SDK?

Does this compile on Linux for you @Drachenfrucht1?

Specs:
Godot 3.2.4 beta 4
Ubuntu 20.10

Godot 3.3.2 Stable release fails to build with Godotcord

Hi everyone, I just wanted to make a PR to update the version of Godot to 3.3.2-stable, but it doesn't seem to compile properly. Could someone look into it? Windows does compiles, Mac OS seem to have problems with linking and Linux build got cancelled because of the failure in Compilation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.