diff --git a/resources/server/config.ini b/resources/server/config.ini new file mode 100644 index 0000000..35d4c35 --- /dev/null +++ b/resources/server/config.ini @@ -0,0 +1,40 @@ +[General] +Run Master = true +Master Host = localhost +Master Port = 5050 + +[Defaults] +; amount of threads to start with (never close) +Initial Count = 3 +; starting limit of clients per thread +Initial Size = 3 +; amount the limit scales when threshold is passed +Size Growth = 1 + +; any values below marked -1 indicates no limit +; max amount of clients in scaled thread +Max Size = -1 +; maximum number of threads +Max Count = -1 +; maximum number of connections in the pool +Max Total = -1 +; excess deviance from threshold necessary to rebalance +Tolerance = -1 + +[Master to Client] +Port = 5050 + +[Master to Slave] +Port = 8008 + +[Slave] +Port = 9000 +Name = Test Server 1 + +[Slave] +Port = 9001 +Name = Test Server 2 + +[Slave] +Port = 9002 +Name = Test Server 3 \ No newline at end of file diff --git a/resources/server/test.ini b/resources/server/test.ini deleted file mode 100644 index 2e2c9d7..0000000 --- a/resources/server/test.ini +++ /dev/null @@ -1,5 +0,0 @@ -; test ini file - -[Test Section] -TEST = ARE YOU SQWOOBIN -ANSWER = TRUE \ No newline at end of file diff --git a/src/server/hosts/master_client.cpp b/src/server/hosts/master_client.cpp index d10db51..989a74a 100644 --- a/src/server/hosts/master_client.cpp +++ b/src/server/hosts/master_client.cpp @@ -84,6 +84,12 @@ bool sosc::MasterClient::Process(const db::Queries *queries) { } bool sosc::MasterClient::ProcessLogin(Packet &pck) { + if(this->authed) + return true; + if(!pck.Check(2, PCK_ANY, PCK_ANY)) + return false; + + db::Query* query = this->queries->at(QRY_USER_NAME_EXISTS); return true; } diff --git a/src/server/main.cpp b/src/server/main.cpp index cb22fc3..22897aa 100644 --- a/src/server/main.cpp +++ b/src/server/main.cpp @@ -122,15 +122,13 @@ int main(int argc, char **argv) { configure_poolinfo(&info, (*config)["master to slave"][0]); _ctx.master_intra = new master_intra_ctx; master_intra_start( - (uint16_t)(*config)["master"]["intra port"], - poolinfo_t() + (uint16_t)(*config)["master"]["intra port"], info ); configure_poolinfo(&info, (*config)["master to client"][0]); _ctx.master_client = new master_client_ctx; master_client_start( - (uint16_t)(*config)["master"]["client port"], - poolinfo_t() + (uint16_t)(*config)["master"]["client port"], info ); } @@ -142,8 +140,7 @@ int main(int argc, char **argv) { configure_poolinfo(&info, (*config)["slave"][i]); slave_start( (uint16_t)(*config)["slave"][i]["port"], - poolinfo_t(), - _ctx.slaves + i + info, _ctx.slaves + i ); } }