mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-07-23 19:17:05 +00:00
Remove WinAPI ints from network and save helpers
This commit is contained in:
parent
9abfbb0c67
commit
a2ddb7c2f0
|
|
@ -5709,7 +5709,7 @@ int CMinecraftApp::ExitAndJoinFromInviteAndSaveReturned(void *pParam,int iPad,C4
|
||||||
// results switched for this dialog
|
// results switched for this dialog
|
||||||
if(result==C4JStorage::EMessage_ResultDecline)
|
if(result==C4JStorage::EMessage_ResultDecline)
|
||||||
{
|
{
|
||||||
INT saveOrCheckpointId = 0;
|
int saveOrCheckpointId = 0;
|
||||||
|
|
||||||
// Check they have the full texture pack if they are using one
|
// Check they have the full texture pack if they are using one
|
||||||
// 4J-PB - Is the player trying to save but they are using a trial texturepack ?
|
// 4J-PB - Is the player trying to save but they are using a trial texturepack ?
|
||||||
|
|
|
||||||
|
|
@ -342,7 +342,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, void *lpParamet
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 4J Stu - Host needs to generate a unique multiplayer id for sentient telemetry reporting
|
// 4J Stu - Host needs to generate a unique multiplayer id for sentient telemetry reporting
|
||||||
INT multiplayerInstanceId = TelemetryManager->GenerateMultiplayerInstanceId();
|
int multiplayerInstanceId = TelemetryManager->GenerateMultiplayerInstanceId();
|
||||||
TelemetryManager->SetMultiplayerInstanceId(multiplayerInstanceId);
|
TelemetryManager->SetMultiplayerInstanceId(multiplayerInstanceId);
|
||||||
}
|
}
|
||||||
TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected();
|
TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected();
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class CGameNetworkManager;
|
||||||
|
|
||||||
typedef struct _SearchForGamesData
|
typedef struct _SearchForGamesData
|
||||||
{
|
{
|
||||||
DWORD sessionIDCount;
|
unsigned int sessionIDCount;
|
||||||
XSESSION_SEARCHRESULT_HEADER *searchBuffer;
|
XSESSION_SEARCHRESULT_HEADER *searchBuffer;
|
||||||
XNQOS **ppQos;
|
XNQOS **ppQos;
|
||||||
SessionID *sessionIDList;
|
SessionID *sessionIDList;
|
||||||
|
|
|
||||||
|
|
@ -1428,7 +1428,7 @@ int UIScene_LoadMenu::DeleteSaveDataReturned(void *pParam,bool bSuccess)
|
||||||
// 4J Stu - Shared functionality that is the same whether we needed a quadrant sign-in or not
|
// 4J Stu - Shared functionality that is the same whether we needed a quadrant sign-in or not
|
||||||
void UIScene_LoadMenu::StartGameFromSave(UIScene_LoadMenu* pClass, int localUsersMask)
|
void UIScene_LoadMenu::StartGameFromSave(UIScene_LoadMenu* pClass, int localUsersMask)
|
||||||
{
|
{
|
||||||
INT saveOrCheckpointId = 0;
|
int saveOrCheckpointId = 0;
|
||||||
bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
|
bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
|
||||||
TelemetryManager->RecordLevelResume(pClass->m_iPad, eSen_FriendOrMatch_Playing_With_Invited_Friends, eSen_CompeteOrCoop_Coop_and_Competitive, app.GetGameSettings(pClass->m_iPad,eGameSetting_Difficulty), app.GetLocalPlayerCount(), g_NetworkManager.GetOnlinePlayerCount(), saveOrCheckpointId);
|
TelemetryManager->RecordLevelResume(pClass->m_iPad, eSen_FriendOrMatch_Playing_With_Invited_Friends, eSen_CompeteOrCoop_Coop_and_Competitive, app.GetGameSettings(pClass->m_iPad,eGameSetting_Difficulty), app.GetLocalPlayerCount(), g_NetworkManager.GetOnlinePlayerCount(), saveOrCheckpointId);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -940,7 +940,7 @@ int CScene_LoadGameSettings::DeviceRemovedDialogReturned(void *pParam,int iPad,C
|
||||||
// 4J Stu - Shared functionality that is the same whether we needed a quadrant sign-in or not
|
// 4J Stu - Shared functionality that is the same whether we needed a quadrant sign-in or not
|
||||||
void CScene_LoadGameSettings::StartGameFromSave(CScene_LoadGameSettings* pClass, DWORD dwLocalUsersMask)
|
void CScene_LoadGameSettings::StartGameFromSave(CScene_LoadGameSettings* pClass, DWORD dwLocalUsersMask)
|
||||||
{
|
{
|
||||||
INT saveOrCheckpointId = 0;
|
int saveOrCheckpointId = 0;
|
||||||
bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
|
bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
|
||||||
TelemetryManager->RecordLevelResume(pClass->m_iPad, eSen_FriendOrMatch_Playing_With_Invited_Friends, eSen_CompeteOrCoop_Coop_and_Competitive, app.GetGameSettings(pClass->m_iPad,eGameSetting_Difficulty), app.GetLocalPlayerCount(), g_NetworkManager.GetOnlinePlayerCount(), saveOrCheckpointId);
|
TelemetryManager->RecordLevelResume(pClass->m_iPad, eSen_FriendOrMatch_Playing_With_Invited_Friends, eSen_CompeteOrCoop_Coop_and_Competitive, app.GetGameSettings(pClass->m_iPad,eGameSetting_Difficulty), app.GetLocalPlayerCount(), g_NetworkManager.GetOnlinePlayerCount(), saveOrCheckpointId);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1298,10 +1298,11 @@ void CPlatformNetworkManagerXbox::SearchForGames()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD sessionIDCount = std::min( XSESSION_SEARCH_MAX_IDS, friendsSessions[m_lastSearchPad].size() );
|
unsigned int sessionIDCount = static_cast<unsigned int>(std::min<std::size_t>(XSESSION_SEARCH_MAX_IDS, friendsSessions[m_lastSearchPad].size()));
|
||||||
|
DWORD xboxSessionIDCount = sessionIDCount;
|
||||||
SessionID *sessionIDList = new SessionID[sessionIDCount];
|
SessionID *sessionIDList = new SessionID[sessionIDCount];
|
||||||
|
|
||||||
for(DWORD i = 0; i < sessionIDCount; ++i)
|
for(unsigned int i = 0; i < sessionIDCount; ++i)
|
||||||
{
|
{
|
||||||
sessionIDList[i] = friendsSessions[m_lastSearchPad].at(i)->sessionId;
|
sessionIDList[i] = friendsSessions[m_lastSearchPad].at(i)->sessionId;
|
||||||
}
|
}
|
||||||
|
|
@ -1313,7 +1314,7 @@ void CPlatformNetworkManagerXbox::SearchForGames()
|
||||||
// size.
|
// size.
|
||||||
|
|
||||||
dwStatus = XSessionSearchByIds(
|
dwStatus = XSessionSearchByIds(
|
||||||
sessionIDCount,
|
xboxSessionIDCount,
|
||||||
sessionIDList,
|
sessionIDList,
|
||||||
g_NetworkManager.GetPrimaryPad(),
|
g_NetworkManager.GetPrimaryPad(),
|
||||||
&cbResults, // Pass in the address of the size variable
|
&cbResults, // Pass in the address of the size variable
|
||||||
|
|
@ -1344,7 +1345,7 @@ void CPlatformNetworkManagerXbox::SearchForGames()
|
||||||
// this time use the modified buffer size and a pointer to a buffer that
|
// this time use the modified buffer size and a pointer to a buffer that
|
||||||
// matches it.
|
// matches it.
|
||||||
dwStatus = XSessionSearchByIds(
|
dwStatus = XSessionSearchByIds(
|
||||||
sessionIDCount,
|
xboxSessionIDCount,
|
||||||
sessionIDList,
|
sessionIDList,
|
||||||
g_NetworkManager.GetPrimaryPad(),
|
g_NetworkManager.GetPrimaryPad(),
|
||||||
&cbResults, // Pass in the address of the size variable
|
&cbResults, // Pass in the address of the size variable
|
||||||
|
|
@ -1388,12 +1389,13 @@ int CPlatformNetworkManagerXbox::SearchForGamesThreadProc( void* lpParameter )
|
||||||
{
|
{
|
||||||
SearchForGamesData *threadData = (SearchForGamesData *)lpParameter;
|
SearchForGamesData *threadData = (SearchForGamesData *)lpParameter;
|
||||||
|
|
||||||
DWORD sessionIDCount = threadData->sessionIDCount;
|
unsigned int sessionIDCount = threadData->sessionIDCount;
|
||||||
|
DWORD xboxSessionIDCount = sessionIDCount;
|
||||||
|
|
||||||
XOVERLAPPED *pOverlapped = threadData->pOverlapped;
|
XOVERLAPPED *pOverlapped = threadData->pOverlapped;
|
||||||
|
|
||||||
DWORD dwStatus = ERROR_SUCCESS;
|
DWORD dwStatus = ERROR_SUCCESS;
|
||||||
DWORD cbResults = sessionIDCount;
|
DWORD cbResults = xboxSessionIDCount;
|
||||||
XSESSION_SEARCHRESULT_HEADER *pSearchResults = (XSESSION_SEARCHRESULT_HEADER *)threadData->searchBuffer;
|
XSESSION_SEARCHRESULT_HEADER *pSearchResults = (XSESSION_SEARCHRESULT_HEADER *)threadData->searchBuffer;
|
||||||
|
|
||||||
while( !XHasOverlappedIoCompleted(pOverlapped) )
|
while( !XHasOverlappedIoCompleted(pOverlapped) )
|
||||||
|
|
@ -1415,7 +1417,7 @@ int CPlatformNetworkManagerXbox::SearchForGamesThreadProc( void* lpParameter )
|
||||||
const XNKEY *QoSxnkey[XSESSION_SEARCH_MAX_IDS];// = new XNKEY*[sessionIDCount];
|
const XNKEY *QoSxnkey[XSESSION_SEARCH_MAX_IDS];// = new XNKEY*[sessionIDCount];
|
||||||
|
|
||||||
|
|
||||||
for(DWORD i = 0; i < pSearchResults->dwSearchResults; ++i)
|
for(unsigned int i = 0; i < pSearchResults->dwSearchResults; ++i)
|
||||||
{
|
{
|
||||||
QoSxnaddr[i] = &pSearchResults->pResults[i].info.hostAddress;
|
QoSxnaddr[i] = &pSearchResults->pResults[i].info.hostAddress;
|
||||||
QoSxnkid[i] = &pSearchResults->pResults[i].info.sessionID;
|
QoSxnkid[i] = &pSearchResults->pResults[i].info.sessionID;
|
||||||
|
|
|
||||||
|
|
@ -775,7 +775,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail )
|
||||||
|
|
||||||
int iTextMetadataBytes = app.CreateImageTextData(bTextMetadata, seed, hasSeed, app.GetGameHostOption(eGameHostOption_All), Minecraft::GetInstance()->getCurrentTexturePackId());
|
int iTextMetadataBytes = app.CreateImageTextData(bTextMetadata, seed, hasSeed, app.GetGameHostOption(eGameHostOption_All), Minecraft::GetInstance()->getCurrentTexturePackId());
|
||||||
|
|
||||||
INT saveOrCheckpointId = 0;
|
int saveOrCheckpointId = 0;
|
||||||
bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
|
bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
|
||||||
TelemetryManager->RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(), saveOrCheckpointId, compLength+8);
|
TelemetryManager->RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(), saveOrCheckpointId, compLength+8);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1455,7 +1455,7 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
INT saveOrCheckpointId = 0;
|
int saveOrCheckpointId = 0;
|
||||||
bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
|
bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
|
||||||
TelemetryManager->RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(), saveOrCheckpointId, compLength+8);
|
TelemetryManager->RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(), saveOrCheckpointId, compLength+8);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ void AddPlayerPacket::read(DataInputStream *dis) //throws IOException
|
||||||
m_playerIndex = dis->readByte();
|
m_playerIndex = dis->readByte();
|
||||||
m_skinId = static_cast<std::uint32_t>(dis->readInt());
|
m_skinId = static_cast<std::uint32_t>(dis->readInt());
|
||||||
m_capeId = static_cast<std::uint32_t>(dis->readInt());
|
m_capeId = static_cast<std::uint32_t>(dis->readInt());
|
||||||
INT privileges = dis->readInt();
|
int privileges = dis->readInt();
|
||||||
m_uiGamePrivileges = static_cast<unsigned int>(privileges);
|
m_uiGamePrivileges = static_cast<unsigned int>(privileges);
|
||||||
MemSect(1);
|
MemSect(1);
|
||||||
unpack = SynchedEntityData::unpack(dis);
|
unpack = SynchedEntityData::unpack(dis);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue