forked from mirror/openmw-tes3mp
Merged branch tes3mp-gui into tes3mp-gui
This commit is contained in:
commit
1e3eff91ac
8 changed files with 63 additions and 8 deletions
|
@ -6,6 +6,10 @@ Programmers
|
|||
|
||||
Stanislav (Koncord) Zhukov - The main loafer and Project Leader
|
||||
David Cernat - not a loafer :D
|
||||
|
||||
Script developers
|
||||
--------------
|
||||
Grim Kriegor
|
||||
|
||||
|
||||
Testers:
|
||||
|
|
|
@ -339,7 +339,7 @@ void ScriptFunctions::SetSkill(unsigned short pid, unsigned short skill, int val
|
|||
|
||||
player->NpcStats()->mSkills[skill].mBase = value;
|
||||
|
||||
DEBUG_PRINTF("SetSkill(%d, %d, %d)\n", pid, skill, value);
|
||||
//DEBUG_PRINTF("SetSkill(%d, %d, %d)\n", pid, skill, value);
|
||||
|
||||
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_SKILL)->Send(player, false);
|
||||
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_SKILL)->Send(player, true);
|
||||
|
|
|
@ -181,7 +181,7 @@ void DedicatedPlayer::Move(float dt)
|
|||
ref_pos.pos[0] = lerp.x();
|
||||
ref_pos.pos[1] = lerp.y();
|
||||
ref_pos.pos[2] = lerp.z();
|
||||
ptr.getRefData().setPosition(ref_pos);
|
||||
world->moveObject(ptr, ref_pos.pos[0], ref_pos.pos[1], ref_pos.pos[2]);
|
||||
}
|
||||
|
||||
MWMechanics::Movement *move = &ptr.getClass().getMovementSettings(ptr);
|
||||
|
@ -404,6 +404,13 @@ void DedicatedPlayer::updateCell()
|
|||
cellStore = world->getExterior(cell.mCellId.mIndex.mX, cell.mCellId.mIndex.mY);
|
||||
else
|
||||
cellStore = world->getInterior(cell.mName);
|
||||
|
||||
// tes3mp debug start
|
||||
printf("Server says %s (%s) moved to %s\n",
|
||||
ptr.getBase()->mRef.getRefId().c_str(),
|
||||
this->Npc()->mName.c_str(),
|
||||
cellStore->getCell()->getDescription().c_str());
|
||||
// tes3mp debug end
|
||||
|
||||
// Allow this player's reference to move across a cell now that
|
||||
// a manual cell update has been called
|
||||
|
|
|
@ -342,6 +342,12 @@ void LocalPlayer::updateCell(bool forceUpdate)
|
|||
|
||||
if (shouldUpdate)
|
||||
{
|
||||
// tes3mp debug start
|
||||
printf("Telling server I moved from %s to %s\n",
|
||||
GetCell()->getDescription().c_str(),
|
||||
_cell->getDescription().c_str());
|
||||
// tes3mp debug end
|
||||
|
||||
(*GetCell()) = *_cell;
|
||||
isExterior = _cell->isExterior();
|
||||
|
||||
|
|
|
@ -280,7 +280,7 @@ void Networking::ReciveMessage(RakNet::Packet *packet)
|
|||
{
|
||||
myPacket->Packet(&bsIn, pl, false);
|
||||
|
||||
cout << "Player: " << pl->Npc()->mName << " pressed: " << (pl->GetAttack()->pressed == 1) << endl;
|
||||
//cout << "Player: " << pl->Npc()->mName << " pressed: " << (pl->GetAttack()->pressed == 1) << endl;
|
||||
if(pl->GetAttack()->pressed == 0)
|
||||
{
|
||||
cout << "success: " << (pl->GetAttack()->success == 1);
|
||||
|
@ -525,7 +525,7 @@ void Networking::ReciveMessage(RakNet::Packet *packet)
|
|||
{
|
||||
skillValue.readState(__pl->NpcStats()->mSkills[i]);
|
||||
__pl_ptr.getClass().getNpcStats(__pl_ptr).setSkill(i, skillValue);
|
||||
printf("skill %d, value %d\n", i, skillValue.getBase());
|
||||
//printf("skill %d, value %d\n", i, skillValue.getBase());
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "cellstore.hpp"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -214,6 +216,18 @@ namespace MWWorld
|
|||
if (found != mMovedToAnotherCell.end())
|
||||
{
|
||||
// A cell we had previously moved an object to is returning it to us.
|
||||
|
||||
// tes3mp debug start
|
||||
if (found->second != from) {
|
||||
|
||||
printf("Storage: %s owned %s which it gave to %s which isn't %s therefore CRASH\n",
|
||||
this->getCell()->getDescription().c_str(),
|
||||
object.getBase()->mRef.getRefId().c_str(),
|
||||
found->second->getCell()->getDescription().c_str(),
|
||||
from->getCell()->getDescription().c_str());
|
||||
}
|
||||
// tes3mp debug end
|
||||
|
||||
assert (found->second == from);
|
||||
mMovedToAnotherCell.erase(found);
|
||||
}
|
||||
|
@ -269,6 +283,14 @@ namespace MWWorld
|
|||
// Now that object is back to its rightful owner, we can move it
|
||||
if (cellToMoveTo != originalCell)
|
||||
{
|
||||
// tes3mp debug start
|
||||
printf("Storage: %s's original cell %s gives it from %s to %s\n",
|
||||
object.getBase()->mRef.getRefId().c_str(),
|
||||
originalCell->getCell()->getDescription().c_str(),
|
||||
this->getCell()->getDescription().c_str(),
|
||||
cellToMoveTo->getCell()->getDescription().c_str());
|
||||
// tes3mp debug end
|
||||
|
||||
originalCell->moveTo(object, cellToMoveTo);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "worldimp.hpp"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <osg/Group>
|
||||
#include <osg/ComputeBoundsVisitor>
|
||||
|
||||
|
@ -1140,6 +1142,17 @@ namespace MWWorld
|
|||
bool isPlayer = ptr == mPlayer->getPlayer();
|
||||
bool haveToMove = isPlayer || (currCell && mWorldScene->isCellActive(*currCell));
|
||||
MWWorld::Ptr newPtr = ptr;
|
||||
|
||||
// tes3mp debug start
|
||||
if (currCell != newCell) {
|
||||
|
||||
printf("Tick: %s was %s move from %s to %s\n",
|
||||
ptr.getBase()->mRef.getRefId().c_str(),
|
||||
ptr.getBase()->canChangeCell ? "allowed" : "denied",
|
||||
currCell->getCell()->getDescription().c_str(),
|
||||
newCell->getCell()->getDescription().c_str());
|
||||
}
|
||||
// tes3mp debug end
|
||||
|
||||
if (currCell != newCell && ptr.getBase()->canChangeCell)
|
||||
{
|
||||
|
|
|
@ -76,12 +76,15 @@ namespace mwmp
|
|||
void RW(std::string &str, bool write)
|
||||
{
|
||||
if (write)
|
||||
bs->Write(str.c_str());
|
||||
{
|
||||
RakNet::RakString rstr(str.c_str());
|
||||
bs->Write(rstr);
|
||||
}
|
||||
else
|
||||
{
|
||||
char cstr[256];
|
||||
bs->Read(cstr);
|
||||
str = cstr;
|
||||
RakNet::RakString rstr;
|
||||
bs->Read(rstr);
|
||||
str = rstr.C_String();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue