LoginServer.ini reading updated

- LoginServer and LoginConfig blocks now break out if we enter a new block (previously the ini was read all thru)
- Upon a failure from login server, world server will attempt to reload the ini (you can change account name/password on the fly if it is wrong)
This commit is contained in:
Image 2020-03-19 09:48:30 -04:00
parent ad12e29854
commit 6676f66184
3 changed files with 9 additions and 0 deletions
EQ2/source
LoginServer
WorldServer

View file

@ -221,6 +221,10 @@ bool NetConnection::ReadLoginConfig() {
items[1] = 1;
items[2] = 1;
items[3] = 1;
if (!strncasecmp(type, "[", 1)) {
// new block after LoginServer, skip
break;
}
if (!strncasecmp(type, "serverport", 10)) {
if (Seperator::IsNumber(buf) && atoi(buf) > 0 && atoi(buf) < 0xFFFF) {
port = atoi(buf);

View file

@ -187,6 +187,7 @@ bool LoginServer::Process() {
LogWrite(WORLD__ERROR, 0, "World", "Login Server returned a fatal error: %s\n", pack->pBuffer);
tcpc->Disconnect();
ret = false;
net.ReadLoginINI();
break;
}
case ServerOP_CharTimeStamp:

View file

@ -679,6 +679,10 @@ bool NetConnection::ReadLoginINI() {
if (fscanf (f, "%[^=]=%[^\r\n]\n", type, buf) == 2)
#endif
{
if (!strncasecmp(type, "[", 1)) {
// new block after LoginServer, skip
break;
}
if (!strncasecmp (type, "worldname", 9)) {
snprintf(worldname, sizeof(worldname), "%s", buf);
items[1] = 1;