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

Server sends only one message every ScheduleRunner tick #146

Open
VisualEhrmanntraut opened this issue Feb 13, 2024 · 2 comments
Open

Server sends only one message every ScheduleRunner tick #146

VisualEhrmanntraut opened this issue Feb 13, 2024 · 2 comments

Comments

@VisualEhrmanntraut
Copy link

Is this a bug or am I doing something wrong? I'm making a headless server.

@lucaspoffo
Copy link
Owner

Without code it's hard to know the problem, you might be doing something wrong because it should send more messages. Are you using the example code as base? You can check the bevy_demo also

@VisualEhrmanntraut
Copy link
Author

@lucaspoffo I cross-referenced the bevy and chat examples to get started with using this crate.

let transport = NetcodeServerTransport::new(server_config, socket).unwrap();
App::new()
    .add_plugins((
        MinimalPlugins.set(ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(
            1.0 / 120.0,
        ))),
        LogPlugin::default(),
        RenetServerPlugin,
        NetcodeServerPlugin,
        AssetPlugin::default(),
        PhysicsPlugins::default(),
        WorldPlugin,
    ))
    .insert_resource(server)
    .insert_resource(transport)
    .add_systems(Update, handle_events)
    .run();

The app is created as in the above snippet. Messages are transported later, in an Update system, which has a for loop that sends a bunch of messages on every iteration. Every tick of the schedule runner, the bevy crate sends only one message, instead of as many as possible, which is not what I expected. Do note that I am new at game development, so there might be something I'm doing that's not common practice, or something.

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

No branches or pull requests

2 participants