├── .cargo └── config.toml ├── .ci └── build_individually.sh ├── .github ├── ISSUE_TEMPLATE │ ├── blank_issue.md │ ├── bug_graphics.yml │ ├── bug_input.yml │ └── config.yml └── workflows │ ├── build.yml │ └── format.yml ├── .gitignore ├── .gitmodules ├── Cargo.lock ├── Cargo.toml ├── DEVELOPMENT.md ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── examples ├── lib-modules │ └── editor-lib │ │ ├── Cargo.toml │ │ └── src │ │ └── lib.rs └── wasm-modules │ ├── actionfeed │ ├── Cargo.toml │ └── src │ │ ├── actionfeed │ │ ├── mod.rs │ │ └── page.rs │ │ └── lib.rs │ ├── auto-mapper │ ├── Cargo.toml │ └── src │ │ └── lib.rs │ ├── chat │ ├── Cargo.toml │ └── src │ │ ├── chat │ │ ├── mod.rs │ │ └── page.rs │ │ └── lib.rs │ ├── connecting │ ├── Cargo.toml │ └── src │ │ ├── connecting │ │ ├── mod.rs │ │ └── page.rs │ │ └── lib.rs │ ├── console │ ├── Cargo.toml │ └── src │ │ ├── console │ │ ├── mod.rs │ │ └── page.rs │ │ └── lib.rs │ ├── demo_player │ ├── Cargo.toml │ └── src │ │ ├── demo_player │ │ ├── mod.rs │ │ └── page.rs │ │ └── lib.rs │ ├── editor_wasm │ ├── Cargo.toml │ └── src │ │ └── lib.rs │ ├── emote_wheel │ ├── Cargo.toml │ └── src │ │ ├── emote_wheel │ │ ├── mod.rs │ │ └── page.rs │ │ └── lib.rs │ ├── graphics-mod │ ├── Cargo.toml │ └── src │ │ ├── graphics.rs │ │ ├── handles │ │ ├── backend.rs │ │ ├── buffer_object.rs │ │ ├── canvas.rs │ │ ├── mod.rs │ │ ├── quad_container.rs │ │ ├── shader_storage.rs │ │ ├── stream.rs │ │ └── texture.rs │ │ └── lib.rs │ ├── hud │ ├── Cargo.toml │ └── src │ │ ├── hud │ │ ├── mod.rs │ │ └── page.rs │ │ └── lib.rs │ ├── ingame_menu │ ├── Cargo.toml │ └── src │ │ ├── ingame_menu │ │ ├── mod.rs │ │ ├── page.rs │ │ └── profiles.rs │ │ └── lib.rs │ ├── mainmenu │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── mainmenu │ │ ├── mod.rs │ │ ├── page.rs │ │ └── profiles.rs │ ├── motd │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── motd │ │ ├── mod.rs │ │ └── page.rs │ ├── prediction_timer_ui │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── pred_timer_ui │ │ ├── mod.rs │ │ ├── page.rs │ │ └── ui │ │ ├── main_frame.rs │ │ ├── mod.rs │ │ ├── plot.rs │ │ ├── settings.rs │ │ ├── simulation.rs │ │ └── user_data.rs │ ├── render-game │ ├── Cargo.toml │ └── src │ │ └── lib.rs │ ├── scoreboard │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── scoreboard │ │ ├── mod.rs │ │ └── page.rs │ ├── state │ ├── Cargo.toml │ └── src │ │ ├── collision.rs │ │ ├── config.rs │ │ ├── entities │ │ ├── character.rs │ │ ├── character │ │ │ ├── core.rs │ │ │ └── player.rs │ │ ├── entity.rs │ │ ├── flag.rs │ │ ├── laser.rs │ │ ├── mod.rs │ │ ├── pickup.rs │ │ └── projectile.rs │ │ ├── events.rs │ │ ├── game_objects.rs │ │ ├── lib.rs │ │ ├── match_manager.rs │ │ ├── match_state.rs │ │ ├── simulation_pipe.rs │ │ ├── snapshot.rs │ │ ├── stage.rs │ │ ├── state.rs │ │ ├── types.rs │ │ ├── weapons │ │ ├── definitions.rs │ │ └── mod.rs │ │ └── world.rs │ ├── ui │ ├── Cargo.toml │ └── src │ │ ├── example_page │ │ ├── content │ │ │ ├── main_frame.rs │ │ │ └── mod.rs │ │ ├── main_frame.rs │ │ ├── mod.rs │ │ └── page.rs │ │ └── lib.rs │ └── vote │ ├── Cargo.toml │ └── src │ ├── lib.rs │ └── vote │ ├── mod.rs │ └── page.rs ├── game ├── api-auto-mapper │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── api-editor │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── api-render-game │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── api-state │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── api-ui-game │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── render.rs ├── assets-base │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── loader.rs │ │ ├── verify.rs │ │ └── verify │ │ ├── ogg_vorbis.rs │ │ └── txt.rs ├── binds │ ├── Cargo.toml │ └── src │ │ ├── binds.rs │ │ └── lib.rs ├── client-accounts │ ├── Cargo.toml │ └── src │ │ ├── accounts.rs │ │ └── lib.rs ├── client-console │ ├── Cargo.toml │ └── src │ │ ├── console │ │ ├── console.rs │ │ ├── local_console.rs │ │ ├── mod.rs │ │ └── remote_console.rs │ │ └── lib.rs ├── client-containers │ ├── Cargo.toml │ └── src │ │ ├── container.rs │ │ ├── ctf.rs │ │ ├── emoticons.rs │ │ ├── entities.rs │ │ ├── flags.rs │ │ ├── freezes.rs │ │ ├── game.rs │ │ ├── hooks.rs │ │ ├── hud.rs │ │ ├── lib.rs │ │ ├── ninja.rs │ │ ├── particles.rs │ │ ├── skins.rs │ │ ├── utils.rs │ │ └── weapons.rs ├── client-demo │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── ui │ │ ├── mod.rs │ │ └── render.rs ├── client-extra │ ├── Cargo.toml │ └── src │ │ ├── ddrace_hud_split.rs │ │ ├── emoticon_split.rs │ │ ├── extra_split.rs │ │ ├── game_split.rs │ │ ├── lib.rs │ │ ├── particles_split.rs │ │ └── skin_split.rs ├── client-ghost │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── client-map │ ├── Cargo.toml │ └── src │ │ ├── client_map.rs │ │ └── lib.rs ├── client-notifications │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── overlay.rs ├── client-render-base │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── map │ │ ├── map.rs │ │ ├── map_buffered.rs │ │ ├── map_buffered │ │ │ ├── graphic_border_tile.rs │ │ │ └── graphic_tile.rs │ │ ├── map_image.rs │ │ ├── map_pipeline.rs │ │ ├── map_sound.rs │ │ ├── map_with_visual.rs │ │ ├── mod.rs │ │ ├── render_map_base.rs │ │ ├── render_pipe.rs │ │ └── render_tools.rs │ │ └── render │ │ ├── animation.rs │ │ ├── canvas_mapping.rs │ │ ├── default_anim.rs │ │ ├── effects.rs │ │ ├── mod.rs │ │ ├── particle.rs │ │ ├── particle_manager.rs │ │ ├── tee.rs │ │ ├── toolkit.rs │ │ └── weapons.rs ├── client-render-game │ ├── Cargo.toml │ └── src │ │ ├── components │ │ ├── cursor.rs │ │ ├── game_objects.rs │ │ ├── hud.rs │ │ ├── mod.rs │ │ └── players.rs │ │ ├── lib.rs │ │ └── render_game.rs ├── client-render │ ├── Cargo.toml │ └── src │ │ ├── actionfeed │ │ ├── mod.rs │ │ └── render.rs │ │ ├── chat │ │ ├── mod.rs │ │ └── render.rs │ │ ├── emote_wheel │ │ ├── mod.rs │ │ └── render.rs │ │ ├── emoticons │ │ ├── mod.rs │ │ └── render.rs │ │ ├── hud │ │ ├── mod.rs │ │ └── page.rs │ │ ├── lib.rs │ │ ├── motd │ │ ├── mod.rs │ │ └── page.rs │ │ ├── nameplates │ │ ├── mod.rs │ │ └── render.rs │ │ ├── scoreboard │ │ ├── mod.rs │ │ ├── render.rs │ │ └── types.rs │ │ ├── spectator_selection │ │ ├── mod.rs │ │ └── page.rs │ │ └── vote │ │ ├── mod.rs │ │ └── render.rs ├── client-replay │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── replay.rs ├── client-types │ ├── Cargo.toml │ └── src │ │ ├── actionfeed.rs │ │ ├── cert.rs │ │ ├── chat.rs │ │ ├── console.rs │ │ └── lib.rs ├── client-ui │ ├── Cargo.toml │ └── src │ │ ├── actionfeed │ │ ├── feed_list.rs │ │ ├── kill_entry.rs │ │ ├── main_frame.rs │ │ ├── mod.rs │ │ ├── page.rs │ │ ├── race_finish_entry.rs │ │ ├── shared.rs │ │ └── user_data.rs │ │ ├── chat │ │ ├── chat_entry.rs │ │ ├── chat_list.rs │ │ ├── input.rs │ │ ├── main_frame.rs │ │ ├── mod.rs │ │ ├── page.rs │ │ ├── shared.rs │ │ ├── system_entry.rs │ │ └── user_data.rs │ │ ├── connect │ │ ├── main_frame.rs │ │ ├── mod.rs │ │ ├── page.rs │ │ └── user_data.rs │ │ ├── console │ │ ├── console_list.rs │ │ ├── input.rs │ │ ├── input_err.rs │ │ ├── main_frame.rs │ │ ├── mod.rs │ │ ├── page.rs │ │ ├── suggestions.rs │ │ ├── user_data.rs │ │ └── utils.rs │ │ ├── demo_player │ │ ├── main_frame.rs │ │ ├── mod.rs │ │ ├── page.rs │ │ └── user_data.rs │ │ ├── emote_wheel │ │ ├── main_frame.rs │ │ ├── mod.rs │ │ ├── page.rs │ │ └── user_data.rs │ │ ├── events.rs │ │ ├── hud │ │ ├── main_frame.rs │ │ ├── mod.rs │ │ ├── page.rs │ │ └── user_data.rs │ │ ├── ingame_menu │ │ ├── account │ │ │ ├── main_frame.rs │ │ │ └── mod.rs │ │ ├── account_info.rs │ │ ├── call_vote │ │ │ ├── main_frame.rs │ │ │ ├── map.rs │ │ │ ├── misc.rs │ │ │ ├── mod.rs │ │ │ └── players.rs │ │ ├── client_info.rs │ │ ├── constants.rs │ │ ├── game │ │ │ ├── main_frame.rs │ │ │ └── mod.rs │ │ ├── ghost.rs │ │ ├── main_frame.rs │ │ ├── mod.rs │ │ ├── page.rs │ │ ├── raw_input_info.rs │ │ ├── server_info.rs │ │ ├── server_info │ │ │ └── main_frame.rs │ │ ├── server_players.rs │ │ ├── server_players │ │ │ └── main_frame.rs │ │ ├── topbar │ │ │ ├── main_frame.rs │ │ │ └── mod.rs │ │ ├── user_data.rs │ │ └── votes.rs │ │ ├── lib.rs │ │ ├── main_menu │ │ ├── communities.rs │ │ ├── communities │ │ │ ├── list.rs │ │ │ └── main_frame.rs │ │ ├── constants.rs │ │ ├── content │ │ │ ├── browser │ │ │ │ ├── bottom_bar.rs │ │ │ │ ├── connect_refresh.rs │ │ │ │ ├── filter.rs │ │ │ │ ├── friend_list │ │ │ │ │ ├── list │ │ │ │ │ │ ├── entry.rs │ │ │ │ │ │ ├── frame.rs │ │ │ │ │ │ └── mod.rs │ │ │ │ │ ├── main_frame.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── table.rs │ │ │ │ ├── info.rs │ │ │ │ ├── info_panel │ │ │ │ │ ├── main_frame.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── player_list │ │ │ │ │ │ ├── list │ │ │ │ │ │ ├── entry.rs │ │ │ │ │ │ ├── frame.rs │ │ │ │ │ │ └── mod.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ └── table.rs │ │ │ │ ├── list │ │ │ │ │ ├── header.rs │ │ │ │ │ ├── list.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── server_list │ │ │ │ │ │ ├── entry.rs │ │ │ │ │ │ ├── frame.rs │ │ │ │ │ │ └── mod.rs │ │ │ │ ├── main_frame.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── search.rs │ │ │ │ └── server_address.rs │ │ │ ├── main_frame.rs │ │ │ └── mod.rs │ │ ├── ddnet_info.rs │ │ ├── demo │ │ │ ├── list.rs │ │ │ ├── list │ │ │ │ ├── entry.rs │ │ │ │ ├── frame.rs │ │ │ │ └── header.rs │ │ │ ├── main_frame.rs │ │ │ ├── mod.rs │ │ │ └── search.rs │ │ ├── demo_list.rs │ │ ├── features.rs │ │ ├── leftbar │ │ │ ├── main_frame.rs │ │ │ └── mod.rs │ │ ├── legacy_server_list.rs │ │ ├── main_frame.rs │ │ ├── mod.rs │ │ ├── monitors.rs │ │ ├── page.rs │ │ ├── player_settings_ntfy.rs │ │ ├── profile │ │ │ ├── account_email_op.rs │ │ │ ├── account_email_token.rs │ │ │ ├── account_email_token_web_veri.rs │ │ │ ├── account_info.rs │ │ │ ├── account_info_loading.rs │ │ │ ├── account_steam_loading.rs │ │ │ ├── account_steam_op.rs │ │ │ ├── account_steam_token.rs │ │ │ ├── account_steam_token_web_veri.rs │ │ │ ├── back_bar.rs │ │ │ ├── credential_auth_email_op.rs │ │ │ ├── credential_auth_email_token.rs │ │ │ ├── credential_auth_email_token_web_veri.rs │ │ │ ├── credential_auth_steam_op.rs │ │ │ ├── credential_auth_steam_token.rs │ │ │ ├── credential_auth_steam_token_web_veri.rs │ │ │ ├── delete_confirm.rs │ │ │ ├── delete_prepare.rs │ │ │ ├── email_loading.rs │ │ │ ├── general_error.rs │ │ │ ├── link_email_prepare.rs │ │ │ ├── link_steam_prepare.rs │ │ │ ├── logout_all_prepare.rs │ │ │ ├── logout_loading.rs │ │ │ ├── main_frame.rs │ │ │ ├── mod.rs │ │ │ ├── overview.rs │ │ │ ├── steam_loading.rs │ │ │ ├── unlink_email_prepare.rs │ │ │ └── unlink_steam_prepare.rs │ │ ├── profiles_interface.rs │ │ ├── settings │ │ │ ├── constants.rs │ │ │ ├── general │ │ │ │ ├── main_frame.rs │ │ │ │ ├── mod.rs │ │ │ │ └── themes.rs │ │ │ ├── graphics │ │ │ │ ├── main_frame.rs │ │ │ │ └── mod.rs │ │ │ ├── language │ │ │ │ ├── list.rs │ │ │ │ ├── main_frame.rs │ │ │ │ └── mod.rs │ │ │ ├── list │ │ │ │ ├── entry.rs │ │ │ │ ├── list.rs │ │ │ │ └── mod.rs │ │ │ ├── main_frame.rs │ │ │ ├── mod.rs │ │ │ ├── player │ │ │ │ ├── assets │ │ │ │ │ ├── ctf.rs │ │ │ │ │ ├── emoticons.rs │ │ │ │ │ ├── entities.rs │ │ │ │ │ ├── freeze.rs │ │ │ │ │ ├── game.rs │ │ │ │ │ ├── hook.rs │ │ │ │ │ ├── hud.rs │ │ │ │ │ ├── main_frame.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── ninja.rs │ │ │ │ │ ├── particles.rs │ │ │ │ │ └── weapons.rs │ │ │ │ ├── controls │ │ │ │ │ ├── main_frame.rs │ │ │ │ │ └── mod.rs │ │ │ │ ├── main_frame.rs │ │ │ │ ├── misc │ │ │ │ │ ├── main_frame.rs │ │ │ │ │ └── mod.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── profile_selector.rs │ │ │ │ └── tee │ │ │ │ │ ├── main_frame.rs │ │ │ │ │ └── mod.rs │ │ │ ├── search_settings │ │ │ │ ├── main_frame.rs │ │ │ │ └── mod.rs │ │ │ └── sound │ │ │ │ ├── main_frame.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── spatial_chat │ │ │ │ ├── main_frame.rs │ │ │ │ └── mod.rs │ │ │ │ └── utils.rs │ │ ├── spatial_chat.rs │ │ ├── theme_container.rs │ │ ├── topbar │ │ │ ├── main_frame.rs │ │ │ └── mod.rs │ │ └── user_data.rs │ │ ├── motd │ │ ├── main_frame.rs │ │ ├── mod.rs │ │ ├── page.rs │ │ └── user_data.rs │ │ ├── scoreboard │ │ ├── content │ │ │ ├── footer.rs │ │ │ ├── list │ │ │ │ ├── definitions.rs │ │ │ │ ├── header.rs │ │ │ │ ├── list.rs │ │ │ │ ├── mod.rs │ │ │ │ └── player_list │ │ │ │ │ ├── entry.rs │ │ │ │ │ ├── frame.rs │ │ │ │ │ └── mod.rs │ │ │ ├── main_frame.rs │ │ │ ├── mod.rs │ │ │ └── topbar.rs │ │ ├── main_frame.rs │ │ ├── mod.rs │ │ ├── page.rs │ │ └── user_data.rs │ │ ├── sort.rs │ │ ├── spectator_selection │ │ ├── main_frame.rs │ │ ├── mod.rs │ │ ├── page.rs │ │ └── user_data.rs │ │ ├── thumbnail_container.rs │ │ ├── time_display.rs │ │ ├── utils.rs │ │ └── vote │ │ ├── main_frame.rs │ │ ├── mod.rs │ │ ├── page.rs │ │ └── user_data.rs ├── community │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── user_server.rs ├── demo │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── recorder.rs │ │ └── utils.rs ├── editor-auto-mapper-wasm │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── manager.rs │ │ └── wasm.rs ├── editor-interface │ ├── Cargo.toml │ └── src │ │ ├── auto_mapper.rs │ │ └── lib.rs ├── editor-wasm │ ├── Cargo.toml │ └── src │ │ ├── editor │ │ ├── editor_lib.rs │ │ ├── editor_wasm.rs │ │ ├── editor_wasm_manager.rs │ │ └── mod.rs │ │ └── lib.rs ├── editor │ ├── Cargo.toml │ └── src │ │ ├── action_logic.rs │ │ ├── actions │ │ ├── actions.rs │ │ ├── mod.rs │ │ └── utils.rs │ │ ├── client.rs │ │ ├── dbg.rs │ │ ├── dbg │ │ ├── invalid.rs │ │ └── valid.rs │ │ ├── editor.rs │ │ ├── editor_ui.rs │ │ ├── event.rs │ │ ├── explain.rs │ │ ├── fs.rs │ │ ├── hotkeys.rs │ │ ├── image_store_container.rs │ │ ├── lib.rs │ │ ├── map.rs │ │ ├── map_tools.rs │ │ ├── network.rs │ │ ├── notifications.rs │ │ ├── options.rs │ │ ├── physics_layers.rs │ │ ├── server.rs │ │ ├── sound_store_container.rs │ │ ├── tab.rs │ │ ├── tile_overlays.rs │ │ ├── tools │ │ ├── auto_saver.rs │ │ ├── mod.rs │ │ ├── quad_layer │ │ │ ├── brush.rs │ │ │ ├── mod.rs │ │ │ ├── selection.rs │ │ │ └── shared.rs │ │ ├── shared.rs │ │ ├── sound_layer │ │ │ ├── brush.rs │ │ │ ├── mod.rs │ │ │ └── shared.rs │ │ ├── tile_layer │ │ │ ├── auto_mapper.rs │ │ │ ├── brush.rs │ │ │ ├── legacy_rules.rs │ │ │ ├── mod.rs │ │ │ ├── selection.rs │ │ │ └── shared.rs │ │ ├── tool.rs │ │ └── utils.rs │ │ ├── ui │ │ ├── animation_panel │ │ │ ├── mod.rs │ │ │ └── panel.rs │ │ ├── assets_store_panel │ │ │ ├── mod.rs │ │ │ └── panel.rs │ │ ├── auto_mapper │ │ │ ├── auto_mapper.rs │ │ │ └── mod.rs │ │ ├── auto_saver │ │ │ └── mod.rs │ │ ├── bottom_panel │ │ │ ├── mod.rs │ │ │ └── panel.rs │ │ ├── chat_panel │ │ │ ├── mod.rs │ │ │ └── panel.rs │ │ ├── close_modal.rs │ │ ├── dbg_panel │ │ │ └── mod.rs │ │ ├── dotted_rect.rs │ │ ├── group_and_layer │ │ │ ├── group_props.rs │ │ │ ├── layer_props.rs │ │ │ ├── mod.rs │ │ │ ├── quad_props.rs │ │ │ ├── resource_selector.rs │ │ │ ├── shared.rs │ │ │ └── sound_props.rs │ │ ├── hotkey_panel │ │ │ ├── mod.rs │ │ │ └── panel.rs │ │ ├── left_panel │ │ │ ├── groups_and_layers.rs │ │ │ ├── image_arrays.rs │ │ │ ├── images.rs │ │ │ ├── mod.rs │ │ │ ├── panel.rs │ │ │ ├── resource_limit.rs │ │ │ ├── resource_panel.rs │ │ │ └── sounds.rs │ │ ├── main_frame.rs │ │ ├── mapper_cursors │ │ │ ├── main_frame.rs │ │ │ └── mod.rs │ │ ├── mod.rs │ │ ├── page.rs │ │ ├── server_config_variables │ │ │ ├── mod.rs │ │ │ └── panel.rs │ │ ├── server_settings │ │ │ ├── mod.rs │ │ │ └── panel.rs │ │ ├── tool_overlays │ │ │ ├── mod.rs │ │ │ └── tile_brush.rs │ │ ├── top_menu │ │ │ ├── menu.rs │ │ │ └── mod.rs │ │ ├── top_tabs │ │ │ ├── main_frame.rs │ │ │ └── mod.rs │ │ ├── top_toolbar │ │ │ ├── mod.rs │ │ │ ├── speedup.rs │ │ │ ├── switch.rs │ │ │ ├── tele.rs │ │ │ ├── tile_mirror.rs │ │ │ ├── toolbar.rs │ │ │ └── tune.rs │ │ ├── user_data.rs │ │ └── utils.rs │ │ └── utils.rs ├── egui-timeline │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── point.rs │ │ └── timeline.rs ├── game-base │ ├── Cargo.toml │ └── src │ │ ├── assets_url.rs │ │ ├── browser_favorite_player.rs │ │ ├── config_helper.rs │ │ ├── connecting_log.rs │ │ ├── datafile.rs │ │ ├── game_types.rs │ │ ├── indexmap_tests.rs │ │ ├── lib.rs │ │ ├── local_server_info.rs │ │ ├── mapdef_06.rs │ │ ├── network │ │ ├── messages.rs │ │ ├── mod.rs │ │ └── types │ │ │ ├── chat.rs │ │ │ └── mod.rs │ │ ├── player_input.rs │ │ ├── server_browser.rs │ │ └── types.rs ├── game-config-fs │ ├── Cargo.toml │ └── src │ │ ├── fs.rs │ │ └── lib.rs ├── game-config │ ├── Cargo.toml │ └── src │ │ ├── config.rs │ │ └── lib.rs ├── game-interface │ ├── Cargo.toml │ └── src │ │ ├── account_info.rs │ │ ├── chat_commands.rs │ │ ├── client_commands.rs │ │ ├── events.rs │ │ ├── ghosts.rs │ │ ├── interface.rs │ │ ├── lib.rs │ │ ├── pooling.rs │ │ ├── rcon_entries.rs │ │ ├── settings.rs │ │ ├── tick_result.rs │ │ ├── types │ │ ├── character_info.rs │ │ ├── emoticons.rs │ │ ├── fixed_zoom_level.rs │ │ ├── flag.rs │ │ ├── game.rs │ │ ├── id_gen.rs │ │ ├── id_types.rs │ │ ├── input.rs │ │ ├── input │ │ │ ├── cursor.rs │ │ │ ├── dyn_cam.rs │ │ │ └── viewport.rs │ │ ├── laser.rs │ │ ├── mod.rs │ │ ├── network_stats.rs │ │ ├── pickup.rs │ │ ├── player_info.rs │ │ ├── render │ │ │ ├── character.rs │ │ │ ├── flag.rs │ │ │ ├── game.rs │ │ │ ├── game │ │ │ │ └── game_match.rs │ │ │ ├── laser.rs │ │ │ ├── mod.rs │ │ │ ├── pickup.rs │ │ │ ├── projectiles.rs │ │ │ ├── scoreboard.rs │ │ │ ├── stage.rs │ │ │ └── world.rs │ │ ├── resource_key.rs │ │ ├── snapshot.rs │ │ ├── ticks.rs │ │ └── weapons.rs │ │ ├── vote_commands.rs │ │ └── votes.rs ├── game-network │ ├── Cargo.toml │ └── src │ │ ├── game_event_generator.rs │ │ ├── lib.rs │ │ └── messages.rs ├── game-server │ ├── Cargo.toml │ └── src │ │ ├── auto_map_votes.rs │ │ ├── client.rs │ │ ├── lib.rs │ │ ├── local_server.rs │ │ ├── map_votes.rs │ │ ├── network_plugins │ │ ├── accounts_only.rs │ │ ├── cert_ban.rs │ │ └── mod.rs │ │ ├── rcon.rs │ │ ├── server.rs │ │ ├── server_game.rs │ │ └── spatial_chat.rs ├── game-state-wasm │ ├── Cargo.toml │ └── src │ │ ├── game │ │ ├── mod.rs │ │ ├── state_wasm.rs │ │ └── state_wasm_manager.rs │ │ └── lib.rs ├── ghost │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── recorder.rs ├── http-accounts │ ├── Cargo.toml │ └── src │ │ ├── http.rs │ │ └── lib.rs ├── legacy_proxy │ ├── Cargo.toml │ └── src │ │ ├── client.rs │ │ ├── lib.rs │ │ ├── projectile.rs │ │ └── socket.rs ├── map-convert-lib │ ├── Cargo.toml │ └── src │ │ ├── legacy_to_new.rs │ │ ├── lib.rs │ │ └── new_to_legacy.rs ├── map │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── map.rs │ │ ├── map │ │ ├── animations.rs │ │ ├── command_value.rs │ │ ├── config.rs │ │ ├── groups.rs │ │ ├── groups │ │ │ ├── layers.rs │ │ │ └── layers │ │ │ │ ├── design.rs │ │ │ │ ├── physics.rs │ │ │ │ └── tiles.rs │ │ ├── metadata.rs │ │ └── resources.rs │ │ ├── skeleton.rs │ │ ├── skeleton │ │ ├── animations.rs │ │ ├── config.rs │ │ ├── groups.rs │ │ ├── groups │ │ │ ├── layers.rs │ │ │ └── layers │ │ │ │ ├── design.rs │ │ │ │ └── physics.rs │ │ ├── metadata.rs │ │ └── resources.rs │ │ ├── types.rs │ │ └── utils.rs ├── master-server-types │ ├── Cargo.toml │ └── src │ │ ├── addr.rs │ │ ├── lib.rs │ │ ├── locations.rs │ │ ├── response.rs │ │ └── servers.rs ├── prediction-timer │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── prediction_timing.rs ├── render-game-wasm │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── render │ │ ├── mod.rs │ │ ├── render_wasm.rs │ │ └── render_wasm_manager.rs └── vanilla │ ├── Cargo.toml │ └── src │ ├── collision.rs │ ├── command_chain.rs │ ├── config.rs │ ├── entities │ ├── character.rs │ ├── character │ │ ├── core.rs │ │ ├── hook.rs │ │ ├── player.rs │ │ ├── pos.rs │ │ └── score.rs │ ├── entity.rs │ ├── flag.rs │ ├── laser.rs │ ├── mod.rs │ ├── pickup.rs │ └── projectile.rs │ ├── events.rs │ ├── game_objects.rs │ ├── lib.rs │ ├── match_manager.rs │ ├── match_state.rs │ ├── reusable.rs │ ├── simulation_pipe.rs │ ├── snapshot.rs │ ├── spawns.rs │ ├── sql │ ├── account_created.rs │ ├── account_info.rs │ ├── generic │ │ └── account_info │ │ │ └── account_info.sql │ ├── mod.rs │ ├── mysql │ │ ├── account_created │ │ │ └── rewrite_saves.sql │ │ └── save │ │ │ └── saves.sql │ ├── save.rs │ └── sqlite │ │ ├── account_created │ │ └── rewrite_saves.sql │ │ └── save │ │ └── saves.sql │ ├── stage.rs │ ├── state.rs │ ├── types.rs │ ├── weapons │ ├── definitions.rs │ └── mod.rs │ └── world.rs ├── lib ├── api-macros │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── api-ui │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── ui_impl.rs ├── api-wasm-macros │ ├── Cargo.toml │ └── src │ │ ├── guest_func_auto_impl.rs │ │ ├── guest_funcs.rs │ │ ├── lib.rs │ │ └── mod_prepare.rs ├── api │ ├── Cargo.toml │ └── src │ │ ├── base_fs │ │ ├── filesys.rs │ │ └── mod.rs │ │ ├── base_http │ │ ├── http.rs │ │ └── mod.rs │ │ ├── database │ │ └── mod.rs │ │ ├── graphics │ │ ├── graphics.rs │ │ ├── graphics_mt.rs │ │ └── mod.rs │ │ ├── lib.rs │ │ └── sound │ │ ├── mod.rs │ │ └── sound_backend.rs ├── av-encoder │ ├── Cargo.toml │ └── src │ │ ├── encoder.rs │ │ ├── ffmpeg │ │ ├── converter.rs │ │ ├── encoder.rs │ │ ├── mod.rs │ │ └── utils.rs │ │ ├── lib.rs │ │ ├── old.rs │ │ ├── stub.rs │ │ ├── traits.rs │ │ └── types.rs ├── base-fs │ ├── Cargo.toml │ └── src │ │ ├── filesys.rs │ │ └── lib.rs ├── base-http │ ├── Cargo.toml │ └── src │ │ ├── http.rs │ │ ├── http_server.rs │ │ └── lib.rs ├── base-io-traits │ ├── Cargo.toml │ └── src │ │ ├── fs_traits.rs │ │ ├── http_traits.rs │ │ └── lib.rs ├── base-io │ ├── Cargo.toml │ └── src │ │ ├── io.rs │ │ ├── lib.rs │ │ ├── path_to_url.rs │ │ ├── runtime.rs │ │ └── yield_now.rs ├── base │ ├── Cargo.toml │ └── src │ │ ├── benchmark.rs │ │ ├── duration_ext.rs │ │ ├── hash.rs │ │ ├── join_thread.rs │ │ ├── lib.rs │ │ ├── linked_hash_map_view.rs │ │ ├── network_string.rs │ │ ├── rayon_helper.rs │ │ ├── rayon_join_handle.rs │ │ ├── reduced_ascii_str.rs │ │ └── system.rs ├── bin-patch │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── cache │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── command-parser │ ├── Cargo.toml │ └── src │ │ ├── escape.rs │ │ ├── lib.rs │ │ ├── parser.rs │ │ └── tokenizer.rs ├── config-fs │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── config-macro │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── config │ ├── Cargo.toml │ └── src │ │ ├── config.rs │ │ ├── lib.rs │ │ ├── parsing.rs │ │ ├── traits.rs │ │ └── types.rs ├── game-database-backend │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── game-database-macros │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── game-database │ ├── Cargo.toml │ └── src │ │ ├── dummy.rs │ │ ├── execution_plan.rs │ │ ├── lib.rs │ │ ├── statement.rs │ │ ├── traits.rs │ │ └── types.rs ├── graphics-backend-traits │ ├── Cargo.toml │ └── src │ │ ├── frame_fetcher_plugin.rs │ │ ├── lib.rs │ │ ├── plugin.rs │ │ ├── traits.rs │ │ └── types.rs ├── graphics-backend │ ├── Cargo.toml │ └── src │ │ ├── backend.rs │ │ ├── backend_mt.rs │ │ ├── backend_thread.rs │ │ ├── backends │ │ ├── mod.rs │ │ ├── null │ │ │ └── mod.rs │ │ ├── types.rs │ │ └── vulkan │ │ │ ├── barriers.rs │ │ │ ├── buffer.rs │ │ │ ├── command_buffer.rs │ │ │ ├── command_pool.rs │ │ │ ├── common.rs │ │ │ ├── compiler │ │ │ ├── compiler.rs │ │ │ └── mod.rs │ │ │ ├── dbg_utils_messenger.rs │ │ │ ├── descriptor_layout.rs │ │ │ ├── descriptor_pool.rs │ │ │ ├── descriptor_set.rs │ │ │ ├── fence.rs │ │ │ ├── frame.rs │ │ │ ├── frame_collection.rs │ │ │ ├── frame_resources.rs │ │ │ ├── framebuffer.rs │ │ │ ├── image.rs │ │ │ ├── image_view.rs │ │ │ ├── instance.rs │ │ │ ├── logical_device.rs │ │ │ ├── mapped_memory.rs │ │ │ ├── memory.rs │ │ │ ├── memory_block.rs │ │ │ ├── mod.rs │ │ │ ├── phy_device.rs │ │ │ ├── pipeline_cache.rs │ │ │ ├── pipeline_layout.rs │ │ │ ├── pipeline_manager.rs │ │ │ ├── pipelines.rs │ │ │ ├── queue.rs │ │ │ ├── render_cmds.rs │ │ │ ├── render_fill_manager.rs │ │ │ ├── render_group.rs │ │ │ ├── render_manager.rs │ │ │ ├── render_pass.rs │ │ │ ├── render_setup.rs │ │ │ ├── sampler.rs │ │ │ ├── semaphore.rs │ │ │ ├── stream_memory_pool.rs │ │ │ ├── sub_render_pass.rs │ │ │ ├── surface.rs │ │ │ ├── swapchain.rs │ │ │ ├── utils.rs │ │ │ ├── vulkan.rs │ │ │ ├── vulkan_allocator.rs │ │ │ ├── vulkan_config.rs │ │ │ ├── vulkan_dbg.rs │ │ │ ├── vulkan_device.rs │ │ │ ├── vulkan_limits.rs │ │ │ ├── vulkan_mem.rs │ │ │ ├── vulkan_types.rs │ │ │ └── vulkan_uniform.rs │ │ ├── cache.rs │ │ ├── checker.rs │ │ ├── lib.rs │ │ └── window.rs ├── graphics-base-traits │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── traits.rs ├── graphics-types │ ├── Cargo.toml │ └── src │ │ ├── commands.rs │ │ ├── gpu.rs │ │ ├── lib.rs │ │ ├── rendering.rs │ │ └── types.rs ├── graphics │ ├── Cargo.toml │ └── src │ │ ├── graphics.rs │ │ ├── graphics_mt.rs │ │ ├── handles │ │ ├── backend.rs │ │ ├── buffer_object.rs │ │ ├── canvas.rs │ │ ├── mod.rs │ │ ├── quad_container.rs │ │ ├── shader_storage.rs │ │ ├── stream.rs │ │ ├── stream_types.rs │ │ └── texture.rs │ │ ├── lib.rs │ │ ├── quad_container.rs │ │ ├── streaming.rs │ │ ├── utils.rs │ │ └── window_handling.rs ├── hiarc-macro │ ├── Cargo.toml │ └── src │ │ ├── hi_closure.rs │ │ ├── hiarc_trait.rs │ │ ├── lib.rs │ │ └── safe_wrapper │ │ ├── arc_mutex.rs │ │ ├── mod.rs │ │ ├── rc_refcell.rs │ │ ├── refcell.rs │ │ └── wrapper.rs ├── hiarc │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── image-utils │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── png.rs │ │ └── utils.rs ├── input-binds │ ├── Cargo.toml │ └── src │ │ ├── binds.rs │ │ └── lib.rs ├── math │ ├── Cargo.toml │ └── src │ │ ├── colors.rs │ │ ├── lib.rs │ │ └── math │ │ ├── mod.rs │ │ └── vector.rs ├── microphone │ ├── Cargo.toml │ └── src │ │ ├── cpal_opus │ │ ├── analyze_stream.rs │ │ ├── manager.rs │ │ ├── mod.rs │ │ ├── noise_gate.rs │ │ └── sound_stream.rs │ │ ├── lib.rs │ │ ├── null │ │ ├── analyze_stream.rs │ │ ├── manager.rs │ │ ├── mod.rs │ │ └── sound_stream.rs │ │ ├── stream.rs │ │ ├── stream_sample.rs │ │ ├── traits.rs │ │ └── types.rs ├── native-display │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── native │ ├── Cargo.toml │ └── src │ │ ├── input │ │ └── mod.rs │ │ ├── lib.rs │ │ └── native │ │ ├── app.rs │ │ ├── mod.rs │ │ └── winit_wrapper.rs ├── network │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── network │ │ ├── connection.rs │ │ ├── connection_ban.rs │ │ ├── connection_limit.rs │ │ ├── connection_per_ip.rs │ │ ├── connections.rs │ │ ├── errors.rs │ │ ├── event.rs │ │ ├── event_generator.rs │ │ ├── mod.rs │ │ ├── network.rs │ │ ├── network_async.rs │ │ ├── networks.rs │ │ ├── notifier.rs │ │ ├── packet_compressor.rs │ │ ├── packet_compressor │ │ ├── brotli.rs │ │ ├── header.rs │ │ └── types.rs │ │ ├── packet_dict.rs │ │ ├── plugins.rs │ │ ├── quinn_network.rs │ │ ├── quinnminimal.rs │ │ ├── traits.rs │ │ ├── tungstenite_network.rs │ │ ├── types.rs │ │ └── utils.rs ├── pool │ ├── Cargo.toml │ └── src │ │ ├── arc.rs │ │ ├── datatypes.rs │ │ ├── lib.rs │ │ ├── mixed_datatypes.rs │ │ ├── mixed_pool.rs │ │ ├── mt_datatypes.rs │ │ ├── mt_pool.rs │ │ ├── mt_recycle.rs │ │ ├── pool.rs │ │ ├── pool_clone.rs │ │ ├── rc.rs │ │ ├── recycle.rs │ │ └── traits.rs ├── sound-backend │ ├── Cargo.toml │ └── src │ │ ├── backend │ │ ├── kira │ │ │ ├── instance.rs │ │ │ ├── kira.rs │ │ │ ├── listener.rs │ │ │ ├── mem_allocator.rs │ │ │ ├── mod.rs │ │ │ ├── scene.rs │ │ │ ├── sound.rs │ │ │ ├── stream.rs │ │ │ └── stream │ │ │ │ └── stream_decoder.rs │ │ ├── mod.rs │ │ └── null │ │ │ ├── mod.rs │ │ │ └── null.rs │ │ ├── backend_thread.rs │ │ ├── lib.rs │ │ └── sound_backend.rs ├── sound │ ├── Cargo.toml │ └── src │ │ ├── backend_handle.rs │ │ ├── backend_types.rs │ │ ├── commands.rs │ │ ├── frame_fetcher_plugin.rs │ │ ├── lib.rs │ │ ├── scene_handle.rs │ │ ├── scene_object.rs │ │ ├── scene_object_shared.rs │ │ ├── sound.rs │ │ ├── sound_handle.rs │ │ ├── sound_listener.rs │ │ ├── sound_listener_handle.rs │ │ ├── sound_mt.rs │ │ ├── sound_mt_types.rs │ │ ├── sound_object.rs │ │ ├── sound_object_shared.rs │ │ ├── sound_play_handle.rs │ │ ├── stream.rs │ │ ├── stream_handle.rs │ │ ├── stream_object.rs │ │ └── types.rs ├── sql │ ├── Cargo.toml │ └── src │ │ ├── database.rs │ │ └── lib.rs ├── steam │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── runtime.rs │ │ ├── stub.rs │ │ └── traits.rs ├── ui-base │ ├── Cargo.toml │ └── src │ │ ├── better_frame.rs │ │ ├── components │ │ ├── clearable_edit_field.rs │ │ ├── edit_text.rs │ │ ├── menu_top_button.rs │ │ └── mod.rs │ │ ├── custom_callback.rs │ │ ├── font_data.rs │ │ ├── lib.rs │ │ ├── remember_mut.rs │ │ ├── style.rs │ │ ├── types.rs │ │ ├── ui.rs │ │ ├── ui_render.rs │ │ └── utils.rs ├── ui-generic │ ├── Cargo.toml │ └── src │ │ ├── generic_ui_renderer.rs │ │ ├── lib.rs │ │ └── traits.rs ├── ui-wasm-manager │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── wasm-logic-db │ ├── Cargo.toml │ └── src │ │ ├── db.rs │ │ └── lib.rs ├── wasm-logic-fs │ ├── Cargo.toml │ └── src │ │ ├── fs.rs │ │ └── lib.rs ├── wasm-logic-graphics │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── wasm-logic-http │ ├── Cargo.toml │ └── src │ │ ├── http.rs │ │ └── lib.rs ├── wasm-logic-sound │ ├── Cargo.toml │ └── src │ │ ├── checker.rs │ │ ├── lib.rs │ │ └── sound.rs ├── wasm-runtime-types │ ├── Cargo.toml │ └── src │ │ └── lib.rs └── wasm-runtime │ ├── Cargo.toml │ └── src │ └── lib.rs ├── manifest.yaml ├── src ├── assets-server │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── delete.rs │ │ ├── index_dir.rs │ │ ├── main.rs │ │ ├── upload.rs │ │ └── upload │ │ └── verify.rs ├── client │ ├── client.rs │ ├── game.rs │ ├── game │ │ ├── active.rs │ │ ├── data.rs │ │ └── types.rs │ ├── game_events.rs │ ├── input │ │ ├── input_handling.rs │ │ └── mod.rs │ ├── localplayer │ │ ├── dummy_control.rs │ │ └── mod.rs │ ├── mod.rs │ ├── overlays │ │ ├── client_stats.rs │ │ └── mod.rs │ ├── spatial_chat │ │ ├── mod.rs │ │ └── spatial_chat.rs │ └── ui │ │ ├── mod.rs │ │ └── pages │ │ ├── connect_password.rs │ │ ├── editor │ │ ├── mod.rs │ │ └── tee.rs │ │ ├── legacy_warning.rs │ │ ├── loading.rs │ │ ├── mod.rs │ │ ├── not_found.rs │ │ └── test.rs ├── community-register-server │ ├── Cargo.toml │ └── src │ │ └── main.rs ├── community-server │ ├── Cargo.toml │ └── src │ │ ├── main.rs │ │ ├── queries │ │ ├── add_friend.rs │ │ ├── mod.rs │ │ ├── mysql │ │ │ ├── add_friend.sql │ │ │ └── friend_list.sql │ │ └── setup.rs │ │ └── server.rs ├── dilate │ ├── Cargo.toml │ └── src │ │ └── main.rs ├── editor-server │ ├── Cargo.toml │ └── src │ │ └── main.rs ├── emoticon-convert │ ├── Cargo.toml │ └── src │ │ └── main.rs ├── extra-convert │ ├── Cargo.toml │ └── src │ │ └── main.rs ├── game-convert │ ├── Cargo.toml │ └── src │ │ └── main.rs ├── hud-convert │ ├── Cargo.toml │ └── src │ │ └── main.rs ├── lib.rs ├── map-convert │ ├── Cargo.toml │ └── src │ │ └── main.rs ├── master-server │ ├── Cargo.toml │ └── src │ │ └── main.rs ├── part-convert │ ├── Cargo.toml │ └── src │ │ └── main.rs ├── server │ ├── Cargo.toml │ └── src │ │ └── main.rs ├── skin-convert │ ├── Cargo.toml │ └── src │ │ └── main.rs └── tests │ ├── actionfeed.rs │ ├── base.rs │ ├── chat.rs │ ├── emote_wheel.rs │ ├── hud.rs │ ├── ingame.rs │ ├── mod.rs │ ├── motd.rs │ ├── scoreboard.rs │ ├── screenshot.rs │ ├── screenshots.rs │ ├── spectator_selection.rs │ ├── utils.rs │ └── vote.rs └── tests ├── hiarc_tests ├── compile-fail │ ├── macro_fail.rs │ ├── macro_fail.stderr │ ├── safe_rc.rs │ ├── safe_rc.stderr │ ├── safe_rc_return.rs │ └── safe_rc_return.stderr ├── macro_tests.rs └── mod.rs └── integration_test.rs /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [target.'cfg(target_env = "msvc")'] 2 | rustflags = ["-C", "target-feature=+crt-static"] 3 | 4 | [target.x86_64-pc-windows-gnu] 5 | rustflags = [ "-C", "link-arg=-lssp" ] 6 | 7 | [target.i686-pc-windows-gnu] 8 | rustflags = [ "-C", "link-arg=-lssp" ] 9 | 10 | [target.aarch64-linux-android] 11 | rustflags = [ 12 | "-C", "link-arg=-lc++_static", 13 | "-C", "link-arg=-lc++abi", 14 | "-C", "link-arg=-lstdc++" 15 | ] 16 | 17 | [target.'cfg(target_arch = "wasm32")'] 18 | rustflags = [ 19 | "-C", "target-feature=+simd128" 20 | ] 21 | -------------------------------------------------------------------------------- /.ci/build_individually.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | build() { 4 | find $1 -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | while read dir; do echo "Building package: $dir"; cargo clippy -p "$dir"; done 5 | } 6 | build lib 7 | build game 8 | build examples/wasm-modules 9 | build examples/lib-modules 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/blank_issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Blank Issue 3 | about: Create a blank issue. 4 | --- 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Questions (discord) 4 | url: https://ddnet.org/discord 5 | about: Please ask questions in our official discord. 6 | - name: Feature requests, refactors & concepts 7 | url: https://github.com/ddnet/ddnet-rs-rfc 8 | about: Please use our rfc repository for feature requests, concepts or bigger refactors. You can also discuss such things in our chat rooms (discord etc.) 9 | - name: Questions (Matrix & IRC) 10 | url: https://matrix.to/#/#ddnet:ddnet.org 11 | about: 'Please ask questions in our official Matrix space. Or on irc #ddnet. It''s bridged to discord.' 12 | 13 | 14 | -------------------------------------------------------------------------------- /.github/workflows/format.yml: -------------------------------------------------------------------------------- 1 | name: Check-Format 2 | 3 | on: 4 | push: 5 | branches-ignore: 6 | - gh-readonly-queue/** 7 | pull_request: 8 | merge_group: 9 | 10 | jobs: 11 | build: 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | os: [ubuntu-latest] 16 | include: 17 | - os: ubuntu-latest 18 | runs-on: ${{ matrix.os }} 19 | steps: 20 | - uses: actions/checkout@v4 21 | with: 22 | submodules: true 23 | - run: | 24 | rustup toolchain install stable --profile minimal 25 | rustup component add rustfmt 26 | 27 | - name: Check format 28 | run: | 29 | shopt -s globstar 30 | rustfmt --edition=2021 --check **/**.rs 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ 2 | .vscode/ 3 | .cache/ 4 | target/ 5 | artifacts/ 6 | *.sqlite 7 | # artifact for memory analysis feature 8 | /trace.txt 9 | /flamegraph.svg 10 | /perf.data* 11 | /callgrind.out.* 12 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "data"] 2 | path = data 3 | url = https://github.com/ddnet/ddnet-rs-data 4 | shallow = true 5 | 6 | [submodule "misc"] 7 | path = misc 8 | url = https://github.com/ddnet/ddnet-rs-misc 9 | shallow = true 10 | -------------------------------------------------------------------------------- /examples/lib-modules/editor-lib/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "editor-lib" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | editor = { path = "../../../game/editor" } 8 | config = { path = "../../../lib/config" } 9 | graphics = { path = "../../../lib/graphics" } 10 | sound = { path = "../../../lib/sound" } 11 | base-io = { path = "../../../lib/base-io" } 12 | rayon = "1.10.0" 13 | once_cell = "1.21.3" 14 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 15 | 16 | [lib] 17 | crate-type = ["cdylib"] 18 | -------------------------------------------------------------------------------- /examples/wasm-modules/actionfeed/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "actionfeed" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | math = { path = "../../../lib/math" } 8 | api = { path = "../../../lib/api" } 9 | api-ui = { path = "../../../lib/api-ui" } 10 | graphics = { path = "../../../lib/graphics" } 11 | ui-base = { path = "../../../lib/ui-base" } 12 | ui-generic = { path = "../../../lib/ui-generic" } 13 | 14 | api-ui-game = { path = "../../../game/api-ui-game" } 15 | client-ui = { path = "../../../game/client-ui" } 16 | client-render-base = { path = "../../../game/client-render-base" } 17 | client-types = { path = "../../../game/client-types" } 18 | client-containers = { path = "../../../game/client-containers" } 19 | game-interface = { path = "../../../game/game-interface" } 20 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 21 | num-traits = "0.2.19" 22 | 23 | [lib] 24 | crate-type = ["cdylib"] 25 | -------------------------------------------------------------------------------- /examples/wasm-modules/actionfeed/src/actionfeed/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod page; 2 | -------------------------------------------------------------------------------- /examples/wasm-modules/actionfeed/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![warn(unused)] 2 | 3 | pub mod actionfeed; 4 | 5 | use api::GRAPHICS; 6 | use ui_generic::traits::UiPageInterface; 7 | 8 | pub use api_ui::ui_impl::*; 9 | pub use api_ui_game::render::*; 10 | 11 | #[no_mangle] 12 | fn mod_ui_new() -> Box> { 13 | Box::new(actionfeed::page::ActionfeedPage::new( 14 | &GRAPHICS.with(|g| (*g).clone()), 15 | )) 16 | } 17 | -------------------------------------------------------------------------------- /examples/wasm-modules/auto-mapper/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "auto-mapper" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | math = { path = "../../../lib/math" } 8 | api = { path = "../../../lib/api" } 9 | 10 | api-auto-mapper = { path = "../../../game/api-auto-mapper" } 11 | editor-interface = { path = "../../../game/editor-interface" } 12 | 13 | log = "0.4.27" 14 | rustc-hash = "2.1.1" 15 | 16 | [lib] 17 | crate-type = ["cdylib"] 18 | -------------------------------------------------------------------------------- /examples/wasm-modules/chat/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "chat" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | math = { path = "../../../lib/math" } 8 | api = { path = "../../../lib/api" } 9 | api-ui = { path = "../../../lib/api-ui" } 10 | graphics = { path = "../../../lib/graphics" } 11 | ui-base = { path = "../../../lib/ui-base" } 12 | ui-generic = { path = "../../../lib/ui-generic" } 13 | 14 | api-ui-game = { path = "../../../game/api-ui-game" } 15 | client-ui = { path = "../../../game/client-ui" } 16 | client-render-base = { path = "../../../game/client-render-base" } 17 | client-types = { path = "../../../game/client-types" } 18 | client-containers = { path = "../../../game/client-containers" } 19 | game-interface = { path = "../../../game/game-interface" } 20 | game-base = { path = "../../../game/game-base" } 21 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 22 | 23 | [lib] 24 | crate-type = ["cdylib"] 25 | -------------------------------------------------------------------------------- /examples/wasm-modules/chat/src/chat/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod page; 2 | -------------------------------------------------------------------------------- /examples/wasm-modules/chat/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![warn(unused)] 2 | 3 | pub mod chat; 4 | 5 | use api::GRAPHICS; 6 | use ui_generic::traits::UiPageInterface; 7 | 8 | pub use api_ui::ui_impl::*; 9 | pub use api_ui_game::render::*; 10 | 11 | #[no_mangle] 12 | fn mod_ui_new() -> Box> { 13 | Box::new(chat::page::ChatPage::new(&GRAPHICS.with(|g| (*g).clone()))) 14 | } 15 | -------------------------------------------------------------------------------- /examples/wasm-modules/connecting/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "connecting" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | api-ui = { path = "../../../lib/api-ui" } 8 | ui-base = { path = "../../../lib/ui-base" } 9 | ui-generic = { path = "../../../lib/ui-generic" } 10 | api-ui-game = { path = "../../../game/api-ui-game" } 11 | client-ui = { path = "../../../game/client-ui" } 12 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 13 | 14 | [lib] 15 | crate-type = ["cdylib"] 16 | -------------------------------------------------------------------------------- /examples/wasm-modules/connecting/src/connecting/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod page; 2 | -------------------------------------------------------------------------------- /examples/wasm-modules/connecting/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod connecting; 2 | 3 | use ui_generic::traits::UiPageInterface; 4 | 5 | pub use api_ui::ui_impl::*; 6 | pub use api_ui_game::render::*; 7 | 8 | #[no_mangle] 9 | fn mod_ui_new() -> Box> { 10 | Box::new(connecting::page::Connecting::new()) 11 | } 12 | -------------------------------------------------------------------------------- /examples/wasm-modules/console/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "console" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | api = { path = "../../../lib/api" } 8 | api-ui = { path = "../../../lib/api-ui" } 9 | graphics = { path = "../../../lib/graphics" } 10 | ui-base = { path = "../../../lib/ui-base" } 11 | ui-generic = { path = "../../../lib/ui-generic" } 12 | api-ui-game = { path = "../../../game/api-ui-game" } 13 | client-ui = { path = "../../../game/client-ui" } 14 | client-render-base = { path = "../../../game/client-render-base" } 15 | client-types = { path = "../../../game/client-types" } 16 | client-containers = { path = "../../../game/client-containers" } 17 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 18 | 19 | [lib] 20 | crate-type = ["cdylib"] 21 | -------------------------------------------------------------------------------- /examples/wasm-modules/console/src/console/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod page; 2 | -------------------------------------------------------------------------------- /examples/wasm-modules/console/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod console; 2 | 3 | use api::GRAPHICS; 4 | use ui_generic::traits::UiPageInterface; 5 | 6 | pub use api_ui::ui_impl::*; 7 | pub use api_ui_game::render::*; 8 | 9 | #[no_mangle] 10 | fn mod_ui_new() -> Box> { 11 | GRAPHICS.with(|g| Box::new(console::page::Console::new(g))) 12 | } 13 | -------------------------------------------------------------------------------- /examples/wasm-modules/demo_player/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "demo_player" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | api = { path = "../../../lib/api" } 8 | api-ui = { path = "../../../lib/api-ui" } 9 | graphics = { path = "../../../lib/graphics" } 10 | ui-base = { path = "../../../lib/ui-base" } 11 | ui-generic = { path = "../../../lib/ui-generic" } 12 | 13 | api-ui-game = { path = "../../../game/api-ui-game" } 14 | client-ui = { path = "../../../game/client-ui" } 15 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 16 | 17 | [lib] 18 | crate-type = ["cdylib"] 19 | -------------------------------------------------------------------------------- /examples/wasm-modules/demo_player/src/demo_player/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod page; 2 | -------------------------------------------------------------------------------- /examples/wasm-modules/demo_player/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod demo_player; 2 | 3 | use api::GRAPHICS; 4 | use ui_generic::traits::UiPageInterface; 5 | 6 | pub use api_ui::ui_impl::*; 7 | pub use api_ui_game::render::*; 8 | 9 | #[no_mangle] 10 | fn mod_ui_new() -> Box> { 11 | Box::new(demo_player::page::DemoPlayerPage::new( 12 | &GRAPHICS.with(|g| (*g).clone()), 13 | )) 14 | } 15 | -------------------------------------------------------------------------------- /examples/wasm-modules/editor_wasm/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "editor_wasm" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | ui-base = { path = "../../../lib/ui-base" } 8 | api = { path = "../../../lib/api" } 9 | api-editor = { path = "../../../game/api-editor" } 10 | editor = { path = "../../../game/editor" } 11 | 12 | [lib] 13 | crate-type = ["cdylib"] 14 | -------------------------------------------------------------------------------- /examples/wasm-modules/editor_wasm/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub use api::*; 2 | pub use api_editor::*; 3 | use editor::editor::{Editor, EditorInterface}; 4 | use ui_base::font_data::FontDefinitions; 5 | 6 | #[no_mangle] 7 | fn mod_editor_new(font_data: &FontDefinitions) -> Box { 8 | let editor = Editor::new( 9 | &SOUND.with(|g| (*g).clone()), 10 | &GRAPHICS.with(|g| (*g).clone()), 11 | &IO.with(|g| (*g).clone()), 12 | &RUNTIME_THREAD_POOL, 13 | font_data, 14 | ); 15 | Box::new(editor) 16 | } 17 | -------------------------------------------------------------------------------- /examples/wasm-modules/emote_wheel/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "emote_wheel" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | api = { path = "../../../lib/api" } 8 | api-ui = { path = "../../../lib/api-ui" } 9 | graphics = { path = "../../../lib/graphics" } 10 | ui-base = { path = "../../../lib/ui-base" } 11 | ui-generic = { path = "../../../lib/ui-generic" } 12 | api-ui-game = { path = "../../../game/api-ui-game" } 13 | client-ui = { path = "../../../game/client-ui" } 14 | client-render-base = { path = "../../../game/client-render-base" } 15 | client-containers = { path = "../../../game/client-containers" } 16 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 17 | 18 | [lib] 19 | crate-type = ["cdylib"] 20 | -------------------------------------------------------------------------------- /examples/wasm-modules/emote_wheel/src/emote_wheel/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod page; 2 | -------------------------------------------------------------------------------- /examples/wasm-modules/emote_wheel/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod emote_wheel; 2 | 3 | use api::GRAPHICS; 4 | use ui_generic::traits::UiPageInterface; 5 | 6 | pub use api_ui::ui_impl::*; 7 | pub use api_ui_game::render::*; 8 | 9 | #[no_mangle] 10 | fn mod_ui_new() -> Box> { 11 | Box::new(emote_wheel::page::EmoteWheelPage::new( 12 | &GRAPHICS.with(|g| (*g).clone()), 13 | )) 14 | } 15 | -------------------------------------------------------------------------------- /examples/wasm-modules/graphics-mod/src/graphics.rs: -------------------------------------------------------------------------------- 1 | use api_macros::graphics_mod; 2 | 3 | #[graphics_mod("../../../")] 4 | pub mod graphics {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/graphics-mod/src/handles/backend.rs: -------------------------------------------------------------------------------- 1 | use api_macros::handle_backend_mod; 2 | 3 | #[handle_backend_mod("../../../")] 4 | pub mod backend {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/graphics-mod/src/handles/buffer_object.rs: -------------------------------------------------------------------------------- 1 | use api_macros::handle_buffer_object_mod; 2 | 3 | #[handle_buffer_object_mod("../../../")] 4 | pub mod buffer_object {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/graphics-mod/src/handles/canvas.rs: -------------------------------------------------------------------------------- 1 | use api_macros::handle_canvas_mod; 2 | 3 | #[handle_canvas_mod("../../../")] 4 | pub mod canvas {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/graphics-mod/src/handles/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod backend; 2 | pub mod buffer_object; 3 | pub mod canvas; 4 | pub mod quad_container; 5 | pub mod shader_storage; 6 | pub mod stream; 7 | pub mod stream_types { 8 | pub use ::graphics::handles::stream_types::*; 9 | } 10 | pub mod texture; 11 | -------------------------------------------------------------------------------- /examples/wasm-modules/graphics-mod/src/handles/quad_container.rs: -------------------------------------------------------------------------------- 1 | use api_macros::handle_quad_container_mod; 2 | 3 | #[handle_quad_container_mod("../../../")] 4 | pub mod quad_container {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/graphics-mod/src/handles/shader_storage.rs: -------------------------------------------------------------------------------- 1 | use api_macros::handle_shader_storage_mod; 2 | 3 | #[handle_shader_storage_mod("../../../")] 4 | pub mod shader_storage {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/graphics-mod/src/handles/stream.rs: -------------------------------------------------------------------------------- 1 | use api_macros::handle_stream_mod; 2 | 3 | #[handle_stream_mod("../../../")] 4 | pub mod stream {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/graphics-mod/src/handles/texture.rs: -------------------------------------------------------------------------------- 1 | use api_macros::handle_texture_mod; 2 | 3 | #[handle_texture_mod("../../../")] 4 | pub mod texture {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/graphics-mod/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::too_many_arguments)] 2 | 3 | pub mod graphics; 4 | pub mod handles; 5 | 6 | pub mod graphics_mt { 7 | pub use ::graphics::graphics_mt::*; 8 | } 9 | 10 | pub mod quad_container { 11 | pub use ::graphics::quad_container::*; 12 | } 13 | pub mod streaming { 14 | pub use ::graphics::streaming::*; 15 | } 16 | pub mod utils { 17 | pub use ::graphics::utils::*; 18 | } 19 | pub mod window_handling { 20 | pub use ::graphics::window_handling::*; 21 | } 22 | -------------------------------------------------------------------------------- /examples/wasm-modules/hud/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hud" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../../../lib/base" } 8 | api = { path = "../../../lib/api" } 9 | api-ui = { path = "../../../lib/api-ui" } 10 | graphics = { path = "../../../lib/graphics" } 11 | ui-base = { path = "../../../lib/ui-base" } 12 | ui-generic = { path = "../../../lib/ui-generic" } 13 | pool = { path = "../../../lib/pool", features = ["enable_hiarc"] } 14 | 15 | api-ui-game = { path = "../../../game/api-ui-game" } 16 | client-ui = { path = "../../../game/client-ui" } 17 | client-render-base = { path = "../../../game/client-render-base" } 18 | client-containers = { path = "../../../game/client-containers" } 19 | game-interface = { path = "../../../game/game-interface" } 20 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 21 | 22 | [lib] 23 | crate-type = ["cdylib"] 24 | -------------------------------------------------------------------------------- /examples/wasm-modules/hud/src/hud/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod page; 2 | -------------------------------------------------------------------------------- /examples/wasm-modules/hud/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod hud; 2 | 3 | use api::GRAPHICS; 4 | use ui_generic::traits::UiPageInterface; 5 | 6 | pub use api_ui::ui_impl::*; 7 | pub use api_ui_game::render::*; 8 | 9 | #[no_mangle] 10 | fn mod_ui_new() -> Box> { 11 | Box::new(hud::page::HudPage::new(&GRAPHICS.with(|g| (*g).clone()))) 12 | } 13 | -------------------------------------------------------------------------------- /examples/wasm-modules/ingame_menu/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod ingame_menu; 2 | 3 | use api::GRAPHICS; 4 | use ui_generic::traits::UiPageInterface; 5 | 6 | pub use api_ui::ui_impl::*; 7 | pub use api_ui_game::render::*; 8 | 9 | #[no_mangle] 10 | fn mod_ui_new() -> Box> { 11 | Box::new(ingame_menu::page::IngameMenu::new( 12 | &GRAPHICS.with(|g| (*g).clone()), 13 | )) 14 | } 15 | -------------------------------------------------------------------------------- /examples/wasm-modules/mainmenu/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod mainmenu; 2 | 3 | use api::{GRAPHICS, IO}; 4 | use ui_generic::traits::UiPageInterface; 5 | 6 | pub use api_ui::ui_impl::*; 7 | pub use api_ui_game::render::*; 8 | 9 | #[no_mangle] 10 | fn mod_ui_new() -> Box> { 11 | Box::new(mainmenu::page::MainMenu::new( 12 | &GRAPHICS.with(|g| (*g).clone()), 13 | IO.with(|g| (*g).clone()), 14 | )) 15 | } 16 | -------------------------------------------------------------------------------- /examples/wasm-modules/motd/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "motd" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | api-ui = { path = "../../../lib/api-ui" } 8 | ui-base = { path = "../../../lib/ui-base" } 9 | ui-generic = { path = "../../../lib/ui-generic" } 10 | api-ui-game = { path = "../../../game/api-ui-game" } 11 | client-ui = { path = "../../../game/client-ui" } 12 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 13 | 14 | [lib] 15 | crate-type = ["cdylib"] 16 | -------------------------------------------------------------------------------- /examples/wasm-modules/motd/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod motd; 2 | 3 | use ui_generic::traits::UiPageInterface; 4 | 5 | pub use api_ui::ui_impl::*; 6 | pub use api_ui_game::render::*; 7 | 8 | #[no_mangle] 9 | fn mod_ui_new() -> Box> { 10 | Box::new(motd::page::MotdPage::new()) 11 | } 12 | -------------------------------------------------------------------------------- /examples/wasm-modules/motd/src/motd/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod page; 2 | -------------------------------------------------------------------------------- /examples/wasm-modules/prediction_timer_ui/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "prediction_timer_ui" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | math = { path = "../../../lib/math" } 8 | api-ui = { path = "../../../lib/api-ui" } 9 | ui-base = { path = "../../../lib/ui-base" } 10 | ui-generic = { path = "../../../lib/ui-generic" } 11 | 12 | api-ui-game = { path = "../../../game/api-ui-game" } 13 | prediction-timer = { path = "../../../game/prediction-timer" } 14 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 15 | egui_plot = { version = "0.32.1" } 16 | 17 | [lib] 18 | crate-type = ["cdylib"] 19 | -------------------------------------------------------------------------------- /examples/wasm-modules/prediction_timer_ui/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod pred_timer_ui; 2 | 3 | use ui_generic::traits::UiPageInterface; 4 | 5 | pub use api_ui::ui_impl::*; 6 | pub use api_ui_game::render::*; 7 | 8 | #[no_mangle] 9 | fn mod_ui_new() -> Box> { 10 | Box::new(pred_timer_ui::page::PredTimerPage::new()) 11 | } 12 | -------------------------------------------------------------------------------- /examples/wasm-modules/prediction_timer_ui/src/pred_timer_ui/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod page; 2 | pub mod ui; 3 | -------------------------------------------------------------------------------- /examples/wasm-modules/prediction_timer_ui/src/pred_timer_ui/ui/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | pub mod plot; 3 | pub mod settings; 4 | pub mod simulation; 5 | pub mod user_data; 6 | -------------------------------------------------------------------------------- /examples/wasm-modules/prediction_timer_ui/src/pred_timer_ui/ui/settings.rs: -------------------------------------------------------------------------------- 1 | use std::time::Duration; 2 | 3 | use egui::DragValue; 4 | 5 | use super::user_data::SimulationProps; 6 | 7 | pub fn render(ui: &mut egui::Ui, props: &mut SimulationProps) { 8 | ui.label("rtt offset(ms)"); 9 | let mut millis = props.rtt_offset.as_millis() as u64; 10 | ui.add(DragValue::new(&mut millis).update_while_editing(false)); 11 | props.rtt_offset = Duration::from_millis(millis); 12 | 13 | ui.label("rtt half jitter range"); 14 | let mut millis = props.half_rtt_jitter_range.as_millis() as u64; 15 | ui.add(DragValue::new(&mut millis).update_while_editing(false)); 16 | props.half_rtt_jitter_range = Duration::from_millis(millis); 17 | 18 | ui.label("snaps/s"); 19 | ui.add(DragValue::new(&mut props.snaps_per_sec).update_while_editing(false)); 20 | 21 | ui.label("time scale"); 22 | ui.add(DragValue::new(&mut props.time_scale).update_while_editing(false)); 23 | } 24 | -------------------------------------------------------------------------------- /examples/wasm-modules/render-game/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "render-game" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | config = { path = "../../../lib/config" } 8 | api = { path = "../../../lib/api" } 9 | 10 | api-render-game = { path = "../../../game/api-render-game" } 11 | client-render-game = { path = "../../../game/client-render-game" } 12 | 13 | [lib] 14 | crate-type = ["cdylib"] 15 | -------------------------------------------------------------------------------- /examples/wasm-modules/render-game/src/lib.rs: -------------------------------------------------------------------------------- 1 | use std::time::Duration; 2 | 3 | pub use api::*; 4 | pub use api_render_game::*; 5 | use client_render_game::render_game::{RenderGame, RenderGameCreateOptions, RenderGameInterface}; 6 | use config::config::ConfigDebug; 7 | 8 | #[no_mangle] 9 | fn mod_render_game_new( 10 | map_file: Vec, 11 | config: &ConfigDebug, 12 | props: RenderGameCreateOptions, 13 | ) -> Result, String> { 14 | let state = RenderGame::new( 15 | &SOUND.with(|g| (*g).clone()), 16 | &GRAPHICS.with(|g| (*g).clone()), 17 | &IO.with(|g| (*g).clone()), 18 | &RUNTIME_THREAD_POOL, 19 | &Duration::ZERO, 20 | map_file, 21 | config, 22 | props, 23 | )?; 24 | Ok(Box::new(state)) 25 | } 26 | -------------------------------------------------------------------------------- /examples/wasm-modules/scoreboard/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "scoreboard" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../../../lib/base" } 8 | math = { path = "../../../lib/math" } 9 | api = { path = "../../../lib/api" } 10 | api-ui = { path = "../../../lib/api-ui" } 11 | pool = { path = "../../../lib/pool" } 12 | graphics = { path = "../../../lib/graphics" } 13 | ui-base = { path = "../../../lib/ui-base" } 14 | ui-generic = { path = "../../../lib/ui-generic" } 15 | api-ui-game = { path = "../../../game/api-ui-game" } 16 | client-ui = { path = "../../../game/client-ui" } 17 | client-render-base = { path = "../../../game/client-render-base" } 18 | client-containers = { path = "../../../game/client-containers" } 19 | game-interface = { path = "../../../game/game-interface" } 20 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 21 | 22 | [lib] 23 | crate-type = ["cdylib"] 24 | -------------------------------------------------------------------------------- /examples/wasm-modules/scoreboard/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod scoreboard; 2 | 3 | use api::GRAPHICS; 4 | use ui_generic::traits::UiPageInterface; 5 | 6 | pub use api_ui::ui_impl::*; 7 | pub use api_ui_game::render::*; 8 | 9 | #[no_mangle] 10 | fn mod_ui_new() -> Box> { 11 | Box::new(scoreboard::page::Scoreboard::new( 12 | &GRAPHICS.with(|g| (*g).clone()), 13 | )) 14 | } 15 | -------------------------------------------------------------------------------- /examples/wasm-modules/scoreboard/src/scoreboard/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod page; 2 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/collision.rs: -------------------------------------------------------------------------------- 1 | use api_macros::collision_mod; 2 | 3 | #[collision_mod("../../../")] 4 | pub mod collision {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/config.rs: -------------------------------------------------------------------------------- 1 | use api_macros::config_mod; 2 | 3 | #[config_mod("../../../")] 4 | pub mod config {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/entities/character.rs: -------------------------------------------------------------------------------- 1 | pub mod core; 2 | pub mod player; 3 | pub mod pos { 4 | pub use ::vanilla::entities::character::pos::*; 5 | } 6 | pub mod hook { 7 | pub use ::vanilla::entities::character::hook::*; 8 | } 9 | pub mod score { 10 | pub use ::vanilla::entities::character::score::*; 11 | } 12 | 13 | use api_macros::character_mod; 14 | 15 | #[character_mod("../../../")] 16 | pub mod character {} 17 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/entities/character/core.rs: -------------------------------------------------------------------------------- 1 | use api_macros::character_core_mod; 2 | 3 | #[character_core_mod("../../../")] 4 | pub mod character_core { 5 | impl Core { 6 | // half gravity mod 7 | fn get_gravity(collision: &Collision, pos: &vec2) -> f32 { 8 | let tuning = collision.get_tune_at(pos); 9 | tuning.gravity * 0.5 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/entities/character/player.rs: -------------------------------------------------------------------------------- 1 | use api_macros::player_mod; 2 | 3 | #[player_mod("../../../")] 4 | pub mod player {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/entities/entity.rs: -------------------------------------------------------------------------------- 1 | use api_macros::entity_mod; 2 | 3 | #[entity_mod("../../../")] 4 | pub mod entity {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/entities/flag.rs: -------------------------------------------------------------------------------- 1 | use api_macros::flag_mod; 2 | 3 | #[flag_mod("../../../")] 4 | pub mod flag {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/entities/laser.rs: -------------------------------------------------------------------------------- 1 | use api_macros::laser_mod; 2 | 3 | #[laser_mod("../../../")] 4 | pub mod laser {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/entities/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod character; 2 | pub mod entity; 3 | pub mod flag; 4 | pub mod laser; 5 | pub mod pickup; 6 | pub mod projectile; 7 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/entities/pickup.rs: -------------------------------------------------------------------------------- 1 | use api_macros::pickup_mod; 2 | 3 | #[pickup_mod("../../../")] 4 | pub mod pickup {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/entities/projectile.rs: -------------------------------------------------------------------------------- 1 | use api_macros::projectile_mod; 2 | 3 | #[projectile_mod("../../../")] 4 | pub mod projectile {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/events.rs: -------------------------------------------------------------------------------- 1 | use api_macros::events_mod; 2 | 3 | #[events_mod("../../../")] 4 | pub mod events {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/game_objects.rs: -------------------------------------------------------------------------------- 1 | use api_macros::game_objects_mod; 2 | 3 | #[game_objects_mod("../../../")] 4 | pub mod game_objects {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/match_manager.rs: -------------------------------------------------------------------------------- 1 | use api_macros::match_manager_mod; 2 | 3 | #[match_manager_mod("../../../")] 4 | pub mod match_manager {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/match_state.rs: -------------------------------------------------------------------------------- 1 | use api_macros::match_state_mod; 2 | 3 | #[match_state_mod("../../../")] 4 | pub mod match_state {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/simulation_pipe.rs: -------------------------------------------------------------------------------- 1 | use api_macros::simulation_pipe_mod; 2 | 3 | #[simulation_pipe_mod("../../../")] 4 | pub mod simulation_pipe {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/snapshot.rs: -------------------------------------------------------------------------------- 1 | use api_macros::snapshot_mod; 2 | 3 | #[snapshot_mod("../../../")] 4 | pub mod snapshot {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/stage.rs: -------------------------------------------------------------------------------- 1 | use api_macros::stage_mod; 2 | 3 | #[stage_mod("../../../")] 4 | pub mod stage {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/state.rs: -------------------------------------------------------------------------------- 1 | use api_macros::state_mod; 2 | 3 | #[state_mod("../../../")] 4 | pub mod state {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/types.rs: -------------------------------------------------------------------------------- 1 | use api_macros::types_mod; 2 | 3 | #[types_mod("../../../")] 4 | pub mod types {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/weapons/definitions.rs: -------------------------------------------------------------------------------- 1 | use api_macros::weapon_def_mod; 2 | 3 | #[weapon_def_mod("../../../")] 4 | pub mod weapon_def {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/weapons/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod definitions; 2 | -------------------------------------------------------------------------------- /examples/wasm-modules/state/src/world.rs: -------------------------------------------------------------------------------- 1 | use api_macros::world_mod; 2 | 3 | #[world_mod("../../../")] 4 | pub mod world {} 5 | -------------------------------------------------------------------------------- /examples/wasm-modules/ui/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ui" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | api-ui = { path = "../../../lib/api-ui" } 8 | ui-base = { path = "../../../lib/ui-base" } 9 | ui-generic = { path = "../../../lib/ui-generic" } 10 | api-ui-game = { path = "../../../game/api-ui-game" } 11 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 12 | 13 | [lib] 14 | crate-type = ["cdylib"] 15 | -------------------------------------------------------------------------------- /examples/wasm-modules/ui/src/example_page/content/main_frame.rs: -------------------------------------------------------------------------------- 1 | pub fn render(ui: &mut egui::Ui) { 2 | ui.label("it works"); 3 | } 4 | -------------------------------------------------------------------------------- /examples/wasm-modules/ui/src/example_page/content/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | -------------------------------------------------------------------------------- /examples/wasm-modules/ui/src/example_page/main_frame.rs: -------------------------------------------------------------------------------- 1 | pub fn render(ui: &mut egui::Ui) { 2 | super::content::main_frame::render(ui); 3 | } 4 | -------------------------------------------------------------------------------- /examples/wasm-modules/ui/src/example_page/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod content; 2 | pub mod main_frame; 3 | pub mod page; 4 | -------------------------------------------------------------------------------- /examples/wasm-modules/ui/src/example_page/page.rs: -------------------------------------------------------------------------------- 1 | use ui_base::types::{UiRenderPipe, UiState}; 2 | use ui_generic::traits::UiPageInterface; 3 | 4 | pub struct ExamplePage {} 5 | 6 | impl Default for ExamplePage { 7 | fn default() -> Self { 8 | Self::new() 9 | } 10 | } 11 | 12 | impl ExamplePage { 13 | pub fn new() -> Self { 14 | Self {} 15 | } 16 | 17 | fn render_impl(&mut self, ui: &mut egui::Ui) { 18 | super::main_frame::render(ui) 19 | } 20 | } 21 | 22 | impl UiPageInterface<()> for ExamplePage { 23 | fn render(&mut self, ui: &mut egui::Ui, _pipe: &mut UiRenderPipe<()>, _ui_state: &mut UiState) { 24 | self.render_impl(ui) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /examples/wasm-modules/ui/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod example_page; 2 | 3 | use ui_generic::traits::UiPageInterface; 4 | 5 | pub use api_ui::ui_impl::*; 6 | pub use api_ui_game::render::*; 7 | 8 | #[no_mangle] 9 | fn mod_ui_new() -> Box> { 10 | Box::new(example_page::page::ExamplePage::new()) 11 | } 12 | -------------------------------------------------------------------------------- /examples/wasm-modules/vote/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "vote" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | api = { path = "../../../lib/api" } 8 | api-ui = { path = "../../../lib/api-ui" } 9 | graphics = { path = "../../../lib/graphics" } 10 | ui-base = { path = "../../../lib/ui-base" } 11 | ui-generic = { path = "../../../lib/ui-generic" } 12 | 13 | api-ui-game = { path = "../../../game/api-ui-game" } 14 | client-ui = { path = "../../../game/client-ui" } 15 | client-render-base = { path = "../../../game/client-render-base" } 16 | client-containers = { path = "../../../game/client-containers" } 17 | game-interface = { path = "../../../game/game-interface" } 18 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 19 | 20 | [lib] 21 | crate-type = ["cdylib"] 22 | -------------------------------------------------------------------------------- /examples/wasm-modules/vote/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod vote; 2 | 3 | use api::GRAPHICS; 4 | use ui_generic::traits::UiPageInterface; 5 | 6 | pub use api_ui::ui_impl::*; 7 | pub use api_ui_game::render::*; 8 | 9 | #[no_mangle] 10 | fn mod_ui_new() -> Box> { 11 | Box::new(vote::page::VotePage::new(&GRAPHICS.with(|g| (*g).clone()))) 12 | } 13 | -------------------------------------------------------------------------------- /game/api-auto-mapper/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "api-auto-mapper" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | editor-interface = { path = "../editor-interface" } 8 | 9 | api = { path = "../../lib/api" } 10 | api-wasm-macros = { path = "../../lib/api-wasm-macros" } 11 | 12 | once_cell = "1.21.3" 13 | -------------------------------------------------------------------------------- /game/api-editor/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "api-editor" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | editor = { path = "../editor" } 8 | api-wasm-macros = { path = "../../lib/api-wasm-macros" } 9 | api = { path = "../../lib/api" } 10 | graphics-types = { path = "../../lib/graphics-types" } 11 | config = { path = "../../lib/config" } 12 | once_cell = "1.21.3" 13 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 14 | -------------------------------------------------------------------------------- /game/api-render-game/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "api-render-game" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | client-render-game = { path = "../client-render-game" } 8 | game-config = { path = "../game-config" } 9 | game-interface = { path = "../game-interface" } 10 | api-wasm-macros = { path = "../../lib/api-wasm-macros" } 11 | api = { path = "../../lib/api" } 12 | graphics-types = { path = "../../lib/graphics-types" } 13 | config = { path = "../../lib/config" } 14 | 15 | once_cell = "1.21.3" 16 | -------------------------------------------------------------------------------- /game/api-state/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "api-state" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | game-interface = { path = "../game-interface" } 8 | 9 | base = { path = "../../lib/base" } 10 | base-io = { path = "../../lib/base-io" } 11 | api-wasm-macros = { path = "../../lib/api-wasm-macros" } 12 | api = { path = "../../lib/api" } 13 | math = { path = "../../lib/math" } 14 | pool = { path = "../../lib/pool" } 15 | game-database = { path = "../../lib/game-database" } 16 | 17 | once_cell = "1.21.3" 18 | -------------------------------------------------------------------------------- /game/api-ui-game/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "api-ui-game" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | api = { path = "../../lib/api" } 8 | 9 | client-containers = { path = "../../game/client-containers" } 10 | -------------------------------------------------------------------------------- /game/api-ui-game/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod render; 2 | -------------------------------------------------------------------------------- /game/assets-base/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "assets-base" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../../lib/base" } 8 | hiarc = { path = "../../lib/hiarc", features = ["derive", "enable_chrono", "enable_serde_json"] } 9 | 10 | serde = { version = "1.0.219", features = ["derive"] } 11 | serde_json = "1.0.140" 12 | chrono = { version = "0.4.41", default-features = false, features = ["serde"] } 13 | anyhow = { version = "1.0.98", features = ["backtrace"] } 14 | tar = "0.4.44" 15 | rustc-hash = "2.1.1" 16 | symphonia = { version = "0.5.4", default-features = false, features = ["ogg", "vorbis"] } 17 | -------------------------------------------------------------------------------- /game/assets-base/src/verify.rs: -------------------------------------------------------------------------------- 1 | pub mod ogg_vorbis; 2 | pub mod txt; 3 | -------------------------------------------------------------------------------- /game/binds/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "binds" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | game-interface = { path = "../game-interface" } 8 | client-types = { path = "../client-types" } 9 | 10 | hiarc = { path = "../../lib/hiarc" } 11 | input-binds = { path = "../../lib/input-binds" } 12 | command-parser = { path = "../../lib/command-parser" } 13 | 14 | serde_json = "1.0.140" 15 | anyhow = { version = "1.0.98", features = ["backtrace"] } 16 | log = "0.4.27" 17 | -------------------------------------------------------------------------------- /game/binds/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod binds; 2 | -------------------------------------------------------------------------------- /game/client-accounts/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "client-accounts" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base-io = { path = "../../lib/base-io" } 8 | steam = { path = "../../lib/steam" } 9 | 10 | client-ui = { path = "../client-ui" } 11 | http-accounts = { path = "../http-accounts" } 12 | 13 | ddnet-accounts-shared = { version = "0.2.0" } 14 | ddnet-account-client-http-fs = { version = "0.3.0" } 15 | async-trait = "0.1.88" 16 | url = { version = "2.5.4", features = ["serde"] } 17 | anyhow = { version = "1.0.98", features = ["backtrace"] } 18 | email_address = { version = "0.2.9", features = ["serde"] } 19 | chrono = { version = "0.4.41" } 20 | serde_json = "1.0.140" 21 | -------------------------------------------------------------------------------- /game/client-accounts/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod accounts; 2 | -------------------------------------------------------------------------------- /game/client-console/src/console/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod console; 2 | pub mod local_console; 3 | pub mod remote_console; 4 | -------------------------------------------------------------------------------- /game/client-console/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::module_inception)] 2 | pub mod console; 3 | -------------------------------------------------------------------------------- /game/client-containers/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::identity_op)] 2 | #![allow(clippy::too_many_arguments)] 3 | 4 | pub mod container; 5 | pub mod ctf; 6 | pub mod emoticons; 7 | pub mod entities; 8 | pub mod flags; 9 | pub mod freezes; 10 | pub mod game; 11 | pub mod hooks; 12 | pub mod hud; 13 | pub mod ninja; 14 | pub mod particles; 15 | pub mod skins; 16 | pub mod utils; 17 | pub mod weapons; 18 | -------------------------------------------------------------------------------- /game/client-demo/src/ui/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod render; 2 | -------------------------------------------------------------------------------- /game/client-extra/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "client-extra" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | anyhow = { version = "1.0.98", features = ["backtrace"] } 10 | -------------------------------------------------------------------------------- /game/client-extra/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::erasing_op)] 2 | #![allow(clippy::identity_op)] 3 | pub mod ddrace_hud_split; 4 | pub mod emoticon_split; 5 | pub mod extra_split; 6 | pub mod game_split; 7 | pub mod particles_split; 8 | pub mod skin_split; 9 | -------------------------------------------------------------------------------- /game/client-ghost/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "client-ghost" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base-io = { path = "../../lib/base-io" } 8 | base-io-traits = { path = "../../lib/base-io-traits" } 9 | base = { path = "../../lib/base" } 10 | config = { path = "../../lib/config" } 11 | graphics = { path = "../../lib/graphics" } 12 | graphics-backend = { path = "../../lib/graphics-backend" } 13 | pool = { path = "../../lib/pool" } 14 | ui-base = { path = "../../lib/ui-base" } 15 | sound = { path = "../../lib/sound" } 16 | sound-backend = { path = "../../lib/sound-backend" } 17 | 18 | client-demo = { path = "../client-demo", default-features = false } 19 | game-config = { path = "../game-config" } 20 | client-render-game = { path = "../client-render-game" } 21 | game-interface = { path = "../game-interface" } 22 | rayon = "1.10.0" 23 | 24 | log = "0.4.27" 25 | -------------------------------------------------------------------------------- /game/client-map/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::too_many_arguments)] 2 | 3 | pub mod client_map; 4 | -------------------------------------------------------------------------------- /game/client-notifications/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "client-notifications" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../../lib/base" } 8 | ui-base = { path = "../../lib/ui-base" } 9 | ui-generic = { path = "../../lib/ui-generic" } 10 | graphics = { path = "../../lib/graphics" } 11 | 12 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 13 | egui-notify = "0.19.0" 14 | -------------------------------------------------------------------------------- /game/client-notifications/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod overlay; 2 | -------------------------------------------------------------------------------- /game/client-render-base/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::too_many_arguments)] 2 | #![allow(clippy::module_inception)] 3 | pub mod map; 4 | pub mod render; 5 | -------------------------------------------------------------------------------- /game/client-render-base/src/map/map_image.rs: -------------------------------------------------------------------------------- 1 | use graphics_types::types::GraphicsBackendMemory; 2 | use hiarc::Hiarc; 3 | use sound::sound_mt_types::SoundBackendMemory; 4 | 5 | #[derive(Debug, Hiarc)] 6 | pub struct ClientMapImageLoading { 7 | pub width: u32, 8 | pub height: u32, 9 | pub depth: u32, 10 | pub mem: GraphicsBackendMemory, 11 | pub name: String, 12 | } 13 | 14 | #[derive(Debug, Hiarc)] 15 | pub struct ClientMapSoundLoading { 16 | pub mem: SoundBackendMemory, 17 | } 18 | 19 | #[derive(Debug, Hiarc, Default)] 20 | pub struct ClientMapImagesLoading { 21 | pub images: Vec, 22 | pub images_2d_array: Vec, 23 | } 24 | 25 | pub type ClientMapSoundsLoading = Vec; 26 | -------------------------------------------------------------------------------- /game/client-render-base/src/map/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod map_buffered; 2 | 3 | pub mod map; 4 | pub mod map_image; 5 | pub mod map_pipeline; 6 | pub mod map_sound; 7 | pub mod map_with_visual; 8 | pub mod render_map_base; 9 | pub mod render_pipe; 10 | pub mod render_tools; 11 | -------------------------------------------------------------------------------- /game/client-render-base/src/render/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod animation; 2 | pub mod canvas_mapping; 3 | pub mod default_anim; 4 | pub mod effects; 5 | pub mod particle; 6 | pub mod particle_manager; 7 | pub mod tee; 8 | pub mod toolkit; 9 | pub mod weapons; 10 | -------------------------------------------------------------------------------- /game/client-render-game/src/components/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod cursor; 2 | pub mod game_objects; 3 | pub mod hud; 4 | pub mod players; 5 | -------------------------------------------------------------------------------- /game/client-render-game/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::too_many_arguments)] 2 | 3 | pub mod components; 4 | pub mod render_game; 5 | -------------------------------------------------------------------------------- /game/client-render/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "client-render" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../../lib/base" } 8 | graphics-types = { path = "../../lib/graphics-types" } 9 | graphics = { path = "../../lib/graphics" } 10 | ui-base = { path = "../../lib/ui-base" } 11 | ui-generic = { path = "../../lib/ui-generic" } 12 | math = { path = "../../lib/math" } 13 | 14 | game-interface = { path = "../game-interface" } 15 | game-base = { path = "../game-base" } 16 | client-ui = { path = "../client-ui" } 17 | client-render-base = { path = "../client-render-base" } 18 | client-types = { path = "../client-types" } 19 | client-containers = { path = "../client-containers" } 20 | 21 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 22 | serde = { version = "1.0.219", features = ["derive"] } 23 | -------------------------------------------------------------------------------- /game/client-render/src/actionfeed/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod render; 2 | -------------------------------------------------------------------------------- /game/client-render/src/chat/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod render; 2 | -------------------------------------------------------------------------------- /game/client-render/src/emote_wheel/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod render; 2 | -------------------------------------------------------------------------------- /game/client-render/src/emoticons/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod render; 2 | -------------------------------------------------------------------------------- /game/client-render/src/hud/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod page; 2 | -------------------------------------------------------------------------------- /game/client-render/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::too_many_arguments)] 2 | 3 | pub mod actionfeed; 4 | pub mod chat; 5 | pub mod emote_wheel; 6 | pub mod emoticons; 7 | pub mod hud; 8 | pub mod motd; 9 | pub mod nameplates; 10 | pub mod scoreboard; 11 | pub mod spectator_selection; 12 | pub mod vote; 13 | -------------------------------------------------------------------------------- /game/client-render/src/motd/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod page; 2 | -------------------------------------------------------------------------------- /game/client-render/src/nameplates/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod render; 2 | -------------------------------------------------------------------------------- /game/client-render/src/scoreboard/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod render; 2 | pub mod types; 3 | -------------------------------------------------------------------------------- /game/client-render/src/scoreboard/types.rs: -------------------------------------------------------------------------------- 1 | pub struct ScoreboardEntry { 2 | pub score: i64, 3 | pub name: String, 4 | pub clan: String, 5 | pub ping: u32, 6 | } 7 | -------------------------------------------------------------------------------- /game/client-render/src/spectator_selection/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod page; 2 | -------------------------------------------------------------------------------- /game/client-render/src/vote/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod render; 2 | -------------------------------------------------------------------------------- /game/client-replay/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "client-replay" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base-io = { path = "../../lib/base-io" } 8 | 9 | client-demo = { path = "../client-demo", default-features = false } 10 | demo = { path = "../demo", features = ["recorder"] } 11 | game-interface = { path = "../game-interface" } 12 | 13 | rayon = "1.10.0" 14 | anyhow = { version = "1.0.98", features = ["backtrace"] } 15 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 16 | -------------------------------------------------------------------------------- /game/client-replay/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod replay; 2 | -------------------------------------------------------------------------------- /game/client-types/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "client-types" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../../lib/base" } 8 | config = { path = "../../lib/config" } 9 | hiarc = { path = "../../lib/hiarc" } 10 | game-base = { path = "../game-base" } 11 | game-config = { path = "../game-config" } 12 | game-interface = { path = "../game-interface" } 13 | 14 | command-parser = { path = "../../lib/command-parser" } 15 | 16 | serde = { version = "1.0.219", features = ["derive"] } 17 | anyhow = { version = "1.0.98", features = ["backtrace"] } 18 | -------------------------------------------------------------------------------- /game/client-types/src/cert.rs: -------------------------------------------------------------------------------- 1 | use base::hash::Hash; 2 | use hiarc::Hiarc; 3 | 4 | #[derive(Debug, Clone, Hiarc)] 5 | pub enum ServerCertMode { 6 | Cert(Vec), 7 | Hash(Hash), 8 | /// The game will try to get the mode automatically 9 | Unknown, 10 | } 11 | -------------------------------------------------------------------------------- /game/client-types/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod actionfeed; 2 | pub mod cert; 3 | pub mod chat; 4 | pub mod console; 5 | -------------------------------------------------------------------------------- /game/client-ui/src/actionfeed/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod feed_list; 2 | pub mod kill_entry; 3 | pub mod main_frame; 4 | pub mod page; 5 | pub mod race_finish_entry; 6 | pub mod shared; 7 | pub mod user_data; 8 | -------------------------------------------------------------------------------- /game/client-ui/src/actionfeed/page.rs: -------------------------------------------------------------------------------- 1 | use ui_base::types::{UiRenderPipe, UiState}; 2 | use ui_generic::traits::UiPageInterface; 3 | 4 | use super::{main_frame, user_data::UserData}; 5 | 6 | pub struct ActionFeedUi {} 7 | 8 | impl Default for ActionFeedUi { 9 | fn default() -> Self { 10 | Self::new() 11 | } 12 | } 13 | 14 | impl ActionFeedUi { 15 | pub fn new() -> Self { 16 | Self {} 17 | } 18 | } 19 | 20 | impl UiPageInterface> for ActionFeedUi { 21 | fn render( 22 | &mut self, 23 | ui: &mut egui::Ui, 24 | pipe: &mut UiRenderPipe, 25 | ui_state: &mut UiState, 26 | ) { 27 | main_frame::render(ui, pipe, ui_state) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /game/client-ui/src/actionfeed/shared.rs: -------------------------------------------------------------------------------- 1 | use egui::{epaint::Shadow, Color32, Stroke}; 2 | 3 | pub fn entry_frame(ui: &mut egui::Ui, f: impl FnOnce(&mut egui::Ui)) { 4 | let color_frame = Color32::from_rgba_unmultiplied(0, 0, 0, 15); 5 | 6 | let style = ui.style(); 7 | egui::Frame::group(style) 8 | .fill(color_frame) 9 | .stroke(Stroke::NONE) 10 | .shadow(Shadow { 11 | color: style.visuals.window_shadow.color, 12 | spread: (style.spacing.item_spacing.y / 2.0) as u8, 13 | blur: 5, 14 | ..Default::default() 15 | }) 16 | .show(ui, f); 17 | } 18 | -------------------------------------------------------------------------------- /game/client-ui/src/chat/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod chat_entry; 2 | pub mod chat_list; 3 | pub mod input; 4 | pub mod main_frame; 5 | pub mod page; 6 | pub mod shared; 7 | pub mod system_entry; 8 | pub mod user_data; 9 | -------------------------------------------------------------------------------- /game/client-ui/src/chat/page.rs: -------------------------------------------------------------------------------- 1 | use ui_base::types::{UiRenderPipe, UiState}; 2 | use ui_generic::traits::UiPageInterface; 3 | 4 | use super::{main_frame, user_data::UserData}; 5 | 6 | pub struct ChatUi {} 7 | 8 | impl Default for ChatUi { 9 | fn default() -> Self { 10 | Self::new() 11 | } 12 | } 13 | 14 | impl ChatUi { 15 | pub fn new() -> Self { 16 | Self {} 17 | } 18 | } 19 | 20 | impl UiPageInterface> for ChatUi { 21 | fn render( 22 | &mut self, 23 | ui: &mut egui::Ui, 24 | pipe: &mut UiRenderPipe, 25 | ui_state: &mut UiState, 26 | ) { 27 | main_frame::render(ui, pipe, ui_state) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /game/client-ui/src/chat/shared.rs: -------------------------------------------------------------------------------- 1 | use egui::{epaint::Shadow, Color32, Stroke}; 2 | 3 | /// Since egui's frame's inner margin makes trouble, 4 | /// use this instead. 5 | pub const MARGIN: f32 = 5.0; 6 | pub const TEE_SIZE: f32 = 25.0; 7 | pub const MARGIN_FROM_TEE: f32 = 5.0; 8 | pub fn entry_frame(ui: &mut egui::Ui, stroke: Stroke, f: impl FnOnce(&mut egui::Ui)) { 9 | let color_frame = Color32::from_rgba_unmultiplied(0, 0, 0, 15); 10 | 11 | let style = ui.style(); 12 | egui::Frame::default() 13 | .fill(color_frame) 14 | .stroke(stroke) 15 | .corner_radius(5.0) 16 | .shadow(Shadow { 17 | color: style.visuals.window_shadow.color, 18 | spread: (style.spacing.item_spacing.y / 2.0) as u8, 19 | blur: 5, 20 | ..Default::default() 21 | }) 22 | .show(ui, f); 23 | } 24 | -------------------------------------------------------------------------------- /game/client-ui/src/connect/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | pub mod page; 3 | pub mod user_data; 4 | -------------------------------------------------------------------------------- /game/client-ui/src/connect/user_data.rs: -------------------------------------------------------------------------------- 1 | use game_base::connecting_log::ConnectingLog; 2 | use game_config::config::Config; 3 | 4 | use crate::events::UiEvents; 5 | 6 | pub struct UserData<'a> { 7 | pub log: &'a ConnectingLog, 8 | pub config: &'a mut Config, 9 | pub events: &'a UiEvents, 10 | } 11 | -------------------------------------------------------------------------------- /game/client-ui/src/console/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod console_list; 2 | pub mod input; 3 | pub mod input_err; 4 | pub mod main_frame; 5 | pub mod page; 6 | pub mod suggestions; 7 | pub mod user_data; 8 | pub mod utils; 9 | -------------------------------------------------------------------------------- /game/client-ui/src/console/page.rs: -------------------------------------------------------------------------------- 1 | use egui::Color32; 2 | use ui_base::types::{UiRenderPipe, UiState}; 3 | use ui_generic::traits::UiPageInterface; 4 | 5 | use super::{main_frame, user_data::UserData}; 6 | 7 | pub struct ConsoleUi { 8 | bg_color: Color32, 9 | } 10 | 11 | impl ConsoleUi { 12 | pub fn new(bg_color: Color32) -> Self { 13 | Self { bg_color } 14 | } 15 | } 16 | 17 | impl<'a> UiPageInterface> for ConsoleUi { 18 | fn render( 19 | &mut self, 20 | ui: &mut egui::Ui, 21 | pipe: &mut UiRenderPipe>, 22 | ui_state: &mut UiState, 23 | ) { 24 | main_frame::render(ui, pipe, ui_state, self.bg_color) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /game/client-ui/src/demo_player/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | pub mod page; 3 | pub mod user_data; 4 | -------------------------------------------------------------------------------- /game/client-ui/src/demo_player/page.rs: -------------------------------------------------------------------------------- 1 | use ui_base::types::{UiRenderPipe, UiState}; 2 | use ui_generic::traits::UiPageInterface; 3 | 4 | use super::{main_frame, user_data::UserData}; 5 | 6 | pub struct DemoPlayerUi {} 7 | 8 | impl Default for DemoPlayerUi { 9 | fn default() -> Self { 10 | Self::new() 11 | } 12 | } 13 | 14 | impl DemoPlayerUi { 15 | pub fn new() -> Self { 16 | Self {} 17 | } 18 | } 19 | 20 | impl UiPageInterface> for DemoPlayerUi { 21 | fn render( 22 | &mut self, 23 | ui: &mut egui::Ui, 24 | pipe: &mut UiRenderPipe, 25 | ui_state: &mut UiState, 26 | ) { 27 | main_frame::render(ui, pipe, ui_state) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /game/client-ui/src/emote_wheel/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | pub mod page; 3 | pub mod user_data; 4 | -------------------------------------------------------------------------------- /game/client-ui/src/emote_wheel/page.rs: -------------------------------------------------------------------------------- 1 | use ui_base::types::{UiRenderPipe, UiState}; 2 | use ui_generic::traits::UiPageInterface; 3 | 4 | use super::{main_frame, user_data::UserData}; 5 | 6 | pub struct EmoteWheelUi {} 7 | 8 | impl Default for EmoteWheelUi { 9 | fn default() -> Self { 10 | Self::new() 11 | } 12 | } 13 | 14 | impl EmoteWheelUi { 15 | pub fn new() -> Self { 16 | Self {} 17 | } 18 | } 19 | 20 | impl UiPageInterface> for EmoteWheelUi { 21 | fn render( 22 | &mut self, 23 | ui: &mut egui::Ui, 24 | pipe: &mut UiRenderPipe, 25 | ui_state: &mut UiState, 26 | ) { 27 | main_frame::render(ui, pipe, ui_state) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /game/client-ui/src/hud/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | pub mod page; 3 | pub mod user_data; 4 | -------------------------------------------------------------------------------- /game/client-ui/src/hud/page.rs: -------------------------------------------------------------------------------- 1 | use ui_base::types::{UiRenderPipe, UiState}; 2 | use ui_generic::traits::UiPageInterface; 3 | 4 | use super::{main_frame, user_data::UserData}; 5 | 6 | pub struct HudUi {} 7 | 8 | impl Default for HudUi { 9 | fn default() -> Self { 10 | Self::new() 11 | } 12 | } 13 | 14 | impl HudUi { 15 | pub fn new() -> Self { 16 | Self {} 17 | } 18 | } 19 | 20 | impl UiPageInterface> for HudUi { 21 | fn render( 22 | &mut self, 23 | ui: &mut egui::Ui, 24 | pipe: &mut UiRenderPipe, 25 | ui_state: &mut UiState, 26 | ) { 27 | main_frame::render(ui, pipe, ui_state) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /game/client-ui/src/ingame_menu/account/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | -------------------------------------------------------------------------------- /game/client-ui/src/ingame_menu/call_vote/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | pub mod map; 3 | pub mod misc; 4 | pub mod players; 5 | -------------------------------------------------------------------------------- /game/client-ui/src/ingame_menu/constants.rs: -------------------------------------------------------------------------------- 1 | pub const INGAME_MENU_UI_PAGE_QUERY: &str = "game"; 2 | pub const INGAME_MENU_VOTE_QUERY: &str = "vote"; 3 | pub const INGAME_MENU_FALLBACK_QUERY: &str = "Server info"; 4 | -------------------------------------------------------------------------------- /game/client-ui/src/ingame_menu/game/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | -------------------------------------------------------------------------------- /game/client-ui/src/ingame_menu/ghost.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /game/client-ui/src/ingame_menu/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod account; 2 | pub mod account_info; 3 | pub mod call_vote; 4 | pub mod client_info; 5 | pub mod constants; 6 | pub mod game; 7 | pub mod ghost; 8 | pub mod main_frame; 9 | pub mod page; 10 | pub mod raw_input_info; 11 | pub mod server_info; 12 | pub mod server_players; 13 | pub mod topbar; 14 | pub mod user_data; 15 | pub mod votes; 16 | -------------------------------------------------------------------------------- /game/client-ui/src/ingame_menu/raw_input_info.rs: -------------------------------------------------------------------------------- 1 | use hiarc::{hiarc_safer_rc_refcell, Hiarc}; 2 | 3 | #[derive(Debug, Hiarc, Default, Clone)] 4 | pub struct RawInput { 5 | #[cfg(feature = "binds")] 6 | pub keys: std::collections::HashSet, 7 | } 8 | 9 | #[hiarc_safer_rc_refcell] 10 | #[derive(Debug, Hiarc, Default)] 11 | pub struct RawInputInfo { 12 | raw_input: RawInput, 13 | needs_raw_input: bool, 14 | } 15 | 16 | #[hiarc_safer_rc_refcell] 17 | impl RawInputInfo { 18 | pub fn set_raw_input(&mut self, raw_input: RawInput) { 19 | self.raw_input = raw_input; 20 | } 21 | 22 | pub fn raw_input(&self) -> RawInput { 23 | self.raw_input.clone() 24 | } 25 | 26 | pub fn request_raw_input(&mut self) { 27 | self.needs_raw_input = true; 28 | } 29 | 30 | pub fn wants_raw_input(&mut self) -> bool { 31 | std::mem::take(&mut self.needs_raw_input) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /game/client-ui/src/ingame_menu/server_info/main_frame.rs: -------------------------------------------------------------------------------- 1 | use egui::{Frame, Grid}; 2 | use ui_base::{ 3 | style::bg_frame_color, 4 | types::{UiRenderPipe, UiState}, 5 | utils::get_margin, 6 | }; 7 | 8 | use crate::ingame_menu::user_data::UserData; 9 | 10 | pub fn render(ui: &mut egui::Ui, pipe: &mut UiRenderPipe, ui_state: &mut UiState) { 11 | let res = Frame::default() 12 | .fill(bg_frame_color()) 13 | .corner_radius(5.0) 14 | .inner_margin(get_margin(ui)) 15 | .show(ui, |ui| { 16 | let game_info = pipe.user_data.game_server_info.game_info(); 17 | Grid::new("server-info-grid").num_columns(2).show(ui, |ui| { 18 | ui.label("Map:"); 19 | ui.label(&game_info.map_name); 20 | }); 21 | }); 22 | ui_state.add_blur_rect(res.response.rect, 5.0); 23 | } 24 | -------------------------------------------------------------------------------- /game/client-ui/src/ingame_menu/topbar/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | -------------------------------------------------------------------------------- /game/client-ui/src/ingame_menu/user_data.rs: -------------------------------------------------------------------------------- 1 | use math::math::Rng; 2 | 3 | use crate::{main_menu, thumbnail_container::ThumbnailContainer}; 4 | 5 | use super::{ 6 | account_info::AccountInfo, server_info::GameServerInfo, server_players::ServerPlayers, 7 | votes::Votes, 8 | }; 9 | 10 | pub struct UserData<'a> { 11 | pub browser_menu: crate::main_menu::user_data::UserData<'a>, 12 | pub server_players: &'a ServerPlayers, 13 | pub votes: &'a Votes, 14 | pub game_server_info: &'a GameServerInfo, 15 | pub account_info: &'a AccountInfo, 16 | pub map_vote_thumbnail_container: &'a mut ThumbnailContainer, 17 | pub rng: &'a mut Rng, 18 | } 19 | 20 | impl<'a> AsMut> for UserData<'a> { 21 | fn as_mut(&mut self) -> &mut main_menu::user_data::UserData<'a> { 22 | &mut self.browser_menu 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /game/client-ui/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::too_many_arguments)] 2 | #![allow(clippy::module_inception)] 3 | 4 | pub mod actionfeed; 5 | pub mod chat; 6 | pub mod connect; 7 | pub mod console; 8 | pub mod demo_player; 9 | pub mod emote_wheel; 10 | pub mod events; 11 | pub mod hud; 12 | pub mod ingame_menu; 13 | pub mod main_menu; 14 | pub mod motd; 15 | pub mod scoreboard; 16 | pub mod sort; 17 | pub mod spectator_selection; 18 | pub mod thumbnail_container; 19 | pub mod time_display; 20 | pub mod utils; 21 | pub mod vote; 22 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/constants.rs: -------------------------------------------------------------------------------- 1 | pub const MENU_UI_PAGE_QUERY: &str = "main"; 2 | 3 | pub const MENU_DEMO_NAME: &str = "\u{e131}"; 4 | pub const MENU_SETTINGS_NAME: &str = "\u{f013}"; 5 | pub const MENU_QUIT_NAME: &str = "\u{f011}"; 6 | pub const MENU_PROFILE_NAME: &str = "\u{f007}"; 7 | 8 | pub const MENU_INTERNET_NAME: &str = "\u{f0ac}"; 9 | pub const MENU_LAN_NAME: &str = "\u{f6ff}"; 10 | pub const MENU_FAVORITES_NAME: &str = "\u{f005}"; 11 | pub const MENU_EXPLORE_COMMUNITIES_NAME: &str = "\u{e595}"; 12 | 13 | pub const MENU_COMMUNITY_PREFIX: &str = "internal::community_"; 14 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/content/browser/friend_list/list/frame.rs: -------------------------------------------------------------------------------- 1 | use egui_extras::TableBody; 2 | use game_base::browser_favorite_player::FavoritePlayers; 3 | use ui_base::types::{UiRenderPipe, UiState}; 4 | 5 | use crate::main_menu::user_data::UserData; 6 | 7 | /// server list frame (scrollable) 8 | pub fn render( 9 | body: TableBody<'_>, 10 | pipe: &mut UiRenderPipe, 11 | ui_state: &mut UiState, 12 | favorites: &FavoritePlayers, 13 | ) { 14 | body.rows(25.0, favorites.len(), |row| { 15 | let row_index = row.index(); 16 | 17 | let favorite = &favorites[row_index]; 18 | 19 | super::entry::render(row, pipe, ui_state, favorite); 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/content/browser/friend_list/list/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod entry; 2 | pub mod frame; 3 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/content/browser/friend_list/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod list; 2 | pub mod main_frame; 3 | pub mod table; 4 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/content/browser/info_panel/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | pub mod player_list; 3 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/content/browser/info_panel/player_list/list/frame.rs: -------------------------------------------------------------------------------- 1 | use egui::Rect; 2 | use egui_extras::TableBody; 3 | use game_base::server_browser::ServerBrowserServer; 4 | use ui_base::types::{UiRenderPipe, UiState}; 5 | 6 | use super::entry::EntryData; 7 | 8 | /// server list frame (scrollable) 9 | pub fn render( 10 | body: TableBody<'_>, 11 | full_rect: &Rect, 12 | pipe: &mut UiRenderPipe, 13 | ui_state: &mut UiState, 14 | cur_server: &ServerBrowserServer, 15 | ) { 16 | body.rows(25.0, cur_server.info.players.len(), |row| { 17 | let row_index = row.index(); 18 | let player = &cur_server.info.players[row_index]; 19 | super::entry::render(row, full_rect, pipe, ui_state, player); 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/content/browser/info_panel/player_list/list/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod entry; 2 | pub mod frame; 3 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/content/browser/info_panel/player_list/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod list; 2 | pub mod table; 3 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/content/browser/list/header.rs: -------------------------------------------------------------------------------- 1 | use egui_extras::TableRow; 2 | use game_base::server_browser::{SortDir, TableSort}; 3 | use game_config::config::Config; 4 | 5 | use crate::sort::sortable_header; 6 | 7 | /// table header 8 | pub fn render(header: &mut TableRow<'_, '_>, config: &mut Config) { 9 | let sort: TableSort = config.storage("browser_sort"); 10 | if sort.name.is_empty() { 11 | config.set_storage( 12 | "browser_sort", 13 | &TableSort { 14 | name: "Players".to_string(), 15 | sort_dir: SortDir::Desc, 16 | }, 17 | ); 18 | } 19 | sortable_header( 20 | header, 21 | "browser_sort", 22 | config, 23 | &["", "Name", "Type", "Map", "Players", "Ping"], 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/content/browser/list/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod header; 2 | pub mod list; 3 | pub mod server_list; 4 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/content/browser/list/server_list/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod entry; 2 | pub mod frame; 3 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/content/browser/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod bottom_bar; 2 | pub mod connect_refresh; 3 | pub mod filter; 4 | pub mod friend_list; 5 | pub mod info; 6 | pub mod info_panel; 7 | pub mod list; 8 | pub mod main_frame; 9 | pub mod search; 10 | pub mod server_address; 11 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/content/browser/server_address.rs: -------------------------------------------------------------------------------- 1 | use ui_base::{components::clearable_edit_field::clearable_edit_field, types::UiRenderPipe}; 2 | 3 | use crate::main_menu::user_data::UserData; 4 | 5 | /// server address input field 6 | pub fn render(ui: &mut egui::Ui, pipe: &mut UiRenderPipe) { 7 | ui.horizontal(|ui| { 8 | ui.label("\u{f233} - Address:"); 9 | }); 10 | let mut cur_address: String = pipe.user_data.config.storage::("server-addr"); 11 | if clearable_edit_field(ui, &mut cur_address, Some(200.0), None) 12 | .map(|res| res.changed()) 13 | .unwrap_or_default() 14 | { 15 | pipe.user_data 16 | .config 17 | .set_storage("server-addr", &cur_address); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/content/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod browser; 2 | pub mod main_frame; 3 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/demo/list/header.rs: -------------------------------------------------------------------------------- 1 | use crate::sort::sortable_header; 2 | use egui_extras::TableRow; 3 | use game_config::config::Config; 4 | 5 | /// table header 6 | pub fn render(header: &mut TableRow<'_, '_>, config: &mut Config) { 7 | sortable_header(header, "demo.sort", config, &["", "Name", "Date"]) 8 | } 9 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/demo/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod list; 2 | pub mod main_frame; 3 | pub mod search; 4 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/demo_list.rs: -------------------------------------------------------------------------------- 1 | #[derive(Debug)] 2 | pub enum DemoListEntry { 3 | File { name: String, date: String }, 4 | Directory { name: String }, 5 | } 6 | 7 | pub type DemoList = Vec; 8 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/features.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | 3 | #[derive(Debug, Hiarc, Default, Clone, Copy)] 4 | pub struct EnabledFeatures { 5 | pub demo_to_video: bool, 6 | pub spatial_chat: bool, 7 | } 8 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/leftbar/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod communities; 2 | pub mod constants; 3 | pub mod content; 4 | pub mod ddnet_info; 5 | pub mod demo; 6 | pub mod demo_list; 7 | pub mod features; 8 | pub mod leftbar; 9 | pub mod legacy_server_list; 10 | pub mod main_frame; 11 | pub mod monitors; 12 | pub mod page; 13 | pub mod player_settings_ntfy; 14 | pub mod profile; 15 | pub mod profiles_interface; 16 | pub mod settings; 17 | pub mod spatial_chat; 18 | pub mod theme_container; 19 | pub mod topbar; 20 | pub mod user_data; 21 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/monitors.rs: -------------------------------------------------------------------------------- 1 | use std::rc::Rc; 2 | 3 | use hiarc::{hiarc_safer_rc_refcell, Hiarc}; 4 | 5 | #[derive(Debug, Hiarc)] 6 | pub struct UiMonitorVideoMode { 7 | pub width: u32, 8 | pub height: u32, 9 | pub refresh_rate_mhz: u32, 10 | } 11 | 12 | #[derive(Debug, Hiarc)] 13 | pub struct UiMonitor { 14 | pub name: String, 15 | pub video_modes: Vec, 16 | } 17 | 18 | #[hiarc_safer_rc_refcell] 19 | #[derive(Debug, Hiarc)] 20 | pub struct UiMonitors { 21 | monitors: Rc>, 22 | } 23 | 24 | #[hiarc_safer_rc_refcell] 25 | impl UiMonitors { 26 | pub fn new(monitors: Vec) -> Self { 27 | Self { 28 | monitors: Rc::new(monitors), 29 | } 30 | } 31 | 32 | pub fn monitors(&self) -> Rc> { 33 | self.monitors.clone() 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/profile/account_info_loading.rs: -------------------------------------------------------------------------------- 1 | use egui::Spinner; 2 | 3 | use crate::main_menu::user_data::ProfileTasks; 4 | 5 | use super::back_bar::back_bar; 6 | 7 | /// overview 8 | pub fn render(ui: &mut egui::Ui, tasks: &mut ProfileTasks) { 9 | back_bar(ui, "Account overview", tasks); 10 | 11 | ui.add(Spinner::new()); 12 | } 13 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/profile/account_steam_loading.rs: -------------------------------------------------------------------------------- 1 | use egui::Spinner; 2 | 3 | use crate::main_menu::user_data::ProfileTasks; 4 | 5 | use super::back_bar::back_bar; 6 | 7 | /// overview 8 | pub fn render(ui: &mut egui::Ui, tasks: &mut ProfileTasks) { 9 | back_bar(ui, "Login by steam", tasks); 10 | 11 | ui.add(Spinner::new()); 12 | } 13 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/profile/delete_confirm.rs: -------------------------------------------------------------------------------- 1 | use crate::main_menu::user_data::{ProfileState, ProfileTasks}; 2 | 3 | use super::back_bar::back_bar; 4 | 5 | /// overview 6 | pub fn render(ui: &mut egui::Ui, tasks: &mut ProfileTasks) { 7 | back_bar(ui, "Delete account", tasks); 8 | 9 | if let ProfileState::DeleteConfirm { profile_name, info } = &tasks.state { 10 | let profile_name = profile_name.clone(); 11 | let info = info.clone(); 12 | ui.label("Are you sure you want to proceed?\nDeleting an account cannot be undone."); 13 | 14 | ui.horizontal(|ui| { 15 | if ui.button("Proceed & delete account").clicked() { 16 | tasks.state = ProfileState::DeletePrepare { profile_name, info }; 17 | } 18 | if ui.button("Cancel").clicked() { 19 | tasks.state = ProfileState::Overview; 20 | } 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/profile/general_error.rs: -------------------------------------------------------------------------------- 1 | use egui::ScrollArea; 2 | 3 | use crate::main_menu::user_data::{ProfileState, ProfileTasks}; 4 | 5 | use super::back_bar::back_bar; 6 | 7 | /// overview 8 | pub fn render(ui: &mut egui::Ui, tasks: &mut ProfileTasks) { 9 | back_bar(ui, "An error occurred", tasks); 10 | 11 | if let ProfileState::Err(err) = &tasks.state { 12 | ui.label("The following errors occurred:"); 13 | ScrollArea::vertical().show(ui, |ui| { 14 | ui.label(err); 15 | }); 16 | if ui.button("Try again").clicked() { 17 | tasks.state = ProfileState::Overview; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/profile/logout_loading.rs: -------------------------------------------------------------------------------- 1 | use egui::Spinner; 2 | 3 | use crate::main_menu::user_data::ProfileTasks; 4 | 5 | use super::back_bar::back_bar; 6 | 7 | /// overview 8 | pub fn render(ui: &mut egui::Ui, tasks: &mut ProfileTasks) { 9 | back_bar(ui, "Logging out", tasks); 10 | 11 | ui.add(Spinner::new()); 12 | } 13 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/profile/unlink_email_prepare.rs: -------------------------------------------------------------------------------- 1 | use crate::main_menu::user_data::{CredentialAuthOperation, ProfileState, ProfileTasks}; 2 | 3 | use super::back_bar::back_bar; 4 | 5 | /// overview 6 | pub fn render(ui: &mut egui::Ui, tasks: &mut ProfileTasks) { 7 | back_bar(ui, "Unlink email", tasks); 8 | 9 | if let ProfileState::UnlinkEmailPrepare { profile_name, .. } = &tasks.state { 10 | tasks.state = ProfileState::EmailCredentialAuthTokenPrepare( 11 | CredentialAuthOperation::UnlinkCredential { 12 | profile_name: profile_name.clone(), 13 | }, 14 | ); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/profile/unlink_steam_prepare.rs: -------------------------------------------------------------------------------- 1 | use crate::main_menu::user_data::{CredentialAuthOperation, ProfileState, ProfileTasks}; 2 | 3 | use super::back_bar::back_bar; 4 | 5 | /// overview 6 | pub fn render(ui: &mut egui::Ui, tasks: &mut ProfileTasks) { 7 | back_bar(ui, "Unlink steam", tasks); 8 | 9 | if let ProfileState::UnlinkSteamPrepare { profile_name, .. } = &tasks.state { 10 | tasks.state = ProfileState::SteamCredentialAuthTokenPrepare( 11 | CredentialAuthOperation::UnlinkCredential { 12 | profile_name: profile_name.clone(), 13 | }, 14 | ); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/constants.rs: -------------------------------------------------------------------------------- 1 | pub const SETTINGS_UI_PAGE_QUERY: &str = "sub"; 2 | pub const SETTINGS_SUB_UI_PAGE_QUERY: &str = "subsub"; 3 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/general/main_frame.rs: -------------------------------------------------------------------------------- 1 | use crate::main_menu::user_data::UserData; 2 | use ui_base::types::{UiRenderPipe, UiState}; 3 | 4 | pub fn render(ui: &mut egui::Ui, pipe: &mut UiRenderPipe, ui_state: &mut UiState) { 5 | super::themes::theme_list(ui, pipe, ui_state) 6 | } 7 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/general/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | pub mod themes; 3 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/graphics/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/language/main_frame.rs: -------------------------------------------------------------------------------- 1 | use crate::main_menu::user_data::UserData; 2 | use ui_base::types::{UiRenderPipe, UiState}; 3 | 4 | pub fn render(ui: &mut egui::Ui, pipe: &mut UiRenderPipe, ui_state: &mut UiState) { 5 | super::list::lang_list(ui, pipe, ui_state) 6 | } 7 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/language/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod list; 2 | pub mod main_frame; 3 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/list/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod entry; 2 | pub mod list; 3 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod constants; 2 | pub mod general; 3 | pub mod graphics; 4 | pub mod language; 5 | pub mod list; 6 | pub mod main_frame; 7 | pub mod player; 8 | pub mod search_settings; 9 | pub mod sound; 10 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/player/assets/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod ctf; 2 | pub mod emoticons; 3 | pub mod entities; 4 | pub mod freeze; 5 | pub mod game; 6 | pub mod hook; 7 | pub mod hud; 8 | pub mod main_frame; 9 | pub mod ninja; 10 | pub mod particles; 11 | pub mod weapons; 12 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/player/controls/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/player/misc/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/player/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod assets; 2 | // too annoying with wasm support 3 | #[cfg(feature = "binds")] 4 | pub mod controls; 5 | pub mod main_frame; 6 | pub mod misc; 7 | pub mod profile_selector; 8 | pub mod tee; 9 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/player/tee/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/search_settings/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/sound/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | pub mod spatial_chat; 3 | pub mod utils; 4 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/sound/spatial_chat/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/settings/sound/utils.rs: -------------------------------------------------------------------------------- 1 | pub fn db_to_ratio(v: f64) -> f64 { 2 | (10_f64).powf(v / 20.0) 3 | } 4 | pub fn ratio_to_db(v: f64) -> f64 { 5 | v.log10() * 20.0 6 | } 7 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/theme_container.rs: -------------------------------------------------------------------------------- 1 | use crate::thumbnail_container::ThumbnailContainer; 2 | 3 | pub type ThemeContainer = ThumbnailContainer; 4 | pub const THEME_CONTAINER_PATH: &str = "themes/"; 5 | -------------------------------------------------------------------------------- /game/client-ui/src/main_menu/topbar/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | -------------------------------------------------------------------------------- /game/client-ui/src/motd/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | pub mod page; 3 | pub mod user_data; 4 | -------------------------------------------------------------------------------- /game/client-ui/src/motd/page.rs: -------------------------------------------------------------------------------- 1 | use ui_base::types::{UiRenderPipe, UiState}; 2 | use ui_generic::traits::UiPageInterface; 3 | 4 | use super::{main_frame, user_data::UserData}; 5 | 6 | pub struct MotdUi {} 7 | 8 | impl Default for MotdUi { 9 | fn default() -> Self { 10 | Self::new() 11 | } 12 | } 13 | 14 | impl MotdUi { 15 | pub fn new() -> Self { 16 | Self {} 17 | } 18 | } 19 | 20 | impl UiPageInterface> for MotdUi { 21 | fn render( 22 | &mut self, 23 | ui: &mut egui::Ui, 24 | pipe: &mut UiRenderPipe, 25 | ui_state: &mut UiState, 26 | ) { 27 | main_frame::render(ui, pipe, ui_state) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /game/client-ui/src/motd/user_data.rs: -------------------------------------------------------------------------------- 1 | pub struct UserData<'a> { 2 | pub msg: &'a str, 3 | } 4 | -------------------------------------------------------------------------------- /game/client-ui/src/scoreboard/content/list/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod definitions; 2 | pub mod header; 3 | pub mod list; 4 | pub mod player_list; 5 | -------------------------------------------------------------------------------- /game/client-ui/src/scoreboard/content/list/player_list/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod entry; 2 | pub mod frame; 3 | -------------------------------------------------------------------------------- /game/client-ui/src/scoreboard/content/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod footer; 2 | pub mod list; 3 | pub mod main_frame; 4 | pub mod topbar; 5 | -------------------------------------------------------------------------------- /game/client-ui/src/scoreboard/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod content; 2 | pub mod main_frame; 3 | pub mod page; 4 | pub mod user_data; 5 | -------------------------------------------------------------------------------- /game/client-ui/src/scoreboard/page.rs: -------------------------------------------------------------------------------- 1 | use ui_base::types::{UiRenderPipe, UiState}; 2 | use ui_generic::traits::UiPageInterface; 3 | 4 | use super::{main_frame, user_data::UserData}; 5 | 6 | pub struct ScoreboardUi {} 7 | 8 | impl Default for ScoreboardUi { 9 | fn default() -> Self { 10 | Self::new() 11 | } 12 | } 13 | 14 | impl ScoreboardUi { 15 | pub fn new() -> Self { 16 | Self {} 17 | } 18 | } 19 | 20 | impl UiPageInterface> for ScoreboardUi { 21 | fn render( 22 | &mut self, 23 | ui: &mut egui::Ui, 24 | pipe: &mut UiRenderPipe, 25 | ui_state: &mut UiState, 26 | ) { 27 | main_frame::render(ui, pipe, ui_state) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /game/client-ui/src/scoreboard/user_data.rs: -------------------------------------------------------------------------------- 1 | use base::linked_hash_map_view::FxLinkedHashMap; 2 | use client_containers::{flags::FlagsContainer, skins::SkinContainer}; 3 | use client_render_base::render::tee::RenderTee; 4 | use game_interface::types::{ 5 | id_types::CharacterId, 6 | render::{character::CharacterInfo, scoreboard::Scoreboard}, 7 | }; 8 | use graphics::handles::{ 9 | canvas::canvas::GraphicsCanvasHandle, stream::stream::GraphicsStreamHandle, 10 | }; 11 | 12 | pub struct UserData<'a> { 13 | pub scoreboard: &'a Scoreboard, 14 | pub character_infos: &'a FxLinkedHashMap, 15 | pub stream_handle: &'a GraphicsStreamHandle, 16 | pub canvas_handle: &'a GraphicsCanvasHandle, 17 | pub skin_container: &'a mut SkinContainer, 18 | pub render_tee: &'a RenderTee, 19 | pub flags_container: &'a mut FlagsContainer, 20 | 21 | pub own_character_id: &'a CharacterId, 22 | } 23 | -------------------------------------------------------------------------------- /game/client-ui/src/spectator_selection/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | pub mod page; 3 | pub mod user_data; 4 | -------------------------------------------------------------------------------- /game/client-ui/src/spectator_selection/page.rs: -------------------------------------------------------------------------------- 1 | use ui_base::types::{UiRenderPipe, UiState}; 2 | use ui_generic::traits::UiPageInterface; 3 | 4 | use super::{main_frame, user_data::UserData}; 5 | 6 | pub struct SpectatorSelectionUi {} 7 | 8 | impl Default for SpectatorSelectionUi { 9 | fn default() -> Self { 10 | Self::new() 11 | } 12 | } 13 | 14 | impl SpectatorSelectionUi { 15 | pub fn new() -> Self { 16 | Self {} 17 | } 18 | } 19 | 20 | impl UiPageInterface> for SpectatorSelectionUi { 21 | fn render( 22 | &mut self, 23 | ui: &mut egui::Ui, 24 | pipe: &mut UiRenderPipe, 25 | ui_state: &mut UiState, 26 | ) { 27 | main_frame::render(ui, pipe, ui_state) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /game/client-ui/src/time_display.rs: -------------------------------------------------------------------------------- 1 | pub trait TimeDisplay { 2 | fn to_local_time_string(&self, short: bool) -> String; 3 | } 4 | 5 | #[cfg(not(target_arch = "wasm32"))] 6 | impl TimeDisplay for chrono::DateTime { 7 | fn to_local_time_string(&self, short: bool) -> String { 8 | if short { 9 | >::from(*self) 10 | .format("%Y-%m-%d") 11 | .to_string() 12 | } else { 13 | >::from(*self) 14 | .format("%Y-%m-%d %H:%M:%S") 15 | .to_string() 16 | } 17 | } 18 | } 19 | 20 | #[cfg(target_arch = "wasm32")] 21 | impl TimeDisplay for chrono::DateTime { 22 | fn to_local_time_string(&self, short: bool) -> String { 23 | if short { 24 | (*self).format("%Y-%m-%d").to_string() 25 | } else { 26 | self.to_string() 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /game/client-ui/src/vote/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | pub mod page; 3 | pub mod user_data; 4 | -------------------------------------------------------------------------------- /game/client-ui/src/vote/page.rs: -------------------------------------------------------------------------------- 1 | use ui_base::types::{UiRenderPipe, UiState}; 2 | use ui_generic::traits::UiPageInterface; 3 | 4 | use super::{main_frame, user_data::UserData}; 5 | 6 | pub struct VoteUi {} 7 | 8 | impl Default for VoteUi { 9 | fn default() -> Self { 10 | Self::new() 11 | } 12 | } 13 | 14 | impl VoteUi { 15 | pub fn new() -> Self { 16 | Self {} 17 | } 18 | } 19 | 20 | impl UiPageInterface> for VoteUi { 21 | fn render( 22 | &mut self, 23 | ui: &mut egui::Ui, 24 | pipe: &mut UiRenderPipe, 25 | ui_state: &mut UiState, 26 | ) { 27 | main_frame::render(ui, pipe, ui_state) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /game/community/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "community" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../../lib/base" } 8 | 9 | serde = { version = "1.0.219", features = ["derive"] } 10 | 11 | ddnet-accounts-types = { version = "0.1.0" } 12 | -------------------------------------------------------------------------------- /game/community/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod user_server; 2 | 3 | use std::{collections::HashMap, net::SocketAddr}; 4 | 5 | use base::hash::Hash; 6 | use serde::{Deserialize, Serialize}; 7 | 8 | #[derive(Debug, Clone, Serialize, Deserialize)] 9 | pub struct ServerInfo { 10 | pub cert_hash: Hash, 11 | pub cur_load: u64, 12 | pub max_load: u64, 13 | } 14 | 15 | #[derive(Debug, Clone, Serialize, Deserialize)] 16 | pub struct Info { 17 | pub servers: HashMap, 18 | } 19 | 20 | #[derive(Debug, Clone, Serialize, Deserialize)] 21 | pub struct Register { 22 | pub password: String, 23 | pub info: ServerInfo, 24 | pub port: u16, 25 | } 26 | -------------------------------------------------------------------------------- /game/community/src/user_server.rs: -------------------------------------------------------------------------------- 1 | //! Communication between user & community server 2 | 3 | use std::net::SocketAddr; 4 | 5 | use ddnet_accounts_types::account_id::AccountId; 6 | use serde::{Deserialize, Serialize}; 7 | 8 | #[derive(Debug, Clone, Serialize, Deserialize)] 9 | pub struct JoinServer { 10 | pub addr: SocketAddr, 11 | } 12 | 13 | #[derive(Debug, Clone, Serialize, Deserialize)] 14 | pub struct AddFriend { 15 | pub add_account_id: AccountId, 16 | } 17 | 18 | #[derive(Debug, Clone, Serialize, Deserialize)] 19 | pub enum UserToCommunityServer { 20 | JoinServer(JoinServer), 21 | AddFriend(AddFriend), 22 | } 23 | 24 | #[derive(Debug, Clone, Serialize, Deserialize)] 25 | pub enum CommunityServerToUser { 26 | ConnectedInfo, 27 | } 28 | -------------------------------------------------------------------------------- /game/demo/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "demo" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../../lib/base" } 8 | config = { path = "../../lib/config" } 9 | bin-patch = { path = "../../lib/bin-patch" } 10 | 11 | game-base = { path = "../game-base" } 12 | game-interface = { path = "../game-interface" } 13 | 14 | serde = { version = "1.0.219", features = ["derive"] } 15 | bincode = { features = ["serde"], version = "2.0.1" } 16 | anyhow = { version = "1.0.98", features = ["backtrace"] } 17 | zstd = { version = "0.13", default-features = false, features = ["experimental", "zdict_builder"] } 18 | itertools = "0.14.0" 19 | log = "0.4.27" 20 | 21 | # feature related 22 | base-io = { path = "../../lib/base-io", optional = true } 23 | 24 | tempfile = { version = "3.19.1", optional = true } 25 | chrono = { version = "0.4.41", features = ["serde"], optional = true } 26 | 27 | [features] 28 | recorder = ["chrono", "tempfile", "base-io"] 29 | -------------------------------------------------------------------------------- /game/demo/src/utils.rs: -------------------------------------------------------------------------------- 1 | use std::io::Read; 2 | 3 | use serde::de::DeserializeOwned; 4 | 5 | pub fn decomp<'a>(v: &[u8], writer: &'a mut Vec) -> anyhow::Result<&'a [u8]> { 6 | writer.clear(); 7 | let mut decoder = zstd::Decoder::new(v)?; 8 | decoder.read_to_end(&mut *writer)?; 9 | decoder.finish(); 10 | 11 | Ok(writer.as_mut_slice()) 12 | } 13 | pub fn deser_ex(v: &[u8], fixed_size: bool) -> anyhow::Result<(T, usize)> { 14 | if fixed_size { 15 | Ok(bincode::serde::decode_from_slice( 16 | v, 17 | bincode::config::standard().with_fixed_int_encoding(), 18 | )?) 19 | } else { 20 | Ok(bincode::serde::decode_from_slice( 21 | v, 22 | bincode::config::standard(), 23 | )?) 24 | } 25 | } 26 | pub fn deser(v: &[u8]) -> anyhow::Result<(T, usize)> { 27 | deser_ex(v, false) 28 | } 29 | -------------------------------------------------------------------------------- /game/editor-auto-mapper-wasm/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "editor-auto-mapper-wasm" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | editor-interface = { path = "../editor-interface" } 8 | 9 | wasm-runtime = { path = "../../lib/wasm-runtime" } 10 | api-wasm-macros = { path = "../../lib/api-wasm-macros" } 11 | base-io-traits = { path = "../../lib/base-io-traits" } 12 | cache = { path = "../../lib/cache" } 13 | 14 | wasmer = { version = "6.0.0", default-features = false, features = ["sys", "cranelift"] } 15 | anyhow = { version = "1.0.98", features = ["backtrace"] } 16 | -------------------------------------------------------------------------------- /game/editor-auto-mapper-wasm/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::module_inception)] 2 | 3 | pub mod manager; 4 | pub mod wasm; 5 | -------------------------------------------------------------------------------- /game/editor-interface/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "editor-interface" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | map = { path = "../map" } 8 | 9 | serde = { version = "1.0.219", features = ["derive"] } 10 | -------------------------------------------------------------------------------- /game/editor-interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod auto_mapper; 2 | -------------------------------------------------------------------------------- /game/editor-wasm/src/editor/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod editor_lib; 2 | pub mod editor_wasm; 3 | pub mod editor_wasm_manager; 4 | -------------------------------------------------------------------------------- /game/editor-wasm/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::module_inception)] 2 | 3 | pub mod editor; 4 | -------------------------------------------------------------------------------- /game/editor/src/actions/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod actions; 2 | pub mod utils; 3 | -------------------------------------------------------------------------------- /game/editor/src/dbg.rs: -------------------------------------------------------------------------------- 1 | pub mod invalid; 2 | pub mod valid; 3 | -------------------------------------------------------------------------------- /game/editor/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::too_many_arguments)] 2 | #![allow(clippy::module_inception)] 3 | 4 | pub mod action_logic; 5 | pub mod actions; 6 | pub mod client; 7 | pub mod dbg; 8 | pub mod editor; 9 | pub mod editor_ui; 10 | pub mod event; 11 | pub mod explain; 12 | pub mod fs; 13 | pub mod hotkeys; 14 | pub mod image_store_container; 15 | pub mod map; 16 | pub mod map_tools; 17 | pub mod network; 18 | pub mod notifications; 19 | pub mod options; 20 | pub mod physics_layers; 21 | pub mod server; 22 | pub mod sound_store_container; 23 | pub mod tab; 24 | pub mod tile_overlays; 25 | pub mod tools; 26 | pub mod ui; 27 | pub mod utils; 28 | -------------------------------------------------------------------------------- /game/editor/src/notifications.rs: -------------------------------------------------------------------------------- 1 | use hiarc::{hiarc_safer_rc_refcell, Hiarc}; 2 | 3 | #[derive(Debug, Hiarc)] 4 | pub enum EditorNotification { 5 | Error(String), 6 | Warning(String), 7 | Info(String), 8 | } 9 | 10 | #[hiarc_safer_rc_refcell] 11 | #[derive(Debug, Hiarc, Default)] 12 | pub struct EditorNotifications { 13 | notifications: Vec, 14 | } 15 | 16 | #[hiarc_safer_rc_refcell] 17 | impl EditorNotifications { 18 | pub fn push(&mut self, nfy: EditorNotification) { 19 | self.notifications.push(nfy); 20 | } 21 | 22 | pub fn take(&mut self) -> Vec { 23 | std::mem::take(&mut self.notifications) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /game/editor/src/options.rs: -------------------------------------------------------------------------------- 1 | use std::{collections::VecDeque, sync::Arc}; 2 | 3 | use egui::{Key, Modifiers}; 4 | 5 | use crate::hotkeys::{EditorBindsFile, EditorHotkeyEvent}; 6 | 7 | #[derive(Debug)] 8 | pub struct EditorHotkeyEdit { 9 | pub modifiers: Modifiers, 10 | pub key: Option, 11 | 12 | /// Edit for this event 13 | pub ev: EditorHotkeyEvent, 14 | } 15 | 16 | #[derive(Debug, Default)] 17 | pub struct EditorOptions { 18 | pub hotkeys_open: bool, 19 | pub hotkeys_edit: Option, 20 | pub hotkeys_write_in_order: Arc>>, 21 | } 22 | -------------------------------------------------------------------------------- /game/editor/src/tools/auto_saver.rs: -------------------------------------------------------------------------------- 1 | use std::{path::PathBuf, time::Duration}; 2 | 3 | #[derive(Debug)] 4 | pub struct AutoSaver { 5 | pub active: bool, 6 | pub interval: Option, 7 | 8 | pub last_time: Option, 9 | 10 | pub path: Option, 11 | } 12 | -------------------------------------------------------------------------------- /game/editor/src/tools/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod auto_saver; 2 | pub mod quad_layer; 3 | pub mod shared; 4 | pub mod sound_layer; 5 | pub mod tile_layer; 6 | pub mod tool; 7 | pub mod utils; 8 | -------------------------------------------------------------------------------- /game/editor/src/tools/quad_layer/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod brush; 2 | pub mod selection; 3 | pub mod shared; 4 | -------------------------------------------------------------------------------- /game/editor/src/tools/sound_layer/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod brush; 2 | pub mod shared; 3 | -------------------------------------------------------------------------------- /game/editor/src/tools/tile_layer/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod auto_mapper; 2 | pub mod brush; 3 | pub mod legacy_rules; 4 | pub mod selection; 5 | pub mod shared; 6 | -------------------------------------------------------------------------------- /game/editor/src/ui/animation_panel/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod panel; 2 | -------------------------------------------------------------------------------- /game/editor/src/ui/assets_store_panel/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod panel; 2 | -------------------------------------------------------------------------------- /game/editor/src/ui/auto_mapper/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod auto_mapper; 2 | -------------------------------------------------------------------------------- /game/editor/src/ui/bottom_panel/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod panel; 2 | -------------------------------------------------------------------------------- /game/editor/src/ui/chat_panel/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod panel; 2 | -------------------------------------------------------------------------------- /game/editor/src/ui/group_and_layer/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod group_props; 2 | pub mod layer_props; 3 | pub mod quad_props; 4 | pub mod resource_selector; 5 | pub mod shared; 6 | pub mod sound_props; 7 | -------------------------------------------------------------------------------- /game/editor/src/ui/hotkey_panel/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod panel; 2 | -------------------------------------------------------------------------------- /game/editor/src/ui/left_panel/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod groups_and_layers; 2 | pub mod image_arrays; 3 | pub mod images; 4 | pub mod panel; 5 | pub mod resource_limit; 6 | pub mod resource_panel; 7 | pub mod sounds; 8 | -------------------------------------------------------------------------------- /game/editor/src/ui/left_panel/resource_limit.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashSet; 2 | 3 | use crate::{client::EditorClient, map::EditorResources, notifications::EditorNotification}; 4 | 5 | pub fn check_legacy_resource_limit_images(client: &EditorClient, resources: &EditorResources) { 6 | let imgs: HashSet<_> = resources 7 | .images 8 | .iter() 9 | .map(|i| i.def.meta.blake3_hash) 10 | .chain( 11 | resources 12 | .image_arrays 13 | .iter() 14 | .map(|i| i.def.meta.blake3_hash), 15 | ) 16 | .collect(); 17 | // ddnet limitation 18 | if imgs.len() >= 64 { 19 | client.notifications.push(EditorNotification::Warning( 20 | "Adding more than 64 images makes \ 21 | this map incompatible to (old) ddnet" 22 | .to_string(), 23 | )); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /game/editor/src/ui/mapper_cursors/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | -------------------------------------------------------------------------------- /game/editor/src/ui/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod animation_panel; 2 | pub mod assets_store_panel; 3 | pub mod auto_mapper; 4 | pub mod auto_saver; 5 | pub mod bottom_panel; 6 | pub mod chat_panel; 7 | pub mod close_modal; 8 | pub mod dbg_panel; 9 | pub mod dotted_rect; 10 | pub mod group_and_layer; 11 | pub mod hotkey_panel; 12 | pub mod left_panel; 13 | pub mod main_frame; 14 | pub mod mapper_cursors; 15 | pub mod page; 16 | pub mod server_config_variables; 17 | pub mod server_settings; 18 | pub mod tool_overlays; 19 | pub mod top_menu; 20 | pub mod top_tabs; 21 | pub mod top_toolbar; 22 | pub mod user_data; 23 | pub mod utils; 24 | -------------------------------------------------------------------------------- /game/editor/src/ui/server_config_variables/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod panel; 2 | -------------------------------------------------------------------------------- /game/editor/src/ui/server_settings/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod panel; 2 | -------------------------------------------------------------------------------- /game/editor/src/ui/tool_overlays/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod tile_brush; 2 | -------------------------------------------------------------------------------- /game/editor/src/ui/top_menu/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod menu; 2 | -------------------------------------------------------------------------------- /game/editor/src/ui/top_tabs/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod main_frame; 2 | -------------------------------------------------------------------------------- /game/editor/src/ui/top_toolbar/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod speedup; 2 | pub mod switch; 3 | pub mod tele; 4 | pub mod tile_mirror; 5 | pub mod toolbar; 6 | pub mod tune; 7 | -------------------------------------------------------------------------------- /game/egui-timeline/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "egui-timeline" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | math = { path = "../../lib/math" } 8 | map = { path = "../map" } 9 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 10 | egui_extras = { version = "0.31.1" } 11 | -------------------------------------------------------------------------------- /game/egui-timeline/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod point; 2 | pub mod timeline; 3 | -------------------------------------------------------------------------------- /game/game-base/src/assets_url.rs: -------------------------------------------------------------------------------- 1 | pub const HTTP_RESOURCE_URL: &str = "https://pg.ddnet.org:7777"; 2 | -------------------------------------------------------------------------------- /game/game-base/src/browser_favorite_player.rs: -------------------------------------------------------------------------------- 1 | use base::network_string::NetworkString; 2 | use game_interface::types::{ 3 | character_info::{ 4 | NetworkSkinInfo, MAX_ASSET_NAME_LEN, MAX_CHARACTER_CLAN_LEN, MAX_CHARACTER_NAME_LEN, 5 | MAX_FLAG_NAME_LEN, 6 | }, 7 | resource_key::NetworkResourceKey, 8 | }; 9 | use hiarc::Hiarc; 10 | use serde::{Deserialize, Serialize}; 11 | 12 | #[derive(Debug, Hiarc, Clone, PartialEq, Eq, Serialize, Deserialize)] 13 | pub struct FavoritePlayer { 14 | pub name: NetworkString, 15 | pub clan: NetworkString, 16 | pub skin: NetworkResourceKey, 17 | pub skin_info: NetworkSkinInfo, 18 | pub flag: NetworkString, 19 | } 20 | 21 | pub type FavoritePlayers = Vec; 22 | -------------------------------------------------------------------------------- /game/game-base/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod assets_url; 2 | pub mod browser_favorite_player; 3 | pub mod config_helper; 4 | pub mod connecting_log; 5 | pub mod datafile; 6 | pub mod game_types; 7 | pub mod indexmap_tests; 8 | pub mod local_server_info; 9 | pub mod mapdef_06; 10 | pub mod network; 11 | pub mod player_input; 12 | pub mod server_browser; 13 | pub mod types; 14 | -------------------------------------------------------------------------------- /game/game-base/src/network/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod messages; 2 | pub mod types; 3 | -------------------------------------------------------------------------------- /game/game-base/src/network/types/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod chat; 2 | -------------------------------------------------------------------------------- /game/game-base/src/types.rs: -------------------------------------------------------------------------------- 1 | use game_interface::types::character_info::NetworkCharacterInfo; 2 | 3 | pub type ClientLocalInfos = Vec; 4 | -------------------------------------------------------------------------------- /game/game-config-fs/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "game-config-fs" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base-io = { path = "../../lib/base-io" } 8 | 9 | game-config = { path = "../game-config" } 10 | 11 | anyhow = { version = "1.0.98", features = ["backtrace"] } 12 | -------------------------------------------------------------------------------- /game/game-config-fs/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod fs; 2 | -------------------------------------------------------------------------------- /game/game-config/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "game-config" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | config = { path = "../../lib/config" } 8 | 9 | game-interface = { path = "../game-interface" } 10 | 11 | serde = { version = "1.0.219", features = ["derive"] } 12 | serde_json = "1.0.140" 13 | anyhow = { version = "1.0.98", features = ["backtrace"] } 14 | -------------------------------------------------------------------------------- /game/game-config/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod config; 2 | -------------------------------------------------------------------------------- /game/game-interface/src/account_info.rs: -------------------------------------------------------------------------------- 1 | use base::network_string::NetworkReducedAsciiString; 2 | use game_database::types::UnixUtcTimestamp; 3 | use hiarc::Hiarc; 4 | use serde::{Deserialize, Serialize}; 5 | 6 | pub const MAX_ACCOUNT_NAME_LEN: usize = 32; 7 | 8 | /// Account information that the client can interpret by default. 9 | #[derive(Debug, Hiarc, Clone, Serialize, Deserialize)] 10 | pub struct AccountInfo { 11 | /// The name of the account on this game server 12 | pub name: NetworkReducedAsciiString, 13 | /// The date when the account was first registered 14 | /// on this game server. 15 | pub creation_date: UnixUtcTimestamp, 16 | } 17 | -------------------------------------------------------------------------------- /game/game-interface/src/chat_commands.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | 3 | use base::network_string::NetworkString; 4 | use command_parser::parser::CommandArg; 5 | use hiarc::Hiarc; 6 | use serde::{Deserialize, Serialize}; 7 | 8 | /// Commands supported by the server. 9 | #[derive(Debug, Hiarc, Default, Clone, Serialize, Deserialize)] 10 | pub struct ChatCommands { 11 | /// list of commands and their required args 12 | pub cmds: HashMap, Vec>, 13 | /// list of prefixes that trigger a chat command (e.g. `/` for slash commands) 14 | pub prefixes: Vec, 15 | } 16 | 17 | /// The command that comes from the client. 18 | #[derive(Debug, Hiarc, Clone, Serialize, Deserialize)] 19 | pub struct ClientChatCommand { 20 | /// the raw unprocessed command string, 21 | /// excluding the "/"-prefix (or other chosen prefixes) 22 | pub raw: NetworkString<{ 2048 + 1 }>, 23 | } 24 | -------------------------------------------------------------------------------- /game/game-interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![deny(warnings)] 2 | #![deny(clippy::all)] 3 | 4 | pub mod account_info; 5 | pub mod chat_commands; 6 | pub mod client_commands; 7 | pub mod events; 8 | pub mod ghosts; 9 | pub mod interface; 10 | pub mod pooling; 11 | pub mod rcon_entries; 12 | pub mod settings; 13 | pub mod tick_result; 14 | pub mod types; 15 | pub mod vote_commands; 16 | pub mod votes; 17 | -------------------------------------------------------------------------------- /game/game-interface/src/settings.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | #[derive(Debug, Hiarc, Clone, Serialize, Deserialize)] 5 | pub struct GameStateSettings { 6 | /// How many players are allowed to play. 7 | /// 8 | /// clients above this limits must then be spectators. 9 | pub max_ingame_players: u32, 10 | /// Whether the game is currently in a tournament mode 11 | pub tournament_mode: bool, 12 | } 13 | -------------------------------------------------------------------------------- /game/game-interface/src/tick_result.rs: -------------------------------------------------------------------------------- 1 | use pool::datatypes::PoolVec; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | use crate::types::{ 5 | id_types::PlayerId, 6 | player_info::{PlayerBanReason, PlayerKickReason}, 7 | }; 8 | 9 | #[derive(Debug, Clone, Serialize, Deserialize)] 10 | pub enum TickEvent { 11 | Kick { 12 | player_id: PlayerId, 13 | reason: PlayerKickReason, 14 | }, 15 | Ban { 16 | player_id: PlayerId, 17 | until: Option>, 18 | reason: PlayerBanReason, 19 | }, 20 | } 21 | 22 | /// The tick result contains per tick data 23 | /// usually only used inside the server. 24 | #[derive(Debug, Clone, Serialize, Deserialize)] 25 | pub struct TickResult { 26 | /// Events that the server should handle 27 | pub events: PoolVec, 28 | } 29 | -------------------------------------------------------------------------------- /game/game-interface/src/types/emoticons.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | use num_derive::FromPrimitive; 3 | use serde::{Deserialize, Serialize}; 4 | pub use strum::{EnumCount, EnumIter, IntoEnumIterator, IntoStaticStr}; 5 | 6 | #[derive( 7 | Debug, 8 | Hiarc, 9 | Clone, 10 | Copy, 11 | Hash, 12 | PartialEq, 13 | Eq, 14 | PartialOrd, 15 | Ord, 16 | FromPrimitive, 17 | EnumIter, 18 | EnumCount, 19 | IntoStaticStr, 20 | Serialize, 21 | Deserialize, 22 | )] 23 | pub enum EmoticonType { 24 | OOP, 25 | EXCLAMATION, 26 | HEARTS, 27 | /// Or tear 28 | DROP, 29 | DOTDOT, 30 | MUSIC, 31 | SORRY, 32 | GHOST, 33 | SUSHI, 34 | SPLATTEE, 35 | DEVILTEE, 36 | ZOMG, 37 | ZZZ, 38 | WTF, 39 | /// Happy eyes 40 | EYES, 41 | QUESTION, 42 | } 43 | -------------------------------------------------------------------------------- /game/game-interface/src/types/flag.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | #[derive(Debug, Hiarc, Default, Copy, Clone, Serialize, Deserialize)] 5 | pub enum FlagType { 6 | #[default] 7 | Red, 8 | Blue, 9 | } 10 | -------------------------------------------------------------------------------- /game/game-interface/src/types/laser.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | #[derive(Debug, Hiarc, Default, Copy, Clone, Serialize, Deserialize)] 5 | pub enum LaserType { 6 | #[default] 7 | Rifle, 8 | Shotgun, // TODO: rename to puller? 9 | Door, 10 | Freeze, 11 | } 12 | -------------------------------------------------------------------------------- /game/game-interface/src/types/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod character_info; 2 | pub mod emoticons; 3 | pub mod fixed_zoom_level; 4 | pub mod flag; 5 | pub mod game; 6 | pub mod id_gen; 7 | pub mod id_types; 8 | pub mod input; 9 | pub mod laser; 10 | pub mod network_stats; 11 | pub mod pickup; 12 | pub mod player_info; 13 | pub mod render; 14 | pub mod resource_key; 15 | pub mod snapshot; 16 | pub mod ticks; 17 | pub mod weapons; 18 | -------------------------------------------------------------------------------- /game/game-interface/src/types/network_stats.rs: -------------------------------------------------------------------------------- 1 | use std::time::Duration; 2 | 3 | use hiarc::Hiarc; 4 | use serde::{Deserialize, Serialize}; 5 | 6 | /// The network statistics for a single player. 7 | #[derive(Debug, Hiarc, Default, Clone, Copy, Serialize, Deserialize)] 8 | pub struct PlayerNetworkStats { 9 | // the estimated RTT of the connection. 10 | pub ping: Duration, 11 | // estimated amount of packet loss. 12 | pub packet_loss: f32, 13 | } 14 | -------------------------------------------------------------------------------- /game/game-interface/src/types/pickup.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | use super::weapons::WeaponType; 5 | 6 | #[derive(Debug, Hiarc, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)] 7 | pub enum PickupType { 8 | PowerupHealth, 9 | PowerupArmor, 10 | PowerupNinja, 11 | PowerupWeapon(WeaponType), 12 | } 13 | -------------------------------------------------------------------------------- /game/game-interface/src/types/render/flag.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | use math::math::vector::vec2; 3 | use serde::{Deserialize, Serialize}; 4 | 5 | use crate::types::{flag::FlagType, id_types::CharacterId}; 6 | 7 | /// The ingame metric is 1 tile = 1.0 float units 8 | #[derive(Debug, Hiarc, Copy, Clone, Serialize, Deserialize)] 9 | pub struct FlagRenderInfo { 10 | pub pos: vec2, 11 | pub ty: FlagType, 12 | 13 | /// If this entity is owned by a character, this should be `Some` and 14 | /// include the characters id. 15 | /// In this specific case it could make sense if the flag is currently 16 | /// owned/carried by a character. 17 | pub owner_id: Option, 18 | 19 | /// Whether the entity is phased, e.g. cannot hit any entitiy 20 | /// except the owner. 21 | /// 22 | /// In ddrace this is solo. 23 | #[doc(alias = "solo")] 24 | pub phased: bool, 25 | } 26 | -------------------------------------------------------------------------------- /game/game-interface/src/types/render/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod character; 2 | pub mod flag; 3 | pub mod game; 4 | pub mod laser; 5 | pub mod pickup; 6 | pub mod projectiles; 7 | pub mod scoreboard; 8 | pub mod stage; 9 | pub mod world; 10 | -------------------------------------------------------------------------------- /game/game-interface/src/types/render/pickup.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | use math::math::vector::vec2; 3 | use serde::{Deserialize, Serialize}; 4 | 5 | use crate::types::{id_types::CharacterId, pickup::PickupType}; 6 | 7 | /// The ingame metric is 1 tile = 1.0 float units 8 | #[derive(Debug, Hiarc, Copy, Clone, Serialize, Deserialize)] 9 | pub struct PickupRenderInfo { 10 | pub ty: PickupType, 11 | pub pos: vec2, 12 | 13 | /// If this entity is owned by a character, this should be `Some` and 14 | /// include the characters id. 15 | /// In this specific case it _could_ be the nearest character for example. 16 | /// If unsure leave it to `None`. 17 | pub owner_id: Option, 18 | 19 | /// Whether the entity is phased, e.g. cannot hit any entitiy 20 | /// except the owner. 21 | /// 22 | /// In ddrace this is solo. 23 | #[doc(alias = "solo")] 24 | pub phased: bool, 25 | } 26 | -------------------------------------------------------------------------------- /game/game-interface/src/types/render/stage.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | use crate::types::game::GameTickType; 5 | 6 | use super::{game::GameRenderInfo, world::WorldRenderInfo}; 7 | 8 | /// The stage in which the world is 9 | /// and matches/races are happening. 10 | /// In ddrace language this is a "team". 11 | /// A game can generally have multiple stages. 12 | #[derive(Debug, Hiarc, Serialize, Deserialize)] 13 | pub struct StageRenderInfo { 14 | /// Contains the render information for all entities in the world. 15 | pub world: WorldRenderInfo, 16 | /// Contains the game related rendering information. 17 | pub game: GameRenderInfo, 18 | /// How many game ticks have passed for this stage. 19 | /// This is potentially equal to the race time for all tees, 20 | /// or equal to the ticks in an active round. 21 | pub game_ticks_passed: GameTickType, 22 | } 23 | -------------------------------------------------------------------------------- /game/game-interface/src/types/ticks.rs: -------------------------------------------------------------------------------- 1 | use serde::{Deserialize, Serialize}; 2 | 3 | #[derive(Debug, Default, Clone, Copy, Serialize, Deserialize)] 4 | pub struct TickOptions { 5 | /// Whether this tick should be handled as future tick prediction. 6 | /// See [`crate::interface::GameStateInterface`] for more information 7 | /// about prediction code. 8 | pub is_future_tick_prediction: bool, 9 | } 10 | -------------------------------------------------------------------------------- /game/game-interface/src/types/weapons.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | use num_derive::FromPrimitive; 3 | use serde::{Deserialize, Serialize}; 4 | pub use strum::{EnumCount, EnumIter}; 5 | 6 | // TODO: move this somewhere better 7 | #[derive( 8 | Debug, 9 | Hiarc, 10 | Default, 11 | Copy, 12 | Clone, 13 | PartialEq, 14 | Eq, 15 | FromPrimitive, 16 | Serialize, 17 | Deserialize, 18 | Hash, 19 | PartialOrd, 20 | Ord, 21 | EnumCount, 22 | EnumIter, 23 | )] 24 | pub enum WeaponType { 25 | #[default] 26 | Hammer = 0, 27 | Gun, 28 | Shotgun, 29 | Grenade, 30 | Laser, 31 | } 32 | -------------------------------------------------------------------------------- /game/game-network/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "game-network" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../../lib/base" } 8 | network = { path = "../../lib/network" } 9 | pool = { path = "../../lib/pool" } 10 | 11 | game-base = { path = "../game-base" } 12 | game-interface = { path = "../game-interface" } 13 | 14 | bincode = { features = ["serde"], version = "2.0.1" } 15 | async-trait = "0.1.88" 16 | serde = "1.0.219" 17 | tokio = { version = "1.45.0", features = ["rt-multi-thread", "sync", "time", "macros"] } 18 | log = "0.4.27" 19 | -------------------------------------------------------------------------------- /game/game-network/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod game_event_generator; 2 | pub mod messages; 3 | -------------------------------------------------------------------------------- /game/game-server/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::too_many_arguments)] 2 | 3 | pub mod auto_map_votes; 4 | pub mod client; 5 | pub mod local_server; 6 | pub mod map_votes; 7 | pub mod network_plugins; 8 | pub mod rcon; 9 | pub mod server; 10 | pub mod server_game; 11 | pub mod spatial_chat; 12 | -------------------------------------------------------------------------------- /game/game-server/src/network_plugins/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod accounts_only; 2 | pub mod cert_ban; 3 | -------------------------------------------------------------------------------- /game/game-state-wasm/src/game/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod state_wasm; 2 | pub mod state_wasm_manager; 3 | -------------------------------------------------------------------------------- /game/game-state-wasm/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::module_inception)] 2 | 3 | pub mod game; 4 | -------------------------------------------------------------------------------- /game/ghost/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ghost" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | demo = { path = "../demo", features = ["recorder"] } 8 | game-interface = { path = "../game-interface" } 9 | 10 | pool = { path = "../../lib/pool" } 11 | -------------------------------------------------------------------------------- /game/ghost/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod recorder; 2 | -------------------------------------------------------------------------------- /game/http-accounts/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "http-accounts" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base-io-traits = { path = "../../lib/base-io-traits" } 8 | async-trait = "0.1.88" 9 | url = { version = "2.5.4", features = ["serde"] } 10 | anyhow = { version = "1.0.98", features = ["backtrace"] } 11 | 12 | ddnet-account-client = { version = "0.2.0" } 13 | ddnet-account-client-http-fs = { version = "0.3.0" } 14 | -------------------------------------------------------------------------------- /game/http-accounts/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod http; 2 | -------------------------------------------------------------------------------- /game/map/src/map/command_value.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | /// Represents a usually command value with optional 5 | /// comment. 6 | /// 7 | /// This is usually used for commands, config variables 8 | /// tune values etc. 9 | #[derive(Debug, Hiarc, Clone, Serialize, Deserialize, PartialEq, Eq)] 10 | pub struct CommandValue { 11 | /// The value itself 12 | pub value: String, 13 | /// An optional comment 14 | pub comment: Option, 15 | } 16 | -------------------------------------------------------------------------------- /game/map/src/map/groups/layers.rs: -------------------------------------------------------------------------------- 1 | pub mod design; 2 | pub mod physics; 3 | pub mod tiles; 4 | -------------------------------------------------------------------------------- /game/map/src/map/metadata.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | /// The meta data is not useful for the game. 5 | /// They simply exist for completeness 6 | #[derive(Debug, Hiarc, Clone, Serialize, Deserialize, PartialEq, Eq)] 7 | pub struct Metadata { 8 | pub authors: Vec, 9 | pub licenses: Vec, 10 | pub version: String, 11 | pub credits: String, 12 | pub memo: String, 13 | } 14 | -------------------------------------------------------------------------------- /game/map/src/skeleton/config.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | 3 | use crate::map::config::Config; 4 | 5 | #[derive(Debug, Hiarc, Clone)] 6 | pub struct ConfigSkeleton { 7 | pub def: Config, 8 | pub user: C, 9 | } 10 | 11 | impl From> for Config { 12 | fn from(value: ConfigSkeleton) -> Self { 13 | value.def 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /game/map/src/skeleton/groups/layers.rs: -------------------------------------------------------------------------------- 1 | pub mod design; 2 | pub mod physics; 3 | -------------------------------------------------------------------------------- /game/map/src/skeleton/metadata.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | 3 | use crate::map::metadata::Metadata; 4 | 5 | #[derive(Debug, Hiarc, Clone)] 6 | pub struct MetadataSkeleton { 7 | pub def: Metadata, 8 | pub user: M, 9 | } 10 | 11 | impl From> for Metadata { 12 | fn from(value: MetadataSkeleton) -> Self { 13 | value.def 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /game/master-server-types/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "master-server-types" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["heinrich5991 "] 6 | publish = false 7 | license = "Zlib" 8 | 9 | [dependencies] 10 | arrayvec = { version = "=0.5.2", features = ["serde"] } 11 | csv = "1.3.1" 12 | serde = { version = "1.0.219", features = ["derive"] } 13 | serde_json = { version = "1.0.140", features = [ 14 | "float_roundtrip", 15 | "preserve_order", 16 | "raw_value", 17 | ] } 18 | url = { version = "2.5.4", features = ["serde"] } 19 | ipnet = { version = "2.11.0", features = ["serde"] } 20 | http = "=0.2.12" 21 | 22 | serde_with = "3.12.0" 23 | -------------------------------------------------------------------------------- /game/master-server-types/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod addr; 2 | pub mod locations; 3 | pub mod response; 4 | pub mod servers; 5 | -------------------------------------------------------------------------------- /game/prediction-timer/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "prediction-timer" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | math = { path = "../../lib/math" } 8 | 9 | [dev-dependencies] 10 | textplots = "0.8.7" 11 | rgb = "0.8.50" 12 | -------------------------------------------------------------------------------- /game/prediction-timer/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod prediction_timing; 2 | -------------------------------------------------------------------------------- /game/render-game-wasm/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::too_many_arguments)] 2 | #![allow(clippy::module_inception)] 3 | 4 | pub mod render; 5 | -------------------------------------------------------------------------------- /game/render-game-wasm/src/render/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod render_wasm; 2 | pub mod render_wasm_manager; 3 | -------------------------------------------------------------------------------- /game/vanilla/src/entities/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod character; 2 | pub mod entity; 3 | pub mod flag; 4 | pub mod laser; 5 | pub mod pickup; 6 | pub mod projectile; 7 | -------------------------------------------------------------------------------- /game/vanilla/src/spawns.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | use math::math::vector::vec2; 3 | 4 | #[derive(Debug, Hiarc)] 5 | pub struct GameSpawns { 6 | pub spawns: Vec, 7 | pub spawns_red: Vec, 8 | pub spawns_blue: Vec, 9 | } 10 | -------------------------------------------------------------------------------- /game/vanilla/src/sql/generic/account_info/account_info.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | user.id, 3 | user.name, 4 | user.create_time 5 | FROM 6 | user 7 | WHERE 8 | user.account_id = ?; 9 | -------------------------------------------------------------------------------- /game/vanilla/src/sql/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod account_created; 2 | pub mod account_info; 3 | pub mod save; 4 | -------------------------------------------------------------------------------- /game/vanilla/src/sql/mysql/account_created/rewrite_saves.sql: -------------------------------------------------------------------------------- 1 | UPDATE 2 | user_save 3 | SET 4 | user_save.user_id = ? 5 | WHERE 6 | user_save.user_hash = ? 7 | AND user_save.user_id = NULL; 8 | -------------------------------------------------------------------------------- /game/vanilla/src/sql/mysql/save/saves.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE user_save ( 2 | id BIGINT NOT NULL AUTO_INCREMENT, 3 | user_id BIGINT, 4 | user_hash BINARY(32), 5 | score_laser_kills BIGINT NOT NULL DEFAULT 0, 6 | score_deaths BIGINT NOT NULL DEFAULT 0, 7 | score_hits BIGINT NOT NULL DEFAULT 0, 8 | score_teamkills BIGINT NOT NULL DEFAULT 0, 9 | score_suicides BIGINT NOT NULL DEFAULT 0, 10 | PRIMARY KEY(id), 11 | UNIQUE KEY(user_id), 12 | UNIQUE KEY(user_hash) 13 | ); 14 | -------------------------------------------------------------------------------- /game/vanilla/src/sql/sqlite/account_created/rewrite_saves.sql: -------------------------------------------------------------------------------- 1 | UPDATE 2 | user_save 3 | SET 4 | user_id = ? 5 | WHERE 6 | user_save.user_hash = ? 7 | AND user_save.user_id = NULL; 8 | -------------------------------------------------------------------------------- /game/vanilla/src/sql/sqlite/save/saves.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE user_save ( 2 | id INTEGER AUTO_INCREMENT, 3 | user_id INTEGER UNIQUE, 4 | user_hash BINARY(32) UNIQUE, 5 | score_laser_kills INTEGER NOT NULL DEFAULT 0, 6 | score_deaths INTEGER NOT NULL DEFAULT 0, 7 | score_hits INTEGER NOT NULL DEFAULT 0, 8 | score_teamkills INTEGER NOT NULL DEFAULT 0, 9 | score_suicides INTEGER NOT NULL DEFAULT 0, 10 | PRIMARY KEY(id) 11 | ); 12 | -------------------------------------------------------------------------------- /game/vanilla/src/weapons/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod definitions; 2 | -------------------------------------------------------------------------------- /lib/api-macros/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "api-macros" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [lib] 7 | proc-macro = true 8 | 9 | [dependencies] 10 | proc-macro2 = "1.0.95" 11 | quote = "1.0.40" 12 | syn = { version = "2.0.101", features = ["full", "extra-traits"] } 13 | -------------------------------------------------------------------------------- /lib/api-ui/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "api-ui" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | api = { path = "../../lib/api" } 8 | ui-base = { path = "../../lib/ui-base" } 9 | ui-generic = { path = "../../lib/ui-generic" } 10 | graphics-types = { path = "../../lib/graphics-types" } 11 | once_cell = "1.21.3" 12 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 13 | -------------------------------------------------------------------------------- /lib/api-ui/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod ui_impl; 2 | -------------------------------------------------------------------------------- /lib/api-wasm-macros/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "api-wasm-macros" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [lib] 7 | proc-macro = true 8 | 9 | [dependencies] 10 | proc-macro2 = "1.0.95" 11 | quote = "1.0.40" 12 | syn = { version = "2.0.101", features = ["full"] } 13 | -------------------------------------------------------------------------------- /lib/api/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "api" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../base" } 8 | base-io-traits = { path = "../base-io-traits" } 9 | base-io = { path = "../base-io" } 10 | graphics = { path = "../graphics" } 11 | graphics-backend-traits = { path = "../graphics-backend-traits" } 12 | game-database = { path = "../game-database" } 13 | graphics-types = { path = "../graphics-types" } 14 | graphics-base-traits = { path = "../graphics-base-traits" } 15 | pool = { path = "../pool" } 16 | sound = { path = "../sound" } 17 | once_cell = "1.21.3" 18 | bincode = "2.0.1" 19 | async-trait = "0.1.88" 20 | anyhow = { version = "1.0.98", features = ["backtrace"] } 21 | rayon = "1.10.0" 22 | bytes = { version = "1.10.1", features = ["serde"] } 23 | serde = "1.0.219" 24 | url = { version = "2.5.4", features = ["serde"] } 25 | log = { version = "0.4.27", features = ["std"] } 26 | -------------------------------------------------------------------------------- /lib/api/src/base_fs/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod filesys; 2 | -------------------------------------------------------------------------------- /lib/api/src/base_http/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod http; 2 | -------------------------------------------------------------------------------- /lib/api/src/graphics/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod graphics; 2 | pub mod graphics_mt; 3 | -------------------------------------------------------------------------------- /lib/api/src/sound/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod sound_backend; 2 | -------------------------------------------------------------------------------- /lib/av-encoder/src/ffmpeg/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod converter; 2 | pub mod encoder; 3 | pub mod utils; 4 | -------------------------------------------------------------------------------- /lib/av-encoder/src/ffmpeg/utils.rs: -------------------------------------------------------------------------------- 1 | pub(crate) fn as_res(code: i32) -> Result<(), ffmpeg_next::Error> { 2 | match code { 3 | 0 => Ok(()), 4 | _ => Err(ffmpeg_next::Error::from(code)), 5 | } 6 | } 7 | pub(crate) fn non_null(ptr: *mut T) -> Result<*mut T, ffmpeg_next::Error> { 8 | if ptr.is_null() { 9 | Err(ffmpeg_next::Error::Unknown) 10 | } else { 11 | Ok(ptr) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/av-encoder/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(feature = "ffmpeg")] 2 | pub mod encoder; 3 | #[cfg(feature = "ffmpeg")] 4 | mod ffmpeg; 5 | 6 | pub mod stub; 7 | pub mod traits; 8 | pub mod types; 9 | 10 | #[cfg(feature = "ffmpeg")] 11 | pub type AvEncoder = encoder::FfmpegEncoder; 12 | #[cfg(not(feature = "ffmpeg"))] 13 | pub type AvEncoder = stub::StubEncoder; 14 | -------------------------------------------------------------------------------- /lib/av-encoder/src/stub.rs: -------------------------------------------------------------------------------- 1 | use anyhow::anyhow; 2 | 3 | use crate::traits::AudioVideoEncoder; 4 | 5 | pub struct StubEncoder; 6 | 7 | impl AudioVideoEncoder for StubEncoder { 8 | fn new( 9 | _video_frame_buffer_id: graphics_backend_traits::frame_fetcher_plugin::OffscreenCanvasId, 10 | _audio_frame_buffer_id: sound::frame_fetcher_plugin::OffairSoundManagerId, 11 | _file_path: &std::path::Path, 12 | _backend: &std::rc::Rc, 13 | _sound_backend: &std::rc::Rc, 14 | _encoder_settings: crate::types::EncoderSettings, 15 | ) -> anyhow::Result { 16 | Err(anyhow!("The stub encoder cannot encode anything.")) 17 | } 18 | 19 | fn overloaded(&self) -> bool { 20 | false 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/av-encoder/src/traits.rs: -------------------------------------------------------------------------------- 1 | use std::{path::Path, rc::Rc}; 2 | 3 | use graphics_backend::backend::GraphicsBackend; 4 | use graphics_backend_traits::frame_fetcher_plugin::OffscreenCanvasId; 5 | use sound::frame_fetcher_plugin::OffairSoundManagerId; 6 | use sound_backend::sound_backend::SoundBackend; 7 | 8 | use crate::types::EncoderSettings; 9 | 10 | pub trait AudioVideoEncoder 11 | where 12 | Self: Sized, 13 | { 14 | fn new( 15 | video_frame_buffer_id: OffscreenCanvasId, 16 | audio_frame_buffer_id: OffairSoundManagerId, 17 | file_path: &Path, 18 | backend: &Rc, 19 | sound_backend: &Rc, 20 | encoder_settings: EncoderSettings, 21 | ) -> anyhow::Result; 22 | 23 | /// The encoder is overloaded with either video or audio frames 24 | /// and the implementation should skip the next call so the encoders 25 | /// can catch up. 26 | fn overloaded(&self) -> bool; 27 | } 28 | -------------------------------------------------------------------------------- /lib/av-encoder/src/types.rs: -------------------------------------------------------------------------------- 1 | /// Settings that are given to the encoder 2 | #[derive(Debug, Clone)] 3 | pub struct EncoderSettings { 4 | /// Frames per second 5 | pub fps: u32, 6 | /// "Constant Rate Factor" for x264. 7 | /// Where 0 is lossless and 51 is the worst. 8 | /// 18 is default. 9 | pub crf: u8, 10 | /// Width of the video 11 | pub width: u32, 12 | /// Height of the video 13 | pub height: u32, 14 | /// The hardware acceleration to use during video encoding. 15 | /// This setting is highly OS dependent. 16 | pub hw_accel: String, 17 | /// Max number of CPU threads the encoders should use. 18 | pub max_threads: u64, 19 | /// Sample rate for audio. 20 | /// It's __strongly__ recommended that this is a multiple of 21 | /// [`Self::fps`]. 22 | pub sample_rate: u32, 23 | } 24 | -------------------------------------------------------------------------------- /lib/base-http/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "base-http" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | base = { path = "../base" } 10 | base-io = { path = "../base-io" } 11 | base-io-traits = { path = "../base-io-traits" } 12 | 13 | anyhow = { version = "1.0.98", features = ["backtrace"] } 14 | axum = "0.8.4" 15 | bytes = "1.10.1" 16 | reqwest = { version = "0.12.15", default-features = false, features = ["rustls-tls"] } 17 | tokio = { version = "1.45.0", features = ["rt-multi-thread", "sync"] } 18 | url = "2.5.4" 19 | async-trait = "0.1.88" 20 | http-body-util = "0.1.3" 21 | http = "1" 22 | log = "0.4.27" 23 | 24 | tower-http = { version = "0.6.2", features = ["fs", "trace"] } 25 | 26 | [dev-dependencies] 27 | base = { path = "../base" } 28 | -------------------------------------------------------------------------------- /lib/base-http/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod http; 2 | pub mod http_server; 3 | -------------------------------------------------------------------------------- /lib/base-io-traits/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "base-io-traits" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../base" } 8 | 9 | anyhow = { version = "1.0.98", features = ["backtrace"] } 10 | async-trait = "0.1.88" 11 | bytes = "1.10.1" 12 | url = "2.5.4" 13 | thiserror = "2.0.12" 14 | serde = { version = "1.0.219", features = ["derive"] } 15 | rustc-hash = "2.1.1" 16 | -------------------------------------------------------------------------------- /lib/base-io-traits/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod fs_traits; 2 | pub mod http_traits; 3 | -------------------------------------------------------------------------------- /lib/base-io/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "base-io" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base-io-traits = { path = "../base-io-traits" } 8 | hiarc = { path = "../hiarc", features = ["enable_anyhow", "enable_tokio"] } 9 | 10 | anyhow = { version = "1.0.98", features = ["backtrace"] } 11 | urlencoding = "2.1.3" 12 | 13 | [target.'cfg(target_arch = "wasm32")'.dependencies] 14 | tokio = { version = "1.45.0", features = ["sync", "macros"] } 15 | async-executor = "1.13.2" 16 | async-task = "4.7.1" 17 | futures-lite = "2.6.0" 18 | 19 | [target.'cfg(not(target_arch = "wasm32"))'.dependencies] 20 | tokio = { version = "1.45.0", features = ["rt-multi-thread", "net", "sync", "fs", "time", "macros"] } 21 | 22 | -------------------------------------------------------------------------------- /lib/base-io/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod io; 2 | pub mod path_to_url; 3 | pub mod runtime; 4 | pub mod yield_now; 5 | -------------------------------------------------------------------------------- /lib/base-io/src/path_to_url.rs: -------------------------------------------------------------------------------- 1 | use std::path::Path; 2 | 3 | use anyhow::anyhow; 4 | 5 | /// Converts path components to a properly url encoded path string. 6 | pub fn relative_path_to_url(path: &Path) -> anyhow::Result { 7 | if path.is_absolute() { 8 | anyhow::bail!("Only relative paths are supported, but absolute path was found: {path:?}"); 9 | } 10 | Ok(path 11 | .components() 12 | .map(|p| { 13 | p.as_os_str() 14 | .to_str() 15 | .map(|p| urlencoding::encode(p).to_string()) 16 | }) 17 | .collect::>>() 18 | .ok_or_else(|| anyhow!("One or more components were not valid strings: {path:?}"))? 19 | .join("/")) 20 | } 21 | -------------------------------------------------------------------------------- /lib/base-io/src/yield_now.rs: -------------------------------------------------------------------------------- 1 | use std::future::Future; 2 | use std::pin::Pin; 3 | 4 | /// Very simply yielding 5 | /// only tested and used for `io_runtime` for WASM modules 6 | pub async fn yield_now() { 7 | YieldNow(false).await 8 | } 9 | 10 | struct YieldNow(bool); 11 | 12 | impl Future for YieldNow { 13 | type Output = (); 14 | 15 | fn poll( 16 | mut self: Pin<&mut Self>, 17 | cx: &mut std::task::Context<'_>, 18 | ) -> std::task::Poll { 19 | if !self.0 { 20 | self.0 = true; 21 | cx.waker().wake_by_ref(); 22 | std::task::Poll::Pending 23 | } else { 24 | std::task::Poll::Ready(()) 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/base/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "base" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | hiarc = { path = "../hiarc", features = ["derive", "enable_anyhow", "enable_parking_lot", "enable_ascii"] } 8 | pool = { path = "../pool", features = ["hiarc"] } 9 | 10 | hashlink = { git = "https://github.com/Jupeyy/hashlink/", branch = "ddnet", features = ["serde", "serde_impl"] } 11 | rustc-hash = "2.1.1" 12 | once_cell = "1.21.3" 13 | parking_lot = "0.12.3" 14 | anyhow = { version = "1.0.98", features = ["backtrace"] } 15 | rayon = "1.10.0" 16 | blake3 = "1.8.2" 17 | hex = "0.4.3" 18 | ascii = { version = "1.1.0", features = ["serde"] } 19 | thiserror = "2.0.12" 20 | serde = { version = "1.0.219", features = ["derive"] } 21 | -------------------------------------------------------------------------------- /lib/base/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![deny(warnings)] 2 | #![deny(clippy::nursery)] 3 | #![deny(clippy::all)] 4 | 5 | pub mod benchmark; 6 | pub mod duration_ext; 7 | pub mod hash; 8 | pub mod join_thread; 9 | pub mod linked_hash_map_view; 10 | pub mod network_string; 11 | pub mod rayon_helper; 12 | pub mod rayon_join_handle; 13 | pub mod reduced_ascii_str; 14 | pub mod system; 15 | -------------------------------------------------------------------------------- /lib/bin-patch/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "bin-patch" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | zstd = { version = "0.13", default-features = false, features = ["experimental", "zdict_builder"] } 8 | anyhow = { version = "1.0.98", features = ["backtrace"] } 9 | 10 | [dev-dependencies] 11 | bidiff = "1.0.0" 12 | qbsdiff = "1.4.3" 13 | bsdiff = "0.2.1" 14 | brotli = "8.0.1" 15 | base = { path = "../base" } 16 | -------------------------------------------------------------------------------- /lib/cache/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cache" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../base" } 8 | base-io = { path = "../base-io" } 9 | base-fs = { path = "../base-fs" } 10 | base-io-traits = { path = "../base-io-traits" } 11 | hiarc = { path = "../hiarc", features = ["enable_tokio"] } 12 | 13 | anyhow = { version = "1.0.98", features = ["backtrace"] } 14 | -------------------------------------------------------------------------------- /lib/command-parser/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "command-parser" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../base" } 8 | hiarc = { path = "../hiarc", features = ["derive"] } 9 | 10 | serde = { version = "1.0.219", features = ["derive"] } 11 | serde_json = "1.0.140" 12 | anyhow = { version = "1.0.98", features = ["backtrace"] } 13 | logos = { version = "0.15.0" } 14 | regex = "1.11.1" 15 | thiserror = "2.0.12" 16 | -------------------------------------------------------------------------------- /lib/command-parser/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod escape; 2 | pub mod parser; 3 | pub mod tokenizer; 4 | -------------------------------------------------------------------------------- /lib/config-fs/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "config-fs" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base-io = { path = "../base-io" } 8 | config = { path = "../config" } 9 | 10 | anyhow = { version = "1.0.98", features = ["backtrace"] } 11 | -------------------------------------------------------------------------------- /lib/config-fs/src/lib.rs: -------------------------------------------------------------------------------- 1 | use base_io::io::{Io, IoFileSys}; 2 | use config::config::ConfigEngine; 3 | 4 | pub fn save(config: &ConfigEngine, io: &Io) { 5 | let save_str = config.to_json_string(); 6 | 7 | if let Ok(save_str) = save_str { 8 | let fs_clone = io.fs.clone(); 9 | io.rt.spawn_without_lifetime(async move { 10 | fs_clone 11 | .write_file("cfg_engine.json".as_ref(), save_str.as_bytes().to_vec()) 12 | .await 13 | .unwrap(); 14 | Ok(()) 15 | }); 16 | } 17 | } 18 | 19 | pub fn load(io: &IoFileSys) -> anyhow::Result { 20 | let fs = io.fs.clone(); 21 | let config_file = io 22 | .rt 23 | .spawn(async move { Ok(fs.read_file("cfg_engine.json".as_ref()).await?) }); 24 | let res = config_file.get_storage()?; 25 | ConfigEngine::from_json_slice(&res) 26 | } 27 | -------------------------------------------------------------------------------- /lib/config-macro/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "config-macro" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [lib] 7 | proc-macro = true 8 | 9 | [dependencies] 10 | proc-macro2 = "1.0.95" 11 | quote = "1.0.40" 12 | syn = { version = "2.0.101", features = ["full"] } 13 | -------------------------------------------------------------------------------- /lib/config/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "config" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | math = { path = "../math" } 8 | config-macro = { path = "../config-macro" } 9 | hiarc = { path = "../hiarc", features = ["derive"] } 10 | command-parser = { path = "../command-parser" } 11 | 12 | serde = { version = "1.0.219", features = ["derive"] } 13 | serde_json = "1.0.140" 14 | num-derive = "0.4.2" 15 | num-traits = "0.2.19" 16 | anyhow = { version = "1.0.98", features = ["backtrace"] } 17 | atomic_enum = "0.3.0" 18 | thiserror = "2.0.12" 19 | 20 | [package.metadata.cargo-machete] 21 | ignored = ["num-traits"] 22 | -------------------------------------------------------------------------------- /lib/config/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod config; 2 | pub mod parsing; 3 | pub mod traits; 4 | pub mod types; 5 | 6 | pub use config_macro::*; 7 | -------------------------------------------------------------------------------- /lib/game-database-macros/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "game-database-macros" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [lib] 7 | proc-macro = true 8 | 9 | [dependencies] 10 | proc-macro2 = "1.0.95" 11 | quote = "1.0.40" 12 | syn = { version = "2.0.101", features = ["full"] } 13 | -------------------------------------------------------------------------------- /lib/game-database/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "game-database" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | game-database-macros = { path = "../game-database-macros" } 8 | 9 | hiarc = { path = "../../lib/hiarc", features = ["derive"] } 10 | 11 | anyhow = { version = "1.0.98", features = ["backtrace"] } 12 | serde = { version = "1.0.219", features = ["derive"] } 13 | async-trait = "0.1.88" 14 | chrono = { version = "0.4.41", default-features = false, features = ["serde"] } 15 | futures = "0.3.31" 16 | 17 | [features] 18 | mysql = [] 19 | sqlite = [] 20 | 21 | default = ["mysql", "sqlite"] 22 | -------------------------------------------------------------------------------- /lib/game-database/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod dummy; 2 | pub mod execution_plan; 3 | pub mod statement; 4 | pub mod traits; 5 | pub mod types; 6 | 7 | pub use game_database_macros::StatementArgs; 8 | pub use game_database_macros::StatementResult; 9 | -------------------------------------------------------------------------------- /lib/graphics-backend-traits/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "graphics-backend-traits" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | pool = { path = "../pool" } 8 | graphics-types = { path = "../graphics-types" } 9 | graphics-base-traits = { path = "../graphics-base-traits" } 10 | hiarc = { path = "../hiarc", features = ["derive"] } 11 | anyhow = { version = "1.0.98", features = ["backtrace"] } 12 | thiserror = "2.0.12" 13 | bitflags = { version = "2.9.0", features = ["serde"] } 14 | -------------------------------------------------------------------------------- /lib/graphics-backend-traits/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod frame_fetcher_plugin; 2 | pub mod plugin; 3 | pub mod traits; 4 | pub mod types; 5 | 6 | pub fn add(left: usize, right: usize) -> usize { 7 | left + right 8 | } 9 | 10 | #[cfg(test)] 11 | mod tests { 12 | use super::*; 13 | 14 | #[test] 15 | fn it_works() { 16 | let result = add(2, 2); 17 | assert_eq!(result, 4); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/graphics-backend/src/backends/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod null; 2 | pub mod types; 3 | pub mod vulkan; 4 | -------------------------------------------------------------------------------- /lib/graphics-backend/src/backends/types.rs: -------------------------------------------------------------------------------- 1 | use std::{collections::HashMap, path::PathBuf, sync::Arc}; 2 | 3 | pub type BackendWriteFiles = Arc>>>; 4 | -------------------------------------------------------------------------------- /lib/graphics-backend/src/backends/vulkan/common.rs: -------------------------------------------------------------------------------- 1 | use ash::vk; 2 | 3 | pub fn image_mip_level_count_ex(width: usize, height: usize, depth: usize) -> usize { 4 | (((std::cmp::max(width, std::cmp::max(height, depth)) as f32).log2()).floor() + 1.0) as usize 5 | } 6 | 7 | pub fn image_mip_level_count(img_extent: vk::Extent3D) -> usize { 8 | image_mip_level_count_ex( 9 | img_extent.width as usize, 10 | img_extent.height as usize, 11 | img_extent.depth as usize, 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /lib/graphics-backend/src/backends/vulkan/compiler/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod compiler; 2 | -------------------------------------------------------------------------------- /lib/graphics-backend/src/backends/vulkan/fence.rs: -------------------------------------------------------------------------------- 1 | use std::sync::Arc; 2 | 3 | use ash::vk; 4 | use hiarc::Hiarc; 5 | 6 | use super::logical_device::LogicalDevice; 7 | 8 | #[derive(Debug, Hiarc)] 9 | pub struct Fence { 10 | #[hiarc_skip_unsafe] 11 | pub fence: vk::Fence, 12 | 13 | device: Arc, 14 | } 15 | 16 | impl Fence { 17 | pub fn new(device: Arc) -> anyhow::Result> { 18 | let mut fence_info = vk::FenceCreateInfo::default(); 19 | fence_info.flags = vk::FenceCreateFlags::SIGNALED; 20 | 21 | let fence = unsafe { device.device.create_fence(&fence_info, None) }?; 22 | 23 | Ok(Arc::new(Self { fence, device })) 24 | } 25 | } 26 | 27 | impl Drop for Fence { 28 | fn drop(&mut self) { 29 | unsafe { 30 | self.device.device.destroy_fence(self.fence, None); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/graphics-backend/src/backends/vulkan/queue.rs: -------------------------------------------------------------------------------- 1 | use std::sync::Arc; 2 | 3 | use ash::vk; 4 | use hiarc::Hiarc; 5 | 6 | #[derive(Debug, Hiarc)] 7 | pub struct VkQueues { 8 | #[hiarc_skip_unsafe] 9 | pub graphics_queue: vk::Queue, 10 | #[hiarc_skip_unsafe] 11 | pub present_queue: vk::Queue, 12 | } 13 | 14 | #[derive(Debug, Hiarc)] 15 | pub struct Queue { 16 | pub queues: parking_lot::Mutex, 17 | } 18 | 19 | impl Queue { 20 | pub fn new(graphics_queue: vk::Queue, present_queue: vk::Queue) -> Arc { 21 | Arc::new(Self { 22 | queues: parking_lot::Mutex::new(VkQueues { 23 | graphics_queue, 24 | present_queue, 25 | }), 26 | }) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/graphics-backend/src/backends/vulkan/vulkan_config.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | 3 | #[derive(Debug, Hiarc, Default, Clone)] 4 | pub struct Config { 5 | // device props 6 | pub allows_linear_blitting: bool, 7 | pub optimal_swap_chain_image_blitting: bool, 8 | pub optimal_rgba_image_blitting: bool, 9 | pub linear_rgba_image_blitting: bool, 10 | } 11 | -------------------------------------------------------------------------------- /lib/graphics-backend/src/backends/vulkan/vulkan_dbg.rs: -------------------------------------------------------------------------------- 1 | use config::config::{AtomicGfxDebugModes, GfxDebugModes}; 2 | 3 | /************************ 4 | * LOGGING 5 | ************************/ 6 | 7 | #[must_use] 8 | pub fn is_verbose_mode(dbg_gfx: GfxDebugModes) -> bool { 9 | let val = dbg_gfx; 10 | val == GfxDebugModes::Verbose || val == GfxDebugModes::All 11 | } 12 | 13 | #[must_use] 14 | pub fn is_verbose(dbg_gfx: &AtomicGfxDebugModes) -> bool { 15 | let val = dbg_gfx.load(std::sync::atomic::Ordering::Relaxed); 16 | val == GfxDebugModes::Verbose || val == GfxDebugModes::All 17 | } 18 | -------------------------------------------------------------------------------- /lib/graphics-backend/src/backends/vulkan/vulkan_limits.rs: -------------------------------------------------------------------------------- 1 | use ash::vk; 2 | use hiarc::Hiarc; 3 | 4 | #[derive(Debug, Hiarc, Default, Clone)] 5 | pub struct Limits { 6 | pub non_coherent_mem_alignment: vk::DeviceSize, 7 | pub optimal_image_copy_mem_alignment: vk::DeviceSize, 8 | 9 | pub max_texture_size: u32, 10 | pub max_sampler_anisotropy: u32, 11 | #[hiarc_skip_unsafe] 12 | pub max_multi_sample: vk::SampleCountFlags, 13 | 14 | pub min_uniform_align: u32, 15 | } 16 | -------------------------------------------------------------------------------- /lib/graphics-backend/src/cache.rs: -------------------------------------------------------------------------------- 1 | use std::sync::Arc; 2 | 3 | use base_io_traits::fs_traits::FileSystemInterface; 4 | use cache::Cache; 5 | 6 | pub async fn get_backend_cache(fs: &Arc) -> Cache<6012025> { 7 | Cache::new_async("graphics-backend-cache", fs).await 8 | } 9 | -------------------------------------------------------------------------------- /lib/graphics-base-traits/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "graphics-base-traits" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | graphics-types = { path = "../graphics-types" } 8 | pool = { path = "../pool" } 9 | hiarc = { path = "../hiarc", features = ["derive"] } 10 | anyhow = { version = "1.0.98", features = ["backtrace"] } 11 | serde = { version = "1.0.219", features = ["derive"] } 12 | bincode = { features = ["serde"], version = "2.0.1" } 13 | -------------------------------------------------------------------------------- /lib/graphics-base-traits/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod traits; 2 | -------------------------------------------------------------------------------- /lib/graphics-types/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "graphics-types" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | math = { path = "../math" } 8 | pool = { path = "../pool", features = ["enable_hiarc"] } 9 | hiarc = { path = "../hiarc", features = ["enable_hashlink"] } 10 | num-traits = "0.2.19" 11 | bitflags = { version = "2.9.0", features = ["serde"] } 12 | serde = "1.0.219" 13 | 14 | [package.metadata.cargo-machete] 15 | ignored = ["num-traits"] 16 | -------------------------------------------------------------------------------- /lib/graphics-types/src/gpu.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | #[derive(Debug, Hiarc, Copy, Clone, Serialize, Deserialize, PartialEq, PartialOrd)] 5 | pub enum GpuType { 6 | Discrete = 0, 7 | Integrated, 8 | Virtual, 9 | Cpu, 10 | 11 | // should stay at last position in this enum 12 | Invalid, 13 | } 14 | 15 | #[derive(Debug, Hiarc, Clone, Serialize, Deserialize)] 16 | pub struct Gpu { 17 | pub name: String, 18 | pub ty: GpuType, 19 | } 20 | 21 | #[derive(Debug, Hiarc, Clone, Serialize, Deserialize)] 22 | pub struct CurGpu { 23 | pub name: String, 24 | pub msaa_sampling_count: u32, 25 | pub ty: GpuType, 26 | } 27 | 28 | #[derive(Debug, Hiarc, Clone, Serialize, Deserialize)] 29 | pub struct Gpus { 30 | pub gpus: Vec, 31 | pub auto: Gpu, 32 | pub cur: CurGpu, 33 | } 34 | -------------------------------------------------------------------------------- /lib/graphics-types/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::too_many_arguments)] 2 | 3 | pub mod commands; 4 | pub mod gpu; 5 | pub mod rendering; 6 | pub mod types; 7 | -------------------------------------------------------------------------------- /lib/graphics/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "graphics" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | math = { path = "../math" } 8 | graphics-backend-traits = { path = "../graphics-backend-traits" } 9 | graphics-types = { path = "../graphics-types" } 10 | graphics-base-traits = { path = "../graphics-base-traits" } 11 | image-utils = { path = "../image-utils" } 12 | pool = { path = "../pool", features = ["enable_hiarc"] } 13 | hiarc = { path = "../hiarc", features = ["derive"] } 14 | anyhow = { version = "1.0.98", features = ["backtrace"] } 15 | -------------------------------------------------------------------------------- /lib/graphics/src/handles/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod backend; 2 | pub mod buffer_object; 3 | pub mod canvas; 4 | pub mod quad_container; 5 | pub mod shader_storage; 6 | pub mod stream; 7 | pub mod stream_types; 8 | pub mod texture; 9 | -------------------------------------------------------------------------------- /lib/graphics/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::too_many_arguments)] 2 | #![allow(clippy::module_inception)] 3 | 4 | pub mod graphics; 5 | pub mod graphics_mt; 6 | pub mod handles; 7 | pub mod quad_container; 8 | pub mod streaming; 9 | pub mod utils; 10 | pub mod window_handling; 11 | -------------------------------------------------------------------------------- /lib/graphics/src/window_handling.rs: -------------------------------------------------------------------------------- 1 | use super::graphics::graphics::Graphics; 2 | 3 | pub struct WindowEventPipe<'a> { 4 | pub graphics: &'a mut Graphics, 5 | } 6 | 7 | pub struct WindowHandling<'a> { 8 | pub pipe: WindowEventPipe<'a>, 9 | } 10 | -------------------------------------------------------------------------------- /lib/hiarc-macro/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hiarc-macro" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [lib] 7 | proc-macro = true 8 | 9 | [dependencies] 10 | proc-macro2 = "1.0.95" 11 | quote = "1.0.40" 12 | syn = { version = "2.0.101", features = ["full", "extra-traits"] } 13 | 14 | [dev-dependencies] 15 | hiarc = { path = "../hiarc" } 16 | -------------------------------------------------------------------------------- /lib/hiarc-macro/src/safe_wrapper/arc_mutex.rs: -------------------------------------------------------------------------------- 1 | use proc_macro::TokenStream; 2 | use quote::quote; 3 | 4 | use super::wrapper::hiarc_safer_wrapper; 5 | 6 | pub(crate) fn hiarc_safer_arc_mutex_impl(attr: TokenStream, tokens: TokenStream) -> TokenStream { 7 | hiarc_safer_wrapper( 8 | attr, 9 | tokens, 10 | |ty| quote!(std::sync::Arc>), 11 | |inner| quote!(std::sync::Arc::new(hiarc::HiUnsafeMutex::new(#inner))), 12 | quote!(std::sync::Arc), 13 | true, 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /lib/hiarc-macro/src/safe_wrapper/mod.rs: -------------------------------------------------------------------------------- 1 | pub(crate) mod arc_mutex; 2 | pub(crate) mod rc_refcell; 3 | pub(crate) mod refcell; 4 | mod wrapper; 5 | -------------------------------------------------------------------------------- /lib/hiarc-macro/src/safe_wrapper/rc_refcell.rs: -------------------------------------------------------------------------------- 1 | use proc_macro::TokenStream; 2 | use quote::quote; 3 | 4 | use super::wrapper::hiarc_safer_wrapper; 5 | 6 | pub(crate) fn hiarc_safer_rc_refcell_impl(attr: TokenStream, tokens: TokenStream) -> TokenStream { 7 | hiarc_safer_wrapper( 8 | attr, 9 | tokens, 10 | |ty| quote!(std::rc::Rc>), 11 | |inner| quote!(std::rc::Rc::new(hiarc::HiUnsafeRefCell::new(#inner))), 12 | quote!(std::rc::Rc), 13 | true, 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /lib/hiarc-macro/src/safe_wrapper/refcell.rs: -------------------------------------------------------------------------------- 1 | use proc_macro::TokenStream; 2 | use quote::quote; 3 | 4 | use super::wrapper::hiarc_safer_wrapper; 5 | 6 | pub(crate) fn hiarc_safer_refcell_impl(attr: TokenStream, tokens: TokenStream) -> TokenStream { 7 | hiarc_safer_wrapper( 8 | attr, 9 | tokens, 10 | |ty| quote!(hiarc::HiUnsafeRefCell<#ty>), 11 | |inner| quote!(hiarc::HiUnsafeRefCell::new(#inner)), 12 | quote!(), 13 | false, 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /lib/image-utils/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "image-utils" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | anyhow = { version = "1.0.98", features = ["backtrace"] } 8 | png = "0.17.16" 9 | image = { version = "0.25.6", default-features = false } 10 | rayon = "1.10.0" 11 | -------------------------------------------------------------------------------- /lib/image-utils/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod png; 2 | pub mod utils; 3 | -------------------------------------------------------------------------------- /lib/input-binds/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "input-binds" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../base" } 8 | pool = { path = "../pool" } 9 | hiarc = { path = "../hiarc", features = ["enable_winit"] } 10 | serde = { version = "1.0.219", features = ["derive"] } 11 | winit = { version = "0.30.10", features = ["serde", "android-native-activity"] } 12 | 13 | [dev-dependencies] 14 | serde_json = "1.0.140" 15 | -------------------------------------------------------------------------------- /lib/input-binds/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod binds; 2 | 3 | #[cfg(test)] 4 | mod test { 5 | use winit::keyboard::{KeyCode, PhysicalKey}; 6 | 7 | use crate::binds::BindKey; 8 | 9 | #[test] 10 | fn bind_json_abuse() { 11 | dbg!(serde_json::to_string(&KeyCode::KeyA).unwrap()); 12 | dbg!(serde_json::to_string(&BindKey::Key(PhysicalKey::Code(KeyCode::KeyA))).unwrap()); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/math/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "math" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | hiarc = { path = "../hiarc", features = ["derive", "enable_fixed"] } 8 | serde = { version = "1.0.219", features = ["derive"] } 9 | rand = { version = "0.9.1", default-features = false } 10 | rand_xoshiro = "0.7.0" 11 | num-traits = { version = "0.2.19", features = ["libm"] } 12 | palette = "0.7.6" 13 | fixed = { version = "1.29.0", features = ["serde", "serde-str"] } 14 | -------------------------------------------------------------------------------- /lib/math/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![deny(warnings)] 2 | #![deny(clippy::all)] 3 | 4 | pub mod colors; 5 | pub mod math; 6 | -------------------------------------------------------------------------------- /lib/microphone/src/cpal_opus/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod analyze_stream; 2 | pub mod manager; 3 | pub mod noise_gate; 4 | pub mod sound_stream; 5 | -------------------------------------------------------------------------------- /lib/microphone/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(feature = "cpal_opus")] 2 | mod cpal_opus; 3 | #[cfg(not(feature = "cpal_opus"))] 4 | mod null; 5 | 6 | pub mod stream; 7 | pub mod stream_sample; 8 | pub mod traits; 9 | pub mod types; 10 | 11 | #[cfg(feature = "cpal_opus")] 12 | pub type AnalyzeStream = cpal_opus::analyze_stream::AnalyzeStream; 13 | #[cfg(feature = "cpal_opus")] 14 | pub type SoundStream = cpal_opus::sound_stream::SoundStream; 15 | #[cfg(feature = "cpal_opus")] 16 | pub type MicrophoneManager = cpal_opus::manager::MicrophoneManager; 17 | 18 | #[cfg(not(feature = "cpal_opus"))] 19 | pub type AnalyzeStream = null::analyze_stream::AnalyzeStream; 20 | #[cfg(not(feature = "cpal_opus"))] 21 | pub type SoundStream = null::sound_stream::SoundStream; 22 | #[cfg(not(feature = "cpal_opus"))] 23 | pub type MicrophoneManager = null::manager::Manager; 24 | -------------------------------------------------------------------------------- /lib/microphone/src/null/analyze_stream.rs: -------------------------------------------------------------------------------- 1 | use std::sync::{Arc, RwLock}; 2 | 3 | use hiarc::Hiarc; 4 | 5 | use crate::stream::MicrophoneStream; 6 | 7 | #[derive(Debug, Hiarc, Default)] 8 | pub struct AnalyzeStream { 9 | pub cur_loudest: Arc>, 10 | } 11 | 12 | impl AnalyzeStream { 13 | pub fn new(_microphone: MicrophoneStream) -> Self { 14 | Self::default() 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/microphone/src/null/manager.rs: -------------------------------------------------------------------------------- 1 | use anyhow::anyhow; 2 | use hiarc::Hiarc; 3 | 4 | use crate::{ 5 | traits::Microphone, 6 | types::{MicrophoneDevices, MicrophoneHosts}, 7 | }; 8 | 9 | #[derive(Debug, Hiarc, Default)] 10 | pub struct Manager; 11 | 12 | impl Microphone for Manager { 13 | fn hosts(&self) -> MicrophoneHosts { 14 | MicrophoneHosts { 15 | default: "null".to_string(), 16 | hosts: Default::default(), 17 | } 18 | } 19 | 20 | fn devices(&self, _host: &str) -> anyhow::Result { 21 | Err(anyhow!("null host has no devices.")) 22 | } 23 | 24 | fn stream_opus( 25 | &self, 26 | _host: &str, 27 | _device: &str, 28 | _settings: crate::types::MicrophoneNoiseFilterSettings, 29 | ) -> anyhow::Result { 30 | Err(anyhow!("null can no start streams.")) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/microphone/src/null/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod analyze_stream; 2 | pub mod manager; 3 | pub mod sound_stream; 4 | -------------------------------------------------------------------------------- /lib/microphone/src/stream.rs: -------------------------------------------------------------------------------- 1 | use crossbeam::channel::Receiver; 2 | 3 | use crate::{stream_sample::StreamSample, traits::MicrophoneStreamRaii}; 4 | 5 | pub struct MicrophoneStream { 6 | pub opus_receiver: Receiver, 7 | pub(crate) inner: Box, 8 | } 9 | 10 | impl MicrophoneStream { 11 | pub fn split(self) -> (Box, Receiver) { 12 | (self.inner, self.opus_receiver) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/microphone/src/stream_sample.rs: -------------------------------------------------------------------------------- 1 | use hiarc::Hiarc; 2 | 3 | #[derive(Debug, Hiarc)] 4 | pub struct StreamSample { 5 | pub data: Vec, 6 | } 7 | -------------------------------------------------------------------------------- /lib/microphone/src/traits.rs: -------------------------------------------------------------------------------- 1 | use crate::{ 2 | stream::MicrophoneStream, 3 | types::{MicrophoneDevices, MicrophoneHosts, MicrophoneNoiseFilterSettings}, 4 | }; 5 | 6 | /// Just a RAII object that keeps the stream running 7 | pub trait MicrophoneStreamRaii {} 8 | 9 | pub trait Microphone { 10 | fn hosts(&self) -> MicrophoneHosts; 11 | 12 | fn devices(&self, host: &str) -> anyhow::Result; 13 | 14 | /// When the stream handle is dropped, the recording ends. 15 | fn stream_opus( 16 | &self, 17 | host: &str, 18 | device: &str, 19 | settings: MicrophoneNoiseFilterSettings, 20 | ) -> anyhow::Result; 21 | } 22 | -------------------------------------------------------------------------------- /lib/native-display/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "native-display" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | raw-window-handle = "0.6.2" 8 | anyhow = { version = "1.0.98", features = ["backtrace"] } 9 | -------------------------------------------------------------------------------- /lib/native/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "native" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../base" } 8 | native-display = { path = "../native-display" } 9 | 10 | anyhow = { version = "1.0.98", features = ["backtrace"] } 11 | raw-window-handle = "0.6.2" 12 | log = "0.4.27" 13 | winit = { version = "0.30.10", features = ["serde", "android-native-activity"] } 14 | -------------------------------------------------------------------------------- /lib/native/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod input; 2 | pub mod native; 3 | -------------------------------------------------------------------------------- /lib/native/src/native/app.rs: -------------------------------------------------------------------------------- 1 | #[cfg(not(target_os = "android"))] 2 | pub type NativeApp = (); 3 | 4 | #[cfg(target_os = "android")] 5 | pub use winit::platform::android::activity::AndroidApp as NativeApp; 6 | 7 | pub const MIN_WINDOW_WIDTH: u32 = 50; 8 | pub const MIN_WINDOW_HEIGHT: u32 = 50; 9 | -------------------------------------------------------------------------------- /lib/network/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::too_many_arguments)] 2 | #![allow(clippy::module_inception)] 3 | 4 | pub mod network; 5 | -------------------------------------------------------------------------------- /lib/network/src/network/packet_compressor/header.rs: -------------------------------------------------------------------------------- 1 | use serde::{Deserialize, Serialize}; 2 | 3 | #[derive(Debug, Serialize, Deserialize)] 4 | pub struct CompressHeader { 5 | pub size: usize, 6 | pub is_compressed: bool, 7 | } 8 | -------------------------------------------------------------------------------- /lib/network/src/network/packet_compressor/types.rs: -------------------------------------------------------------------------------- 1 | #[derive(Debug, Default, Clone, Copy)] 2 | pub enum DecompressionByteLimit { 3 | #[default] 4 | FourMegaBytes, 5 | OneGigaByte, 6 | } 7 | -------------------------------------------------------------------------------- /lib/network/src/network/utils.rs: -------------------------------------------------------------------------------- 1 | use ed25519_dalek::{pkcs8::EncodePrivateKey, SigningKey}; 2 | use rcgen::{CertificateParams, KeyPair, PKCS_ED25519}; 3 | use spki::der::{pem::LineEnding, Decode}; 4 | 5 | pub fn create_certifified_keys() -> (x509_cert::Certificate, SigningKey) { 6 | let mut rng = rand::rngs::OsRng; 7 | let private_key = SigningKey::generate(&mut rng); 8 | 9 | let key = private_key.to_pkcs8_pem(LineEnding::LF).unwrap(); 10 | let key_pair = KeyPair::from_pkcs8_pem_and_sign_algo(&key, &PKCS_ED25519).unwrap(); 11 | let cert = CertificateParams::new(vec!["localhost".into()]) 12 | .unwrap() 13 | .self_signed(&key_pair) 14 | .unwrap(); 15 | 16 | // yep, this is stupid, didn't get x509_cert to work with ed25519 keys 17 | ( 18 | x509_cert::Certificate::from_der(cert.der()).unwrap(), 19 | private_key, 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /lib/pool/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pool" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | hiarc = { path = "../hiarc", features = ["enable_parking_lot", "derive"], optional = true } 10 | hashlink = { git = "https://github.com/Jupeyy/hashlink/", branch = "ddnet", features = ["serde", "serde_impl"] } 11 | bincode = { version = "2.0.1", features = ["serde"] } 12 | serde = { version = "1.0.219", features = ["derive", "rc"] } 13 | parking_lot = "0.12.3" 14 | rustc-hash = "2.1.1" 15 | 16 | [features] 17 | enable_hiarc = ["hiarc"] 18 | -------------------------------------------------------------------------------- /lib/pool/src/mixed_datatypes.rs: -------------------------------------------------------------------------------- 1 | use crate::mixed_pool::Pool; 2 | 3 | pub type StringPool = Pool; 4 | -------------------------------------------------------------------------------- /lib/sound-backend/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sound-backend" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../base" } 8 | math = { path = "../math" } 9 | hiarc = { path = "../hiarc", features = ["derive", "enable_kira", "enable_hashlink", "enable_rustc_hash", "enable_mint"] } 10 | sound = { path = "../sound" } 11 | config = { path = "../config" } 12 | kira = "0.9.6" 13 | mint = "0.5.9" 14 | anyhow = { version = "1.0.98", features = ["backtrace"] } 15 | log = "0.4.27" 16 | -------------------------------------------------------------------------------- /lib/sound-backend/src/backend/kira/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod instance; 2 | pub mod kira; 3 | mod listener; 4 | pub mod mem_allocator; 5 | pub mod scene; 6 | pub mod sound; 7 | pub mod stream; 8 | -------------------------------------------------------------------------------- /lib/sound-backend/src/backend/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod kira; 2 | pub mod null; 3 | -------------------------------------------------------------------------------- /lib/sound-backend/src/backend/null/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod null; 2 | -------------------------------------------------------------------------------- /lib/sound-backend/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::module_inception)] 2 | 3 | pub mod backend; 4 | pub mod backend_thread; 5 | pub mod sound_backend; 6 | -------------------------------------------------------------------------------- /lib/sound/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sound" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../base" } 8 | math = { path = "../math" } 9 | hiarc = { path = "../hiarc", features = ["derive"] } 10 | 11 | anyhow = { version = "1.0.98", features = ["backtrace"] } 12 | serde = { version = "1.0.219", features = ["derive"] } 13 | thiserror = "2.0.12" 14 | -------------------------------------------------------------------------------- /lib/sound/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod backend_handle; 2 | pub mod backend_types; 3 | pub mod commands; 4 | pub mod frame_fetcher_plugin; 5 | pub mod scene_handle; 6 | pub mod scene_object; 7 | pub mod scene_object_shared; 8 | pub mod sound; 9 | pub mod sound_handle; 10 | pub mod sound_listener; 11 | pub mod sound_listener_handle; 12 | pub mod sound_mt; 13 | pub mod sound_mt_types; 14 | pub mod sound_object; 15 | pub mod sound_object_shared; 16 | pub mod sound_play_handle; 17 | pub mod stream; 18 | pub mod stream_handle; 19 | pub mod stream_object; 20 | pub mod types; 21 | -------------------------------------------------------------------------------- /lib/sound/src/scene_object_shared.rs: -------------------------------------------------------------------------------- 1 | use std::rc::Rc; 2 | 3 | use hiarc::Hiarc; 4 | 5 | use crate::{ 6 | backend_handle::SoundBackendHandle, 7 | commands::{SoundCommand, SoundCommandSoundScene, SoundCommandState}, 8 | }; 9 | 10 | #[derive(Debug, Hiarc)] 11 | pub struct SceneObjectInner { 12 | pub(crate) id: u128, 13 | pub(crate) backend_handle: SoundBackendHandle, 14 | } 15 | 16 | impl SceneObjectInner { 17 | pub fn new(id: u128, backend_handle: SoundBackendHandle) -> Rc { 18 | Rc::new(Self { backend_handle, id }) 19 | } 20 | } 21 | 22 | impl Drop for SceneObjectInner { 23 | fn drop(&mut self) { 24 | self.backend_handle 25 | .add_cmd(SoundCommand::State(SoundCommandState::SoundScene( 26 | SoundCommandSoundScene::Destroy { id: self.id }, 27 | ))); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/sound/src/sound_handle.rs: -------------------------------------------------------------------------------- 1 | use std::rc::Rc; 2 | 3 | use hiarc::{hiarc_safer_rc_refcell, Hiarc}; 4 | 5 | use crate::{ 6 | scene_object_shared::SceneObjectInner, sound_mt_types::SoundBackendMemory, 7 | sound_object::SoundObject, 8 | }; 9 | 10 | /// handles sound creation 11 | #[hiarc_safer_rc_refcell] 12 | #[derive(Debug, Hiarc)] 13 | pub struct SoundObjectHandle { 14 | id_gen: u128, 15 | 16 | scene: Rc, 17 | } 18 | 19 | #[hiarc_safer_rc_refcell] 20 | impl SoundObjectHandle { 21 | pub fn new(scene: Rc) -> Self { 22 | Self { id_gen: 0, scene } 23 | } 24 | 25 | pub fn create(&mut self, mem: SoundBackendMemory) -> SoundObject { 26 | let id = self.id_gen; 27 | self.id_gen += 1; 28 | 29 | SoundObject::new(id, mem, self.scene.clone()) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/sound/src/sound_listener_handle.rs: -------------------------------------------------------------------------------- 1 | use std::rc::Rc; 2 | 3 | use hiarc::{hiarc_safer_rc_refcell, Hiarc}; 4 | use math::math::vector::vec2; 5 | 6 | use crate::{scene_object_shared::SceneObjectInner, sound_listener::SoundListener}; 7 | 8 | /// Allocates new sound listeners 9 | #[hiarc_safer_rc_refcell] 10 | #[derive(Debug, Hiarc)] 11 | pub struct SoundListenerHandle { 12 | id_gen: u128, 13 | scene: Rc, 14 | } 15 | 16 | #[hiarc_safer_rc_refcell] 17 | impl SoundListenerHandle { 18 | pub fn new(scene: Rc) -> Self { 19 | Self { id_gen: 0, scene } 20 | } 21 | 22 | pub fn create(&mut self, pos: vec2) -> SoundListener { 23 | let id = self.id_gen; 24 | self.id_gen += 1; 25 | 26 | SoundListener::new(id, pos, self.scene.clone()) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/sound/src/sound_mt.rs: -------------------------------------------------------------------------------- 1 | use std::{ops::Deref, sync::Arc}; 2 | 3 | use hiarc::Hiarc; 4 | 5 | use crate::backend_types::SoundManagerMtInterface; 6 | 7 | #[derive(Debug, Hiarc, Clone)] 8 | pub struct SoundMultiThreaded(#[hiarc_skip_unsafe] pub(crate) Arc); 9 | 10 | impl Deref for SoundMultiThreaded { 11 | type Target = dyn SoundManagerMtInterface; 12 | 13 | fn deref(&self) -> &Self::Target { 14 | self.0.as_ref() 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/sound/src/stream.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | use hiarc::Hiarc; 4 | 5 | #[derive(Debug, Hiarc, Default, Clone, Copy)] 6 | pub struct StreamFrame { 7 | pub left: f32, 8 | pub right: f32, 9 | } 10 | 11 | pub enum DecodeError { 12 | /// Generate `usize` empty samples 13 | MustGenerateEmpty(usize), 14 | Err(anyhow::Error), 15 | } 16 | 17 | pub trait StreamDecoder: 'static + Debug + Send + Sync { 18 | // Required methods 19 | fn sample_rate(&self) -> u32; 20 | fn num_frames(&self) -> usize; 21 | fn decode(&self) -> Result, DecodeError>; 22 | fn seek(&self, index: usize) -> Result; 23 | } 24 | -------------------------------------------------------------------------------- /lib/sql/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sql" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | game-database = { path = "../game-database", default-features = false } 8 | 9 | anyhow = { version = "1.0.98", features = ["backtrace"] } 10 | sqlx = { version = "0.8.5", features = ["runtime-tokio-rustls", "chrono"] } 11 | ddnet-account-sql = { version = "0.3.0", default-features = false } 12 | 13 | [features] 14 | mysql = ["ddnet-account-sql/mysql", "game-database/mysql", "sqlx/mysql"] 15 | sqlite = ["ddnet-account-sql/sqlite", "game-database/sqlite", "sqlx/sqlite"] 16 | 17 | default = ["mysql", "sqlite"] 18 | -------------------------------------------------------------------------------- /lib/sql/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod database; 2 | -------------------------------------------------------------------------------- /lib/steam/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "steam" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../base" } 8 | 9 | steamworks = { version = "0.11.0", optional = true } 10 | 11 | anyhow = { version = "1.0.98", features = ["backtrace"] } 12 | log = "0.4.27" 13 | tokio = { version = "1.45.0", features = ["rt-multi-thread", "sync", "fs", "time", "macros"] } 14 | async-trait = "0.1.88" 15 | 16 | [features] 17 | runtime = ["steamworks"] 18 | 19 | -------------------------------------------------------------------------------- /lib/steam/src/stub.rs: -------------------------------------------------------------------------------- 1 | use anyhow::anyhow; 2 | use async_trait::async_trait; 3 | 4 | use crate::traits::{SteamClient, SteamRaii}; 5 | 6 | pub struct SteamSt; 7 | impl SteamRaii for SteamSt {} 8 | 9 | pub struct SteamMt; 10 | #[async_trait] 11 | impl SteamClient for SteamMt { 12 | fn is_stub(&self) -> bool { 13 | true 14 | } 15 | 16 | fn steam_id64(&self) -> i64 { 17 | -1 18 | } 19 | 20 | fn steam_user_name(&self) -> String { 21 | "invalid".to_string() 22 | } 23 | 24 | async fn session_ticket_for_webapi(&self) -> anyhow::Result> { 25 | Err(anyhow!("This is just a stub.")) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/steam/src/traits.rs: -------------------------------------------------------------------------------- 1 | use async_trait::async_trait; 2 | 3 | /// The functionality of the steam client 4 | #[async_trait] 5 | pub trait SteamClient: Send + Sync { 6 | fn is_stub(&self) -> bool; 7 | 8 | fn steam_id64(&self) -> i64; 9 | fn steam_user_name(&self) -> String; 10 | 11 | async fn session_ticket_for_webapi(&self) -> anyhow::Result>; 12 | } 13 | 14 | /// The underlaying object is a RAII object 15 | /// and must be kept alive during the whole runtime 16 | /// of the app. 17 | pub trait SteamRaii {} 18 | -------------------------------------------------------------------------------- /lib/ui-base/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ui-base" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base-io = { path = "../base-io" } 8 | math = { path = "../math" } 9 | graphics = { path = "../graphics" } 10 | graphics-types = { path = "../graphics-types" } 11 | hiarc = { path = "../hiarc", features = ["enable_egui"] } 12 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 13 | egui_extras = { version = "0.31.1" } 14 | serde = { version = "1.0.219", features = ["derive"] } 15 | anyhow = { version = "1.0.98", features = ["backtrace"] } 16 | -------------------------------------------------------------------------------- /lib/ui-base/src/components/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod clearable_edit_field; 2 | pub mod edit_text; 3 | pub mod menu_top_button; 4 | -------------------------------------------------------------------------------- /lib/ui-base/src/custom_callback.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | pub trait CustomCallbackTrait: Debug + 'static { 4 | fn render(&self); 5 | } 6 | -------------------------------------------------------------------------------- /lib/ui-base/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::too_many_arguments)] 2 | 3 | pub mod better_frame; 4 | pub mod components; 5 | pub mod custom_callback; 6 | pub mod font_data; 7 | pub mod remember_mut; 8 | pub mod style; 9 | pub mod types; 10 | pub mod ui; 11 | pub mod ui_render; 12 | pub mod utils; 13 | -------------------------------------------------------------------------------- /lib/ui-generic/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ui-generic" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | ui-base = { path = "../ui-base" } 8 | graphics = { path = "../graphics" } 9 | math = { path = "../math" } 10 | 11 | egui = { version = "0.31.1", default-features = false, features = ["serde"] } 12 | -------------------------------------------------------------------------------- /lib/ui-generic/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod generic_ui_renderer; 2 | pub mod traits; 3 | -------------------------------------------------------------------------------- /lib/ui-generic/src/traits.rs: -------------------------------------------------------------------------------- 1 | use ui_base::types::{UiRenderPipe, UiState}; 2 | 3 | pub trait UiPageInterface { 4 | /// actually render the ui 5 | fn render(&mut self, ui: &mut egui::Ui, pipe: &mut UiRenderPipe, ui_state: &mut UiState); 6 | 7 | /// called exactly once, when the ui was mounted and the implementation that uses 8 | /// this ui supports this event. 9 | /// This event is usually useful to prepare some resources. 10 | fn mount(&mut self) {} 11 | 12 | /// Called exactly once, when the ui is about to be unmounted and the implementation that uses 13 | /// this ui supports this event. 14 | /// This event is usually useful to free some reasources. 15 | /// For reliable cleanup the destructor/Drop should still be prefered 16 | fn unmount(&mut self) {} 17 | } 18 | -------------------------------------------------------------------------------- /lib/wasm-logic-db/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wasm-logic-db" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base-io = { path = "../base-io" } 8 | wasm-runtime-types = { path = "../wasm-runtime-types" } 9 | game-database = { path = "../game-database" } 10 | 11 | wasmer = { version = "6.0.0", default-features = false, features = ["sys", "cranelift"] } 12 | sendable = "0.6.1" 13 | -------------------------------------------------------------------------------- /lib/wasm-logic-db/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod db; 2 | -------------------------------------------------------------------------------- /lib/wasm-logic-fs/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wasm-logic-fs" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base-io = { path = "../base-io" } 8 | base-io-traits = { path = "../base-io-traits" } 9 | wasm-runtime-types = { path = "../wasm-runtime-types" } 10 | 11 | wasmer = { version = "6.0.0", default-features = false, features = ["sys", "cranelift"] } 12 | sendable = "0.6.1" 13 | -------------------------------------------------------------------------------- /lib/wasm-logic-fs/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod fs; 2 | -------------------------------------------------------------------------------- /lib/wasm-logic-graphics/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wasm-logic-graphics" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | graphics-types = { path = "../graphics-types" } 8 | graphics = { path = "../graphics" } 9 | graphics-backend = { path = "../graphics-backend" } 10 | graphics-backend-traits = { path = "../graphics-backend-traits" } 11 | hiarc = { path = "../hiarc", features = ["derive"] } 12 | wasm-runtime-types = { path = "../wasm-runtime-types" } 13 | 14 | wasmer = { version = "6.0.0", default-features = false, features = ["sys", "cranelift"] } 15 | sendable = "0.6.1" 16 | -------------------------------------------------------------------------------- /lib/wasm-logic-http/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wasm-logic-http" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../base" } 8 | base-io = { path = "../base-io" } 9 | base-io-traits = { path = "../base-io-traits" } 10 | wasm-runtime-types = { path = "../wasm-runtime-types" } 11 | 12 | wasmer = { version = "6.0.0", default-features = false, features = ["sys", "cranelift"] } 13 | url = { version = "2.5.4", features = ["serde"] } 14 | bytes = { version = "1.10.1", features = ["serde"] } 15 | sendable = "0.6.1" 16 | -------------------------------------------------------------------------------- /lib/wasm-logic-http/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod http; 2 | -------------------------------------------------------------------------------- /lib/wasm-logic-sound/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wasm-logic-sound" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../base" } 8 | sound = { path = "../sound" } 9 | wasm-runtime-types = { path = "../wasm-runtime-types" } 10 | hiarc = { path = "../hiarc", features = ["derive", "enable_hashlink", "enable_rustc_hash"] } 11 | wasmer = { version = "6.0.0", default-features = false, features = ["sys", "cranelift"] } 12 | anyhow = { version = "1.0.98", features = ["backtrace"] } 13 | sendable = "0.6.1" 14 | -------------------------------------------------------------------------------- /lib/wasm-logic-sound/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod checker; 2 | pub mod sound; 3 | -------------------------------------------------------------------------------- /lib/wasm-runtime-types/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wasm-runtime-types" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | pool = { path = "../pool" } 8 | 9 | wasmer = { version = "6.0.0", default-features = false, features = ["sys", "cranelift"] } 10 | bincode = "2.0.1" 11 | serde = "1.0.219" 12 | sendable = "0.6.1" 13 | -------------------------------------------------------------------------------- /lib/wasm-runtime/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wasm-runtime" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | wasm-runtime-types = { path = "../wasm-runtime-types" } 8 | anyhow = { version = "1.0.98", features = ["backtrace"] } 9 | wasmer = { version = "6.0.0", default-features = false, features = ["sys", "cranelift"] } 10 | bincode = { version = "2.0.1", features = ["serde"] } 11 | arrayvec = "0.7.6" 12 | serde = "1.0.219" 13 | -------------------------------------------------------------------------------- /manifest.yaml: -------------------------------------------------------------------------------- 1 | android: 2 | manifest: 3 | uses_permission: 4 | - name: "android.permission.ACCESS_WIFI_STATE" 5 | - name: "android.permission.CHANGE_WIFI_MULTICAST_STATE" 6 | - name: "android.permission.ACCESS_NETWORK_STATE" 7 | - name: "android.permission.INTERNET" 8 | uses_feature: 9 | - 10 | name: "android.hardware.screen.landscape" 11 | required: true 12 | application: 13 | activities: 14 | - 15 | config_changes: "orientation|screenSize|screenLayout|keyboardHidden" 16 | orientation: "landscape" 17 | hardware_accelerated: true 18 | theme: "@android:style/Theme.NoTitleBar.Fullscreen" 19 | debuggable: true 20 | -------------------------------------------------------------------------------- /src/assets-server/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "assets-server" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../../lib/base" } 8 | image-utils = { path = "../../lib/image-utils" } 9 | 10 | assets-base = { path = "../../game/assets-base" } 11 | 12 | tokio = { version = "1.45.0", features = ["rt-multi-thread", "sync", "fs", "net", "time", "macros"] } 13 | anyhow = { version = "1.0.98", features = ["backtrace"] } 14 | axum = { version = "0.8.4" } 15 | 16 | tower-http = { version = "0.6.2", features = ["fs", "trace"] } 17 | tower-service = { version = "0.3.3" } 18 | serde_json = "1.0.140" 19 | clap = { version = "4.5.37", features = ["derive"] } 20 | urlencoding = "2.1.3" 21 | parking_lot = "0.12.3" 22 | log = "0.4.27" 23 | env_logger = "0.11.8" 24 | dotenvy = "0.15.7" 25 | -------------------------------------------------------------------------------- /src/assets-server/README.md: -------------------------------------------------------------------------------- 1 | Assets server needs all asset dirs to exist, even if empty: 2 | 3 | ```bash 4 | mkdir -p skins entities ctfs emoticons flags freezes games hooks huds ninjas particles weapons map/resources/images map/resources/sounds editor/rules 5 | ``` 6 | -------------------------------------------------------------------------------- /src/client/input/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod input_handling; 2 | -------------------------------------------------------------------------------- /src/client/localplayer/dummy_control.rs: -------------------------------------------------------------------------------- 1 | use std::time::Duration; 2 | 3 | #[derive(Debug, Default, Clone, Copy)] 4 | pub enum DummyHammerState { 5 | #[default] 6 | None, 7 | Active { 8 | last_hammer: Option, 9 | }, 10 | } 11 | 12 | #[derive(Debug, Default)] 13 | pub struct DummyControlState { 14 | // dummy controls 15 | pub dummy_copy_moves: bool, 16 | pub dummy_hammer: DummyHammerState, 17 | } 18 | -------------------------------------------------------------------------------- /src/client/overlays/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod client_stats; 2 | -------------------------------------------------------------------------------- /src/client/spatial_chat/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod spatial_chat; 2 | -------------------------------------------------------------------------------- /src/client/ui/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod pages; 2 | -------------------------------------------------------------------------------- /src/client/ui/pages/editor/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod tee; 2 | -------------------------------------------------------------------------------- /src/client/ui/pages/loading.rs: -------------------------------------------------------------------------------- 1 | use game_config::config::Config; 2 | use ui_generic::traits::UiPageInterface; 3 | 4 | pub struct LoadingPage {} 5 | 6 | impl Default for LoadingPage { 7 | fn default() -> Self { 8 | Self::new() 9 | } 10 | } 11 | 12 | impl LoadingPage { 13 | pub fn new() -> Self { 14 | Self {} 15 | } 16 | } 17 | 18 | impl UiPageInterface for LoadingPage { 19 | fn render( 20 | &mut self, 21 | ui: &mut egui::Ui, 22 | _pipe: &mut ui_base::types::UiRenderPipe, 23 | _ui_state: &mut ui_base::types::UiState, 24 | ) { 25 | ui.label("Loading page..."); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/client/ui/pages/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod connect_password; 2 | pub mod editor; 3 | pub mod legacy_warning; 4 | pub mod loading; 5 | pub mod not_found; 6 | pub mod test; 7 | -------------------------------------------------------------------------------- /src/community-register-server/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "community-register-server" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | community = { path = "../../game/community" } 8 | 9 | tokio = { version = "1.45.0", features = ["rt-multi-thread", "sync", "fs", "net", "time", "macros"] } 10 | anyhow = { version = "1.0.98", features = ["backtrace"] } 11 | axum = "0.8.4" 12 | clap = { version = "4.5.37", features = ["derive"] } 13 | 14 | tower-http = { version = "0.6.2", features = ["fs", "trace"] } 15 | -------------------------------------------------------------------------------- /src/community-server/src/queries/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod add_friend; 2 | pub mod setup; 3 | -------------------------------------------------------------------------------- /src/community-server/src/queries/mysql/add_friend.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ddnet/ddnet-rs/65082d70db26438bbd9d212d1b725eaca2d44481/src/community-server/src/queries/mysql/add_friend.sql -------------------------------------------------------------------------------- /src/community-server/src/queries/mysql/friend_list.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE friend_list ( 2 | account_id1 BIGINT NOT NULL, 3 | account_id2 BIGINT NOT NULL, 4 | UNIQUE KEY((account_id1, account_id2)) 5 | ); 6 | -------------------------------------------------------------------------------- /src/dilate/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "dilate" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | image-utils = { path = "../../lib/image-utils" } 8 | 9 | tokio = { version = "1.45.0", features = ["rt-multi-thread", "sync", "fs", "time", "macros"] } 10 | clap = { version = "4.5.37", features = ["derive"] } 11 | rayon = "1.10.0" 12 | oxipng = { version = "9.1", features = ["parallel"], default-features = false } 13 | -------------------------------------------------------------------------------- /src/emoticon-convert/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "emoticon-convert" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | client-extra = { path = "../../game/client-extra" } 8 | 9 | image-utils = { path = "../../lib/image-utils" } 10 | 11 | clap = { version = "4.5.37", features = ["derive"] } 12 | tar = "0.4.44" 13 | -------------------------------------------------------------------------------- /src/extra-convert/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "extra-convert" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | client-extra = { path = "../../game/client-extra" } 8 | image-utils = { path = "../../lib/image-utils" } 9 | 10 | clap = { version = "4.5.37", features = ["derive"] } 11 | tar = "0.4.44" 12 | -------------------------------------------------------------------------------- /src/game-convert/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "game-convert" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | client-extra = { path = "../../game/client-extra" } 8 | image-utils = { path = "../../lib/image-utils" } 9 | 10 | clap = { version = "4.5.37", features = ["derive"] } 11 | tar = "0.4.44" 12 | -------------------------------------------------------------------------------- /src/hud-convert/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hud-convert" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | client-extra = { path = "../../game/client-extra" } 8 | image-utils = { path = "../../lib/image-utils" } 9 | 10 | clap = { version = "4.5.37", features = ["derive"] } 11 | tar = "0.4.44" 12 | -------------------------------------------------------------------------------- /src/map-convert/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "map-convert" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base = { path = "../../lib/base" } 8 | base-io = { path = "../../lib/base-io" } 9 | base-fs = { path = "../../lib/base-fs" } 10 | 11 | map = { path = "../../game/map" } 12 | map-convert-lib = { path = "../../game/map-convert-lib" } 13 | 14 | clap = { version = "4.5.37", features = ["derive"] } 15 | rayon = "1.10.0" 16 | anyhow = { version = "1.0.98", features = ["backtrace"] } 17 | log = "0.4.27" 18 | env_logger = "0.11.8" 19 | -------------------------------------------------------------------------------- /src/part-convert/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "part-convert" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | client-extra = { path = "../../game/client-extra" } 8 | image-utils = { path = "../../lib/image-utils" } 9 | 10 | clap = { version = "4.5.37", features = ["derive"] } 11 | tar = "0.4.44" 12 | -------------------------------------------------------------------------------- /src/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "server" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | network = { path = "../../lib/network" } 8 | base = { path = "../../lib/base" } 9 | base-fs = { path = "../../lib/base-fs", default-features = false } 10 | 11 | game-server = { path = "../../game/game-server", default-features = false } 12 | game-base = { path = "../../game/game-base" } 13 | env_logger = "0.11.8" 14 | 15 | # The dep is unused here, but used in a feature 16 | [package.metadata.cargo-machete] 17 | ignored = ["base-fs"] 18 | 19 | [features] 20 | bundled_data_dir = ["base-fs/bundled_data_dir"] 21 | -------------------------------------------------------------------------------- /src/skin-convert/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "skin-convert" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | clap = { version = "4.5.37", features = ["derive"] } 8 | client-extra = { path = "../../game/client-extra" } 9 | image-utils = { path = "../../lib/image-utils" } 10 | -------------------------------------------------------------------------------- /src/tests/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod actionfeed; 2 | pub mod base; 3 | pub mod chat; 4 | pub mod emote_wheel; 5 | pub mod hud; 6 | pub mod ingame; 7 | pub mod motd; 8 | pub mod scoreboard; 9 | pub mod screenshot; 10 | pub mod screenshots; 11 | pub mod spectator_selection; 12 | pub mod utils; 13 | pub mod vote; 14 | -------------------------------------------------------------------------------- /src/tests/utils.rs: -------------------------------------------------------------------------------- 1 | use std::time::Duration; 2 | 3 | use graphics::graphics::graphics::Graphics; 4 | 5 | pub fn render_helper( 6 | graphics: &Graphics, 7 | mut render_func: impl FnMut(u64, Duration), 8 | time_offset: &mut Duration, 9 | base_name: &str, 10 | save_screenshot: &dyn Fn(&str), 11 | ) { 12 | const RUNS: u64 = 5; 13 | const FAKE_FRAMES: u64 = 3; 14 | 15 | for i in 0..RUNS { 16 | // fake render for ui delayed rendering & centering 17 | for _ in 0..FAKE_FRAMES { 18 | render_func(i + 1, *time_offset); 19 | graphics.swap(); 20 | *time_offset += Duration::from_secs(1); 21 | } 22 | render_func(i + 1, *time_offset); 23 | save_screenshot(&format!("{base_name}_{:0>3}", i)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/hiarc_tests/compile-fail/macro_fail.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | use hiarc::hiarc; 3 | use hiarc::HiBox; 4 | #[hiarc] 5 | pub struct A { 6 | #[hiarc(inner)] 7 | b: Option>, 8 | } 9 | 10 | #[hiarc] 11 | pub struct B { 12 | #[hiarc(inner)] 13 | b: Option>, 14 | } 15 | 16 | fn main() { 17 | let _ = A { b: None }; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/hiarc_tests/compile-fail/safe_rc.stderr: -------------------------------------------------------------------------------- 1 | error[E0133]: call to unsafe function is unsafe and requires unsafe function or block 2 | --> tests/hiarc_tests/compile-fail/safe_rc.rs:15:13 3 | | 4 | 15 | self.0.borrow_mut() 5 | | ^^^^^^^^^^^^^^^^^^^ call to unsafe function 6 | | 7 | = note: consult the function's documentation for information on how to avoid undefined behavior 8 | -------------------------------------------------------------------------------- /tests/hiarc_tests/compile-fail/safe_rc_return.stderr: -------------------------------------------------------------------------------- 1 | error[E0515]: cannot return reference to temporary value 2 | --> tests/hiarc_tests/compile-fail/safe_rc_return.rs:13:5 3 | | 4 | 13 | #[hiarc_safer_rc_refcell] 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ returns a reference to data owned by the current function 6 | | 7 | = note: this error originates in the attribute macro `hiarc_safer_rc_refcell` (in Nightly builds, run with -Z macro-backtrace for more info) 8 | -------------------------------------------------------------------------------- /tests/hiarc_tests/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod macro_tests; 2 | -------------------------------------------------------------------------------- /tests/integration_test.rs: -------------------------------------------------------------------------------- 1 | mod hiarc_tests; 2 | --------------------------------------------------------------------------------