mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Feature] Client Checksum Verification (Resubmit old 1678) (#1922)
* [Feature] Client Checksum Verification (Resubmit old 1678) * Updated db version * Add new updatechecksum to CmakeLists.txt * Removed magic number and used constant * Fix new command to have access to worldserver * spacing, more venbose desc and remove unneeded check * Cleanup, refactoring Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
@@ -548,6 +548,7 @@ SET(gm_commands
|
||||
gm_commands/unmemspells.cpp
|
||||
gm_commands/unscribespell.cpp
|
||||
gm_commands/unscribespells.cpp
|
||||
gm_commands/updatechecksum.cpp
|
||||
gm_commands/untraindisc.cpp
|
||||
gm_commands/untraindiscs.cpp
|
||||
gm_commands/uptime.cpp
|
||||
|
||||
@@ -388,6 +388,7 @@ int command_init(void)
|
||||
command_add("unscribespells", "- Clear out your or your player target's spell book.", AccountStatus::GMCoder, command_unscribespells) ||
|
||||
command_add("untraindisc", "[Spell ID] - Untrain your or your target's discipline by Spell ID", AccountStatus::GMCoder, command_untraindisc) ||
|
||||
command_add("untraindiscs", "- Untrains all disciplines from your target.", AccountStatus::GMCoder, command_untraindiscs) ||
|
||||
command_add("updatechecksum", "update client checksum", AccountStatus::GMImpossible, command_updatechecksum) ||
|
||||
command_add("uptime", "[zone server id] - Get uptime of worldserver, or zone server if argument provided", AccountStatus::Steward, command_uptime) ||
|
||||
command_add("version", "- Display current version of EQEmu server", AccountStatus::Player, command_version) ||
|
||||
command_add("viewcurrencies", "- View your or your target's currencies", AccountStatus::GMAdmin, command_viewcurrencies) ||
|
||||
|
||||
@@ -310,6 +310,7 @@ void command_unscribespell(Client *c, const Seperator *sep);
|
||||
void command_unscribespells(Client *c, const Seperator *sep);
|
||||
void command_untraindisc(Client *c, const Seperator *sep);
|
||||
void command_untraindiscs(Client *c, const Seperator *sep);
|
||||
void command_updatechecksum(Client* c, const Seperator* sep);
|
||||
void command_uptime(Client *c, const Seperator *sep);
|
||||
void command_version(Client *c, const Seperator *sep);
|
||||
void command_viewcurrencies(Client *c, const Seperator *sep);
|
||||
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#include "../client.h"
|
||||
#include "../worldserver.h"
|
||||
#include "../../common/repositories/account_repository.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void command_updatechecksum(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (c) {
|
||||
// if account found
|
||||
auto account = AccountRepository::FindOne(database, c->AccountID());
|
||||
if (account.id > 0) {
|
||||
database.SetVariable("crc_eqgame", account.crc_eqgame);
|
||||
database.SetVariable("crc_skillcaps", account.crc_skillcaps);
|
||||
database.SetVariable("crc_basedata", account.crc_basedata);
|
||||
|
||||
// reload rules (world)
|
||||
auto pack = new ServerPacket(ServerOP_ReloadRulesWorld, 0);
|
||||
worldserver.SendPacket(pack);
|
||||
c->Message(Chat::Red, "Successfully sent the packet to world to reload rules. (only world)");
|
||||
safe_delete(pack);
|
||||
|
||||
// reload variables (world)
|
||||
pack = new ServerPacket(ServerOP_ReloadVariablesWorld, 0);
|
||||
worldserver.SendPacket(pack);
|
||||
c->Message(Chat::Red, "Successfully sent the packet to world to reload variables. (only world)");
|
||||
safe_delete(pack);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// we should never see this
|
||||
c->Message(Chat::Red, "Error: Your account was not found!");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user