diff --git a/CMakeLists.txt b/CMakeLists.txt index 9630527de..5d00b2765 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -497,8 +497,8 @@ if(WIN32) SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.openmw.org") SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.openmw.org") SET(CPACK_NSIS_INSTALLED_ICON_NAME "openmw-launcher.exe") - SET(CPACK_NSIS_MUI_ICON "${OpenMW_SOURCE_DIR}/files/windows/openmw.ico") - SET(CPACK_NSIS_MUI_UNIICON "${OpenMW_SOURCE_DIR}/files/windows/openmw.ico") + SET(CPACK_NSIS_MUI_ICON "${OpenMW_SOURCE_DIR}/files/tes3mp/tes3mp.ico") + SET(CPACK_NSIS_MUI_UNIICON "${OpenMW_SOURCE_DIR}/files/tes3mp/tes3mp.ico") SET(CPACK_PACKAGE_ICON "${OpenMW_SOURCE_DIR}\\\\files\\\\openmw.bmp") SET(VCREDIST32 "${OpenMW_BINARY_DIR}/vcredist_x86.exe") diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 8af8e9595..5cf1ffeba 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -115,9 +115,8 @@ void Networking::Update(RakNet::Packet *packet) if (!player->isHandshaked()) { - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Wrong auth for player %d, name: %s", - player->GetID(), - player->Npc()->mName.c_str()); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Have not completed handshake with player %d", + player->GetID()); //KickPlayer(player->guid); return; } diff --git a/apps/openmw-mp/Script/Functions/Translocations.cpp b/apps/openmw-mp/Script/Functions/Translocations.cpp index 40c623a93..78d5f0ea0 100644 --- a/apps/openmw-mp/Script/Functions/Translocations.cpp +++ b/apps/openmw-mp/Script/Functions/Translocations.cpp @@ -58,7 +58,6 @@ void ScriptFunctions::SetPos(unsigned short pid, double x, double y, double z) n player->Position()->pos[2] = z; mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_UPDATE_POS)->Send(player, false); - mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_UPDATE_POS)->Send(player, true); } void ScriptFunctions::SetCell(unsigned short pid, const char *name) noexcept @@ -80,7 +79,6 @@ void ScriptFunctions::SetCell(unsigned short pid, const char *name) noexcept cout << " in to cell \"" << player->GetCell()->mName << "\"" << endl; mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_CELL)->Send(player, false); - mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_CELL)->Send(player, true); } const char* ScriptFunctions::GetCell(unsigned short pid) noexcept @@ -109,7 +107,6 @@ void ScriptFunctions::SetExterior(unsigned short pid, int x, int y) noexcept player->GetCell()->mCellId.mIndex.mY = y; mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_CELL)->Send(player, false); - mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_CELL)->Send(player, true); } int ScriptFunctions::GetExteriorX(unsigned short pid) noexcept @@ -182,5 +179,4 @@ void ScriptFunctions::SetAngle(unsigned short pid, double x, double y, double z) player->Position()->rot[2] = z; mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_UPDATE_POS)->Send(player, false); - mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_UPDATE_POS)->Send(player, true); } diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index cf4f20f80..15950e00e 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -3,7 +3,7 @@ set(GAME main.cpp engine.cpp - ${CMAKE_SOURCE_DIR}/files/windows/openmw.rc + ${CMAKE_SOURCE_DIR}/files/tes3mp/tes3mp.rc ) if (ANDROID) diff --git a/apps/openmw/mwgui/mainmenu.cpp b/apps/openmw/mwgui/mainmenu.cpp index 258f0dfb0..9a8701c28 100644 --- a/apps/openmw/mwgui/mainmenu.cpp +++ b/apps/openmw/mwgui/mainmenu.cpp @@ -211,6 +211,8 @@ namespace MWGui if (state==MWBase::StateManager::State_Running) buttons.push_back("return"); + /* Disabled by tes3mp + buttons.push_back("newgame"); if (state==MWBase::StateManager::State_Running && @@ -221,6 +223,7 @@ namespace MWGui if (MWBase::Environment::get().getStateManager()->characterBegin()!= MWBase::Environment::get().getStateManager()->characterEnd()) buttons.push_back("loadgame"); + */ buttons.push_back("options"); diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 14db9b527..89a123a99 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -133,6 +133,9 @@ void LocalPlayer::updatePosition(bool forceUpdate) static bool posChanged = false; + static bool isJumping = false; + static bool sentJumpEnd = true; + ESM::Position _pos = player.getRefData().getPosition(); const bool isChangedPos = (move.mPosition[0] != 0 || move.mPosition[1] != 0 || move.mPosition[2] != 0 @@ -142,6 +145,9 @@ void LocalPlayer::updatePosition(bool forceUpdate) { posChanged = isChangedPos; + if (!isJumping && !world->isOnGround(player) && !world->isFlying(player)) { + isJumping = true; + } (*Position()) = _pos; @@ -151,6 +157,18 @@ void LocalPlayer::updatePosition(bool forceUpdate) GetNetworking()->GetPacket(ID_GAME_UPDATE_POS)->Send(this); } + else if (isJumping && world->isOnGround(player)) { + + isJumping = false; + sentJumpEnd = false; + } + // Packet with jump end position has to be sent one tick after above check + else if (!sentJumpEnd) { + + sentJumpEnd = true; + (*Position()) = _pos; + GetNetworking()->GetPacket(ID_GAME_UPDATE_POS)->Send(this); + } } @@ -162,6 +180,8 @@ void LocalPlayer::setPosition() world->getPlayer().setTeleported(true); world->moveObject(player, Position()->pos[0], Position()->pos[1], Position()->pos[2]); world->rotateObject(player, Position()->rot[0], Position()->rot[1], Position()->rot[2]); + + updatePosition(true); } void LocalPlayer::setCell() diff --git a/apps/openmw/mwmp/Main.cpp b/apps/openmw/mwmp/Main.cpp index 0df96ed2d..47cc9ab00 100644 --- a/apps/openmw/mwmp/Main.cpp +++ b/apps/openmw/mwmp/Main.cpp @@ -154,7 +154,7 @@ void Main::Frame(float dt) Players::Update(dt); get().UpdateWorld(dt); - get().getGUIConroller()->update(dt); + get().getGUIController()->update(dt); } @@ -176,7 +176,7 @@ void Main::UpdateWorld(float dt) const mNetworking->Connect(server, port); player.getClass().getCreatureStats(player).getSpells().add("fireball"); mLocalPlayer->updateBaseStats(true); - get().getGUIConroller()->setChatVisible(true); + get().getGUIController()->setChatVisible(true); } else mLocalPlayer->Update(); @@ -198,7 +198,7 @@ LocalPlayer *Main::getLocalPlayer() const } -GUIController *Main::getGUIConroller() const +GUIController *Main::getGUIController() const { return mGUIController; } @@ -206,6 +206,6 @@ GUIController *Main::getGUIConroller() const void Main::PressedKey(int key) { if (pMain == nullptr) return; - if (get().getGUIConroller()->pressedKey(key)) + if (get().getGUIController()->pressedKey(key)) return; // if any gui bind pressed } \ No newline at end of file diff --git a/apps/openmw/mwmp/Main.hpp b/apps/openmw/mwmp/Main.hpp index 48ab2336d..7292f92dd 100644 --- a/apps/openmw/mwmp/Main.hpp +++ b/apps/openmw/mwmp/Main.hpp @@ -22,7 +22,7 @@ namespace mwmp Networking *getNetworking() const; LocalPlayer *getLocalPlayer() const; - GUIController *getGUIConroller() const; + GUIController *getGUIController() const; void UpdateWorld(float dt) const; diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 35a853812..a6eec5b17 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -410,8 +410,8 @@ void Networking::ReceiveMessage(RakNet::Packet *packet) MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr(); player.getClass().getCreatureStats(player).resurrect(); ESM::Position pos; - MWBase::Environment::get().getWorld()->findInteriorPosition("ToddTest", pos); - MWBase::Environment::get().getWorld()->changeToInteriorCell("ToddTest", pos, true); + MWBase::Environment::get().getWorld()->findInteriorPosition("Pelagiad, Fort Pelagiad", pos); + MWBase::Environment::get().getWorld()->changeToInteriorCell("Pelagiad, Fort Pelagiad", pos, true); (*getLocalPlayer()->Position()) = pos; (*getLocalPlayer()->GetCell()) = *player.getCell()->getCell(); myPacket->Send(getLocalPlayer(), serverAddr); @@ -477,7 +477,7 @@ void Networking::ReceiveMessage(RakNet::Packet *packet) myPacket->Packet(&bsIn, pl, false); message = *pl->ChatMessage(); } - Main::get().getGUIConroller()->PrintChatMessage(message); + Main::get().getGUIController()->PrintChatMessage(message); break; } case ID_GAME_CHARGEN: @@ -559,11 +559,11 @@ void Networking::ReceiveMessage(RakNet::Packet *packet) getLocalPlayer()->guiMessageBox.label.c_str()); if (getLocalPlayer()->guiMessageBox.type == BasePlayer::GUIMessageBox::MessageBox) - Main::get().getGUIConroller()->ShowMessageBox(getLocalPlayer()->guiMessageBox); + Main::get().getGUIController()->ShowMessageBox(getLocalPlayer()->guiMessageBox); else if (getLocalPlayer()->guiMessageBox.type == BasePlayer::GUIMessageBox::CustomMessageBox) - Main::get().getGUIConroller()->ShowCustomMessageBox(getLocalPlayer()->guiMessageBox); + Main::get().getGUIController()->ShowCustomMessageBox(getLocalPlayer()->guiMessageBox); else if (getLocalPlayer()->guiMessageBox.type == BasePlayer::GUIMessageBox::InputDialog) - Main::get().getGUIConroller()->ShowInputBox(getLocalPlayer()->guiMessageBox); + Main::get().getGUIController()->ShowInputBox(getLocalPlayer()->guiMessageBox); } break; } diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 5e3779f80..f46e7acff 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -257,6 +257,9 @@ namespace MWWorld if (!getPlayerPtr().isInCell()) { ESM::Position pos; + + /* Disabled by tes3mp + const int cellSize = 8192; pos.pos[0] = cellSize/2; pos.pos[1] = cellSize/2; @@ -265,6 +268,11 @@ namespace MWWorld pos.rot[1] = 0; pos.rot[2] = 0; mWorldScene->changeToExteriorCell(pos, true); + */ + + findExteriorPosition("Pelagiad", pos); + changeToExteriorCell(pos, true); + fixPosition(getPlayerPtr()); } } diff --git a/files/tes3mp/tes3mp.ico b/files/tes3mp/tes3mp.ico new file mode 100644 index 000000000..793865963 Binary files /dev/null and b/files/tes3mp/tes3mp.ico differ diff --git a/files/tes3mp/tes3mp.rc b/files/tes3mp/tes3mp.rc new file mode 100644 index 000000000..9895e8c8b --- /dev/null +++ b/files/tes3mp/tes3mp.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "tes3mp.ico"