Added command '#ucs' to force re-connect after ucs server unavailability (must manually re-join channels for now)

This commit is contained in:
Uleat 2018-03-07 22:45:05 -05:00
parent ae966e546b
commit 2da70c69da
5 changed files with 93 additions and 1 deletions

View File

@ -1,5 +1,10 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50) EQEMu Changelog (Started on Sept 24, 2003 15:50)
------------------------------------------------------- -------------------------------------------------------
== 03/07/2018 ==
Uleat: Added command '#ucs' to force a reconnect to UCS server.
- Works in place of client auto-reconnect packet in zones where feature is unsupported
- Currently, you will need to manually re-join channels
== 03/04/2018 == == 03/04/2018 ==
Uleat: Updated UCS versioning Uleat: Updated UCS versioning
- SoF and higher clients have a new opcode identified (update your *.conf files) - SoF and higher clients have a new opcode identified (update your *.conf files)

View File

@ -30,7 +30,7 @@
Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
*/ */
#define CURRENT_BINARY_DATABASE_VERSION 9121 #define CURRENT_BINARY_DATABASE_VERSION 9122
#ifdef BOTS #ifdef BOTS
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9018 #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9018
#else #else

View File

@ -375,6 +375,7 @@
9119|2018_02_10_GlobalLoot.sql|SHOW TABLES LIKE 'global_loot'|empty| 9119|2018_02_10_GlobalLoot.sql|SHOW TABLES LIKE 'global_loot'|empty|
9120|2018_02_13_Heading.sql|SELECT value FROM variables WHERE varname = 'fixed_heading'|empty| 9120|2018_02_13_Heading.sql|SELECT value FROM variables WHERE varname = 'fixed_heading'|empty|
9121|2018_02_18_bug_reports.sql|SHOW TABLES LIKE 'bug_reports'|empty| 9121|2018_02_18_bug_reports.sql|SHOW TABLES LIKE 'bug_reports'|empty|
9122|2018_03_07_ucs_command.sql|SELECT * FROM `command_settings` WHERE `command` LIKE 'ucs'|empty|
# Upgrade conditions: # Upgrade conditions:
# This won't be needed after this system is implemented, but it is used database that are not # This won't be needed after this system is implemented, but it is used database that are not

View File

@ -389,6 +389,7 @@ int command_init(void)
command_add("traindisc", "[level] - Trains all the disciplines usable by the target, up to level specified. (may freeze client for a few seconds)", 150, command_traindisc) || command_add("traindisc", "[level] - Trains all the disciplines usable by the target, up to level specified. (may freeze client for a few seconds)", 150, command_traindisc) ||
command_add("trapinfo", "- Gets infomation about the traps currently spawned in the zone.", 81, command_trapinfo) || command_add("trapinfo", "- Gets infomation about the traps currently spawned in the zone.", 81, command_trapinfo) ||
command_add("tune", "Calculate ideal statical values related to combat.", 100, command_tune) || command_add("tune", "Calculate ideal statical values related to combat.", 100, command_tune) ||
command_add("ucs", "- Attempts to reconnect to the UCS server", 0, command_ucs) ||
command_add("undyeme", "- Remove dye from all of your armor slots", 0, command_undyeme) || command_add("undyeme", "- Remove dye from all of your armor slots", 0, command_undyeme) ||
command_add("unfreeze", "- Unfreeze your target", 80, command_unfreeze) || command_add("unfreeze", "- Unfreeze your target", 80, command_unfreeze) ||
command_add("unlock", "- Unlock the worldserver", 150, command_unlock) || command_add("unlock", "- Unlock the worldserver", 150, command_unlock) ||
@ -7158,6 +7159,90 @@ void command_undye(Client *c, const Seperator *sep)
} }
} }
void command_ucs(Client *c, const Seperator *sep)
{
if (!c)
return;
Log(Logs::Detail, Logs::UCS_Server, "Character %s attempting ucs reconnect while ucs server is %savailable",
c->GetName(), (zone->IsUCSServerAvailable() ? "" : "un"));
if (zone->IsUCSServerAvailable()) {
EQApplicationPacket* outapp = nullptr;
std::string buffer;
std::string MailKey = database.GetMailKey(c->CharacterID(), true);
EQEmu::versions::UCSVersion ConnectionType = EQEmu::versions::ucsUnknown;
// chat server packet
switch (c->ClientVersion()) {
case EQEmu::versions::ClientVersion::Titanium:
ConnectionType = EQEmu::versions::ucsTitaniumChat;
break;
case EQEmu::versions::ClientVersion::SoF:
ConnectionType = EQEmu::versions::ucsSoFCombined;
break;
case EQEmu::versions::ClientVersion::SoD:
ConnectionType = EQEmu::versions::ucsSoDCombined;
break;
case EQEmu::versions::ClientVersion::UF:
ConnectionType = EQEmu::versions::ucsUFCombined;
break;
case EQEmu::versions::ClientVersion::RoF:
ConnectionType = EQEmu::versions::ucsRoFCombined;
break;
case EQEmu::versions::ClientVersion::RoF2:
ConnectionType = EQEmu::versions::ucsRoF2Combined;
break;
default:
ConnectionType = EQEmu::versions::ucsUnknown;
break;
}
buffer = StringFormat("%s,%i,%s.%s,%c%s",
Config->ChatHost.c_str(),
Config->ChatPort,
Config->ShortName.c_str(),
c->GetName(),
ConnectionType,
MailKey.c_str()
);
outapp = new EQApplicationPacket(OP_SetChatServer, (buffer.length() + 1));
memcpy(outapp->pBuffer, buffer.c_str(), buffer.length());
outapp->pBuffer[buffer.length()] = '\0';
c->QueuePacket(outapp);
safe_delete(outapp);
// mail server packet
switch (c->ClientVersion()) {
case EQEmu::versions::ClientVersion::Titanium:
ConnectionType = EQEmu::versions::ucsTitaniumMail;
break;
default:
// retain value from previous switch
break;
}
buffer = StringFormat("%s,%i,%s.%s,%c%s",
Config->MailHost.c_str(),
Config->MailPort,
Config->ShortName.c_str(),
c->GetName(),
ConnectionType,
MailKey.c_str()
);
outapp = new EQApplicationPacket(OP_SetChatServer2, (buffer.length() + 1));
memcpy(outapp->pBuffer, buffer.c_str(), buffer.length());
outapp->pBuffer[buffer.length()] = '\0';
c->QueuePacket(outapp);
safe_delete(outapp);
}
}
void command_undyeme(Client *c, const Seperator *sep) void command_undyeme(Client *c, const Seperator *sep)
{ {
if(c) { if(c) {

View File

@ -302,6 +302,7 @@ void command_titlesuffix(Client *c, const Seperator *sep);
void command_traindisc(Client *c, const Seperator *sep); void command_traindisc(Client *c, const Seperator *sep);
void command_trapinfo(Client* c, const Seperator *sep); void command_trapinfo(Client* c, const Seperator *sep);
void command_tune(Client *c, const Seperator *sep); void command_tune(Client *c, const Seperator *sep);
void command_ucs(Client *c, const Seperator *sep);
void command_undye(Client *c, const Seperator *sep); void command_undye(Client *c, const Seperator *sep);
void command_undyeme(Client *c, const Seperator *sep); void command_undyeme(Client *c, const Seperator *sep);
void command_unfreeze(Client *c, const Seperator *sep); void command_unfreeze(Client *c, const Seperator *sep);