squash some of my overly verbose commits that have no uses

This commit is contained in:
DarthArgus
2016-09-26 06:27:53 +00:00
parent 10b86bcc7f
commit 1651feb4de
8 changed files with 29 additions and 37 deletions
+2 -2
View File
@@ -67,11 +67,11 @@ elseif(UNIX)
# not sure if needed or not - https://wiki.debian.org/Hardening
# ============================================================================================
# -fstack-protector-all -Wstack-protector --param ssp-buffer-size=4 -fPIE -ftrapv
# -D_FORTIFY_SOURCE=2 is generally considered safe but crashes datatabletool when built with gcc
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -D_GLIBCXX_USE_CXX11_ABI=0 \
-m32 -pipe -march=native -mtune=native \
-Wformat \
-Wno-overloaded-virtual -Wno-missing-braces -Wno-format \
-Wformat -Wno-overloaded-virtual -Wno-missing-braces -Wno-format \
-Wno-write-strings -Wno-unknown-pragmas \
-Wno-uninitialized -Wno-reorder")
@@ -69,7 +69,7 @@ void ConfigLoginServer::install(void)
KEY_INT (centralServicePort, 44452);
KEY_INT (clientServicePort, 44453);
KEY_INT (clientOverflowLimit, 1024 * 8);
KEY_INT (maxClients, 250);
KEY_INT (maxClients, 3000);
KEY_INT (taskServicePort, 44459);
KEY_INT (pingServicePort, 44460);
KEY_INT (httpServicePort, 44490);
@@ -112,7 +112,7 @@ void ConfigLoginServer::install(void)
KEY_INT (populationHeavyThresholdPercent, 32);
KEY_INT (populationMediumThresholdPercent, 16);
KEY_INT (populationLightThresholdPercent, 8);
KEY_INT (csToolPort, 10666);
KEY_INT (csToolPort, 0); // use 10666 if you want to turn the tool on
KEY_BOOL(requireSecureLoginForCsTool, true);
KEY_BOOL(useExternalAuth, false);
KEY_STRING(externalAuthURL, "");
@@ -160,8 +160,12 @@ LoginServer::LoginServer() :
m_centralService = new Service(ConnectionAllocator<CentralServerConnection>(), setup);
}
// only start the customer tool connection listener if the port is set (defaults to 0)
setup.port = ConfigLoginServer::getCSToolPort();
m_CSService = new Service(ConnectionAllocator<CSToolConnection>(), setup);
if (setup.port)
{
m_CSService = new Service(ConnectionAllocator<CSToolConnection>(), setup);
}
// set up message connections
connectToMessage("ClaimRewardsMessage");
@@ -387,12 +391,17 @@ void LoginServer::receiveMessage(const MessageDispatch::Emitter & source, const
CentralServerConnection * connection = const_cast<CentralServerConnection*>(safe_cast<const CentralServerConnection *>(&source));
DEBUG_REPORT_LOG(true, ("Cluster connection %s opened\n", msg.getClusterName().c_str()));
ClusterListEntry *cle = nullptr;
if (ConfigLoginServer::getDevelopmentMode())
{
// in this mode, we trust the name sent by the cluster and we dynamically add clusters we don't know about
cle = findClusterByName(msg.getClusterName());
if (!cle)
cle = addCluster(msg.getClusterName());
if (ConfigLoginServer::getDevelopmentMode()) {
// in this mode, we trust the name sent by the cluster
cle = findClusterByName(msg.getClusterName());
#ifdef _DEBUG
// if in debug mode, we dynamically add clusters we don't know about
// DO NOT USE ON PRODUCTION! This is where other servers are getting hijacked.
if (!cle)
{
cle = addCluster(msg.getClusterName());
}
#endif
}
else
{
@@ -407,7 +416,7 @@ void LoginServer::receiveMessage(const MessageDispatch::Emitter & source, const
disconnectCluster(*cle, true, false);
cle = nullptr;
}
}
}
if (cle)
{
@@ -1961,4 +1970,4 @@ void LoginServer::setClusterInfoByName(const std::string &name, const std::strin
}
}
// ======================================================================
// ======================================================================
@@ -38,24 +38,13 @@ bool TaskGetClusterList::process(DB::Session *session)
while ((rowsFetched = qry.fetch()) > 0)
{
qry.altAddress.getValue(temp.m_address);
if (temp.m_address.empty())
{
qry.address.getValue(temp.m_address);
}
if (qry.port.isNull())
{
temp.m_port = ConfigLoginServer::getCentralServicePort();
}
else
{
temp.m_port = static_cast<uint16>(qry.port.getValue());
}
qry.cluster_id.getValue(temp.m_clusterId);
qry.cluster_name.getValue(temp.m_clusterName);
qry.address.getValue(temp.m_address);
if (qry.port.isNull())
temp.m_port = ConfigLoginServer::getCentralServicePort();
else
temp.m_port = static_cast<uint16>(qry.port.getValue());
qry.secret.getValue(temp.m_secret);
qry.locked.getValue(temp.m_locked);
qry.not_recommended.getValue(temp.m_notRecommended);
@@ -88,7 +77,7 @@ void TaskGetClusterList::onComplete()
void TaskGetClusterList::GetClustersQuery::getSQL(std::string &sql)
{
sql=std::string("begin :result := ")+DatabaseConnection::getInstance().getSchemaQualifier()+"login.get_cluster_list(:group_id); end;";
DEBUG_REPORT_LOG(true, ("TaskGetClusterList SQL: %s\n", sql.c_str()));
// DEBUG_REPORT_LOG(true, ("TaskGetClusterList SQL: %s\n", sql.c_str()));
}
@@ -107,7 +96,6 @@ bool TaskGetClusterList::GetClustersQuery::bindColumns()
if (!bindCol(cluster_id)) return false;
if (!bindCol(cluster_name)) return false;
if (!bindCol(address)) return false;
if (!bindCol(altAddress)) return false;
if (!bindCol(port)) return false;
if (!bindCol(secret)) return false;
if (!bindCol(locked)) return false;
@@ -136,7 +124,6 @@ TaskGetClusterList::GetClustersQuery::GetClustersQuery() :
cluster_id(),
cluster_name(),
address(),
altAddress(),
port(),
secret(),
locked(),
@@ -36,7 +36,6 @@ class TaskGetClusterList : public DB::TaskRequest
DB::BindableLong cluster_id; //lint !e1925 // public data member
DB::BindableString<255> cluster_name; //lint !e1925 // public data member
DB::BindableString<255> address; //lint !e1925 // public data member
DB::BindableString<255> altAddress; //lint !e1925 // public data member
DB::BindableLong port; //lint !e1925 // public data member
DB::BindableBool secret; //lint !e1925 // public data member
DB::BindableBool locked; //lint !e1925 // public data member
@@ -64,7 +63,6 @@ class TaskGetClusterList : public DB::TaskRequest
uint32 m_clusterId;
std::string m_clusterName;
std::string m_address;
std::string m_altAddress;
uint16 m_port;
bool m_secret;
bool m_locked;
@@ -32,7 +32,7 @@ as
from default_char_limits;
open result_cursor for
select id, name, address, altAddress, port, secret, locked, not_recommended, maxCharacterPerAccount,
select id, name, address, port, secret, locked, not_recommended, maxCharacterPerAccount,
online_player_limit,online_free_trial_limit,free_trial_can_create_char,online_tutorial_limit
from cluster_list
where group_id = p_group;
@@ -4,7 +4,6 @@ create table cluster_list --NO_IMPORT
name varchar2(255),
num_characters number,
address varchar2(255),
altAddress varchar2(255),
port number default 44463,
secret char(1),
locked char(1),
-1
View File
@@ -1,5 +1,4 @@
alter table cluster_list add address varchar2(255);
alter table cluster_list add altAddress varchar2(255);
alter table cluster_list add port number;
alter table cluster_list add secret char(1);
update cluster_list set secret='N';