mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
chore: Speed up and cleanup level and zone loading; Add safer asset buffer reading (#1314)
* Remove std::couts littered throughout the base * working End of optimizations for now going faster * Remove extraneous compare function std::less<LWOSCENEID> already does this in a map. * gaming * Update Zone.cpp * dlu is moving to bitbucket again * Update Level.cpp --------- Co-authored-by: Jettford <mrjettbradford@gmail.com>
This commit is contained in:
@@ -621,15 +621,13 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
if (args[0].find("/") != std::string::npos) return;
|
||||
if (args[0].find("\\") != std::string::npos) return;
|
||||
|
||||
auto buf = Game::assetManager->GetFileAsBuffer(("macros/" + args[0] + ".scm").c_str());
|
||||
auto infile = Game::assetManager->GetFile(("macros/" + args[0] + ".scm").c_str());
|
||||
|
||||
if (!buf.m_Success) {
|
||||
if (!infile) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Unknown macro! Is the filename right?");
|
||||
return;
|
||||
}
|
||||
|
||||
std::istream infile(&buf);
|
||||
|
||||
if (infile.good()) {
|
||||
std::string line;
|
||||
while (std::getline(infile, line)) {
|
||||
@@ -639,8 +637,6 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Unknown macro! Is the filename right?");
|
||||
}
|
||||
|
||||
buf.close();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user