mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-25 11:33:37 +00:00
major fixes of my shit code
This commit is contained in:
parent
769d9ceb0d
commit
dcb2c43944
|
|
@ -1988,4 +1988,7 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE
|
|||
">"
|
||||
)
|
||||
|
||||
add_compile_options(-fpermissive -Wtemplate-body)
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||
-fpermissive
|
||||
-Wtemplate-body
|
||||
)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
#define TRUE true
|
||||
#define FALSE false
|
||||
|
|
@ -37,45 +38,23 @@ typedef struct {
|
|||
long long QuadPart;
|
||||
LONG HighPart;
|
||||
} LARGE_INTEGER;
|
||||
typedef long long LONGLONG;
|
||||
typedef size_t SIZE_T;
|
||||
typedef std::wstring LPWSTR;
|
||||
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-filetime
|
||||
typedef struct _FILETIME {
|
||||
DWORD dwLowDateTime;
|
||||
DWORD dwHighDateTime;
|
||||
} FILETIME, *PFILETIME, *LPFILETIME;
|
||||
|
||||
typedef short SHORT;
|
||||
|
||||
typedef struct {
|
||||
int xuidInvitee;
|
||||
int xuidInviter;
|
||||
DWORD dwTitleID;
|
||||
int hostInfo;
|
||||
bool fFromGameInvite;
|
||||
} XINVITE_INFO, * PXINVITE_INFO;
|
||||
typedef VOID* XMEMCOMPRESSION_CONTEXT;
|
||||
typedef VOID* XMEMDECOMPRESSION_CONTEXT;
|
||||
|
||||
typedef XINVITE_INFO INVITE_INFO;
|
||||
typedef float FLOAT;
|
||||
|
||||
typedef struct HXUIOBJ {
|
||||
// Stub fields representing the actual Xbox HXUIOBJ structure.
|
||||
int id;
|
||||
const char* name;
|
||||
} HXUIOBJ;
|
||||
#include "../x64headers/extraX64.h"
|
||||
|
||||
typedef struct _RTL_CRITICAL_SECTION {
|
||||
// //
|
||||
// // The following field is used for blocking when there is contention for
|
||||
// // the resource
|
||||
// //
|
||||
//
|
||||
union {
|
||||
ULONG_PTR RawEvent[4];
|
||||
} Synchronization;
|
||||
//
|
||||
// //
|
||||
// // The following three fields control entering and exiting the critical
|
||||
// // section for the resource
|
||||
// //
|
||||
//
|
||||
LONG LockCount;
|
||||
LONG RecursionCount;
|
||||
HANDLE OwningThread;
|
||||
} RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
|
||||
|
||||
typedef RTL_CRITICAL_SECTION CRITICAL_SECTION;
|
||||
|
||||
#endif // WLINUX_H
|
||||
#endif // WLINUX_H
|
||||
|
|
|
|||
|
|
@ -126,60 +126,6 @@ typedef struct _XSESSION_INFO
|
|||
XNKEY keyExchangeKey; // 16 bytes
|
||||
} XSESSION_INFO, *PXSESSION_INFO;
|
||||
|
||||
typedef struct _XUSER_DATA
|
||||
{
|
||||
BYTE type;
|
||||
|
||||
union
|
||||
{
|
||||
int nData; // XUSER_DATA_TYPE_INT32
|
||||
int64 i64Data; // XUSER_DATA_TYPE_INT64
|
||||
double dblData; // XUSER_DATA_TYPE_DOUBLE
|
||||
struct // XUSER_DATA_TYPE_UNICODE
|
||||
{
|
||||
uint cbData; // Includes null-terminator
|
||||
char * pwszData;
|
||||
} string;
|
||||
float fData; // XUSER_DATA_TYPE_FLOAT
|
||||
struct // XUSER_DATA_TYPE_BINARY
|
||||
{
|
||||
uint cbData;
|
||||
char * pbData;
|
||||
} binary;
|
||||
};
|
||||
} XUSER_DATA, *PXUSER_DATA;
|
||||
|
||||
typedef struct _XUSER_PROPERTY
|
||||
{
|
||||
DWORD dwPropertyId;
|
||||
XUSER_DATA value;
|
||||
} XUSER_PROPERTY, *PXUSER_PROPERTY;
|
||||
|
||||
typedef struct _XUSER_CONTEXT
|
||||
{
|
||||
DWORD dwContextId;
|
||||
DWORD dwValue;
|
||||
} XUSER_CONTEXT, *PXUSER_CONTEXT;
|
||||
|
||||
typedef struct _XSESSION_SEARCHRESULT
|
||||
{
|
||||
XSESSION_INFO info;
|
||||
DWORD dwOpenPublicSlots;
|
||||
DWORD dwOpenPrivateSlots;
|
||||
DWORD dwFilledPublicSlots;
|
||||
DWORD dwFilledPrivateSlots;
|
||||
DWORD cProperties;
|
||||
DWORD cContexts;
|
||||
PXUSER_PROPERTY pProperties;
|
||||
PXUSER_CONTEXT pContexts;
|
||||
} XSESSION_SEARCHRESULT, *PXSESSION_SEARCHRESULT;
|
||||
|
||||
typedef struct _XSESSION_SEARCHRESULT_HEADER
|
||||
{
|
||||
DWORD dwSearchResults;
|
||||
XSESSION_SEARCHRESULT *pResults;
|
||||
} XSESSION_SEARCHRESULT_HEADER, *PXSESSION_SEARCHRESULT_HEADER;
|
||||
|
||||
typedef struct _XSESSION_REGISTRANT
|
||||
{
|
||||
uint64 qwMachineID;
|
||||
|
|
@ -195,25 +141,6 @@ typedef struct _XSESSION_REGISTRATION_RESULTS
|
|||
XSESSION_REGISTRANT *rgRegistrants;
|
||||
} XSESSION_REGISTRATION_RESULTS, *PXSESSION_REGISTRATION_RESULTS;
|
||||
|
||||
typedef struct {
|
||||
BYTE bFlags;
|
||||
BYTE bReserved;
|
||||
WORD cProbesXmit;
|
||||
WORD cProbesRecv;
|
||||
WORD cbData;
|
||||
BYTE * pbData;
|
||||
WORD wRttMinInMsecs;
|
||||
WORD wRttMedInMsecs;
|
||||
DWORD dwUpBitsPerSec;
|
||||
DWORD dwDnBitsPerSec;
|
||||
} XNQOSINFO;
|
||||
|
||||
typedef struct {
|
||||
uint cxnqos;
|
||||
uint cxnqosPending;
|
||||
XNQOSINFO axnqosinfo[1];
|
||||
} XNQOS;
|
||||
|
||||
#define XSESSION_CREATE_HOST 0
|
||||
#define XUSER_DATA_TYPE_INT32 0
|
||||
#define XSESSION_CREATE_USES_ARBITRATION 0
|
||||
|
|
|
|||
|
|
@ -124,8 +124,7 @@ typedef XUID GameSessionUID;
|
|||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
#if !defined(__linux__)
|
||||
#include "extraX64.h"
|
||||
#if defined(__linux__)
|
||||
#else
|
||||
#include "../Minecraft.Client/Xbox/Network/extra.h"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -4,15 +4,16 @@
|
|||
#include <string>
|
||||
#include <functional>
|
||||
|
||||
#include "..\..\Minecraft.Client\SkinBox.h"
|
||||
#include "../../Minecraft.Client/SkinBox.h"
|
||||
|
||||
|
||||
#include <vector>
|
||||
|
||||
#define MULTITHREAD_ENABLE
|
||||
|
||||
#ifndef __linux__
|
||||
typedef unsigned char byte;
|
||||
|
||||
#endif // __linux__
|
||||
const int XUSER_INDEX_ANY = 255;
|
||||
const int XUSER_INDEX_FOCUS = 254;
|
||||
|
||||
|
|
@ -24,7 +25,43 @@ const int XUSER_MAX_COUNT = 4;
|
|||
const int MINECRAFT_NET_MAX_PLAYERS = 8;
|
||||
#endif
|
||||
|
||||
#if defined(__linux__)
|
||||
|
||||
typedef struct _RTL_CRITICAL_SECTION {
|
||||
// //
|
||||
// // The following field is used for blocking when there is contention for
|
||||
// // the resource
|
||||
// //
|
||||
//
|
||||
union {
|
||||
ULONG_PTR RawEvent[4];
|
||||
} Synchronization;
|
||||
//
|
||||
// //
|
||||
// // The following three fields control entering and exiting the critical
|
||||
// // section for the resource
|
||||
// //
|
||||
//
|
||||
LONG LockCount;
|
||||
LONG RecursionCount;
|
||||
HANDLE OwningThread;
|
||||
} RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
|
||||
|
||||
typedef RTL_CRITICAL_SECTION CRITICAL_SECTION;
|
||||
|
||||
|
||||
inline void DeleteCriticalSection(CRITICAL_SECTION* stubEnterCS)
|
||||
{
|
||||
}
|
||||
|
||||
inline void EnterCriticalSection(CRITICAL_SECTION* stubEnterCS)
|
||||
{
|
||||
}
|
||||
|
||||
inline void LeaveCriticalSection( CRITICAL_SECTION* stubEnterCS)
|
||||
{
|
||||
}
|
||||
#endif // __linux__
|
||||
|
||||
#ifdef __ORBIS__
|
||||
#include <net.h>
|
||||
|
|
@ -406,7 +443,7 @@ const int QNET_SENDDATA_SEQUENTIAL = 0;
|
|||
struct XRNM_SEND_BUFFER
|
||||
{
|
||||
DWORD dwDataSize;
|
||||
byte *pbyData;
|
||||
std::byte *pbyData;
|
||||
};
|
||||
|
||||
const int D3DBLEND_CONSTANTALPHA = 0;
|
||||
|
|
@ -451,7 +488,7 @@ HRESULT XMemDecompress(
|
|||
XMEMDECOMPRESSION_CONTEXT Context,
|
||||
VOID *pDestination,
|
||||
SIZE_T *pDestSize,
|
||||
CONST VOID *pSource,
|
||||
VOID *pSource,
|
||||
SIZE_T SrcSize
|
||||
);
|
||||
|
||||
|
|
@ -460,20 +497,20 @@ HRESULT XMemCompress(
|
|||
XMEMCOMPRESSION_CONTEXT Context,
|
||||
VOID *pDestination,
|
||||
SIZE_T *pDestSize,
|
||||
CONST VOID *pSource,
|
||||
VOID *pSource,
|
||||
SIZE_T SrcSize
|
||||
);
|
||||
|
||||
HRESULT XMemCreateCompressionContext(
|
||||
XMEMCODEC_TYPE CodecType,
|
||||
CONST VOID *pCodecParams,
|
||||
const VOID *pCodecParams,
|
||||
DWORD Flags,
|
||||
XMEMCOMPRESSION_CONTEXT *pContext
|
||||
);
|
||||
|
||||
HRESULT XMemCreateDecompressionContext(
|
||||
XMEMCODEC_TYPE CodecType,
|
||||
CONST VOID *pCodecParams,
|
||||
const VOID *pCodecParams,
|
||||
DWORD Flags,
|
||||
XMEMDECOMPRESSION_CONTEXT *pContext
|
||||
);
|
||||
|
|
@ -630,7 +667,7 @@ public:
|
|||
D3DXVECTOR3();
|
||||
D3DXVECTOR3(float,float,float);
|
||||
float x,y,z,pad;
|
||||
D3DXVECTOR3& operator += ( CONST D3DXVECTOR3& add );
|
||||
D3DXVECTOR3& operator += ( const D3DXVECTOR3& add );
|
||||
};
|
||||
|
||||
#define QNET_E_SESSION_FULL 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue