Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classes with base of HttpRequest fail to register #88

Closed
justofisker opened this issue Jan 27, 2023 · 6 comments · Fixed by #114
Closed

Classes with base of HttpRequest fail to register #88

justofisker opened this issue Jan 27, 2023 · 6 comments · Fixed by #114

Comments

@justofisker
Copy link

justofisker commented Jan 27, 2023

When attempting to create a class that extends HttpRequest it fails to register and outputs and error.

Simple class that extends HttpRequest.

use godot::engine::{HttpRequest};
use godot::prelude::*;

#[derive(GodotClass)]
#[class(base=HttpRequest)]
pub struct TestHTTP {
    #[base]
    base: Base<HttpRequest>,
}

#[godot_api]
impl GodotExt for TestHTTP {
    fn init(base: Base<HttpRequest>) -> Self {
        TestHTTP {
            base,
        }
    }
}

Error when attempt to run project.

E 0:00:00:0400   _register_extension_class: Attempt to register an extension class 'TestHTTP' using non-existing parent class 'HttpRequest'
  <C++ Error>    Method/function failed.
  <C++ Source>   core/extension/gdextension.cpp:263 @ _register_extension_class()

If I change the base type to Node or Control it works fine.

@justofisker justofisker changed the title Classes with base of HttpRequest aren't recognized Classes with base of HttpRequest aren't recognized on Windows Jan 27, 2023
@Bromeon
Copy link
Member

Bromeon commented Jan 27, 2023

What do you mean with "not recognized by Godot"?

@Coder2195Text
Copy link

What do you mean with "not recognized by Godot"?

I think they mean like showing up as a extended node in the list that appears when u choose node types

@justofisker
Copy link
Author

What do you mean with "not recognized by Godot"?

I cannot reference the class type in code or create a node of it's type in the editor. I was getting an error message at some point I'll try to cause it again and post it here.

@justofisker
Copy link
Author

I get this error, when I run the project from the editor.

E 0:00:00:0400   _register_extension_class: Attempt to register an extension class 'TestHTTP' using non-existing parent class 'HttpRequest'
  <C++ Error>    Method/function failed.
  <C++ Source>   core/extension/gdextension.cpp:263 @ _register_extension_class()

@Coder2195Text
Copy link

Coder2195Text commented Jan 28, 2023

I get this error, when I run the project from the editor.

E 0:00:00:0400   _register_extension_class: Attempt to register an extension class 'TestHTTP' using non-existing parent class 'HttpRequest'
  <C++ Error>    Method/function failed.
  <C++ Source>   core/extension/gdextension.cpp:263 @ _register_extension_class()

this might be more suited for https://github.com/godotengine/godot itself, because that is core Godot Api stuff

@justofisker justofisker changed the title Classes with base of HttpRequest aren't recognized on Windows Classes with base of HttpRequest fail to register Jan 28, 2023
@bors bors bot closed this as completed in f25f65c Feb 5, 2023
@Bromeon
Copy link
Member

Bromeon commented Feb 5, 2023

This was indeed a bug on our side, it's not Godot's responsibility to accept case-insensitive class names.
Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants