mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-24 06:27:24 +00:00
3222e78815
Brick building as of right now does not implement the undo action properly. This commit addresses the issue with undoing button being non-functional server side and implements the GM needed for addressing further issues. Implement GameMessage UnUseModel which is called when a model in BrickBuilding is UnUsed. Important for UGC content down the line. Final code has been tested as follows: 1. Placed a model in brick build 2. saved placed a brick 3. repeat 2 and 3 twice more for 6 total models 4. Place a new model in brick mode and then edit all 7 models into one brick model instance 5. Pressing undo returns the converted model to the inventory and properly discards the other 6 without crashing. Intended live behavior is to store this in the inventory instead however behind the scenes work is needed to implement UGC models properly. Implement enum Implement the BlueprintSaveResponseType enum so there are less magic numbers sent via packets. Correct int sizes from unsigned int to uint32_t Add deserialize test Add a test for de-serializing a GM that is sent to the client. Assertions verify the data is in the correct order and has no extra information.
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#ifndef __GAMEDEPENDENCIES__H__
|
|
#define __GAMEDEPENDENCIES__H__
|
|
|
|
#include "Game.h"
|
|
#include "dLogger.h"
|
|
#include "dServer.h"
|
|
#include "EntityManager.h"
|
|
#include <gtest/gtest.h>
|
|
|
|
class dZoneManager;
|
|
class AssetManager;
|
|
|
|
class dServerMock : public dServer {
|
|
RakNet::BitStream* sentBitStream = nullptr;
|
|
public:
|
|
dServerMock() {};
|
|
~dServerMock() {};
|
|
RakNet::BitStream* GetMostRecentBitStream() { return sentBitStream; };
|
|
void Send(RakNet::BitStream* bitStream, const SystemAddress& sysAddr, bool broadcast) override { sentBitStream = bitStream; };
|
|
};
|
|
|
|
class GameDependenciesTest : public ::testing::Test {
|
|
protected:
|
|
void SetUpDependencies() {
|
|
info.pos = NiPoint3::ZERO;
|
|
info.rot = NiQuaternion::IDENTITY;
|
|
info.scale = 1.0f;
|
|
info.spawner = nullptr;
|
|
info.lot = 999;
|
|
Game::logger = new dLogger("./testing.log", true, true);
|
|
Game::server = new dServerMock();
|
|
}
|
|
|
|
void TearDownDependencies() {
|
|
if (Game::server) delete Game::server;
|
|
delete EntityManager::Instance();
|
|
if (Game::logger) {
|
|
Game::logger->Flush();
|
|
delete Game::logger;
|
|
}
|
|
}
|
|
|
|
EntityInfo info;
|
|
};
|
|
|
|
#endif //!__GAMEDEPENDENCIES__H__
|