forked from teamnwah/openmw-tes3coop
Merged branch master into master
This commit is contained in:
commit
1b403719f5
12 changed files with 48 additions and 21 deletions
|
@ -497,8 +497,8 @@ if(WIN32)
|
||||||
SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.openmw.org")
|
SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.openmw.org")
|
||||||
SET(CPACK_NSIS_URL_INFO_ABOUT "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_INSTALLED_ICON_NAME "openmw-launcher.exe")
|
||||||
SET(CPACK_NSIS_MUI_ICON "${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/windows/openmw.ico")
|
SET(CPACK_NSIS_MUI_UNIICON "${OpenMW_SOURCE_DIR}/files/tes3mp/tes3mp.ico")
|
||||||
SET(CPACK_PACKAGE_ICON "${OpenMW_SOURCE_DIR}\\\\files\\\\openmw.bmp")
|
SET(CPACK_PACKAGE_ICON "${OpenMW_SOURCE_DIR}\\\\files\\\\openmw.bmp")
|
||||||
|
|
||||||
SET(VCREDIST32 "${OpenMW_BINARY_DIR}/vcredist_x86.exe")
|
SET(VCREDIST32 "${OpenMW_BINARY_DIR}/vcredist_x86.exe")
|
||||||
|
|
|
@ -115,9 +115,8 @@ void Networking::Update(RakNet::Packet *packet)
|
||||||
|
|
||||||
if (!player->isHandshaked())
|
if (!player->isHandshaked())
|
||||||
{
|
{
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Wrong auth for player %d, name: %s",
|
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Have not completed handshake with player %d",
|
||||||
player->GetID(),
|
player->GetID());
|
||||||
player->Npc()->mName.c_str());
|
|
||||||
//KickPlayer(player->guid);
|
//KickPlayer(player->guid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,6 @@ void ScriptFunctions::SetPos(unsigned short pid, double x, double y, double z) n
|
||||||
player->Position()->pos[2] = z;
|
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, false);
|
||||||
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_UPDATE_POS)->Send(player, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptFunctions::SetCell(unsigned short pid, const char *name) noexcept
|
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;
|
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, false);
|
||||||
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_CELL)->Send(player, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* ScriptFunctions::GetCell(unsigned short pid) noexcept
|
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;
|
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, false);
|
||||||
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_CELL)->Send(player, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ScriptFunctions::GetExteriorX(unsigned short pid) noexcept
|
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;
|
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, false);
|
||||||
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_UPDATE_POS)->Send(player, true);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ set(GAME
|
||||||
main.cpp
|
main.cpp
|
||||||
engine.cpp
|
engine.cpp
|
||||||
|
|
||||||
${CMAKE_SOURCE_DIR}/files/windows/openmw.rc
|
${CMAKE_SOURCE_DIR}/files/tes3mp/tes3mp.rc
|
||||||
)
|
)
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
|
|
|
@ -211,6 +211,8 @@ namespace MWGui
|
||||||
if (state==MWBase::StateManager::State_Running)
|
if (state==MWBase::StateManager::State_Running)
|
||||||
buttons.push_back("return");
|
buttons.push_back("return");
|
||||||
|
|
||||||
|
/* Disabled by tes3mp
|
||||||
|
|
||||||
buttons.push_back("newgame");
|
buttons.push_back("newgame");
|
||||||
|
|
||||||
if (state==MWBase::StateManager::State_Running &&
|
if (state==MWBase::StateManager::State_Running &&
|
||||||
|
@ -221,6 +223,7 @@ namespace MWGui
|
||||||
if (MWBase::Environment::get().getStateManager()->characterBegin()!=
|
if (MWBase::Environment::get().getStateManager()->characterBegin()!=
|
||||||
MWBase::Environment::get().getStateManager()->characterEnd())
|
MWBase::Environment::get().getStateManager()->characterEnd())
|
||||||
buttons.push_back("loadgame");
|
buttons.push_back("loadgame");
|
||||||
|
*/
|
||||||
|
|
||||||
buttons.push_back("options");
|
buttons.push_back("options");
|
||||||
|
|
||||||
|
|
|
@ -133,6 +133,9 @@ void LocalPlayer::updatePosition(bool forceUpdate)
|
||||||
|
|
||||||
static bool posChanged = false;
|
static bool posChanged = false;
|
||||||
|
|
||||||
|
static bool isJumping = false;
|
||||||
|
static bool sentJumpEnd = true;
|
||||||
|
|
||||||
ESM::Position _pos = player.getRefData().getPosition();
|
ESM::Position _pos = player.getRefData().getPosition();
|
||||||
|
|
||||||
const bool isChangedPos = (move.mPosition[0] != 0 || move.mPosition[1] != 0 || move.mPosition[2] != 0
|
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;
|
posChanged = isChangedPos;
|
||||||
|
|
||||||
|
if (!isJumping && !world->isOnGround(player) && !world->isFlying(player)) {
|
||||||
|
isJumping = true;
|
||||||
|
}
|
||||||
|
|
||||||
(*Position()) = _pos;
|
(*Position()) = _pos;
|
||||||
|
|
||||||
|
@ -151,6 +157,18 @@ void LocalPlayer::updatePosition(bool forceUpdate)
|
||||||
|
|
||||||
GetNetworking()->GetPacket(ID_GAME_UPDATE_POS)->Send(this);
|
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->getPlayer().setTeleported(true);
|
||||||
world->moveObject(player, Position()->pos[0], Position()->pos[1], Position()->pos[2]);
|
world->moveObject(player, Position()->pos[0], Position()->pos[1], Position()->pos[2]);
|
||||||
world->rotateObject(player, Position()->rot[0], Position()->rot[1], Position()->rot[2]);
|
world->rotateObject(player, Position()->rot[0], Position()->rot[1], Position()->rot[2]);
|
||||||
|
|
||||||
|
updatePosition(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocalPlayer::setCell()
|
void LocalPlayer::setCell()
|
||||||
|
|
|
@ -154,7 +154,7 @@ void Main::Frame(float dt)
|
||||||
Players::Update(dt);
|
Players::Update(dt);
|
||||||
get().UpdateWorld(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);
|
mNetworking->Connect(server, port);
|
||||||
player.getClass().getCreatureStats(player).getSpells().add("fireball");
|
player.getClass().getCreatureStats(player).getSpells().add("fireball");
|
||||||
mLocalPlayer->updateBaseStats(true);
|
mLocalPlayer->updateBaseStats(true);
|
||||||
get().getGUIConroller()->setChatVisible(true);
|
get().getGUIController()->setChatVisible(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mLocalPlayer->Update();
|
mLocalPlayer->Update();
|
||||||
|
@ -198,7 +198,7 @@ LocalPlayer *Main::getLocalPlayer() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GUIController *Main::getGUIConroller() const
|
GUIController *Main::getGUIController() const
|
||||||
{
|
{
|
||||||
return mGUIController;
|
return mGUIController;
|
||||||
}
|
}
|
||||||
|
@ -206,6 +206,6 @@ GUIController *Main::getGUIConroller() const
|
||||||
void Main::PressedKey(int key)
|
void Main::PressedKey(int key)
|
||||||
{
|
{
|
||||||
if (pMain == nullptr) return;
|
if (pMain == nullptr) return;
|
||||||
if (get().getGUIConroller()->pressedKey(key))
|
if (get().getGUIController()->pressedKey(key))
|
||||||
return; // if any gui bind pressed
|
return; // if any gui bind pressed
|
||||||
}
|
}
|
|
@ -22,7 +22,7 @@ namespace mwmp
|
||||||
|
|
||||||
Networking *getNetworking() const;
|
Networking *getNetworking() const;
|
||||||
LocalPlayer *getLocalPlayer() const;
|
LocalPlayer *getLocalPlayer() const;
|
||||||
GUIController *getGUIConroller() const;
|
GUIController *getGUIController() const;
|
||||||
|
|
||||||
void UpdateWorld(float dt) const;
|
void UpdateWorld(float dt) const;
|
||||||
|
|
||||||
|
|
|
@ -410,8 +410,8 @@ void Networking::ReceiveMessage(RakNet::Packet *packet)
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
player.getClass().getCreatureStats(player).resurrect();
|
player.getClass().getCreatureStats(player).resurrect();
|
||||||
ESM::Position pos;
|
ESM::Position pos;
|
||||||
MWBase::Environment::get().getWorld()->findInteriorPosition("ToddTest", pos);
|
MWBase::Environment::get().getWorld()->findInteriorPosition("Pelagiad, Fort Pelagiad", pos);
|
||||||
MWBase::Environment::get().getWorld()->changeToInteriorCell("ToddTest", pos, true);
|
MWBase::Environment::get().getWorld()->changeToInteriorCell("Pelagiad, Fort Pelagiad", pos, true);
|
||||||
(*getLocalPlayer()->Position()) = pos;
|
(*getLocalPlayer()->Position()) = pos;
|
||||||
(*getLocalPlayer()->GetCell()) = *player.getCell()->getCell();
|
(*getLocalPlayer()->GetCell()) = *player.getCell()->getCell();
|
||||||
myPacket->Send(getLocalPlayer(), serverAddr);
|
myPacket->Send(getLocalPlayer(), serverAddr);
|
||||||
|
@ -477,7 +477,7 @@ void Networking::ReceiveMessage(RakNet::Packet *packet)
|
||||||
myPacket->Packet(&bsIn, pl, false);
|
myPacket->Packet(&bsIn, pl, false);
|
||||||
message = *pl->ChatMessage();
|
message = *pl->ChatMessage();
|
||||||
}
|
}
|
||||||
Main::get().getGUIConroller()->PrintChatMessage(message);
|
Main::get().getGUIController()->PrintChatMessage(message);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ID_GAME_CHARGEN:
|
case ID_GAME_CHARGEN:
|
||||||
|
@ -559,11 +559,11 @@ void Networking::ReceiveMessage(RakNet::Packet *packet)
|
||||||
getLocalPlayer()->guiMessageBox.label.c_str());
|
getLocalPlayer()->guiMessageBox.label.c_str());
|
||||||
|
|
||||||
if (getLocalPlayer()->guiMessageBox.type == BasePlayer::GUIMessageBox::MessageBox)
|
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)
|
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)
|
else if (getLocalPlayer()->guiMessageBox.type == BasePlayer::GUIMessageBox::InputDialog)
|
||||||
Main::get().getGUIConroller()->ShowInputBox(getLocalPlayer()->guiMessageBox);
|
Main::get().getGUIController()->ShowInputBox(getLocalPlayer()->guiMessageBox);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -257,6 +257,9 @@ namespace MWWorld
|
||||||
if (!getPlayerPtr().isInCell())
|
if (!getPlayerPtr().isInCell())
|
||||||
{
|
{
|
||||||
ESM::Position pos;
|
ESM::Position pos;
|
||||||
|
|
||||||
|
/* Disabled by tes3mp
|
||||||
|
|
||||||
const int cellSize = 8192;
|
const int cellSize = 8192;
|
||||||
pos.pos[0] = cellSize/2;
|
pos.pos[0] = cellSize/2;
|
||||||
pos.pos[1] = cellSize/2;
|
pos.pos[1] = cellSize/2;
|
||||||
|
@ -265,6 +268,11 @@ namespace MWWorld
|
||||||
pos.rot[1] = 0;
|
pos.rot[1] = 0;
|
||||||
pos.rot[2] = 0;
|
pos.rot[2] = 0;
|
||||||
mWorldScene->changeToExteriorCell(pos, true);
|
mWorldScene->changeToExteriorCell(pos, true);
|
||||||
|
*/
|
||||||
|
|
||||||
|
findExteriorPosition("Pelagiad", pos);
|
||||||
|
changeToExteriorCell(pos, true);
|
||||||
|
fixPosition(getPlayerPtr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
BIN
files/tes3mp/tes3mp.ico
Normal file
BIN
files/tes3mp/tes3mp.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
1
files/tes3mp/tes3mp.rc
Normal file
1
files/tes3mp/tes3mp.rc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
IDI_ICON1 ICON DISCARDABLE "tes3mp.ico"
|
Loading…
Reference in a new issue