Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

tox based multiplayer #1

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
update mm_tox
  • Loading branch information
Green-Sky committed Mar 8, 2023
commit 1e9c874fb27a55ac9f2633063ee8cc479323e97a
22 changes: 11 additions & 11 deletions src/main_tox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@
#include <mm/services/scene_tools.hpp>
#include <mm/services/sound_tools.hpp>

#include <services/mm_tox/tox_service.hpp>
#include <services/mm_tox/tox_chat.hpp>
#include <services/mm_tox/tox_net_channeled.hpp>
#include <mm_tox/services/tox_service.hpp>
#include <mm_tox/services/tox_chat.hpp>
#include <mm_tox/services/tox_net_channeled.hpp>

#include "./setup_meta.hpp"

#include <entt/entity/registry.hpp>

template<>
bool setup_service<MM::Services::Tox::ToxService>(MM::Engine& engine, [[maybe_unused]] int argc, [[maybe_unused]] char** argv) {
auto& tox_service = engine.addService<MM::Services::Tox::ToxService>(engine, "save.tox");
bool setup_service<MM::Tox::Services::ToxService>(MM::Engine& engine, [[maybe_unused]] int argc, [[maybe_unused]] char** argv) {
auto& tox_service = engine.addService<MM::Tox::Services::ToxService>(engine, "save.tox");

tox_service._app_name = "miniTD";

if (!engine.enableService<MM::Services::Tox::ToxService>()) {
SPDLOG_ERROR("failed to enable service {}", engine.getService<MM::Services::Tox::ToxService>().name());
if (!engine.enableService<MM::Tox::Services::ToxService>()) {
SPDLOG_ERROR("failed to enable service {}", engine.getService<MM::Tox::Services::ToxService>().name());
return false;
}

Expand All @@ -48,7 +48,7 @@ bool setup_service<Services::LobbyClient>(MM::Engine& engine, [[maybe_unused]] i
auto& service = engine.addService<Services::LobbyClient>();

// ???
service.registerHandler<MM::Services::Tox::ToxNetChanneled>("tox", engine);
service.registerHandler<MM::Tox::Services::ToxNetChanneled>("tox", engine);

// dont auto enable
//if (!engine.enableService<Services::LobbyClient>()) {
Expand Down Expand Up @@ -78,9 +78,9 @@ bool setup_engine(MM::Engine& engine, int argc, char** argv) {

MM::Services::OrganizerSceneService,

MM::Services::Tox::ToxService,
MM::Services::Tox::ToxChat,
MM::Services::Tox::ToxNetChanneled,
MM::Tox::Services::ToxService,
MM::Tox::Services::ToxChat,
MM::Tox::Services::ToxNetChanneled,

Services::LobbyHost,
Services::LobbyClient,
Expand Down