Improve Survival Mode + others (#56)

* * Undo some of the changes done in the "* Work on survival mode." commit.
* TEST_SURVIVAL_MODE is now on by default.

* * Dying no longer crashes the game.

* * Death seems to work ok.

* * Improve some of the damage code.

* x

* work

* Fixed the Makefile (#54)

* * Finally fix the crack texture appearing to flicker/restart

* * Add VS2010 as an optional target.

Fix build with VS2010 (both windows_vs and xenon_vs).

* * Disable survival mode. Getting ready to merge now!

---------

Co-authored-by: Alexander Argentakis <38327951+MFDGaming@users.noreply.github.com>
This commit is contained in:
iProgramInCpp
2023-08-16 22:32:09 +03:00
committed by GitHub
parent 5e8119d279
commit 9a24abc603
63 changed files with 3599 additions and 184 deletions

View File

@@ -22,9 +22,11 @@
ServerSideNetworkHandler::ServerSideNetworkHandler(Minecraft* minecraft, RakNetInstance* rakNetInstance)
{
m_pMinecraft = minecraft;
m_pLevel = nullptr;
m_pRakNetInstance = rakNetInstance;
allowIncomingConnections(false);
m_pRakNetPeer = m_pRakNetInstance->getPeer();
m_bAllowIncoming = false;
setupCommands();
}
@@ -34,8 +36,8 @@ ServerSideNetworkHandler::~ServerSideNetworkHandler()
if (m_pLevel)
m_pLevel->removeListener(this);
for (auto plrKVP : m_onlinePlayers)
delete plrKVP.second;
for (auto it = m_onlinePlayers.begin(); it != m_onlinePlayers.end(); ++it)
delete it->second;
m_onlinePlayers.clear();
}
@@ -121,8 +123,9 @@ void ServerSideNetworkHandler::handle(const RakNet::RakNetGUID& guid, LoginPacke
m_pRakNetPeer->Send(&sgpbs, HIGH_PRIORITY, RELIABLE_ORDERED, 0, guid, false);
// send the connecting player info about all other players in the world
for (Player* player : m_pLevel->m_players)
for (int i = 0; i < int(m_pLevel->m_players.size()); i++)
{
Player* player = m_pLevel->m_players[i];
AddPlayerPacket app(player->m_guid, RakNet::RakString(player->m_name.c_str()), player->m_EntityID, player->m_pos.x, player->m_pos.y - player->field_84, player->m_pos.z);
RakNet::BitStream appbs;
app.write(&appbs);