Skip to content

Commit

Permalink
Format: Google Style code format
Browse files Browse the repository at this point in the history
  • Loading branch information
i0gan committed Apr 27, 2024
1 parent 4131c2c commit dbb9ee4
Show file tree
Hide file tree
Showing 32 changed files with 76 additions and 102 deletions.
17 changes: 8 additions & 9 deletions config/plugin/db_proxy.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<XML>
<DbProxy>
<Plugin Name="core/net" />
<Plugin Name="core/log" />
<Plugin Name="core/node" />

<Plugin Name="node/db_proxy/mysql" />
<Plugin Name="node/db_proxy/mongo" />
<Plugin Name="node/db_proxy/redis" />
<Plugin Name="node/db_proxy/clickhouse" />
<DbProxy>
<Plugin Name="core/net" />
<Plugin Name="core/log" />
<Plugin Name="core/node" />
<Plugin Name="node/db_proxy/mysql" />
<Plugin Name="node/db_proxy/mongo" />
<Plugin Name="node/db_proxy/redis" />
<Plugin Name="node/db_proxy/clickhouse" />
<Plugin Name="node/db_proxy/logic" />
</DbProxy>
</XML>
7 changes: 3 additions & 4 deletions config/plugin/ds_mgr.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<XML>
<GameMgr>
<Plugin Name="core/net" />
<Plugin Name="core/log" />
<Plugin Name="core/net" />
<Plugin Name="core/log" />
<Plugin Name="core/node" />

<Plugin Name="node/ds_mgr/logic" />
<Plugin Name="node/ds_mgr/logic" />
</GameMgr>
</XML>
9 changes: 4 additions & 5 deletions config/plugin/game.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<XML>
<Game>
<Plugin Name="core/net" />
<Plugin Name="core/log" />
<Game>
<Plugin Name="core/net" />
<Plugin Name="core/log" />
<Plugin Name="core/node" />

<Plugin Name="node/game/logic" />
</Game>
</Game>
</XML>
1 change: 0 additions & 1 deletion config/plugin/login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<Plugin Name="core/net" />
<Plugin Name="core/log" />
<Plugin Name="core/node" />

<Plugin Name="node/login/logic" />
</Login>

Expand Down
7 changes: 3 additions & 4 deletions config/plugin/master.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<XML>
<Master>
<Plugin Name="core/net" />
<Plugin Name="core/log" />
<Plugin Name="core/net" />
<Plugin Name="core/log" />
<Plugin Name="core/node" />

<Plugin Name="node/master/logic" />
<Plugin Name="node/master/logic" />
</Master>
</XML>
25 changes: 12 additions & 13 deletions config/plugin/player.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<XML>
<Player>
<!-- The order is priority for destroy -->
<Plugin Name="core/log"/>
<Plugin Name="core/net"/>
<Plugin Name="core/config"/>
<Plugin Name="core/world" />
<Plugin Name="core/utils" />
<Plugin Name="core/thread" />
<Plugin Name="core/lua" />
<Plugin Name="core/node" />

<Plugin Name="node/player/logic" />
</Player>
<Player>
<!-- The order is priority for destroy -->
<Plugin Name="core/log"/>
<Plugin Name="core/net"/>
<Plugin Name="core/config"/>
<Plugin Name="core/world" />
<Plugin Name="core/utils" />
<Plugin Name="core/thread" />
<Plugin Name="core/lua" />
<Plugin Name="core/node" />
<Plugin Name="node/player/logic" />
</Player>
</XML>
13 changes: 6 additions & 7 deletions config/plugin/sqkcli.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<XML>
<Tester>
<Plugin Name="core/net" />
<Plugin Name="core/config" />
<Plugin Name="core/log" />

<Plugin Name="sqkcli/core" />
</Tester>
<Tester>
<Plugin Name="core/net" />
<Plugin Name="core/config" />
<Plugin Name="core/log" />
<Plugin Name="sqkcli/core" />
</Tester>
</XML>
6 changes: 3 additions & 3 deletions config/plugin/tutorial/t1_plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<XML>
<Tutorial>
<Plugin Name="tutorial/t1_plugin" />
</Tutorial>
<Tutorial>
<Plugin Name="tutorial/t1_plugin" />
</Tutorial>
</XML>
6 changes: 3 additions & 3 deletions config/plugin/tutorial/t2_property.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<XML>
<Tutorial>
<Plugin Name="tutorial/t1_Property" />
</Tutorial>
<Tutorial>
<Plugin Name="tutorial/t1_Property" />
</Tutorial>
</XML>
1 change: 0 additions & 1 deletion config/plugin/tutorial/t5_http.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<Tutorial>
<Plugin Name="core/net" />
<Plugin Name="core/log" />

<Plugin Name="tutorial/t5_http" />
</Tutorial>
</XML>
1 change: 0 additions & 1 deletion config/plugin/tutorial/t6_rpc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<Tutorial>
<Plugin Name="core/net" />
<Plugin Name="core/log" />

<Plugin Name="tutorial/t6_rpc" />
</Tutorial>
</XML>
10 changes: 4 additions & 6 deletions config/plugin/web.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<XML>
<Login>
<Plugin Name="core/net" />
<Plugin Name="core/log" />
<Plugin Name="core/net" />
<Plugin Name="core/log" />
<Plugin Name="core/node" />

<Plugin Name="node/web/logic" />
</Login>

<Plugin Name="node/web/logic" />
</Login>
</XML>
15 changes: 7 additions & 8 deletions config/plugin/world.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<XML>
<World>
<Plugin Name="core/net" />
<Plugin Name="core/log" />
<World>
<Plugin Name="core/net" />
<Plugin Name="core/log" />
<Plugin Name="core/config" />
<Plugin Name="core/world" />
<Plugin Name="core/world" />
<Plugin Name="core/utils" />
<Plugin Name="core/thread" />
<Plugin Name="core/lua" />
<Plugin Name="core/lua" />
<Plugin Name="core/node" />

<Plugin Name="node/world/logic" />
</World>
<Plugin Name="node/world/logic" />
</World>
</XML>
3 changes: 1 addition & 2 deletions src/node/db_proxy/logic/i_logic_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include <squick/core/i_module.h>
namespace db_proxy::logic {
class ILogicModule : public IModule {
};
class ILogicModule : public IModule {};

} // namespace db_proxy::logic
4 changes: 2 additions & 2 deletions src/node/db_proxy/logic/logic_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace db_proxy::logic {
bool LogicModule::Start() {
m_node_ = pm_->FindModule<INodeModule>();
vector<int> node_types = { };
vector<int> node_types = {};
m_node_->AddSubscribeNode(node_types);
return true;
}
}
} // namespace db_proxy::logic
1 change: 1 addition & 0 deletions src/node/db_proxy/logic/logic_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class LogicModule : public ILogicModule {
is_update_ = true; // Update
}
virtual bool Start() override;

private:
INodeModule *m_node_;
};
Expand Down
8 changes: 2 additions & 6 deletions src/node/db_proxy/logic/plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ const int Plugin::GetPluginVersion() { return 0; }

const std::string Plugin::GetPluginName() { return GET_CLASS_NAME(Plugin); }

void Plugin::Install() {
REGISTER_MODULE(pm_, ILogicModule, LogicModule)
}
void Plugin::Install() { REGISTER_MODULE(pm_, ILogicModule, LogicModule) }

void Plugin::Uninstall() {
UNREGISTER_MODULE(pm_, ILogicModule, LogicModule)
}
void Plugin::Uninstall() { UNREGISTER_MODULE(pm_, ILogicModule, LogicModule) }

} // namespace db_proxy::logic
2 changes: 1 addition & 1 deletion src/node/game/logic/i_game_mgr_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include <google/protobuf/dynamic_message.h>
#include <squick/core/base.h>

#include <squick/plugin/node/export.h>
#include <squick/plugin/config/export.h>
#include <squick/plugin/log/export.h>
#include <squick/plugin/net/export.h>
#include <squick/plugin/node/export.h>

namespace game::logic {

Expand Down
3 changes: 1 addition & 2 deletions src/node/global/logic/i_logic_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include <squick/core/i_module.h>
namespace global::logic {
class ILogicModule : public IModule {
};
class ILogicModule : public IModule {};

} // namespace global::logic
4 changes: 2 additions & 2 deletions src/node/global/logic/logic_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace global::logic {
bool LogicModule::Start() {
m_node_ = pm_->FindModule<INodeModule>();
vector<int> node_types = { ServerType::ST_DB_PROXY };
vector<int> node_types = {ServerType::ST_DB_PROXY};
m_node_->AddSubscribeNode(node_types);
return true;
}
}
} // namespace global::logic
1 change: 1 addition & 0 deletions src/node/global/logic/logic_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class LogicModule : public ILogicModule {
is_update_ = true; // Update
}
virtual bool Start() override;

private:
INodeModule *m_node_;
};
Expand Down
8 changes: 2 additions & 6 deletions src/node/global/logic/plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ const int Plugin::GetPluginVersion() { return 0; }

const std::string Plugin::GetPluginName() { return GET_CLASS_NAME(Plugin); }

void Plugin::Install() {
REGISTER_MODULE(pm_, ILogicModule, LogicModule)
}
void Plugin::Install() { REGISTER_MODULE(pm_, ILogicModule, LogicModule) }

void Plugin::Uninstall() {
UNREGISTER_MODULE(pm_, ILogicModule, LogicModule)
}
void Plugin::Uninstall() { UNREGISTER_MODULE(pm_, ILogicModule, LogicModule) }

} // namespace global::logic
2 changes: 1 addition & 1 deletion src/node/login/logic/logic_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#include "i_logic_module.h"
#include <iostream>
#include <map>
#include <squick/plugin/node/export.h>
#include <squick/core/platform.h>
#include <squick/plugin/log/export.h>
#include <squick/plugin/net/export.h>
#include <squick/plugin/node/export.h>
#include <struct/struct.h>
#include <third_party/nlohmann/json.hpp>
#include <unordered_map>
Expand Down
1 change: 0 additions & 1 deletion src/node/master/logic/logic_module.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once


#include "i_logic_module.h"
#include <squick/plugin/log/export.h>
#include <squick/plugin/net/export.h>
Expand Down
1 change: 0 additions & 1 deletion src/node/player/logic/logic_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class LogicModule : public ILogicModule {
private:
ILuaScriptModule *m_lua_script_;
INodeModule *m_node_;

};

} // namespace player::logic
2 changes: 1 addition & 1 deletion src/node/proxy/logic/logic_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ bool LogicModule::AfterStart() {

vector<int> node_types = {ServerType::ST_WORLD, ServerType::ST_LOGIN, ServerType::ST_PLAYER};
m_node_->AddSubscribeNode(node_types);

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/node/proxy/logic/logic_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <squick/plugin/config/export.h>
#include <squick/plugin/log/export.h>
#include <squick/plugin/net/export.h>
#include <squick/plugin/utils/export.h>
#include <squick/plugin/node/export.h>
#include <squick/plugin/utils/export.h>

#include "i_logic_module.h"
#include <vector>
Expand Down
3 changes: 1 addition & 2 deletions src/node/world/logic/i_logic_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include <squick/core/i_module.h>
namespace world::logic {
class ILogicModule : public IModule {
};
class ILogicModule : public IModule {};

} // namespace world::logic
4 changes: 2 additions & 2 deletions src/node/world/logic/logic_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace world::logic {
bool LogicModule::Start() {
m_node_ = pm_->FindModule<INodeModule>();
vector<int> node_types = { ServerType::ST_DB_PROXY };
vector<int> node_types = {ServerType::ST_DB_PROXY};
m_node_->AddSubscribeNode(node_types);
return true;
}
}
} // namespace world::logic
1 change: 1 addition & 0 deletions src/node/world/logic/logic_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class LogicModule : public ILogicModule {
is_update_ = true; // Update
}
virtual bool Start() override;

private:
INodeModule *m_node_;
};
Expand Down
8 changes: 2 additions & 6 deletions src/node/world/logic/plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ const int Plugin::GetPluginVersion() { return 0; }

const std::string Plugin::GetPluginName() { return GET_CLASS_NAME(Plugin); }

void Plugin::Install() {
REGISTER_MODULE(pm_, ILogicModule, LogicModule)
}
void Plugin::Install() { REGISTER_MODULE(pm_, ILogicModule, LogicModule) }

void Plugin::Uninstall() {
UNREGISTER_MODULE(pm_, ILogicModule, LogicModule)
}
void Plugin::Uninstall() { UNREGISTER_MODULE(pm_, ILogicModule, LogicModule) }

} // namespace world::logic
2 changes: 1 addition & 1 deletion src/squick/plugin/node/i_node_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
class INodeModule : public IModule {
public:
virtual ServerInfo &GetNodeInfo() = 0;
virtual bool AddSubscribeNode(const vector<int>& types) = 0;
virtual bool AddSubscribeNode(const vector<int> &types) = 0;
};

0 comments on commit dbb9ee4

Please sign in to comment.