mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/GabsPuNs-MinecraftConsoles.git
synced 2026-07-10 19:59:24 +00:00
Use BYTE Win Typedef instead of byte typedef from Minecraft.World
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
// link, the end (0 or 1) is passed as a parameter to the ctor.
|
||||
|
||||
CRITICAL_SECTION Socket::s_hostQueueLock[2];
|
||||
std::queue<byte> Socket::s_hostQueue[2];
|
||||
std::queue<BYTE> Socket::s_hostQueue[2];
|
||||
Socket::SocketOutputStreamLocal *Socket::s_hostOutStream[2];
|
||||
Socket::SocketInputStreamLocal *Socket::s_hostInStream[2];
|
||||
ServerConnection *Socket::s_serverConnection = nullptr;
|
||||
@@ -29,7 +29,7 @@ void Socket::Initialise(ServerConnection *serverConnection)
|
||||
if(TryEnterCriticalSection(&s_hostQueueLock[i]))
|
||||
{
|
||||
// Clear the queue
|
||||
std::queue<byte> empty;
|
||||
std::queue<BYTE> empty;
|
||||
std::swap( s_hostQueue[i], empty );
|
||||
LeaveCriticalSection(&s_hostQueueLock[i]);
|
||||
}
|
||||
@@ -264,7 +264,7 @@ Socket::SocketInputStreamLocal::SocketInputStreamLocal(int queueIdx)
|
||||
m_queueIdx = queueIdx;
|
||||
}
|
||||
|
||||
// Try and get an input byte, blocking until one is available
|
||||
// Try and get an input BYTE, blocking until one is available
|
||||
int Socket::SocketInputStreamLocal::read()
|
||||
{
|
||||
while(m_streamOpen && ShutdownManager::ShouldRun(ShutdownManager::eConnectionReadThreads))
|
||||
@@ -273,7 +273,7 @@ int Socket::SocketInputStreamLocal::read()
|
||||
{
|
||||
if( s_hostQueue[m_queueIdx].size() )
|
||||
{
|
||||
byte retval = s_hostQueue[m_queueIdx].front();
|
||||
BYTE retval = s_hostQueue[m_queueIdx].front();
|
||||
s_hostQueue[m_queueIdx].pop();
|
||||
LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]);
|
||||
return retval;
|
||||
@@ -319,7 +319,7 @@ void Socket::SocketInputStreamLocal::close()
|
||||
{
|
||||
m_streamOpen = false;
|
||||
EnterCriticalSection(&s_hostQueueLock[m_queueIdx]);
|
||||
std::queue<byte> empty;
|
||||
std::queue<BYTE> empty;
|
||||
std::swap(s_hostQueue[m_queueIdx], empty);
|
||||
LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]);
|
||||
}
|
||||
@@ -339,7 +339,7 @@ void Socket::SocketOutputStreamLocal::write(unsigned int b)
|
||||
return;
|
||||
}
|
||||
EnterCriticalSection(&s_hostQueueLock[m_queueIdx]);
|
||||
s_hostQueue[m_queueIdx].push(static_cast<byte>(b));
|
||||
s_hostQueue[m_queueIdx].push(static_cast<BYTE>(b));
|
||||
LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]);
|
||||
}
|
||||
|
||||
@@ -368,7 +368,7 @@ void Socket::SocketOutputStreamLocal::close()
|
||||
{
|
||||
m_streamOpen = false;
|
||||
EnterCriticalSection(&s_hostQueueLock[m_queueIdx]);
|
||||
std::queue<byte> empty;
|
||||
std::queue<BYTE> empty;
|
||||
std::swap(s_hostQueue[m_queueIdx], empty);
|
||||
LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]);
|
||||
}
|
||||
@@ -382,7 +382,7 @@ Socket::SocketInputStreamNetwork::SocketInputStreamNetwork(Socket *socket, int q
|
||||
m_socket = socket;
|
||||
}
|
||||
|
||||
// Try and get an input byte, blocking until one is available
|
||||
// Try and get an input BYTE, blocking until one is available
|
||||
int Socket::SocketInputStreamNetwork::read()
|
||||
{
|
||||
while(m_streamOpen && ShutdownManager::ShouldRun(ShutdownManager::eConnectionReadThreads))
|
||||
@@ -391,7 +391,7 @@ int Socket::SocketInputStreamNetwork::read()
|
||||
{
|
||||
if( m_socket->m_queueNetwork[m_queueIdx].size() )
|
||||
{
|
||||
byte retval = m_socket->m_queueNetwork[m_queueIdx].front();
|
||||
BYTE retval = m_socket->m_queueNetwork[m_queueIdx].front();
|
||||
m_socket->m_queueNetwork[m_queueIdx].pop();
|
||||
LeaveCriticalSection(&m_socket->m_queueLockNetwork[m_queueIdx]);
|
||||
return retval;
|
||||
@@ -451,8 +451,8 @@ void Socket::SocketOutputStreamNetwork::write(unsigned int b)
|
||||
{
|
||||
if( m_streamOpen != true ) return;
|
||||
byteArray barray;
|
||||
byte bb;
|
||||
bb = static_cast<byte>(b);
|
||||
BYTE bb;
|
||||
bb = static_cast<BYTE>(b);
|
||||
barray.data = &bb;
|
||||
barray.length = 1;
|
||||
write(barray, 0, 1);
|
||||
|
||||
Reference in New Issue
Block a user