fixed Windows build for networking branch
This commit is contained in:
1 parent
21e2add09a
commit
43b9d829c8
7 files changed
+19
-15
No files matched your search
@@ -211,22 +211,29 @@ ULONG_PTR IQNetPlayer::GetCustomDataValue() {
|
|||||||
return m_customData;
|
return m_customData;
|
||||||
}
|
}
|
||||||
|
|
||||||
IQNetPlayer IQNet::m_player[4];
|
static IQNetPlayer s_playerArray[4];
|
||||||
|
IQNetPlayer *IQNet::m_player = s_playerArray;
|
||||||
|
DWORD IQNet::s_playerCapacity = 4;
|
||||||
|
DWORD IQNet::s_playerCount = 0;
|
||||||
|
bool IQNet::s_isHosting = false;
|
||||||
|
|
||||||
bool _bQNetStubGameRunning = false;
|
bool _bQNetStubGameRunning = false;
|
||||||
|
|
||||||
HRESULT IQNet::AddLocalPlayerByUserIndex(DWORD dwUserIndex){ return S_OK; }
|
HRESULT IQNet::AddLocalPlayerByUserIndex(DWORD dwUserIndex){ return S_OK; }
|
||||||
|
void IQNet::SetPlayerCapacity(DWORD capacity) { s_playerCapacity = capacity; }
|
||||||
|
DWORD IQNet::GetPlayerCapacity() { return s_playerCapacity; }
|
||||||
IQNetPlayer *IQNet::GetHostPlayer() { return &m_player[0]; }
|
IQNetPlayer *IQNet::GetHostPlayer() { return &m_player[0]; }
|
||||||
IQNetPlayer *IQNet::GetLocalPlayerByUserIndex(DWORD dwUserIndex) { return &m_player[dwUserIndex]; }
|
IQNetPlayer *IQNet::GetLocalPlayerByUserIndex(DWORD dwUserIndex) { return &m_player[dwUserIndex]; }
|
||||||
IQNetPlayer *IQNet::GetPlayerByIndex(DWORD dwPlayerIndex) { return &m_player[0]; }
|
IQNetPlayer *IQNet::GetPlayerByIndex(DWORD dwPlayerIndex) { return &m_player[0]; }
|
||||||
IQNetPlayer *IQNet::GetPlayerBySmallId(BYTE SmallId){ return &m_player[0]; }
|
IQNetPlayer *IQNet::GetPlayerBySmallId(BYTE SmallId){ return &m_player[0]; }
|
||||||
IQNetPlayer *IQNet::GetPlayerByXuid(PlayerUID xuid){ return &m_player[0]; }
|
IQNetPlayer *IQNet::GetPlayerByXuid(PlayerUID xuid){ return &m_player[0]; }
|
||||||
DWORD IQNet::GetPlayerCount() { return 1; }
|
DWORD IQNet::GetPlayerCount() { return s_playerCount; }
|
||||||
QNET_STATE IQNet::GetState() { return _bQNetStubGameRunning ? QNET_STATE_GAME_PLAY : QNET_STATE_IDLE; }
|
QNET_STATE IQNet::GetState() { return _bQNetStubGameRunning ? QNET_STATE_GAME_PLAY : QNET_STATE_IDLE; }
|
||||||
bool IQNet::IsHost() { return true; }
|
bool IQNet::IsHost() { return s_isHosting; }
|
||||||
HRESULT IQNet::JoinGameFromInviteInfo(DWORD dwUserIndex, DWORD dwUserMask, const INVITE_INFO *pInviteInfo) { return S_OK; }
|
HRESULT IQNet::JoinGameFromInviteInfo(DWORD dwUserIndex, DWORD dwUserMask, const INVITE_INFO *pInviteInfo) { return S_OK; }
|
||||||
void IQNet::HostGame() { _bQNetStubGameRunning = true; }
|
void IQNet::HostGame() { _bQNetStubGameRunning = true; s_isHosting = true; }
|
||||||
void IQNet::EndGame() { _bQNetStubGameRunning = false; }
|
void IQNet::ClientJoinGame() { _bQNetStubGameRunning = true; s_isHosting = false; }
|
||||||
|
void IQNet::EndGame() { _bQNetStubGameRunning = false; s_isHosting = false; }
|
||||||
|
|
||||||
DWORD MinecraftDynamicConfigurations::GetTrialTime() { return DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; }
|
DWORD MinecraftDynamicConfigurations::GetTrialTime() { return DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; }
|
||||||
|
|
||||||
|
|||||||
@@ -552,13 +552,13 @@ bool AbstractContainerMenu::isPauseScreen()
|
|||||||
|
|
||||||
void AbstractContainerMenu::setItem(unsigned int slot, shared_ptr<ItemInstance> item)
|
void AbstractContainerMenu::setItem(unsigned int slot, shared_ptr<ItemInstance> item)
|
||||||
{
|
{
|
||||||
if (slot >= slots->size()) return;
|
if (slot >= slots.size()) return;
|
||||||
getSlot(slot)->set(item);
|
getSlot(slot)->set(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractContainerMenu::setAll(ItemInstanceArray *items)
|
void AbstractContainerMenu::setAll(ItemInstanceArray *items)
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < items->length && i < slots->size(); i++)
|
for (unsigned int i = 0; i < items->length && i < slots.size(); i++)
|
||||||
{
|
{
|
||||||
getSlot(i)->set( (*items)[i] );
|
getSlot(i)->set( (*items)[i] );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public:
|
|||||||
dos->write(data);
|
dos->write(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void load(DataInput *dis)
|
void load(DataInput *dis, int tagDepth)
|
||||||
{
|
{
|
||||||
int length = dis->readInt();
|
int length = dis->readInt();
|
||||||
if (length < 0 || length > 2 * 1024 * 1024) length = 0;
|
if (length < 0 || length > 2 * 1024 * 1024) length = 0;
|
||||||
|
|||||||
@@ -490,7 +490,7 @@ LevelChunk *OldChunkStorage::load(Level *level, DataInputStream *dis)
|
|||||||
{
|
{
|
||||||
CompoundTag *teTag = tileTicks->get(i);
|
CompoundTag *teTag = tileTicks->get(i);
|
||||||
|
|
||||||
level->forceAddTileTick(teTag->getInt(L"x"), teTag->getInt(L"y"), teTag->getInt(L"z"), teTag->getInt(L"i"), teTag->getInt(L"t"));
|
level->forceAddTileTick(teTag->getInt(L"x"), teTag->getInt(L"y"), teTag->getInt(L"z"), teTag->getInt(L"i"), teTag->getInt(L"t"), teTag->getInt(L"p"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,4 @@ DataOutputStream *RegionFileCache::_getChunkDataOutputStream(ConsoleSaveFile *sa
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RegionFileCache::~RegionFileCache()
|
|
||||||
{
|
|
||||||
_clear();
|
|
||||||
}
|
|
||||||
@@ -17,7 +17,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
// Made public and non-static so we can have a cache for input and output files
|
// Made public and non-static so we can have a cache for input and output files
|
||||||
RegionFileCache() { InitializeCriticalSectionAndSpinCount(&m_cs, 4000); }
|
RegionFileCache() { InitializeCriticalSectionAndSpinCount(&m_cs, 4000); }
|
||||||
~RegionFileCache() { DeleteCriticalSection(&m_cs); }
|
~RegionFileCache() { _clear(); DeleteCriticalSection(&m_cs); }
|
||||||
|
|
||||||
RegionFile *_getRegionFile(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ); // 4J - TODO was synchronized
|
RegionFile *_getRegionFile(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ); // 4J - TODO was synchronized
|
||||||
void _clear(); // 4J - TODO was synchronized
|
void _clear(); // 4J - TODO was synchronized
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ Tag *Tag::readNamedTag(DataInput *dis)
|
|||||||
Tag *tag = newTag(type, name);
|
Tag *tag = newTag(type, name);
|
||||||
if (tag == NULL) { depth--; return new EndTag(); }
|
if (tag == NULL) { depth--; return new EndTag(); }
|
||||||
|
|
||||||
tag->load(dis);
|
tag->load(dis, depth + 1);
|
||||||
depth--;
|
depth--;
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user