├── CMakeLists.txt ├── CMakeSettings.json ├── GenerateVtablePadding.py ├── IDA └── types.h ├── MakeCWModsCMake.py ├── README.md ├── VtablePadding.h ├── common ├── BytesIO.cpp ├── BytesIO.h ├── ColorRGB.cpp ├── ColorRGB.h ├── Matrix4.cpp ├── Matrix4.h ├── RGBA.cpp ├── RGBA.h ├── Vector2.cpp ├── Vector2.h ├── Vector3.cpp ├── Vector3.h ├── math.cpp ├── math.h └── types.h ├── cube ├── AI.cpp ├── AI.h ├── AdaptionWidget.cpp ├── AdaptionWidget.h ├── BaseWidget.cpp ├── BaseWidget.h ├── Block.cpp ├── Block.h ├── BlockProperties.cpp ├── BlockProperties.h ├── CharacterPreviewWidget.cpp ├── CharacterPreviewWidget.h ├── CharacterStyleWidget.cpp ├── CharacterStyleWidget.h ├── CharacterWidget.cpp ├── CharacterWidget.h ├── ChatWidget.cpp ├── ChatWidget.h ├── Client.cpp ├── Client.h ├── Connection.cpp ├── Connection.h ├── Controls.cpp ├── Controls.h ├── ControlsWidget.cpp ├── ControlsWidget.h ├── Creature.cpp ├── Creature.h ├── Database.cpp ├── Database.h ├── EnchantWidget.cpp ├── EnchantWidget.h ├── Equipment.cpp ├── Equipment.h ├── Field.cpp ├── Field.h ├── FormulaDetailsWidget.cpp ├── FormulaDetailsWidget.h ├── GUI.cpp ├── GUI.h ├── Game.cpp ├── Game.h ├── HelpWidget.cpp ├── HelpWidget.h ├── Host.cpp ├── Host.h ├── Interaction.cpp ├── Interaction.h ├── InventoryWidget.cpp ├── InventoryWidget.h ├── Item.cpp ├── Item.h ├── ItemStack.cpp ├── ItemStack.h ├── MapOverlayWidget.cpp ├── MapOverlayWidget.h ├── MultiplayerWidget.cpp ├── MultiplayerWidget.h ├── Music.cpp ├── Music.h ├── Options.cpp ├── Options.h ├── OptionsWidget.cpp ├── OptionsWidget.h ├── PreviewWidget.cpp ├── PreviewWidget.h ├── Projectile.cpp ├── Projectile.h ├── QuestionWidget.cpp ├── QuestionWidget.h ├── ResolutionInfo.cpp ├── ResolutionInfo.h ├── ServerUpdates.cpp ├── ServerUpdates.h ├── Speech.cpp ├── Speech.h ├── SpeechText.cpp ├── SpeechText.h ├── SpeechTextNode.cpp ├── SpeechTextNode.h ├── SpeechWidget.cpp ├── SpeechWidget.h ├── Spirit.cpp ├── Spirit.h ├── Sprite.cpp ├── Sprite.h ├── SpriteManager.cpp ├── SpriteManager.h ├── SpriteWidget.cpp ├── SpriteWidget.h ├── SystemWidget.cpp ├── SystemWidget.h ├── TextFX.cpp ├── TextFX.h ├── VoxelWidget.cpp ├── VoxelWidget.h ├── World.cpp ├── World.h ├── WorldMap.cpp ├── WorldMap.h ├── XAudio2Engine.cpp ├── XAudio2Engine.h ├── Zone.cpp ├── Zone.h ├── constants.h ├── cube.cpp └── cube.h ├── cwsdk.cpp ├── cwsdk.h ├── gfx ├── Chunk.cpp ├── Chunk.h ├── ChunkBuffer.cpp ├── ChunkBuffer.h ├── D3D11Graphics.cpp ├── D3D11Graphics.h ├── D3D11IndexBuffer.cpp ├── D3D11IndexBuffer.h ├── D3D11Renderer.cpp ├── D3D11Renderer.h ├── D3D11VertexBuffer.cpp ├── D3D11VertexBuffer.h ├── Graphics.cpp ├── Graphics.h ├── IndexBuffer.cpp ├── IndexBuffer.h ├── Renderer.cpp ├── Renderer.h ├── VertexBuffer.cpp └── VertexBuffer.h ├── msvc ├── _Thrd_t.cpp └── _Thrd_t.h ├── plasma ├── Array.cpp ├── Array.h ├── Attribute.cpp ├── Attribute.h ├── ContinuousAttribute.cpp ├── ContinuousAttribute.h ├── D3D11Engine.cpp ├── D3D11Engine.h ├── DiscreteAttribute.cpp ├── DiscreteAttribute.h ├── Display.cpp ├── Display.h ├── Engine.cpp ├── Engine.h ├── FontEngine.cpp ├── FontEngine.h ├── Keyable.cpp ├── Keyable.h ├── Matrix.cpp ├── Matrix.h ├── NamedObject.cpp ├── NamedObject.h ├── Node.cpp ├── Node.h ├── Object.cpp ├── Object.h ├── ObjectManager.cpp ├── ObjectManager.h ├── ScalableFont.cpp ├── ScalableFont.h ├── Transformation.cpp ├── Transformation.h ├── Vector.cpp ├── Vector.h ├── Widget.cpp └── Widget.h └── steam ├── ISteamNetworking.h ├── ISteamUser.h ├── isteamapplist.h ├── isteamapps.h ├── isteamappticket.h ├── isteamclient.h ├── isteamcontroller.h ├── isteamfriends.h ├── isteamgamecoordinator.h ├── isteamgameserver.h ├── isteamgameserverstats.h ├── isteamhtmlsurface.h ├── isteamhttp.h ├── isteaminput.h ├── isteaminventory.h ├── isteammasterserverupdater.h ├── isteammatchmaking.h ├── isteammusic.h ├── isteammusicremote.h ├── isteamnetworkingsockets.h ├── isteamnetworkingutils.h ├── isteamparentalsettings.h ├── isteamps3overlayrenderer.h ├── isteamremoteplay.h ├── isteamremotestorage.h ├── isteamscreenshots.h ├── isteamugc.h ├── isteamuserstats.h ├── isteamutils.h ├── isteamvideo.h ├── matchmakingtypes.h ├── steam_api.h ├── steam_api_common.h ├── steam_api_flat.h ├── steam_api_internal.h ├── steam_api_interop.cs ├── steam_gameserver.h ├── steamclientpublic.h ├── steamdatagram_tickets.h ├── steamencryptedappticket.h ├── steamhttpenums.h ├── steamnetworkingtypes.h ├── steamps3params.h ├── steamtypes.h └── steamuniverse.h /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.8) 2 | if(NOT CMAKE_CL_64) 3 | message(FATAL_ERROR "CWSDK REQUIRES clang-cl x64 to build. " ) 4 | endif() 5 | if(CMAKE_BUILD_TYPE MATCHES "Debug") 6 | message(FATAL_ERROR "CWSDK cannot be built debug mode due to MSVC binary compatibility issues." ) 7 | endif() 8 | project("CWSDK" VERSION "1.0.0") 9 | add_library (CWSDK 10 | cwsdk.cpp 11 | common/BytesIO.cpp 12 | common/ColorRGB.cpp 13 | common/math.cpp 14 | common/Matrix4.cpp 15 | common/RGBA.cpp 16 | common/Vector2.cpp 17 | common/Vector3.cpp 18 | cube/AdaptionWidget.cpp 19 | cube/AI.cpp 20 | cube/BaseWidget.cpp 21 | cube/Block.cpp 22 | cube/BlockProperties.cpp 23 | cube/CharacterPreviewWidget.cpp 24 | cube/CharacterStyleWidget.cpp 25 | cube/CharacterWidget.cpp 26 | cube/ChatWidget.cpp 27 | cube/Client.cpp 28 | cube/Connection.cpp 29 | cube/Controls.cpp 30 | cube/ControlsWidget.cpp 31 | cube/Creature.cpp 32 | cube/cube.cpp 33 | cube/Database.cpp 34 | cube/EnchantWidget.cpp 35 | cube/Equipment.cpp 36 | cube/Field.cpp 37 | cube/FormulaDetailsWidget.cpp 38 | cube/Game.cpp 39 | cube/GUI.cpp 40 | cube/HelpWidget.cpp 41 | cube/Host.cpp 42 | cube/Interaction.cpp 43 | cube/InventoryWidget.cpp 44 | cube/Item.cpp 45 | cube/ItemStack.cpp 46 | cube/MapOverlayWidget.cpp 47 | cube/MultiplayerWidget.cpp 48 | cube/Music.cpp 49 | cube/Options.cpp 50 | cube/OptionsWidget.cpp 51 | cube/PreviewWidget.cpp 52 | cube/Projectile.cpp 53 | cube/QuestionWidget.cpp 54 | cube/ResolutionInfo.cpp 55 | cube/ServerUpdates.cpp 56 | cube/Speech.cpp 57 | cube/SpeechText.cpp 58 | cube/SpeechTextNode.cpp 59 | cube/SpeechWidget.cpp 60 | cube/Spirit.cpp 61 | cube/Sprite.cpp 62 | cube/SpriteManager.cpp 63 | cube/SpriteWidget.cpp 64 | cube/SystemWidget.cpp 65 | cube/TextFX.cpp 66 | cube/VoxelWidget.cpp 67 | cube/World.cpp 68 | cube/WorldMap.cpp 69 | cube/XAudio2Engine.cpp 70 | cube/Zone.cpp 71 | gfx/Chunk.cpp 72 | gfx/ChunkBuffer.cpp 73 | gfx/D3D11Graphics.cpp 74 | gfx/D3D11IndexBuffer.cpp 75 | gfx/D3D11Renderer.cpp 76 | gfx/D3D11VertexBuffer.cpp 77 | gfx/Graphics.cpp 78 | gfx/IndexBuffer.cpp 79 | gfx/Renderer.cpp 80 | gfx/VertexBuffer.cpp 81 | msvc/_Thrd_t.cpp 82 | plasma/Array.cpp 83 | plasma/Attribute.cpp 84 | plasma/ContinuousAttribute.cpp 85 | plasma/D3D11Engine.cpp 86 | plasma/DiscreteAttribute.cpp 87 | plasma/Display.cpp 88 | plasma/Engine.cpp 89 | plasma/FontEngine.cpp 90 | plasma/Keyable.cpp 91 | plasma/Matrix.cpp 92 | plasma/NamedObject.cpp 93 | plasma/Node.cpp 94 | plasma/Object.cpp 95 | plasma/ObjectManager.cpp 96 | plasma/ScalableFont.cpp 97 | plasma/Transformation.cpp 98 | plasma/Vector.cpp 99 | plasma/Widget.cpp) 100 | target_link_libraries(CWSDK winmm.lib) 101 | target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 102 | target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/CWSDK) 103 | target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/CWSDK/common) 104 | target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/CWSDK/cube) 105 | target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/CWSDK/gfx) 106 | target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/CWSDK/IDA) 107 | target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/CWSDK/msvc) 108 | target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/CWSDK/plasma) 109 | target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/CWSDK/steam) -------------------------------------------------------------------------------- /CMakeSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "x64-Debug", 5 | "generator": "Ninja", 6 | "configurationType": "Debug", 7 | "inheritEnvironments": [ "msvc_x64_x64" ], 8 | "buildRoot": "${projectDir}\\out\\build\\${name}", 9 | "installRoot": "${projectDir}\\out\\install\\${name}", 10 | "cmakeCommandArgs": "", 11 | "buildCommandArgs": "-v", 12 | "ctestCommandArgs": "", 13 | "variables": [] 14 | }, 15 | { 16 | "name": "x64-Clang-Release", 17 | "generator": "Ninja", 18 | "configurationType": "RelWithDebInfo", 19 | "buildRoot": "${projectDir}\\out\\build\\${name}", 20 | "installRoot": "${projectDir}\\out\\install\\${name}", 21 | "cmakeCommandArgs": "", 22 | "buildCommandArgs": "-v", 23 | "ctestCommandArgs": "", 24 | "inheritEnvironments": [ "clang_cl_x64" ], 25 | "variables": [] 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /GenerateVtablePadding.py: -------------------------------------------------------------------------------- 1 | with open('VtablePadding.h', 'w') as f: 2 | for i in range(1024): 3 | f.write(f'Priority DummyCallbackPriority_{i} = NormalPriority;\n') 4 | f.write(f'virtual int DummyCallback_{i}(void* a1, void* a2, void* a3, void* a4)' + '{return 0;} \n') 5 | -------------------------------------------------------------------------------- /IDA/types.h: -------------------------------------------------------------------------------- 1 | #ifndef IDA_CONSTANTS_H 2 | #define IDA_CONSTANTS_H 3 | 4 | #define _BYTE unsigned char 5 | #define __int64 long long int 6 | #define __int16 short 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /MakeCWModsCMake.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | import os 3 | 4 | path = os.path.dirname(os.path.realpath(__file__)) 5 | 6 | files = list(Path(path).glob('**/*.cpp')) 7 | 8 | for filename in files: 9 | print(filename) 10 | 11 | 12 | lines = [ 13 | 14 | 'cmake_minimum_required (VERSION 3.8)', 15 | 16 | 'if(NOT CMAKE_CL_64)', 17 | ' message(FATAL_ERROR "CWSDK REQUIRES clang-cl x64 to build. " )', 18 | 'endif()', 19 | 20 | 'if(CMAKE_BUILD_TYPE MATCHES "Debug")', 21 | ' message(FATAL_ERROR "CWSDK cannot be built debug mode due to MSVC binary compatibility issues." )', 22 | 'endif()', 23 | 24 | 'project("CWSDK" VERSION "1.0.0")', 25 | 26 | 'add_library (CWSDK \n %s)' % '\n '.join([str(x)[len(path)+1:].replace('\\', '/') for x in files]), 27 | 'target_link_libraries(CWSDK winmm.lib)', 28 | 'target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})', 29 | 'target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/CWSDK)', 30 | 'target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/CWSDK/common)', 31 | 'target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/CWSDK/cube)', 32 | 'target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/CWSDK/gfx)', 33 | 'target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/CWSDK/IDA)', 34 | 'target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/CWSDK/msvc)', 35 | 'target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/CWSDK/plasma)', 36 | 'target_include_directories (CWSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/CWSDK/steam)' 37 | ] 38 | 39 | with open(os.path.join(path, 'CMakeLists.txt'), 'w') as f: 40 | f.write('\n'.join(lines)) 41 | -------------------------------------------------------------------------------- /common/BytesIO.cpp: -------------------------------------------------------------------------------- 1 | #include "BytesIO.h" 2 | 3 | BytesIO::BytesIO() { 4 | Seek(0); 5 | } 6 | 7 | BytesIO::BytesIO(const u8* buffer, i32 size) { 8 | bytes.resize(size); 9 | memcpy(bytes.data(), buffer, size); 10 | Seek(0); 11 | } 12 | 13 | BytesIO::BytesIO(std::vector& vec) { 14 | bytes.resize(vec.size()); 15 | memcpy(bytes.data(), vec.data(), vec.size()); 16 | Seek(0); 17 | } 18 | 19 | i32 BytesIO::Size() { 20 | return bytes.size(); 21 | } 22 | 23 | i32 BytesIO::Offset() { 24 | return offset; 25 | } 26 | 27 | void BytesIO::Seek(i32 index) { 28 | offset = index; 29 | } 30 | 31 | std::vector& BytesIO::Vector() { 32 | return bytes; 33 | } 34 | 35 | u8* BytesIO::Data() { 36 | return bytes.data(); 37 | } -------------------------------------------------------------------------------- /common/BytesIO.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMON_BYTESIO_H 2 | #define COMMON_BYTESIO_H 3 | 4 | #include 5 | #include "types.h" 6 | 7 | class BytesIO { 8 | 9 | private: 10 | std::vector bytes; 11 | i32 offset; 12 | // 4 bytes padding 13 | 14 | public: 15 | BytesIO(); 16 | BytesIO(const u8* buffer, i32 size); 17 | BytesIO(std::vector& vec); 18 | 19 | i32 Size(); 20 | i32 Offset(); 21 | void Seek(i32 index); 22 | 23 | template 24 | bool Has() { 25 | return (Offset() - Size()) >= sizeof(T); 26 | } 27 | 28 | template 29 | T Peak() { 30 | return *(T*)&bytes[offset]; 31 | } 32 | 33 | template 34 | T Read() { 35 | T result = Peak(); 36 | offset += sizeof(T); 37 | return result; 38 | } 39 | 40 | template 41 | void Write(T element) { 42 | i32 requiredSize = offset + sizeof(T); 43 | if (Size() < requiredSize) { 44 | bytes.resize(requiredSize); 45 | } 46 | else { 47 | bytes.reserve(requiredSize); 48 | } 49 | *(T*)&bytes[offset] = element; 50 | offset += sizeof(T); 51 | } 52 | 53 | std::vector& Vector(); 54 | 55 | u8* Data(); 56 | }; 57 | 58 | static_assert(sizeof(BytesIO) == 0x20, "BytesIO is not the correct size."); 59 | 60 | #endif // COMMON_BYTESIO_H 61 | -------------------------------------------------------------------------------- /common/ColorRGB.cpp: -------------------------------------------------------------------------------- 1 | #include "ColorRGB.h" 2 | -------------------------------------------------------------------------------- /common/ColorRGB.h: -------------------------------------------------------------------------------- 1 | #ifndef COLORRGB_H 2 | #define COLORRGB_H 3 | 4 | template 5 | class ColorRGB { 6 | public: 7 | T red; 8 | T green; 9 | T blue; 10 | 11 | ColorRGB() { 12 | this->red = (T)0; 13 | this->green = (T)0; 14 | this->blue = (T)0; 15 | } 16 | 17 | ColorRGB(T red, T green, T blue) { 18 | this->red = red; 19 | this->green = green; 20 | this->blue = blue; 21 | } 22 | }; 23 | 24 | #define FloatRGB ColorRGB 25 | #define ByteRGB ColorRGB 26 | 27 | #endif // COLORRGB_H 28 | -------------------------------------------------------------------------------- /common/Matrix4.cpp: -------------------------------------------------------------------------------- 1 | #include "Matrix4.h" 2 | -------------------------------------------------------------------------------- /common/Matrix4.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMON_MATRIX4_H 2 | #define COMMON_MATRIX4_H 3 | 4 | 5 | class Matrix4 { 6 | public: 7 | float _11, _12, _13, _14; 8 | float _21, _22, _23, _24; 9 | float _31, _32, _33, _34; 10 | float _41, _42, _43, _44; 11 | }; 12 | 13 | 14 | #endif // COMMON_MATRIX4_H 15 | -------------------------------------------------------------------------------- /common/RGBA.cpp: -------------------------------------------------------------------------------- 1 | #include "RGBA.h" 2 | -------------------------------------------------------------------------------- /common/RGBA.h: -------------------------------------------------------------------------------- 1 | #ifndef RGBA_H 2 | #define RGBA_H 3 | 4 | template 5 | class RGBA { 6 | public: 7 | T red; 8 | T green; 9 | T blue; 10 | T alpha; 11 | RGBA() { 12 | this->red = (T)0; 13 | this->green = (T)0; 14 | this->blue = (T)0; 15 | this->alpha = (T)0; 16 | } 17 | 18 | RGBA(T red, T green, T blue, T alpha) { 19 | this->red = red; 20 | this->green = green; 21 | this->blue = blue; 22 | this->alpha = alpha; 23 | } 24 | }; 25 | 26 | #define FloatRGBA RGBA 27 | #define ByteRGBA RGBA 28 | 29 | #endif // RGBA_H 30 | -------------------------------------------------------------------------------- /common/Vector2.cpp: -------------------------------------------------------------------------------- 1 | #include "Vector2.h" 2 | 3 | -------------------------------------------------------------------------------- /common/Vector2.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include "math.h" 6 | 7 | template 8 | class Vector2 { 9 | public: 10 | T x, y; 11 | Vector2() : x(0), y(0) {}; 12 | Vector2(T x, T y) : x(x), y(y) {}; 13 | 14 | bool operator==(const Vector2& other) const { 15 | return (this->x == other.x && this->y == other.y); 16 | } 17 | 18 | Vector2 operator/(const Vector2& other) const { 19 | return Vector2(this->x / other.x, this->y / other.y); 20 | } 21 | Vector2 operator/(const float& other) const { 22 | return Vector2(this->x / other, this->y / other); 23 | } 24 | 25 | Vector2 operator/(const Vector2& other) const { 26 | return Vector2(this->x / other.x, this->y / other.y); 27 | } 28 | Vector2 operator/(const double& other) const { 29 | return Vector2(this->x / other, this->y / other); 30 | } 31 | 32 | Vector2 operator/(const Vector2& other) const { 33 | return Vector2(pydiv(this->x, other.x), pydiv(this->y, other.y)); 34 | } 35 | Vector2 operator/(const int& other) const { 36 | return Vector2(pydiv(this->x, other), pydiv(this->y, other)); 37 | } 38 | 39 | Vector2 operator/(const Vector2& other) const { 40 | return Vector2(pydiv(this->x, other.x), pydiv(this->y, other.y)); 41 | } 42 | Vector2 operator/(long long int& other) const { 43 | return Vector2(pydiv(this->x, other), pydiv(this->y, other)); 44 | } 45 | }; 46 | 47 | namespace std { 48 | template <> 49 | struct hash> 50 | { 51 | std::size_t operator()(const Vector2& k) const 52 | { 53 | uint64_t x = (uint32_t)k.x; 54 | uint64_t y = (uint32_t)k.y; 55 | uint64_t key = x | (y << 32); 56 | 57 | // Call into the MSVC-STL FNV-1a std::hash function. 58 | return std::hash()(key); 59 | } 60 | }; 61 | }; 62 | 63 | typedef Vector2 IntVector2; 64 | typedef Vector2 LongVector2; 65 | typedef Vector2 FloatVector2; -------------------------------------------------------------------------------- /common/Vector3.cpp: -------------------------------------------------------------------------------- 1 | #include "Vector3.h" 2 | 3 | -------------------------------------------------------------------------------- /common/Vector3.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include "math.h" 6 | 7 | template 8 | class Vector3 { 9 | public: 10 | T x, y, z; 11 | Vector3() : x(0), y(0), z(0) {}; 12 | Vector3(T x, T y, T z) : x(x), y(y), z(z) {}; 13 | 14 | bool operator==(const Vector3& other) const { 15 | return (this->x == other.x && this->y == other.y && this->z == other.z); 16 | } 17 | 18 | 19 | // / 20 | Vector3 operator/(const Vector3& other) const { 21 | return Vector3(this->x / other.x, this->y / other.y, this->z / other.z); 22 | } 23 | Vector3 operator/(const float& other) const { 24 | return Vector3(this->x / other, this->y / other, this->z / other); 25 | } 26 | 27 | Vector3 operator/(const Vector3& other) const { 28 | return Vector3(this->x / other.x, this->y / other.y, this->z / other.z); 29 | } 30 | Vector3 operator/(const double& other) const { 31 | return Vector3(this->x / other, this->y / other, this->z / other); 32 | } 33 | 34 | Vector3 operator/(const Vector3& other) const { 35 | return Vector3(pydiv(this->x, other.x), pydiv(this->y, other.y), pydiv(this->z, other.z)); 36 | } 37 | Vector3 operator/(const int& other) const { 38 | return Vector3(pydiv(this->x, other), pydiv(this->y, other), pydiv(this->z, other)); 39 | } 40 | 41 | Vector3 operator/(const Vector3& other) const { 42 | return Vector3(pydiv(this->x, other.x), pydiv(this->y, other.y), pydiv(this->z, other)); 43 | } 44 | Vector3 operator/(long long int& other) const { 45 | return Vector3(pydiv(this->x, other), pydiv(this->y, other), pydiv(this->z, other)); 46 | } 47 | 48 | // % 49 | Vector3 operator%(const Vector3& other) const { 50 | return Vector3(this->x % other.x, this->y % other.y, this->z % other.z); 51 | } 52 | Vector3 operator%(const float& other) const { 53 | return Vector3(this->x % other, this->y % other, this->z % other); 54 | } 55 | 56 | Vector3 operator%(const Vector3& other) const { 57 | return Vector3(this->x % other.x, this->y % other.y, this->z % other.z); 58 | } 59 | Vector3 operator%(const double& other) const { 60 | return Vector3(this->x % other, this->y % other, this->z % other); 61 | } 62 | 63 | Vector3 operator%(const Vector3& other) const { 64 | return Vector3(pymod(this->x, other.x), pymod(this->y, other.y), pymod(this->z, other.z)); 65 | } 66 | Vector3 operator%(const int& other) const { 67 | return Vector3(pymod(this->x, other), pymod(this->y, other), pymod(this->z, other)); 68 | } 69 | 70 | Vector3 operator%(const Vector3& other) const { 71 | return Vector3(pymod(this->x, other.x), pymod(this->y, other.y), pymod(this->z, other.z)); 72 | } 73 | Vector3 operator%(long long int& other) const { 74 | return Vector3(pymod(this->x, other), pymod(this->y, other), pymod(this->z, other)); 75 | } 76 | 77 | // * 78 | Vector3 operator*(const Vector3& other) const { 79 | return Vector3(this->x * other.x, this->y * other.y, this->z * other.z); 80 | } 81 | Vector3 operator*(const T& other) const { 82 | return Vector3(this->x * other, this->y * other, this->z * other); 83 | } 84 | }; 85 | 86 | typedef Vector3 IntVector3; 87 | typedef Vector3 LongVector3; 88 | typedef Vector3 FloatVector3; 89 | typedef Vector3 DoubleVector3; -------------------------------------------------------------------------------- /common/math.cpp: -------------------------------------------------------------------------------- 1 | #include "math.h" 2 | i64 pydiv(i64 a, i64 b) { 3 | i64 result = a / b; 4 | if ((a < 0) ^ (b < 0)) { 5 | if (pymod(a, b) != 0) { 6 | result -= 1; 7 | } 8 | } 9 | return result; 10 | } 11 | 12 | i64 pymod(i64 a, i64 b) { 13 | i64 result = a % b; 14 | if (result < 0) { 15 | result = b + result; 16 | } 17 | return result; 18 | } 19 | -------------------------------------------------------------------------------- /common/math.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMON_MATH_H 2 | #define COMMON_MATH_H 3 | #include "../common/types.h" 4 | 5 | // C++'s mod and div operators are stupid 6 | i64 pymod(i64 a, i64 b); 7 | i64 pydiv(i64 a, i64 b); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /common/types.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMON_TYPES_H 2 | #define COMMON_TYPES_H 3 | 4 | #define u8 unsigned char 5 | #define i8 signed char 6 | #define u16 unsigned short 7 | #define i16 signed short 8 | #define u32 unsigned int 9 | #define i32 signed int 10 | #define u64 unsigned long long int 11 | #define i64 signed long long int 12 | #define f32 float 13 | #define f64 double 14 | 15 | #endif // COMMON_TYPES_H 16 | -------------------------------------------------------------------------------- /cube/AI.cpp: -------------------------------------------------------------------------------- 1 | #include "AI.h" 2 | -------------------------------------------------------------------------------- /cube/AI.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_AI_H 2 | #define CUBE_AI_H 3 | 4 | #include "../IDA/types.h" 5 | #include 6 | #include 7 | #include "../common/Vector3.h" 8 | 9 | namespace cube { 10 | class AI { 11 | public: 12 | float field_0; 13 | int32_t some_time_ms; 14 | int32_t field_8; 15 | uint8_t unk_bool_0; 16 | uint8_t unk_bool_1; 17 | char field_E; 18 | char field_F; 19 | __int64 field_10; 20 | int64_t field_18; 21 | int32_t field_20; 22 | FloatVector3 unk_vec3_float; 23 | FloatVector3 camera_looking_at_block_offset; 24 | int32_t field_3C; 25 | int32_t field_40; 26 | uint8_t field_44; 27 | uint8_t field_45; 28 | uint8_t field_46; 29 | uint8_t in_spiritworld; 30 | int32_t field_48; 31 | int32_t field_4C; 32 | std::list unk_list_0x50_node_size_0xD8; 33 | int32_t physics_flags; 34 | int32_t binary_toggles; 35 | LongVector3 position; 36 | float graphical_size; 37 | float hitbox_size; 38 | float physical_size; 39 | int32_t field_8C; 40 | int64_t field_90; 41 | std::map unk_map_0x98_node_size_0x40; 42 | std::map unk_map_0xA8_node_size_0x28; 43 | int64_t field_B8; 44 | int32_t field_C0; 45 | int32_t field_C4; 46 | int64_t field_C8; 47 | int64_t field_D0; 48 | int64_t field_D8; 49 | LongVector3 some_position; 50 | int64_t field_F8; 51 | int64_t field_100; 52 | int64_t field_108; 53 | std::list unk_list_0x110_node_size_0x20; 54 | std::map unk_map_0x120_node_size_0x28; 55 | std::list unk_list_0x130_node_size_0x20; 56 | int64_t field_140; 57 | int64_t field_148; 58 | }; 59 | } 60 | 61 | static_assert(sizeof(cube::AI) == 0x150, "cube::AI is not the correct size."); 62 | 63 | #endif // ZONE_H 64 | -------------------------------------------------------------------------------- /cube/AdaptionWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "AdaptionWidget.h" -------------------------------------------------------------------------------- /cube/AdaptionWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_ADAPTIONWIDGET_H 2 | #define CUBE_ADAPTIONWIDGET_H 3 | 4 | #include "BaseWidget.h" 5 | #include "../plasma/Node.h" 6 | 7 | namespace cube { 8 | class Game; 9 | class Item; 10 | class AdaptionWidget : public cube::BaseWidget { 11 | public: 12 | cube::Item* item; 13 | cube::Game* game; 14 | plasma::Node* itemframe; 15 | plasma::Node* rightarrow; 16 | }; 17 | } 18 | 19 | static_assert(sizeof(cube::AdaptionWidget) == 0x208, "cube::AdaptionWidget is not the correct size."); 20 | 21 | #endif // CUBE_ADAPTIONWIDGET_H 22 | -------------------------------------------------------------------------------- /cube/BaseWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "ChatWidget.h" 2 | #include "../cwsdk.h" 3 | 4 | void cube::ChatWidget::PrintMessage(const wchar_t* message, FloatRGBA* color){ 5 | std::wstring str(message); 6 | ((void(*)(cube::ChatWidget*, std::wstring*, FloatRGBA*))CWOffset(0x26BF10))(this, &str, color); 7 | } 8 | 9 | void cube::ChatWidget::PrintMessage(const wchar_t* message) { 10 | this->PrintMessage(message, 255, 255, 255); 11 | } 12 | 13 | void cube::ChatWidget::PrintMessage(const wchar_t* message, char red, char green, char blue){ 14 | float f_red = (float)red / 255.0; 15 | float f_green = (float)green / 255.0; 16 | float f_blue = (float)blue / 255.0; 17 | FloatRGBA color(f_red, f_green, f_blue, 1.0); 18 | this->PrintMessage(message, &color); 19 | } 20 | -------------------------------------------------------------------------------- /cube/BaseWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_BASEWIDGET_H 2 | #define CUBE_BASEWIDGET_H 3 | 4 | #include "../plasma/Widget.h" 5 | #include "../plasma/ScalableFont.h" 6 | namespace cube { 7 | class BaseWidget : public plasma::Widget { 8 | public: 9 | plasma::ScalableFont* scalable_font; 10 | float field_1B0; 11 | float field_1B4; 12 | float field_1B8; 13 | float field_1BC; 14 | float field_1C0; 15 | float field_1C4; 16 | float field_1C8; 17 | float field_1CC; 18 | float field_1D0; 19 | float field_1D4; 20 | float field_1D8; 21 | float field_1DC; 22 | float field_1E0; 23 | float field_1E4; 24 | }; 25 | } 26 | 27 | 28 | static_assert(sizeof(cube::BaseWidget) == 0x1E8, "cube::BaseWidget is not the correct size."); 29 | #endif // CUBE_BASEWIDGET_H 30 | -------------------------------------------------------------------------------- /cube/Block.cpp: -------------------------------------------------------------------------------- 1 | #include "Block.h" 2 | -------------------------------------------------------------------------------- /cube/Block.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_BLOCK_H 2 | #define CUBE_BLOCK_H 3 | #include "../common/types.h" 4 | #include "../IDA/types.h" 5 | #include "BlockProperties.h" 6 | 7 | namespace cube { 8 | class Block : public cube::BlockProperties{ 9 | public: 10 | }; 11 | } 12 | 13 | static_assert(sizeof(cube::Block) == 0x6, "cube::Block is not the correct size."); 14 | 15 | #endif // CUBE_BLOCK_H 16 | -------------------------------------------------------------------------------- /cube/BlockProperties.cpp: -------------------------------------------------------------------------------- 1 | #include "BlockProperties.h" 2 | -------------------------------------------------------------------------------- /cube/BlockProperties.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_BLOCKPROPERTIES_H 2 | #define CUBE_BLOCKPROPERTIES_H 3 | #include "../common/types.h" 4 | #include "../IDA/types.h" 5 | 6 | namespace cube { 7 | template 8 | class BlockProperties { 9 | public: 10 | enum Type : u8 { 11 | Air = 0, 12 | Solid = 1, 13 | Water = 2, 14 | Wet = 3, 15 | Grass = 4, 16 | Ground = 5, 17 | Building = 6, 18 | Tree = 7, 19 | Leaves = 8, 20 | 21 | Snow = 10, 22 | SnowLeaves = 11, 23 | 24 | Path = 13, 25 | 26 | Lava = 17, 27 | Cave = 18, 28 | Poison = 19, 29 | }; 30 | 31 | T red; 32 | T green; 33 | T blue; 34 | u8 field_3; 35 | Type type; 36 | u8 breakable; 37 | 38 | template 39 | void Half(BlockProperties& other) { 40 | red = other.red / (T2)2; 41 | green = other.green / (T2)2; 42 | blue = other.blue / (T2)2; 43 | 44 | for (T* color : { &red, &green, &blue }) { 45 | if (*color > (T)255) *color = (T)255; 46 | else if (*color < (T)0) *color = (T)0; 47 | } 48 | 49 | return; 50 | } 51 | }; 52 | } 53 | #endif // CUBE_BLOCKPROPERTIES_H 54 | -------------------------------------------------------------------------------- /cube/CharacterPreviewWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "CharacterPreviewWidget.h" -------------------------------------------------------------------------------- /cube/CharacterPreviewWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_CHARACTERPREVIEWWIDGET_H 2 | #define CUBE_CHARACTERPREVIEWWIDGET_H 3 | 4 | #include "BaseWidget.h" 5 | 6 | namespace cube { 7 | class Game; 8 | class Creature; 9 | class CharacterPreviewWidget : public cube::BaseWidget { 10 | public: 11 | cube::Creature* creature; 12 | cube::Game* game; 13 | }; 14 | } 15 | 16 | static_assert(sizeof(cube::CharacterPreviewWidget) == 0x1F8, "cube::CharacterPreviewWidget is not the correct size."); 17 | 18 | #endif // CUBE_CHARACTERPREVIEWWIDGET_H 19 | -------------------------------------------------------------------------------- /cube/CharacterStyleWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "CharacterStyleWidget.h" -------------------------------------------------------------------------------- /cube/CharacterStyleWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_CHARACTESTYLERWIDGET_H 2 | #define CUBE_CHARACTESTYLERWIDGET_H 3 | 4 | #include "BaseWidget.h" 5 | #include "../plasma/Node.h" 6 | #include "../common/ColorRGB.h" 7 | 8 | namespace cube { 9 | class Game; 10 | class CharacterStyleWidget : public cube::BaseWidget { 11 | public: 12 | cube::Game* game; 13 | plasma::Node* race_left_button; 14 | plasma::Node* race_right_button; 15 | plasma::Node* class_left_button; 16 | plasma::Node* class_right_button; 17 | plasma::Node* gender_left_button; 18 | plasma::Node* gender_right_button; 19 | plasma::Node* face_left_button; 20 | plasma::Node* face_right_button; 21 | plasma::Node* haircut_left_button; 22 | plasma::Node* haircut_right_button; 23 | int race; 24 | int class_type; 25 | int gender; 26 | int face; 27 | int haircut; 28 | ByteRGB current_hair_color; 29 | ByteRGB preview_hair_color; 30 | // 6 bytes padding 31 | }; 32 | } 33 | 34 | static_assert(sizeof(cube::CharacterStyleWidget) == 0x260, "cube::CharacterStyleWidget is not the correct size."); 35 | 36 | #endif // CUBE_CHARACTESTYLERWIDGET_H 37 | -------------------------------------------------------------------------------- /cube/CharacterWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "CharacterWidget.h" -------------------------------------------------------------------------------- /cube/CharacterWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_CHARACTERWIDGET_H 2 | #define CUBE_CHARACTERWIDGET_H 3 | 4 | #include "BaseWidget.h" 5 | #include "../plasma/Node.h" 6 | 7 | namespace cube { 8 | class Game; 9 | class CharacterWidget : public cube::BaseWidget { 10 | public: 11 | cube::Game* game; 12 | }; 13 | } 14 | 15 | static_assert(sizeof(cube::CharacterWidget) == 0x1F0, "cube::CharacterWidget is not the correct size."); 16 | 17 | #endif // CUBE_CHARACTERWIDGET_H 18 | -------------------------------------------------------------------------------- /cube/ChatWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "ChatWidget.h" 2 | #include "../cwsdk.h" 3 | 4 | void cube::ChatWidget::PrintMessage(std::wstring* message, FloatRGBA* color) { 5 | ((void(*)(cube::ChatWidget*, std::wstring*, FloatRGBA*))CWOffset(0x26BF10))(this, message, color); 6 | } 7 | 8 | void cube::ChatWidget::PrintMessage(const wchar_t* message, FloatRGBA* color){ 9 | std::wstring str(message); 10 | this->PrintMessage(&str, color); 11 | } 12 | 13 | void cube::ChatWidget::PrintMessage(const wchar_t* message) { 14 | this->PrintMessage(message, 255, 255, 255); 15 | } 16 | 17 | void cube::ChatWidget::PrintMessage(const wchar_t* message, char red, char green, char blue){ 18 | float f_red = (float)red / 255.0; 19 | float f_green = (float)green / 255.0; 20 | float f_blue = (float)blue / 255.0; 21 | FloatRGBA color(f_red, f_green, f_blue, 1.0); 22 | this->PrintMessage(message, &color); 23 | } 24 | -------------------------------------------------------------------------------- /cube/ChatWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CHATWIDGET_H 2 | #define CHATWIDGET_H 3 | #include "../common/RGBA.h" 4 | #include "../plasma/Widget.h" 5 | #include "../plasma/ScalableFont.h" 6 | #include 7 | #include 8 | namespace cube { 9 | class ChatWidget : public plasma::Widget { 10 | public: 11 | class MessageData { 12 | public: 13 | std::wstring text; 14 | ByteRGBA color; 15 | char field_24; 16 | char field_25; 17 | char field_26; 18 | char field_27; 19 | }; 20 | 21 | 22 | std::list> message_sections; 23 | std::wstring typebox_text; 24 | bool typebox_active; 25 | plasma::ScalableFont* scalable_font; 26 | int typebox_cursor_position; 27 | int backwards_highlight_length; 28 | 29 | void PrintMessage(std::wstring* message, FloatRGBA* color); 30 | void PrintMessage(const wchar_t* message, FloatRGBA* color); 31 | void PrintMessage(const wchar_t* message); 32 | void PrintMessage(const wchar_t* message, char red, char green, char blue); 33 | }; 34 | } 35 | static_assert(sizeof(cube::ChatWidget) == 0x1F0, "cube::ChatWidget is not the correct size."); 36 | #endif // CHATWIDGET_H 37 | -------------------------------------------------------------------------------- /cube/Client.cpp: -------------------------------------------------------------------------------- 1 | #include "Client.h" 2 | #include "../cwsdk.h" 3 | 4 | void cube::Client::JoinSteamID(long long steamID) { 5 | ((void(*)(cube::Client*, long long))CWOffset(0x3D820))(this, steamID); 6 | } 7 | -------------------------------------------------------------------------------- /cube/Client.h: -------------------------------------------------------------------------------- 1 | #ifndef CLIENT_H 2 | #define CLIENT_H 3 | 4 | #include "../IDA/types.h" 5 | #include "../msvc/_Thrd_t.h" 6 | #include 7 | #include 8 | #include 9 | #include "Creature.h" 10 | #include "../steam/steam_api_common.h" 11 | #include "../common/BytesIO.h" 12 | 13 | namespace cube { 14 | class Host; 15 | class Game; 16 | class Client { 17 | public: 18 | virtual ~Client(); 19 | 20 | char running_callbacks; 21 | char pad_9; 22 | char pad_A; 23 | char pad_B; 24 | int field_C; 25 | msvc::_Thrd_t thread; 26 | std::list some_list_sent_as_SC_PACKET_0x0A; 27 | std::list some_list_sent_as_SC_PACKET_0x0B; 28 | std::list some_list_sent_as_SC_PACKET_0x0C; 29 | std::list some_list_sent_as_SC_PACKET_0x0D; 30 | std::list some_list_unk; 31 | CSteamID host_steam_id; 32 | cube::Creature::EntityData local_entity_data; 33 | int field_9E8; 34 | int unk_timestamp_after_sending_packets; 35 | std::map some_recv_creatures_map; 36 | std::map invited_by_map_maybe; 37 | cube::Host* host; 38 | CRITICAL_SECTION client_recv_packet_list_lock; 39 | std::list> client_recv_packet_list; 40 | cube::Game* game; 41 | 42 | void JoinSteamID(long long steamID); 43 | }; 44 | } 45 | static_assert(sizeof(cube::Client) == 0xA58, "cube::Client is not the correct size."); 46 | #endif // CLIENT_H 47 | -------------------------------------------------------------------------------- /cube/Connection.cpp: -------------------------------------------------------------------------------- 1 | #include "Connection.h" 2 | -------------------------------------------------------------------------------- /cube/Connection.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_CONNECTION_H 2 | #define CUBE_CONNECTION_H 3 | 4 | #include "../IDA/types.h" 5 | #include "../steam/steam_api_common.h" 6 | #include "ServerUpdates.h" 7 | 8 | namespace cube { 9 | class Connection { 10 | public: 11 | __int64 id; 12 | CSteamID steam_id; 13 | cube::ServerUpdates server_updates; 14 | __int64 field_110; 15 | __int64 field_118; 16 | __int64 field_120; 17 | __int64 field_128; 18 | __int64 field_130; 19 | __int64 field_138; 20 | __int64 some_0x998_sized_ptr; 21 | __int64 field_148; 22 | }; 23 | } 24 | 25 | static_assert(sizeof(cube::Connection) == 0x150, "cube::Connection is not the correct size."); 26 | 27 | #endif // CUBE_CONNECTION_H 28 | -------------------------------------------------------------------------------- /cube/Controls.cpp: -------------------------------------------------------------------------------- 1 | #include "Controls.h" 2 | #include "../cwsdk.h" -------------------------------------------------------------------------------- /cube/Controls.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_CONTROLS_H 2 | #define CUBE_CONTROLS_H 3 | 4 | #include 5 | 6 | namespace cube { 7 | class Controls { 8 | public: 9 | int32_t button_attack; 10 | int32_t button_attack_2; 11 | int32_t button_special_attack; 12 | int32_t button_special_attack_2; 13 | int32_t button_class_skill; 14 | int32_t button_class_skill_2; 15 | int32_t button_ultimate_skill; 16 | int32_t button_ultimate_skill_2; 17 | int32_t button_quick_item; 18 | int32_t button_quick_item_2; 19 | int32_t button_up; 20 | int32_t button_up_2; 21 | int32_t button_down; 22 | int32_t button_down_2; 23 | int32_t button_left; 24 | int32_t button_left_2; 25 | int32_t button_right; 26 | int32_t button_right_2; 27 | int32_t button_jump; 28 | int32_t button_jump_2; 29 | int32_t button_dodge; 30 | int32_t button_dodge_2; 31 | int32_t button_use; 32 | int32_t button_use_2; 33 | int32_t button_lamp; 34 | int32_t button_lamp_2; 35 | int32_t button_walk; 36 | int32_t button_walk_2; 37 | int32_t button_call_pet; 38 | int32_t button_call_pet_2; 39 | int32_t button_world_map; 40 | int32_t button_world_map_2; 41 | int32_t button_ring_menu; 42 | int32_t button_ring_menu_2; 43 | int32_t button_inventory; 44 | int32_t button_inventory_2; 45 | int32_t button_crafting_menu; 46 | int32_t button_crafting_menu_2; 47 | int32_t button_system_menu; 48 | int32_t button_system_menu_2; 49 | int32_t button_multiplayer_menu; 50 | int32_t button_multiplayer_menu_2; 51 | int32_t button_zoom_in; 52 | int32_t button_zoom_in_2; 53 | int32_t button_zoom_out; 54 | int32_t button_zoom_out_2; 55 | }; 56 | } 57 | 58 | static_assert(sizeof(cube::Controls) == 0xB8, "cube::Controls is not the correct size."); 59 | 60 | #endif // CUBE_CONTROLS_H 61 | -------------------------------------------------------------------------------- /cube/ControlsWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "ControlsWidget.h" -------------------------------------------------------------------------------- /cube/ControlsWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_CONTROLSWIDGET_H 2 | #define CUBE_CONTROLSWIDGET_H 3 | 4 | #include "BaseWidget.h" 5 | #include "Controls.h" 6 | #include "../plasma/Node.h" 7 | 8 | namespace cube { 9 | class Game; 10 | class ControlsWidget : public cube::BaseWidget { 11 | public: 12 | cube::Game* game; 13 | cube::Controls controls; 14 | plasma::Node* ok_button; 15 | plasma::Node* cancel_button; 16 | plasma::Node* defaults_button; 17 | plasma::Node* upbutton; 18 | plasma::Node* downbutton; 19 | plasma::Node* scrollbutton; 20 | int scroll_position; 21 | int hovered_index; 22 | int selected_index; 23 | int field_2E4; 24 | }; 25 | } 26 | 27 | static_assert(sizeof(cube::ControlsWidget) == 0x2E8, "cube::ControlsWidget is not the correct size."); 28 | 29 | #endif // CUBE_CONTROLSWIDGET_H 30 | -------------------------------------------------------------------------------- /cube/Creature.cpp: -------------------------------------------------------------------------------- 1 | #include "Creature.h" 2 | #include "../cwsdk.h" 3 | 4 | cube::Creature* cube::Creature::Create(__int64 id) { 5 | cube::Creature* newCreature = (cube::Creature*)new char[sizeof(cube::Creature)]; 6 | newCreature->ctor(&id); 7 | return newCreature; 8 | } 9 | 10 | cube::Creature* cube::Creature::ctor(__int64* id) { 11 | return ((cube::Creature*(*)(cube::Creature*, __int64*))CWOffset(0x4CE80))(this, id); 12 | } 13 | 14 | float cube::Creature::GetArmor() { 15 | return ((float (*)(cube::Creature*))CWOffset(0x4F080))(this); 16 | } 17 | 18 | float cube::Creature::GetCritical(cube::Creature* other_creature, bool other_creature_based_on_resistance) { 19 | return ((float (*)(cube::Creature*, cube::Creature*, bool))CWOffset(0x50D30))(this, other_creature, other_creature_based_on_resistance); 20 | } 21 | 22 | float cube::Creature::GetAttackPower(bool unk_bool) { 23 | return ((float (*)(cube::Creature*, bool))CWOffset(0x4FA70))(this, unk_bool); 24 | } 25 | 26 | float cube::Creature::GetSpellPower(bool unk_bool) { 27 | return ((float (*)(cube::Creature*, bool))CWOffset(0x65C70))(this, unk_bool); 28 | } 29 | 30 | float cube::Creature::GetHaste() { 31 | return ((float (*)(cube::Creature*))CWOffset(0x66460))(this); 32 | } 33 | 34 | float cube::Creature::GetMaxHP() { 35 | return ((float (*)(cube::Creature*))CWOffset(0x5FAC0))(this); 36 | } 37 | 38 | float cube::Creature::GetResistance() { 39 | return ((float (*)(cube::Creature*))CWOffset(0x64D90))(this); 40 | } 41 | 42 | float cube::Creature::GetRegeneration() { 43 | return ((float (*)(cube::Creature*))CWOffset(0x647B0))(this); 44 | } 45 | 46 | float cube::Creature::GetManaGeneration() { 47 | return ((float (*)(cube::Creature*))CWOffset(0x5F8D0))(this); 48 | } 49 | -------------------------------------------------------------------------------- /cube/Creature.h: -------------------------------------------------------------------------------- 1 | #ifndef CREATURE_H 2 | #define CREATURE_H 3 | 4 | #include "../IDA/types.h" 5 | #include "../common/Vector3.h" 6 | #include "../common/RGBA.h" 7 | #include "../common/Matrix4.h" 8 | #include 9 | #include 10 | #include "ItemStack.h" 11 | #include "Equipment.h" 12 | #include "Interaction.h" 13 | #include 14 | 15 | namespace cube { 16 | class Creature { 17 | public: 18 | // cube::Creature::EntityData 19 | class EntityData { 20 | public: 21 | // cube::Creature::EntityData::Appearance 22 | class Appearance { 23 | public: 24 | __int16 field_78; 25 | ByteRGBA hair_color; 26 | char padding_7E; 27 | char padding_7F; 28 | unsigned int flags2; 29 | float graphics_scale; 30 | float hitbox_scale; 31 | float physics_scale; 32 | __int16 head_model; 33 | __int16 hair_model; 34 | __int16 hands_model; 35 | __int16 feet_model; 36 | __int16 chest_model; 37 | __int16 tail_model; 38 | __int16 shoulder_model; 39 | __int16 wings_model; 40 | float head_scale; 41 | float chest_scale; 42 | float hands_scale; 43 | float feet_scale; 44 | float unknown_scale; 45 | float weapon_scale; 46 | float tail_scale; 47 | float shoulder_scale; 48 | float wing_scale; 49 | float chest_rotation; 50 | FloatVector3 hands_rotation; 51 | float feet_rotation; 52 | float wings_rotation; 53 | float unknown_rotation; 54 | FloatVector3 chest_position; 55 | FloatVector3 head_position; 56 | FloatVector3 hands_position; 57 | FloatVector3 feet_position; 58 | FloatVector3 unknown_position; 59 | FloatVector3 wings_position; 60 | }; // end cube::Creature::EntityData::Appearance 61 | 62 | LongVector3 position; 63 | float pitch; 64 | float roll; 65 | float yaw; 66 | FloatVector3 velocity; 67 | FloatVector3 acceleration; 68 | FloatVector3 retreat; 69 | float head_rotation; 70 | unsigned int flags; 71 | char hostility_type; 72 | char field_61; 73 | char field_62; 74 | char field_63; 75 | unsigned int race; 76 | BYTE current_ability; 77 | char field_59; 78 | char field_5A; 79 | char field_5B; 80 | float time_since_ability; 81 | int hit_combo; 82 | float time_since_hit; 83 | cube::Creature::EntityData::Appearance appearance; 84 | __int16 binary_toggles; 85 | char field_11A; 86 | char field_11B; 87 | float roll_time; 88 | float stun_time; 89 | float unknown_time; 90 | float slowed_time; 91 | float sprint_time; 92 | int field_140; 93 | unsigned int level; 94 | int XP; 95 | unsigned __int8 classType; 96 | char specialization; 97 | _BYTE gap13E[10]; 98 | char charge; 99 | _BYTE gap149[27]; 100 | FloatVector3 attack_rotation; 101 | float HP; 102 | float float_184; 103 | float MP; 104 | float stealth; 105 | _BYTE gap180[4]; 106 | char field_184; 107 | _BYTE gap185[67]; 108 | cube::Item unk_item; 109 | cube::Equipment equipment; 110 | char name[16]; 111 | __int64 field_958; 112 | char field_960; 113 | char field_961; 114 | char field_962; 115 | char field_963; 116 | int field_964; 117 | __int64 field_968; 118 | }; // end cube::Creature::EntityData 119 | 120 | class Buff { // start cube::Creature::Buff 121 | public: 122 | enum BuffType 123 | { 124 | AuraBulwark = 0x1, 125 | AuraWarFrenzy = 0x2, 126 | AuraCamouflage = 0x3, 127 | AuraPoisoned = 0x4, 128 | AuraManaShield = 0x6, 129 | AuraInstantFire = 0x9, 130 | AuraInstantShoot = 0xA, 131 | AuraDodge = 0xB, 132 | AuraSwiftness = 0xC, 133 | AuraNinjutsu = 0xD, 134 | AuraShadowClone = 0xF, 135 | AuraFlameRush = 0x10, 136 | AuraRegeneration = 0x11, 137 | AuraSpiritWorld = 0x13, 138 | AuraLifeFlask = 0x17, 139 | AuraArmorFlask = 0x18, 140 | AuraResistanceFlask = 0x19, 141 | AuraHeatResistance = 0x1A, 142 | AuraColdFlask = 0x1B, 143 | AuraPlagueResistance = 0x1C, 144 | AuraFrozen = 0x1D, 145 | AuraAncientPower = 0x21, 146 | AuraManaAbsorption = 0x22, 147 | }; 148 | 149 | public: 150 | cube::Creature::Buff::BuffType type; 151 | float unk; 152 | float time_remaining; 153 | int32_t field_10; 154 | int32_t field_14; 155 | int32_t field_18; 156 | }; // end cube::Creature::Buff 157 | 158 | class AnimationState { // start cube::Creature::AnimationState 159 | public: 160 | cube::Creature* creature; 161 | int32_t current_animation_state_timer; 162 | int32_t current_animation_state_id; 163 | int32_t field_10; 164 | int32_t field_14; 165 | int64_t field_18; 166 | FloatVector3 left_hand_shifted_by; 167 | FloatVector3 right_hand_shifted_by; 168 | FloatVector3 left_hand_rot; 169 | FloatVector3 right_hand_rot; 170 | int64_t field_50; 171 | int64_t field_58; 172 | int64_t field_60; 173 | FloatVector3 body_rot; 174 | FloatVector3 entire_creature_rot; 175 | FloatVector3 body_shifted_by; 176 | FloatVector3 head_shifted_by; 177 | FloatVector3 head_rot; 178 | FloatVector3 something_that_rounds_to_360_multiples; 179 | float some_decreasing_timer_0; 180 | float some_hands_rot; 181 | float some_decreasing_timer_1; 182 | float some_body_with_feet_rot; 183 | FloatVector3 entire_creature_shifted_by; 184 | float some_feet_rot; 185 | int32_t field_D0; 186 | int32_t field_D4; 187 | int64_t face_sprite; 188 | int64_t hair_sprite; 189 | int64_t chest_sprite; 190 | int64_t unk_sprite; 191 | int64_t hands_sprite; 192 | int64_t wings_sprite; 193 | int64_t tail_sprite; 194 | int64_t feet_sprite; 195 | int64_t weapon_right_sprite; 196 | int64_t weapon_left_sprite; 197 | int64_t shoulder_sprite; 198 | int64_t neck_sprite; 199 | Matrix4 body_with_head_matrix; 200 | Matrix4 hands_matrix; 201 | Matrix4 body_matrix; 202 | Matrix4 head_matrix; 203 | Matrix4 hair_matrix; 204 | Matrix4 unk_matrix_278; 205 | Matrix4 unk_matrix_2B8; 206 | Matrix4 weapon_in_right_hand_matrix; 207 | Matrix4 weapon_in_left_hand_matrix; 208 | Matrix4 left_hand_matrix; 209 | Matrix4 right_hand_matrix; 210 | Matrix4 unk_matrix_3F8; 211 | Matrix4 unk_matrix_438; 212 | Matrix4 unk_matrix_478; 213 | Matrix4 unk_matrix_4B8; 214 | Matrix4 left_root_matrix; 215 | Matrix4 right_foot_matrix; 216 | Matrix4 field_578; 217 | Matrix4 field_5B8; 218 | Matrix4 field_5F8; 219 | Matrix4 field_638; 220 | Matrix4 field_678; 221 | Matrix4 field_6B8; 222 | Matrix4 field_6F8; 223 | Matrix4 field_738; 224 | Matrix4 field_778; 225 | Matrix4 field_7B8; 226 | Matrix4 field_7F8; 227 | Matrix4 field_838; 228 | Matrix4 field_878; 229 | int64_t field_8B8; 230 | int64_t field_8C0; 231 | uint8_t field_8C8; 232 | uint8_t field_8C9; 233 | uint8_t field_8CA; 234 | uint8_t field_8CB; 235 | int32_t field_8CC; 236 | int64_t field_8D0; 237 | int64_t field_8D8; 238 | int64_t field_8E0; 239 | }; // end cube::Creature::AnimationState 240 | 241 | 242 | // start cube::Creature 243 | public: 244 | void* vtable; 245 | __int64 id; 246 | cube::Creature::EntityData entity_data; 247 | std::list buffs; 248 | _BYTE gap990[96]; 249 | std::vector> inventory_tabs; 250 | int field_A08; 251 | cube::Item unk_item; 252 | int gold; 253 | _BYTE gapAB0[8]; 254 | std::list interactions; 255 | _BYTE gapAC8[144]; 256 | int field_B58; 257 | int climbing_speed; 258 | int swimming_speed; 259 | int diving_skill; 260 | int riding_speed; 261 | int hang_gliding_speed; 262 | int sailing_speed; 263 | int lamp_diameter; 264 | _BYTE gapB78[184]; 265 | __int64 field_C30; 266 | cube::Creature::AnimationState animation_state; 267 | _BYTE gap1520[215]; 268 | char end; 269 | 270 | 271 | static cube::Creature* Create(__int64 id); 272 | cube::Creature* ctor(__int64* id); 273 | float GetArmor(); 274 | float GetCritical(cube::Creature* other_creature = nullptr, bool other_creature_based_on_resistance = true); 275 | float GetAttackPower(bool unk_bool = true); 276 | float GetSpellPower(bool unk_bool = true); 277 | float GetHaste(); 278 | float GetMaxHP(); 279 | float GetResistance(); 280 | float GetRegeneration(); 281 | float GetManaGeneration(); 282 | }; 283 | } 284 | 285 | static_assert(sizeof(cube::Creature) == 0x15F8, "cube::Creature is not the correct size."); 286 | 287 | #endif // CREATURE_H 288 | -------------------------------------------------------------------------------- /cube/Database.cpp: -------------------------------------------------------------------------------- 1 | #include "Database.h" 2 | -------------------------------------------------------------------------------- /cube/Database.h: -------------------------------------------------------------------------------- 1 | #ifndef DATABASE_H 2 | #define DATABASE_H 3 | 4 | #include "../IDA/types.h" 5 | 6 | namespace cube { 7 | class Database { 8 | public: 9 | void *vtable; 10 | __int64 field_8; 11 | }; 12 | } 13 | 14 | #endif // DATABASE_H 15 | -------------------------------------------------------------------------------- /cube/EnchantWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "EnchantWidget.h" -------------------------------------------------------------------------------- /cube/EnchantWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_ENCHANTWIDGET_H 2 | #define CUBE_ENCHANTWIDGET_H 3 | 4 | #include "BaseWidget.h" 5 | #include "../plasma/Node.h" 6 | 7 | 8 | namespace cube { 9 | class Game; 10 | class EnchantWidget : public cube::BaseWidget { 11 | public: 12 | int inventory_tab_index; 13 | int inventory_item_index; 14 | int can_identify; 15 | int field_1F4; 16 | cube::Game* game; 17 | plasma::Node* itemframe; 18 | }; 19 | } 20 | 21 | static_assert(sizeof(cube::EnchantWidget) == 0x208, "cube::EnchantWidget is not the correct size."); 22 | 23 | #endif // CUBE_ENCHANTWIDGET_H 24 | -------------------------------------------------------------------------------- /cube/Equipment.cpp: -------------------------------------------------------------------------------- 1 | #include "Equipment.h" 2 | -------------------------------------------------------------------------------- /cube/Equipment.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_EQUIPMENT_H 2 | #define CUBE_EQUIPMENT_H 3 | #include "Item.h" 4 | 5 | namespace cube { 6 | class Equipment { 7 | public: 8 | cube::Item unk_item; 9 | cube::Item neck; 10 | cube::Item chest; 11 | cube::Item feet; 12 | cube::Item hands; 13 | cube::Item shoulder; 14 | cube::Item weapon_left; 15 | cube::Item weapon_right; 16 | cube::Item ring_left; 17 | cube::Item ring_right; 18 | cube::Item pet; 19 | }; 20 | } 21 | 22 | static_assert(sizeof(cube::Equipment) == 0x6E0, "cube::Equipment is not the correct size."); 23 | 24 | #endif // CUBE_EQUIPMENT_H 25 | -------------------------------------------------------------------------------- /cube/Field.cpp: -------------------------------------------------------------------------------- 1 | #include "Field.h" 2 | -------------------------------------------------------------------------------- /cube/Field.h: -------------------------------------------------------------------------------- 1 | #ifndef FIELD_H 2 | #define FIELD_H 3 | 4 | #include "../IDA/types.h" 5 | #include "Block.h" 6 | #include 7 | 8 | namespace cube { 9 | class Field { 10 | public: 11 | virtual ~Field(); 12 | 13 | float field_8; 14 | float field_C; 15 | float field_10; 16 | float field_14; 17 | float field_18; 18 | float field_1C; 19 | float field_20; 20 | float field_24; 21 | float field_28; 22 | float field_2C; 23 | int field_30; 24 | int field_34; 25 | float field_38; 26 | int base_z; 27 | std::vector blocks; 28 | }; 29 | } 30 | 31 | static_assert(sizeof(cube::Field) == 0x58, "cube::Field is not the correct size."); 32 | 33 | #endif // FIELD_H 34 | -------------------------------------------------------------------------------- /cube/FormulaDetailsWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "FormulaDetailsWidget.h" -------------------------------------------------------------------------------- /cube/FormulaDetailsWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_FORMULADETAILSWIDGET_H 2 | #define CUBE_FORMULADETAILSWIDGET_H 3 | #include "BaseWidget.h" 4 | #include "../plasma/Node.h" 5 | #include "Item.h" 6 | #include "../common/Vector3.h" 7 | namespace cube { 8 | class Game; 9 | class FormulaDetailsWidget : public cube::BaseWidget { 10 | public: 11 | FloatVector3 result_item_rotation; 12 | int field_1F4; 13 | cube::Item result_item; 14 | int workstation_required; 15 | int field_29C; 16 | __int64 field_2A0; 17 | __int64 field_2A8; 18 | __int64 field_2B0; 19 | __int64 field_2B8; 20 | cube::Game* game; 21 | plasma::Node* itemshadow; 22 | plasma::Node* craftbutton; 23 | plasma::Node* craftbar; 24 | plasma::Node* craftbar_bar; 25 | int field_2E8; 26 | cube::Item unk_item; 27 | char field_38C; 28 | char field_38D; 29 | char field_38E; 30 | char field_38F; 31 | }; 32 | } 33 | 34 | static_assert(sizeof(cube::FormulaDetailsWidget) == 0x390, "cube::FormulaDetailsWidget is not the correct size."); 35 | 36 | #endif // CUBE_FORMULADETAILSWIDGET_H 37 | -------------------------------------------------------------------------------- /cube/GUI.cpp: -------------------------------------------------------------------------------- 1 | #include "GUI.h" 2 | #include "../cwsdk.h" 3 | 4 | void cube::GUI::UpdateResolution(signed int width, signed int height) { 5 | ((void(*)(cube::GUI*, signed int, signed int))CWOffset(0x101BD0))(this, width, height); 6 | } -------------------------------------------------------------------------------- /cube/GUI.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_GUI_H 2 | #define CUBE_GUI_H 3 | 4 | #include 5 | #include 6 | 7 | #include "../IDA/types.h" 8 | #include "../plasma/Node.h" 9 | #include "ChatWidget.h" 10 | #include "InventoryWidget.h" 11 | #include "MultiplayerWidget.h" 12 | #include "MapOverlayWidget.h" 13 | #include "FormulaDetailsWidget.h" 14 | #include "CharacterWidget.h" 15 | #include "SystemWidget.h" 16 | #include "EnchantWidget.h" 17 | #include "VoxelWidget.h" 18 | #include "AdaptionWidget.h" 19 | #include "QuestionWidget.h" 20 | #include "HelpWidget.h" 21 | #include "PreviewWidget.h" 22 | #include "SpriteWidget.h" 23 | #include "ControlsWidget.h" 24 | #include "SpeechWidget.h" 25 | #include "OptionsWidget.h" 26 | #include "CharacterPreviewWidget.h" 27 | #include "CharacterStyleWidget.h" 28 | 29 | namespace cube { 30 | class Game; 31 | class GUI { 32 | public: 33 | plasma::Node* startmenu_node; 34 | plasma::Node* startmenu_buttons_node; 35 | void* start_menu_widget; 36 | plasma::Node* character_selection_node; 37 | std::vector character_preview_widgets; 38 | plasma::Node* button2_node; 39 | plasma::Node* smallbutton_node; 40 | plasma::Node* button_node; 41 | __int64 field_50; 42 | plasma::Node* character_creation_node; 43 | cube::CharacterStyleWidget* character_style_widget; 44 | plasma::Node* blackwidget_node; 45 | plasma::Node* button_node_1; 46 | plasma::Node* charactername_node; 47 | plasma::Node* world_selection_node; 48 | std::vector world_selection_preview_cards; 49 | std::map some_map_related_to_worlds_0; 50 | std::map some_map_related_to_worlds_1; 51 | plasma::Node* button_node_2; 52 | plasma::Node* button2_node_1; 53 | plasma::Node* smallbutton_node_1; 54 | plasma::Node* button_node_3; 55 | _BYTE gapE0[8]; 56 | plasma::Node* world_creation_node; 57 | plasma::Node* button_node_4; 58 | plasma::Node* worldseed_node; 59 | plasma::Node* worldname_node; 60 | plasma::Node* interface_elements_node; 61 | std::vector field_110; 62 | std::vector some_plasma_node_vector; 63 | plasma::Node* playername_node; 64 | plasma::Node* plasma_node_21; 65 | plasma::Node* hpbar_node; 66 | plasma::Node* bar_node; 67 | plasma::Node* mpbar_node; 68 | plasma::Node* bar_node_1; 69 | plasma::Node* experiencebar_node; 70 | plasma::Node* xpbar_node; 71 | plasma::Node* chargebar_node; 72 | plasma::Node* castbar_node; 73 | plasma::Node* bar_node_2; 74 | plasma::Node* staminabar_node; 75 | plasma::Node* bar_node_3; 76 | plasma::Node* plasma_node_33; 77 | plasma::Node* info_node_0; 78 | plasma::Node* info_node_1; 79 | plasma::Node* info_node_2; 80 | plasma::Node* location_node; 81 | plasma::Node* levelinfo_node; 82 | plasma::Node* crosshair_node; 83 | plasma::Node* zoomcrosshair_node; 84 | plasma::Node* lockedtarget_node; 85 | plasma::Node* highlightedtarget_node; 86 | plasma::Node* selector_node; 87 | plasma::Node* gold_node; 88 | plasma::Node* plasma_node_45; 89 | plasma::Node* combopoints_node; 90 | cube::InventoryWidget* equipment_inventory_widget; 91 | cube::CharacterWidget* character_widget; 92 | cube::InventoryWidget* crafting_inventory_widget; 93 | cube::FormulaDetailsWidget* formula_details_widget; 94 | cube::InventoryWidget* vendor_inventory_widget; 95 | cube::SystemWidget* system_widget; 96 | cube::EnchantWidget* enchant_widget; 97 | cube::VoxelWidget* voxel_widget; 98 | cube::AdaptionWidget* adaption_widget; 99 | cube::QuestionWidget* question_widget; 100 | cube::MapOverlayWidget* map_overlay_widget; 101 | cube::MultiplayerWidget* multiplayer_widget; 102 | cube::HelpWidget* help_widget; 103 | cube::ChatWidget* chat_widget; 104 | plasma::Node* recentlands_node; 105 | plasma::Node* leftbutton_node; 106 | plasma::Node* rightbutton_node; 107 | plasma::Node* missiontag_white_node; 108 | cube::PreviewWidget* preview_widget; 109 | _BYTE gap2B0[24]; 110 | cube::SpriteWidget* quick_item_sprite_widget; 111 | cube::SpriteWidget* sprite_widget_1; 112 | cube::SpriteWidget* sprite_widget_2; 113 | cube::SpriteWidget* sprite_widget_3; 114 | std::vector speech_widgets; 115 | cube::SpeechWidget* speech_widget; 116 | char esc_menu_displayed; 117 | plasma::Node* blackwidget_node_0; 118 | plasma::Node* speech_node; 119 | plasma::Node* tab_node; 120 | plasma::Node* plasma_node_54; 121 | plasma::Node* cursor_node; 122 | plasma::Node* wait_node; 123 | plasma::Node* button_node_5; 124 | plasma::Node* enemy_node; 125 | plasma::Node* monster_node; 126 | plasma::Node* crystal_node; 127 | plasma::Node* brazier_node; 128 | plasma::Node* manapump_node; 129 | plasma::Node* npc_node; 130 | plasma::Node* static_node; 131 | plasma::Node* object_node; 132 | plasma::Node* star_node; 133 | plasma::Node* cross_node; 134 | plasma::Node* flight_point_node; 135 | plasma::Node* unknown_flight_point_node; 136 | plasma::Node* home_node; 137 | plasma::Node* mapposition_node; 138 | plasma::Node* direction_node; 139 | plasma::Node* armor_shop_node; 140 | plasma::Node* weapon_shop_node; 141 | plasma::Node* item_shop_node; 142 | plasma::Node* identifier_node; 143 | plasma::Node* smithy_node; 144 | plasma::Node* carpenters_shop_node; 145 | plasma::Node* tailors_shop_node; 146 | plasma::Node* inn_node; 147 | plasma::Node* shrine_node; 148 | plasma::Node* spirit_node; 149 | plasma::Node* bell_node; 150 | plasma::Node* harp_node; 151 | plasma::Node* whistle_node; 152 | plasma::Node* solved_node; 153 | plasma::Node* gnome_node; 154 | plasma::Node* hangglider_node; 155 | plasma::Node* boat_node; 156 | plasma::Node* climbingspikes_node; 157 | plasma::Node* reins_node; 158 | plasma::Node* destination_node; 159 | plasma::Node* crafting1_node; 160 | plasma::Node* crafting2_node; 161 | plasma::Node* crafting3_node; 162 | plasma::Node* crafting4_node; 163 | plasma::Node* flight_master_node; 164 | plasma::Node* guild_hall_node; 165 | plasma::Node* flower_node; 166 | plasma::Node* key_node; 167 | plasma::Node* treasure_node; 168 | plasma::Node* witch_node; 169 | plasma::Node* demonportal_node; 170 | char pad_04B8[32]; 171 | plasma::Node* weaponrarity0_node; 172 | plasma::Node* weaponrarity1_node; 173 | plasma::Node* weaponrarity2_node; 174 | plasma::Node* weaponrarity3_node; 175 | plasma::Node* weaponrarity4_node; 176 | plasma::Node* weaponrarity5_node; 177 | plasma::Node* armorrarity0_node; 178 | plasma::Node* armorrarity1_node; 179 | plasma::Node* armorrarity2_node; 180 | plasma::Node* armorrarity3_node; 181 | plasma::Node* armorrarity4_node; 182 | plasma::Node* armorrarity5_node; 183 | cube::OptionsWidget* options_widget; 184 | cube::ControlsWidget* controls_widget; 185 | float mouse_y; 186 | float scale; 187 | bool map_open; 188 | plasma::Node* textFX_node; 189 | plasma::Node* lifebars_node; 190 | plasma::Node* enemylifebar_small_node; 191 | plasma::Node* friendlifebar_small_node; 192 | plasma::Node* staticlifebar_small_node; 193 | plasma::Node* neutrallifebar_small_node; 194 | plasma::Node* enemylifebar_node; 195 | plasma::Node* friendlifebar_node; 196 | plasma::Node* staticlifebar_node; 197 | plasma::Node* neutrallifebar_node; 198 | _BYTE gap5A8[24]; 199 | cube::Game* game; 200 | char pad_05C8[8]; 201 | 202 | void UpdateResolution(signed int width, signed int height); 203 | }; 204 | } 205 | static_assert(sizeof(cube::GUI) == 0x5D0, "cube::GUI is not the correct size."); 206 | #endif // CUBE_GUI_H 207 | -------------------------------------------------------------------------------- /cube/Game.cpp: -------------------------------------------------------------------------------- 1 | #include "Game.h" 2 | #include "../cwsdk.h" 3 | #include 4 | 5 | float degrees_to_radians(float degrees) { 6 | return (degrees * 3.1415926535) / 180.0; 7 | } 8 | float radians_to_degrees(float radians) { 9 | return (radians * 180.0) / 3.1415926535; 10 | } 11 | 12 | cube::Creature* cube::Game::GetPlayer() { 13 | return this->world->local_creature; 14 | } 15 | 16 | bool cube::Game::TraceCrosshairToBlock(float reach_in_blocks_from_camera, bool want_face_block, LongVector3* result, bool pass_through_water) { 17 | //Calculate the direction the camera is in 18 | f32 cameraYaw = this->camera_angle.z; 19 | f32 cameraPitch = this->camera_angle.x; 20 | f32 yaw = degrees_to_radians(cameraYaw + 90.0); 21 | f32 pitch = degrees_to_radians(cameraPitch); 22 | 23 | f32 camera_x_direction = cos(yaw) * sin(pitch); 24 | f32 camera_y_direction = sin(yaw) * sin(pitch); 25 | f32 camera_z_direction = -cos(pitch); 26 | 27 | //Get the absolute location of the camera, in world units (not blocks) 28 | i64 camera_x = this->global_camera_position.x; 29 | i64 camera_y = this->global_camera_position.y; 30 | i64 camera_z = this->global_camera_position.z; 31 | 32 | //We're going to start the raycast at the current position of the camera. 33 | i64 blockx = pydiv(camera_x, DOTS_PER_BLOCK); 34 | i64 blocky = pydiv(camera_y, DOTS_PER_BLOCK); 35 | i64 blockz = pydiv(camera_z, DOTS_PER_BLOCK); 36 | 37 | //These are for the case that you want the block on the face of whatever it hits. 38 | i64 lastblockx = blockx; 39 | i64 lastblocky = blocky; 40 | i64 lastblockz = blockz; 41 | 42 | f32 reach_limit = (f32)DOTS_PER_BLOCK * reach_in_blocks_from_camera; //maximum reach in world units 43 | f32 raycast_precision = 1000.0; 44 | bool withinReach = false; 45 | 46 | //Move the position back in the opposite direction until it hits a block. 47 | for (f32 world_units_traveled = 0.0; world_units_traveled < reach_limit; world_units_traveled += raycast_precision) { 48 | //Update previous block before changing the current block 49 | lastblockx = blockx; 50 | lastblocky = blocky; 51 | lastblockz = blockz; 52 | blockx = pydiv(camera_x, DOTS_PER_BLOCK); 53 | blocky = pydiv(camera_y, DOTS_PER_BLOCK); 54 | blockz = pydiv(camera_z, DOTS_PER_BLOCK); 55 | //Figure out what's in the new location 56 | cube::Block block = this->world->GetBlockInterpolated(blockx, blocky, blockz); 57 | bool isAir = block.type == cube::Block::Type::Air; 58 | bool isWater = block.type == cube::Block::Water; 59 | bool canPassThrough = isAir || (isWater && pass_through_water); 60 | if (!canPassThrough) { //If the block is a block we cannot pass through (we hit something) 61 | withinReach = true; 62 | if (want_face_block) { 63 | //If you want the face block, change the block coords to whatever was seen last time. ie, go back one. 64 | blockx = lastblockx; 65 | blocky = lastblocky; 66 | blockz = lastblockz; 67 | } 68 | break; //Leave loop if successfully hit a block 69 | 70 | } 71 | //Move the position back a tiny bit 72 | camera_x -= (i64)(camera_x_direction * raycast_precision); 73 | camera_y -= (i64)(camera_y_direction * raycast_precision); 74 | camera_z -= (i64)(camera_z_direction * raycast_precision); 75 | } 76 | 77 | LongVector3 position(blockx, blocky, blockz); 78 | 79 | //We've got a block coordinate now, whether it be the block we were looking at, the block on the face of another, or the block at the edge of our reach. 80 | if (withinReach) { 81 | result->x = blockx; 82 | result->y = blocky; 83 | result->z = blockz; 84 | } 85 | 86 | return withinReach; 87 | } 88 | 89 | void cube::Game::PrintMessage(const wchar_t* message, FloatRGBA* color) { 90 | this->gui.chat_widget->PrintMessage(message, color); 91 | } 92 | void cube::Game::PrintMessage(const wchar_t* message) { 93 | this->gui.chat_widget->PrintMessage(message); 94 | } 95 | void cube::Game::PrintMessage(const wchar_t* message, char red, char green, char blue) { 96 | this->gui.chat_widget->PrintMessage(message, red, green, blue); 97 | } 98 | void cube::Game::PlaySoundEffect(SoundEffect sound_id, LongVector3& position, float volume, float speed, bool unkbool) { 99 | ((void(*)(cube::Game*, u32, LongVector3&, float, float, char))CWOffset(0x0A0420))(this, sound_id, position, volume, speed, unkbool); 100 | } 101 | void cube::Game::PlaySoundEffect(SoundEffect sound_id, float volume, float speed, bool unkbool) { 102 | this->PlaySoundEffect(sound_id, this->global_camera_position, volume, speed, unkbool); 103 | } 104 | 105 | // This never worked properly, but I'll leave it here to demonstrate a little about how remeshing works 106 | /*void cube::Game::RemeshZone(int x, int y) { 107 | EnterCriticalSection(&world->zones_critical_section); 108 | cube::Zone* zone = this->world->zones.at(IntVector2(x, y)); 109 | LeaveCriticalSection(&world->zones_critical_section); 110 | 111 | if (zone) { 112 | EnterCriticalSection(&world->critical_section_2); 113 | this->renderer->RemeshZone(x, y); 114 | 115 | EnterCriticalSection(&world->zones_critical_section); 116 | EnterCriticalSection(&world->zones_mesh_critical_section); 117 | 118 | 119 | 120 | 121 | std::list old_chunkbuffers; 122 | 123 | for (gfx::ChunkBuffer* chunkbuffer : zone->chunk.chunkbuffers) { 124 | old_chunkbuffers.push_back(chunkbuffer); 125 | } 126 | 127 | if (zone->chunk.new_chunkbuffers.size() > 1) { 128 | zone->chunk.chunkbuffers.clear(); 129 | } 130 | 131 | 132 | for (gfx::ChunkBuffer* new_chunkbuffer : zone->chunk.new_chunkbuffers) { 133 | zone->chunk.chunkbuffers.push_back(new_chunkbuffer); 134 | } 135 | 136 | zone->chunk.new_chunkbuffers.clear(); 137 | 138 | LeaveCriticalSection(&world->zones_mesh_critical_section); 139 | LeaveCriticalSection(&world->zones_critical_section); 140 | LeaveCriticalSection(&world->critical_section_2); 141 | } 142 | } 143 | 144 | void cube::Game::QueueZoneRemesh(int x, int y) { 145 | EnterCriticalSection(&world->zones_critical_section); 146 | cube::Zone* zone = this->world->zones.at(IntVector2(x, y)); 147 | if (zone) zone->chunk.Remesh(); 148 | LeaveCriticalSection(&world->zones_critical_section); 149 | 150 | std::thread( &cube::Game::RemeshZone, this, x, y ).detach(); 151 | }*/ -------------------------------------------------------------------------------- /cube/HelpWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "HelpWidget.h" -------------------------------------------------------------------------------- /cube/HelpWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_HELPWIDGET_H 2 | #define CUBE_HELPWIDGET_H 3 | 4 | #include "BaseWidget.h" 5 | 6 | namespace cube { 7 | class Game; 8 | class HelpWidget : public cube::BaseWidget { 9 | public: 10 | cube::Game* game; 11 | }; 12 | } 13 | 14 | static_assert(sizeof(cube::HelpWidget) == 0x1F0, "cube::HelpWidget is not the correct size."); 15 | 16 | #endif // CUBE_HELPWIDGET_H 17 | -------------------------------------------------------------------------------- /cube/Host.cpp: -------------------------------------------------------------------------------- 1 | #include "Host.h" 2 | -------------------------------------------------------------------------------- /cube/Host.h: -------------------------------------------------------------------------------- 1 | #ifndef HOST_H 2 | #define HOST_H 3 | 4 | #include "World.h" 5 | #include "../msvc/_Thrd_t.h" 6 | #include "../steam/steam_api_common.h" 7 | #include "Connection.h" 8 | 9 | namespace cube { 10 | class Host { 11 | public: 12 | virtual ~Host(); 13 | 14 | cube::World world; 15 | bool running; 16 | // 7 bytes padding 17 | msvc::_Thrd_t thread; 18 | std::map connections; 19 | std::map invitations; // value is time from timeGetTime() 20 | std::map unk_list_0x588; // Node size 0x58 21 | std::map unk_list_0x598; // Node size 0x40 22 | std::map unk_list_0x5A8; // Node size 0x90 23 | std::map unk_list_0x5B8; // Node size 0x40 24 | __int64 field_5C8; 25 | CRITICAL_SECTION host_recv_packet_list_lock; 26 | CRITICAL_SECTION cube_host_lock_1; 27 | std::list host_recv_packet_list; 28 | }; 29 | } 30 | 31 | static_assert(sizeof(cube::Host) == 0x630, "cube::Host is not the correct size."); 32 | #endif // HOST_H 33 | -------------------------------------------------------------------------------- /cube/Interaction.cpp: -------------------------------------------------------------------------------- 1 | #include "Interaction.h" 2 | 3 | cube::Interaction::Interaction(InteractionType type) { 4 | this->interaction_type = type; 5 | } 6 | 7 | void cube::Interaction::SetItem(const cube::Item& item) { 8 | this->item = item; 9 | } -------------------------------------------------------------------------------- /cube/Interaction.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_INTERACTION_H 2 | #define CUBE_INTERACTION_H 3 | 4 | #include "Interaction.h" 5 | #include "Item.h" 6 | #include "../common/Vector3.h" 7 | #include "../common/types.h" 8 | 9 | namespace cube { 10 | class Interaction { 11 | public: 12 | enum InteractionType : u8 { 13 | Talk = 3, 14 | EndTalk = 4, 15 | StaticEntity = 5, 16 | Pickup = 7, 17 | Drop = 8, 18 | CallPet = 10 19 | }; 20 | 21 | cube::Item item; 22 | IntVector3 position; 23 | int probably_padding_AC; 24 | __int64 creature_id_maybe; 25 | __int64 field_B8; 26 | int field_C0; 27 | InteractionType interaction_type; 28 | char padding_probably; 29 | __int16 field_C6; 30 | 31 | Interaction(InteractionType type); 32 | void SetItem(const cube::Item& item); 33 | }; 34 | } 35 | 36 | static_assert(sizeof(cube::Interaction) == 0xC8, "cube::Interaction is not the correct size."); 37 | 38 | #endif // CUBE_INTERACTION_H 39 | -------------------------------------------------------------------------------- /cube/InventoryWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "InventoryWidget.h" -------------------------------------------------------------------------------- /cube/InventoryWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_INVENTORYWIDGET_H 2 | #define CUBE_INVENTORYWIDGET_H 3 | #include "BaseWidget.h" 4 | #include "../plasma/Node.h" 5 | #include 6 | namespace cube { 7 | class Game; 8 | class InventoryWidget : public cube::BaseWidget { 9 | public: 10 | int64_t field_1E8; 11 | int64_t field_1F0; 12 | int64_t field_1F8; 13 | int64_t field_200; 14 | int64_t field_208; 15 | cube::Game* game; 16 | plasma::Node* field_218; 17 | int64_t field_220; 18 | plasma::Node* field_228; 19 | plasma::Node* up_button; 20 | plasma::Node* up_button_related; 21 | plasma::Node* down_button_related; 22 | plasma::Node* scroll_button_related; 23 | plasma::Node* left_button_related; 24 | plasma::Node* wideitembox; 25 | std::list unk_list_0x260_node_size_0x18; 26 | int64_t field_270; 27 | int64_t field_278; 28 | int32_t unk_inv_index_thing; 29 | int32_t field_284; 30 | int64_t field_288; 31 | int64_t field_290; 32 | int64_t field_298; 33 | bool field_2A0; 34 | bool field_2A1; 35 | bool field_2A2; 36 | bool field_2A3; 37 | int32_t field_2A4; 38 | int32_t field_2A8; 39 | int32_t field_2AC; 40 | int32_t field_2B0; 41 | int32_t field_2B4; 42 | int64_t field_2B8; 43 | int64_t field_2C0; 44 | int64_t field_2C8; 45 | }; 46 | } 47 | 48 | static_assert(sizeof(cube::InventoryWidget) == 0x2D0, "cube::InventoryWidget is not the correct size."); 49 | 50 | #endif // CUBE_INVENTORYWIDGET_H 51 | -------------------------------------------------------------------------------- /cube/Item.cpp: -------------------------------------------------------------------------------- 1 | #include "Item.h" 2 | 3 | 4 | cube::Item::Item(){ 5 | } 6 | cube::Item::Item(char category, int id) { 7 | this->category = category; 8 | this->id = id; 9 | } 10 | -------------------------------------------------------------------------------- /cube/Item.h: -------------------------------------------------------------------------------- 1 | #ifndef ITEM_H 2 | #define ITEM_H 3 | 4 | #include "Spirit.h" 5 | #include "../common/Vector2.h" 6 | 7 | namespace cube { 8 | class Item { 9 | public: 10 | char category; 11 | //3 bytes padding 12 | int id; 13 | unsigned int modifier; 14 | IntVector2 region; 15 | char rarity; 16 | //3 bytes padding 17 | int formula_category; 18 | char material; 19 | cube::Spirit spirits[32]; 20 | char num_spirits; 21 | //2 bytes padding 22 | 23 | Item(); 24 | Item(char category, int id); 25 | }; 26 | } 27 | 28 | static_assert(sizeof(cube::Item) == 0xA0, "cube::Creature is not the correct size."); 29 | 30 | #endif // ITEM_H 31 | -------------------------------------------------------------------------------- /cube/ItemStack.cpp: -------------------------------------------------------------------------------- 1 | #include "ItemStack.h" 2 | #include "Item.h" 3 | 4 | cube::ItemStack::ItemStack() { 5 | } 6 | cube::ItemStack::ItemStack(int quantity, cube::Item item) { 7 | this->quantity = quantity; 8 | this->item = item; 9 | } 10 | -------------------------------------------------------------------------------- /cube/ItemStack.h: -------------------------------------------------------------------------------- 1 | #ifndef ITEMSTACK_H 2 | #define ITEMSTACK_H 3 | 4 | #include "Item.h" 5 | 6 | namespace cube { 7 | class ItemStack { 8 | public: 9 | int quantity; 10 | cube::Item item; 11 | 12 | ItemStack(); 13 | ItemStack(int quantity, cube::Item item); 14 | }; 15 | } 16 | 17 | #endif // ITEMSTACK_H 18 | -------------------------------------------------------------------------------- /cube/MapOverlayWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "MapOverlayWidget.h" -------------------------------------------------------------------------------- /cube/MapOverlayWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_MAPOVERLAYWIDGET_H 2 | #define CUBE_MAPOVERLAYWIDGET_H 3 | #include "../plasma/Widget.h" 4 | #include "../common/Vector2.h" 5 | #include "Item.h" 6 | 7 | namespace cube { 8 | class Game; 9 | class MapOverlayWidget : public plasma::Widget { 10 | public: 11 | cube::Game* game; 12 | cube::Item hovered_artifact; 13 | IntVector2 some_vec_for_preview_widget_but_not_artifacts; 14 | char field_258; 15 | char field_259; 16 | char field_25A; 17 | char field_25B; 18 | int field_25C; 19 | }; 20 | } 21 | 22 | static_assert(sizeof(cube::MapOverlayWidget) == 0x260, "cube::MapOverlayWidget is not the correct size."); 23 | 24 | #endif // CUBE_MAPOVERLAYWIDGET_H 25 | -------------------------------------------------------------------------------- /cube/MultiplayerWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "MultiplayerWidget.h" -------------------------------------------------------------------------------- /cube/MultiplayerWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_MULTIPLAYER_WIDGET_H 2 | #define CUBE_MULTIPLAYER_WIDGET_H 3 | #include "BaseWidget.h" 4 | #include "../plasma/Node.h" 5 | #include "Controls.h" 6 | #include 7 | namespace cube { 8 | class Game; 9 | class MultiplayerWidget : public cube::BaseWidget { 10 | public: 11 | cube::Game* game; 12 | bool verify_appid; 13 | std::vector> friends; 14 | cube::Controls controls; 15 | plasma::Node* leave_button; 16 | plasma::Node* up_button; 17 | plasma::Node* down_button; 18 | plasma::Node* scroll_bar; 19 | int scroll_position; 20 | int selected_player_index; 21 | bool some_bool; 22 | char field_2F1; 23 | char field_2F2; 24 | char field_2F3; 25 | char field_2F4; 26 | char field_2F5; 27 | char field_2F6; 28 | char field_2F7; 29 | }; 30 | } 31 | 32 | static_assert(sizeof(cube::MultiplayerWidget) == 0x2F8, "cube::MultiplayerWidget is not the correct size."); 33 | 34 | #endif // CUBE_MULTIPLAYER_WIDGET_H 35 | -------------------------------------------------------------------------------- /cube/Music.cpp: -------------------------------------------------------------------------------- 1 | #include "Music.h" 2 | -------------------------------------------------------------------------------- /cube/Music.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_MUSIC_H 2 | #define CUBE_MUSIC_H 3 | 4 | #include "../IDA/types.h" 5 | #include 6 | 7 | namespace cube { 8 | class Music { 9 | public: 10 | class UnkSubstruct1 { 11 | public: 12 | _BYTE gap0[655359]; 13 | char end; 14 | }; 15 | 16 | 17 | virtual ~Music(); 18 | 19 | cube::Music::UnkSubstruct1 array_of_structs_3_size_0xA0000[3]; 20 | __int64 pXAudio2Impl; 21 | __int64 some_struct_ptr; 22 | char some_bool; 23 | char some_bool_maybe_0; 24 | BYTE some_bool_maybe_1; 25 | char some_bool_maybe_2; 26 | unsigned int index_of_unk_0xA0000_substruct; 27 | _BYTE gap1E0020[8]; 28 | char some_struct_size_0x348[840]; 29 | }; 30 | } 31 | 32 | static_assert(sizeof(cube::Music) == 0x1E0370, "cube::Music is not the correct size."); 33 | 34 | #endif // CUBE_MUSIC_H 35 | -------------------------------------------------------------------------------- /cube/Options.cpp: -------------------------------------------------------------------------------- 1 | #include "Options.h" 2 | #include "../cwsdk.h" -------------------------------------------------------------------------------- /cube/Options.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_OPTIONS_H 2 | #define CUBE_OPTIONS_H 3 | 4 | namespace cube { 5 | class Options { 6 | public: 7 | int fullscreen; 8 | int resolutionX; 9 | int resolutionY; 10 | int refreshRate; 11 | int antiAliasing; 12 | int renderDistance; 13 | int cpuPerformance; 14 | int soundVolume; 15 | int musicVolume; 16 | int cameraSpeed; 17 | int cameraSmoothness; 18 | int invertY; 19 | int language; 20 | int minTimeStep; 21 | int smallGUI; 22 | int vsync; 23 | int showRarity; 24 | float guiScale; 25 | float mapScale; 26 | int musicLoop; 27 | int antiAliasingSamples; 28 | }; 29 | } 30 | 31 | #endif // CUBE_OPTIONS_H 32 | -------------------------------------------------------------------------------- /cube/OptionsWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "OptionsWidget.h" -------------------------------------------------------------------------------- /cube/OptionsWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_OPTIONSWIDGET_H 2 | #define CUBE_OPTIONSWIDGET_H 3 | 4 | #include "BaseWidget.h" 5 | #include "../plasma/Node.h" 6 | #include "ResolutionInfo.h" 7 | #include "Options.h" 8 | #include 9 | 10 | namespace cube { 11 | class Game; 12 | class OptionsWidget : public cube::BaseWidget { 13 | public: 14 | std::vector resolutions; 15 | cube::Game* game; 16 | plasma::Node* mode_left_button; 17 | plasma::Node* mode_right_button; 18 | plasma::Node* resolution_left_button; 19 | plasma::Node* resolution_right_button; 20 | plasma::Node* refresh_rate_left_button; 21 | plasma::Node* refresh_rate_right_button; 22 | plasma::Node* vsync_left_button; 23 | plasma::Node* vsync_right_button; 24 | plasma::Node* render_distance_left_button; 25 | plasma::Node* render_distance_right_button; 26 | plasma::Node* cpu_usage_left_button; 27 | plasma::Node* cpu_usage_right_button; 28 | plasma::Node* sound_fx_volume_left_button; 29 | plasma::Node* sound_fx_volume_right_button; 30 | plasma::Node* music_volume_left_button; 31 | plasma::Node* music_volume_right_button; 32 | plasma::Node* loop_music_left_button; 33 | plasma::Node* loop_music_right_button; 34 | plasma::Node* camera_speed_left_button; 35 | plasma::Node* camera_speed_right_button; 36 | plasma::Node* camera_smoothnesss_left_button; 37 | plasma::Node* camera_smoothnesss_right_button; 38 | plasma::Node* invert_y_axis_left_button; 39 | plasma::Node* invert_y_axis_right_button; 40 | plasma::Node* fps_limit_left_button; 41 | plasma::Node* fps_limit_right_button; 42 | plasma::Node* language_left_button; 43 | plasma::Node* language_right_button; 44 | plasma::Node* rarity_left_button; 45 | plasma::Node* rarity_right_button; 46 | plasma::Node* apply_button; 47 | plasma::Node* ok_button; 48 | plasma::Node* cancel_button; 49 | cube::Options options; 50 | int resolution_index; 51 | }; 52 | } 53 | 54 | static_assert(sizeof(cube::OptionsWidget) == 0x368, "cube::OptionsWidget is not the correct size."); 55 | 56 | #endif // CUBE_OPTIONSWIDGET_H 57 | -------------------------------------------------------------------------------- /cube/PreviewWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "PreviewWidget.h" -------------------------------------------------------------------------------- /cube/PreviewWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_PREVIEWWIDGET_H 2 | #define CUBE_PREVIEWWIDGET_H 3 | 4 | #include "BaseWidget.h" 5 | 6 | namespace cube { 7 | class Game; 8 | class Item; 9 | class PreviewWidget : public cube::BaseWidget { 10 | public: 11 | __int64 field_1E8; 12 | cube::Item* target_item; 13 | __int64 field_1F8; 14 | signed int field_200; 15 | int field_204; 16 | __int64 field_208; 17 | cube::Item* current_item; 18 | __int64 field_218; 19 | __int64 field_220; 20 | __int64 field_228; 21 | }; 22 | } 23 | 24 | static_assert(sizeof(cube::PreviewWidget) == 0x230, "cube::PreviewWidget is not the correct size."); 25 | 26 | #endif // CUBE_PREVIEWWIDGET_H 27 | -------------------------------------------------------------------------------- /cube/Projectile.cpp: -------------------------------------------------------------------------------- 1 | #include "Projectile.h" -------------------------------------------------------------------------------- /cube/Projectile.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_PROJECTILE_H 2 | #define CUBE_PROJECTILE_H 3 | 4 | #include "../common/Vector3.h" 5 | #include 6 | 7 | namespace cube { 8 | class Projectile { 9 | public: 10 | enum ProjectileType : int32_t { 11 | Arrow = 0, 12 | Bullet = 1, 13 | Shuriken = 2, 14 | unk3 = 3, 15 | Fireball = 4, 16 | ArrowOrBoomerang = 5, // Boomerang if the projectile's GUID is valid creature and said creature has a boomerang equipped in the right weapon slot. 17 | unk6 = 6, 18 | IronDeposit = 7, 19 | Eagle = 8, 20 | Airship = 9, 21 | Medicine = 10, 22 | }; 23 | 24 | Projectile() { 25 | guid = (uint64_t)-1; 26 | some_size_in_blocks = 1.0; 27 | visual_size = 1.0; 28 | current_time_ms_float = 0.0; 29 | some_scalar_1 = 1.0; 30 | max_time_to_live_ms_int = 5000; 31 | } 32 | 33 | uint64_t guid; 34 | LongVector3 pos; 35 | LongVector3 unk_pos; 36 | int32_t field_38; 37 | int32_t field_3C; 38 | int32_t field_40; 39 | FloatVector3 velocity; 40 | float field_50; 41 | float some_size_in_blocks; 42 | float visual_size; 43 | float some_scalar_1; 44 | int32_t field_60; 45 | uint8_t field_64; 46 | ProjectileType projectile_type; 47 | uint8_t field_6C; 48 | float current_time_ms_float; 49 | int32_t max_time_to_live_ms_int; 50 | int32_t field_78; 51 | int32_t _pad; 52 | }; 53 | } 54 | 55 | #endif // CUBE_PROJECTILE_H 56 | -------------------------------------------------------------------------------- /cube/QuestionWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "QuestionWidget.h" -------------------------------------------------------------------------------- /cube/QuestionWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_QUESTIONWIDGET_H 2 | #define CUBE_QUESTIONWIDGET_H 3 | 4 | #include "BaseWidget.h" 5 | #include "../plasma/Node.h" 6 | #include "Item.h" 7 | 8 | namespace cube { 9 | class Game; 10 | class QuestionWidget : public cube::BaseWidget { 11 | public: 12 | __int64 field_1E8; 13 | __int64 field_1F0; 14 | __int64 field_1F8; 15 | __int64 field_200; 16 | cube::Game* game; 17 | __int64 field_210; 18 | __int64 field_218; 19 | __int64 field_220; 20 | __int64 field_228; 21 | __int64 field_230; 22 | float field_238; 23 | int field_23C; 24 | char field_240; 25 | char field_241; 26 | char field_242; 27 | char field_243; 28 | char field_244; 29 | char field_245; 30 | char field_246; 31 | char field_247; 32 | char field_248; 33 | char field_249; 34 | char field_24A; 35 | char field_24B; 36 | char field_24C; 37 | char field_24D; 38 | char field_24E; 39 | char field_24F; 40 | cube::Item item; 41 | __int64 field_2F0; 42 | __int64 field_2F8; 43 | }; 44 | } 45 | 46 | static_assert(sizeof(cube::QuestionWidget) == 0x300, "cube::QuestionWidget is not the correct size."); 47 | 48 | #endif // CUBE_QUESTIONWIDGET_H 49 | -------------------------------------------------------------------------------- /cube/ResolutionInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "ResolutionInfo.h" 2 | -------------------------------------------------------------------------------- /cube/ResolutionInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_RESOLUTIONINFO_H 2 | #define CUBE_RESOLUTIONINFO_H 3 | 4 | #include 5 | #include "../common/types.h" 6 | 7 | namespace cube { 8 | class ResolutionInfo { 9 | public: 10 | int width; 11 | int height; 12 | std::map refresh_rates; //Keys are the available refresh rates, values are unknown. 13 | }; 14 | } 15 | 16 | static_assert(sizeof(cube::ResolutionInfo) == 0x18, "cube::ResolutionInfo is not the correct size."); 17 | 18 | #endif // CUBE_RESOLUTIONINFO_H 19 | -------------------------------------------------------------------------------- /cube/ServerUpdates.cpp: -------------------------------------------------------------------------------- 1 | #include "ServerUpdates.h" 2 | -------------------------------------------------------------------------------- /cube/ServerUpdates.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_SERVERUPDATES_H 2 | #define CUBE_SERVERUPDATES_H 3 | 4 | /* 5 | 6 | Most of this is ripped from CWTCore, and therefore is mostly Andoryuuta's RE work. 7 | https://github.com/CWTesseract/CWTCore 8 | https://github.com/Andoryuuta 9 | 10 | */ 11 | 12 | #include "../IDA/types.h" 13 | #include "../common/RGBA.h" 14 | #include "Projectile.h" 15 | #include "Creature.h" 16 | #include "Block.h" 17 | #include 18 | 19 | namespace cube { 20 | class ServerUpdates { 21 | public: 22 | struct SU_HitPacket 23 | { 24 | int64_t damage_from_guid; 25 | int64_t damage_to_guid; 26 | int32_t damage_value; 27 | uint8_t unk_byte_0; 28 | int32_t stun_time; 29 | int32_t some_animation_time; 30 | LongVector3 some_pos; 31 | FloatVector3 hit_dir; 32 | uint8_t unk_byte_1; 33 | uint8_t some_hit_type_byte; 34 | uint8_t unk_byte_2; 35 | uint8_t field_47; 36 | }; 37 | 38 | struct SU_SoundPacket 39 | { 40 | LongVector3 pos; 41 | int32_t sound_id; 42 | float some_float_1; 43 | float some_float_2; 44 | int64_t guid; 45 | }; 46 | 47 | struct SU_ParticlePacket 48 | { 49 | LongVector3 pos; 50 | FloatVector3 accel_maybe; 51 | FloatRGBA color; 52 | int32_t field_34; 53 | int32_t count; 54 | int32_t particle_type; 55 | int32_t field_40; 56 | int32_t _pad; 57 | }; 58 | 59 | struct SU_CubeChange 60 | { 61 | // Probably just an embedded struct, 62 | // these should match the structures in the list at 63 | // Zone.changes / Zone+0xD8. 64 | int32_t block_pos_x; 65 | int32_t block_pos_y; 66 | int32_t block_pos_z; 67 | cube::Block original_block; 68 | cube::Block new_block; 69 | int32_t field_18; 70 | int32_t _pad; 71 | }; 72 | 73 | struct SU_ProjectilePacket 74 | { 75 | // Just embeds cube::Projectile. 76 | Projectile projectile; 77 | }; 78 | 79 | struct SU_Packet5 80 | { 81 | int32_t zone_x; 82 | int32_t zone_y; 83 | int64_t field_8; 84 | int64_t field_10; 85 | }; 86 | 87 | struct SU_Packet6 88 | { 89 | int32_t zone_x; 90 | int32_t zone_y; 91 | int64_t field_8; 92 | int64_t field_10; 93 | }; 94 | 95 | struct SU_Packet7 96 | { 97 | int32_t zone_x; 98 | int32_t zone_y; 99 | }; 100 | 101 | struct SU_PickupItemPacket 102 | { 103 | int64_t guid; 104 | cube::Item unk_item; 105 | int16_t quantity; 106 | LongVector3 pos; 107 | int32_t some_flag_things; 108 | int32_t _pad; 109 | }; 110 | 111 | struct SU_Packet9 112 | { 113 | int64_t guid; 114 | int64_t guid2; 115 | }; 116 | 117 | struct SU_Packet10 118 | { 119 | int64_t guid; 120 | uint8_t field_8; 121 | uint8_t field_9; 122 | uint8_t field_A; 123 | uint8_t field_B; 124 | int32_t field_C; 125 | int32_t field_10; 126 | int64_t field_18; 127 | int32_t field_20; 128 | int32_t field_24; 129 | }; 130 | 131 | struct SU_Packet11 132 | { 133 | int64_t field_0; 134 | int64_t some_guid; 135 | int64_t field_10; 136 | }; 137 | 138 | struct SU_BuffPacket 139 | { 140 | int64_t from_guid; 141 | int64_t target_guid; 142 | cube::Creature::Buff buff; 143 | uint8_t apply_regardless_if_1; 144 | int32_t field_2C; 145 | }; 146 | 147 | struct SU_Packet13 148 | { 149 | // Might just be a guid. 150 | int32_t field_0; 151 | int32_t _pad; 152 | }; 153 | 154 | struct SU_Packet14 155 | { 156 | int64_t guid; 157 | }; 158 | 159 | struct SU_Packet15 160 | { 161 | int64_t field_0; // Is this a std::wstring? 162 | int64_t field_8; 163 | int64_t field_10; 164 | int64_t field_18; 165 | }; 166 | 167 | 168 | std::list hit_packet_list; 169 | std::list sound_packet_list; 170 | std::list particle_packet_list; 171 | std::list cube_change_list; 172 | std::list projectile_packet_list; 173 | std::list packet_list_5; 174 | std::list packet_list_6; 175 | std::list packet_list_7; 176 | std::list pickup_item_packet_list; 177 | std::list packet_list_9; 178 | std::list packet_list_10; 179 | std::list packet_list_11; 180 | std::list buff_packet_list; 181 | std::list packet_list_13; 182 | std::list packet_list_14; 183 | std::list packet_list_15; 184 | 185 | }; 186 | } 187 | #endif // CUBE_SERVERUPDATES_H 188 | -------------------------------------------------------------------------------- /cube/Speech.cpp: -------------------------------------------------------------------------------- 1 | #include "Speech.h" 2 | -------------------------------------------------------------------------------- /cube/Speech.h: -------------------------------------------------------------------------------- 1 | #ifndef SPEECH_H 2 | #define SPEECH_H 3 | #include "../IDA/types.h" 4 | #include 5 | #include 6 | 7 | #include "SpeechText.h" 8 | 9 | namespace cube { 10 | class Speech { 11 | public: 12 | virtual ~Speech(); 13 | 14 | std::map entity_type_id_map; 15 | std::map skill_type_id_map; 16 | std::map, std::wstring> specialization_type_id_map; 17 | std::map faction_type_id_map; 18 | std::map ruler_type_id_map; 19 | std::map item_identifier_map; 20 | std::map unk_map_1; 21 | std::map unk_map_2; 22 | std::map unk_map_3; 23 | std::map speech_node_map; 24 | std::map macro_node_map; 25 | std::map unk_map_4; 26 | }; 27 | } 28 | 29 | static_assert(sizeof(cube::Speech) == 0xC8, "cube::Speech is not the correct size."); 30 | 31 | #endif // SPEECH_H 32 | -------------------------------------------------------------------------------- /cube/SpeechText.cpp: -------------------------------------------------------------------------------- 1 | #include "SpeechText.h" -------------------------------------------------------------------------------- /cube/SpeechText.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_SPEECHTEXT_H 2 | #define CUBE_SPEECHTEXT_H 3 | 4 | #include "SpeechTextNode.h" 5 | #include 6 | 7 | namespace cube { 8 | class SpeechText { 9 | public: 10 | virtual ~SpeechText(); 11 | 12 | cube::SpeechTextNode* speechtextnode; 13 | __int64 field_10; 14 | __int64 field_18; 15 | __int64 field_20; 16 | std::list unk_list_0x30_node; 17 | std::list unk_list_0x40_node; 18 | }; 19 | } 20 | 21 | static_assert(sizeof(cube::SpeechText) == 0x48, "cube::SpeechText is not the correct size."); 22 | 23 | #endif // CUBE_SPEECHTEXT_H 24 | -------------------------------------------------------------------------------- /cube/SpeechTextNode.cpp: -------------------------------------------------------------------------------- 1 | #include "SpeechTextNode.h" -------------------------------------------------------------------------------- /cube/SpeechTextNode.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_SPEECHTEXTNODE_H 2 | #define CUBE_SPEECHTEXTNODE_H 3 | 4 | #include 5 | #include 6 | 7 | namespace cube { 8 | class SpeechTextNode { 9 | public: 10 | virtual ~SpeechTextNode(); 11 | 12 | std::list field_8; 13 | std::list field_18; 14 | std::list field_28; 15 | std::list field_38; 16 | char some_char_or_bool; 17 | char pad_49; 18 | char pad_4A; 19 | char pad_4B; 20 | char pad_4C; 21 | char pad_4D; 22 | char pad_4E; 23 | char pad_4F; 24 | __int64 some_ptr_probably_list; 25 | int field_58; 26 | int field_5C; 27 | std::wstring some_string; 28 | cube::SpeechTextNode* speechtextnode; 29 | std::list unk_list_0x18_node; 30 | int field_98; 31 | int pad_9C; 32 | }; 33 | } 34 | 35 | static_assert(sizeof(cube::SpeechTextNode) == 0xA0, "cube::SpeechTextNode is not the correct size."); 36 | 37 | #endif // CUBE_SPEECHTEXTNODE_H 38 | -------------------------------------------------------------------------------- /cube/SpeechWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "SpeechWidget.h" -------------------------------------------------------------------------------- /cube/SpeechWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_SPEECHWIDGET_H 2 | #define CUBE_SPEECHWIDGET_H 3 | 4 | #include "BaseWidget.h" 5 | #include "Item.h" 6 | #include 7 | #include 8 | #include "../common/RGBA.h" 9 | #include "../plasma/Node.h" 10 | 11 | 12 | namespace cube { 13 | class Game; 14 | class SpeechWidget : public cube::BaseWidget { 15 | public: 16 | class Dialog // Start of cube::SpeechWidget::Dialog 17 | { 18 | public: 19 | class Phrase // Start of cube::SpeechWidget::Dialog::Phrase 20 | { 21 | public: 22 | std::wstring text; 23 | FloatRGBA color; 24 | }; // End of cube::SpeechWidget::Dialog::Phrase 25 | 26 | std::list phrases; 27 | __int64 field_10; 28 | __int64 field_18; 29 | __int64 field_20; 30 | __int64 field_28; 31 | __int64 field_30; 32 | __int64 field_38; 33 | __int64 field_40; 34 | __int64 field_48; 35 | __int64 field_50; 36 | __int64 field_58; 37 | __int64 field_60; 38 | __int64 field_68; 39 | __int64 field_70; 40 | __int64 field_78; 41 | __int64 field_80; 42 | __int64 field_88; 43 | __int64 field_90; 44 | __int64 field_98; 45 | __int64 field_A0; 46 | __int64 field_A8; 47 | __int64 field_B0; 48 | __int64 field_B8; 49 | __int64 field_C0; 50 | __int64 field_C8; 51 | int field_D0; 52 | int field_D4; 53 | cube::Item item; 54 | __int64 field_178; 55 | __int64 field_180; 56 | __int64 field_188; 57 | __int64 field_190; 58 | __int64 field_198; 59 | __int64 field_1A0; 60 | __int64 field_1A8; 61 | }; // End of cube::SpeechWidget::Dialog 62 | 63 | 64 | std::vector dialogs; 65 | float read_time; 66 | int dialog_index; 67 | float text_uncovered; 68 | int field_20C; 69 | __int64 field_210; 70 | __int64 field_218; 71 | cube::Item item; 72 | __int64 field_2C0; 73 | __int64 field_2C8; 74 | __int64 field_2D0; 75 | cube::Game* game; 76 | plasma::Node* speech_next; 77 | plasma::Node* speech_end; 78 | __int64 field_2F0; 79 | __int64 field_2F8; 80 | }; 81 | } 82 | 83 | static_assert(sizeof(cube::SpeechWidget) == 0x300, "cube::SpeechWidget is not the correct size."); 84 | static_assert(sizeof(cube::SpeechWidget::Dialog) == 0x1B0, "cube::SpeechWidget::Dialog is not the correct size."); 85 | 86 | #endif // CUBE_SPEECHWIDGET_H 87 | -------------------------------------------------------------------------------- /cube/Spirit.cpp: -------------------------------------------------------------------------------- 1 | #include "Spirit.h" 2 | -------------------------------------------------------------------------------- /cube/Spirit.h: -------------------------------------------------------------------------------- 1 | #ifndef SPIRIT_H 2 | #define SPIRIT_H 3 | 4 | namespace cube { 5 | class Spirit { 6 | public: 7 | char x; 8 | char y; 9 | char z; 10 | char material; 11 | }; 12 | } 13 | 14 | #endif // SPIRIT_H 15 | -------------------------------------------------------------------------------- /cube/Sprite.cpp: -------------------------------------------------------------------------------- 1 | #include "Sprite.h" 2 | -------------------------------------------------------------------------------- /cube/Sprite.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_SPRITE_H 2 | #define CUBE_SPRITE_H 3 | 4 | #include "../IDA/types.h" 5 | #include "../gfx/D3D11Graphics.h" 6 | #include "../gfx/D3D11VertexBuffer.h" 7 | #include "../gfx/D3D11IndexBuffer.h" 8 | #include 9 | #include 10 | 11 | namespace cube { 12 | class Sprite { 13 | public: 14 | class UnkSubstruct { 15 | public: 16 | __int64 field_0; 17 | __int64 field_8; 18 | __int64 field_10; 19 | }; 20 | 21 | virtual ~Sprite(); 22 | 23 | cube::Sprite::UnkSubstruct struct_array[3]; 24 | std::map unk_map_size_0x38; 25 | gfx::D3D11Graphics* gfx_D3D11graphics; 26 | __int64 field_68; 27 | gfx::D3D11VertexBuffer* gfx_D3D11VertexBuffer; 28 | gfx::D3D11IndexBuffer* gfx_D3D11IndexBuffer; 29 | unsigned int field_80; 30 | unsigned int field_84; 31 | int something_with_offset_1; 32 | int something_with_offset_2; 33 | int lowering_this_makes_plants_go_fast; 34 | int field_94; 35 | __int64 field_98; 36 | __int64 field_A0; 37 | }; 38 | 39 | } 40 | 41 | static_assert(sizeof(cube::Sprite) == 0xA8, "cube::Sprite is not the correct size."); 42 | 43 | #endif // CUBE_SPRITE_H 44 | -------------------------------------------------------------------------------- /cube/SpriteManager.cpp: -------------------------------------------------------------------------------- 1 | #include "SpriteManager.h" 2 | -------------------------------------------------------------------------------- /cube/SpriteManager.h: -------------------------------------------------------------------------------- 1 | #ifndef SPRITEMANAGER_H 2 | #define SPRITEMANAGER_H 3 | 4 | #include "../IDA/types.h" 5 | #include 6 | #include "../gfx/D3D11Graphics.h" 7 | #include "Sprite.h" 8 | #include 9 | 10 | namespace cube { 11 | class SpriteManager { 12 | public: 13 | virtual ~SpriteManager(); 14 | 15 | gfx::D3D11Graphics* gfx_D3D11Graphics; 16 | std::vector sprites; 17 | std::map unk_map_node_size_0x30; 18 | std::vector environment_sprites; 19 | std::vector building_part_sprites; 20 | std::vector cage_sprites; 21 | }; 22 | } 23 | 24 | static_assert(sizeof(cube::SpriteManager) == 0x80, "cube::SpriteManager is not the correct size."); 25 | 26 | #endif // SPRITEMANAGER_H 27 | -------------------------------------------------------------------------------- /cube/SpriteWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "SpriteWidget.h" -------------------------------------------------------------------------------- /cube/SpriteWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_SPRITEWIDGET_H 2 | #define CUBE_SPRITEWIDGET_H 3 | 4 | #include "BaseWidget.h" 5 | #include "Item.h" 6 | 7 | 8 | // If the item's category is 0, it will try to use the sprite pointer instead. 9 | // This seems to be an unused feature in the actual game? Sprite pointer is always null. 10 | namespace cube { 11 | class Game; 12 | class Sprite; 13 | class SpriteWidget : public cube::BaseWidget { 14 | public: 15 | cube::Sprite* sprite; 16 | __int64 field_1F0; 17 | cube::Item item; 18 | cube::Game* game; 19 | }; 20 | } 21 | 22 | static_assert(sizeof(cube::SpriteWidget) == 0x2A0, "cube::SpriteWidget is not the correct size."); 23 | 24 | #endif // CUBE_SPRITEWIDGET_H 25 | -------------------------------------------------------------------------------- /cube/SystemWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "SystemWidget.h" -------------------------------------------------------------------------------- /cube/SystemWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_SYSTEMWIDGET_H 2 | #define CUBE_SYSTEMWIDGET_H 3 | 4 | #include "BaseWidget.h" 5 | #include "../plasma/Node.h" 6 | 7 | 8 | namespace cube { 9 | class Game; 10 | class SystemWidget : public cube::BaseWidget { 11 | public: 12 | cube::Game* game; 13 | int hovered_button_index; 14 | int field_1F4; 15 | }; 16 | } 17 | 18 | static_assert(sizeof(cube::SystemWidget) == 0x1F8, "cube::SystemWidget is not the correct size."); 19 | 20 | #endif // CUBE_SYSTEMWIDGET_H 21 | -------------------------------------------------------------------------------- /cube/TextFX.cpp: -------------------------------------------------------------------------------- 1 | #include "TextFX.h" 2 | 3 | cube::TextFX::TextFX() { 4 | distance_to_fall = -100.0; 5 | field_60 = 0; 6 | animation_length = 1000; 7 | size = 16.0; 8 | } -------------------------------------------------------------------------------- /cube/TextFX.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_TEXTFX_H 2 | #define CUBE_TEXTFX_H 3 | 4 | #include "../common/Vector3.h" 5 | #include "../common/Vector2.h" 6 | #include "../common/RGBA.h" 7 | 8 | #include 9 | 10 | namespace cube { 11 | class TextFX { 12 | public: 13 | int animation_time; 14 | float distance_to_fall; 15 | LongVector3 position; 16 | FloatVector2 offset_2d; 17 | FloatRGBA color; 18 | std::wstring text; 19 | int animation_length; 20 | float size; 21 | int field_60; 22 | //plus 4 bytes padding 23 | 24 | TextFX(); 25 | }; 26 | } 27 | 28 | static_assert(sizeof(cube::TextFX) == 0x68, "cube::TextFX is not the correct size."); 29 | 30 | #endif // CUBE_TEXTFX_H 31 | -------------------------------------------------------------------------------- /cube/VoxelWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "VoxelWidget.h" -------------------------------------------------------------------------------- /cube/VoxelWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_VOXELWIDGET_H 2 | #define CUBE_VOXELWIDGET_H 3 | 4 | #include "BaseWidget.h" 5 | #include "../plasma/Node.h" 6 | #include "ItemStack.h" 7 | #include "../common/Vector3.h" 8 | #include 9 | 10 | namespace cube { 11 | class Game; 12 | class VoxelWidget : public cube::BaseWidget { 13 | public: 14 | FloatVector3 rotation; 15 | int field_1F4; 16 | std::vector available_customizations; 17 | int selected_upgrade_index; 18 | cube::Item selected_upgrade_item; 19 | int field_2B4; 20 | cube::Game* game; 21 | int selected_item_index; 22 | int hovered_item_index; 23 | IntVector3 voxel_placement_position; 24 | int field_2D4; 25 | int hovered_upgrade_index; 26 | cube::Item preview_upgrade_item; 27 | bool holding_placed_upgrade; 28 | char field_37D; 29 | char field_37E; 30 | char field_37F; 31 | IntVector3 upgrade_pickup_location; 32 | BYTE upgrade_pickup_material; 33 | char field_38D; 34 | char field_38E; 35 | char field_38F; 36 | }; 37 | } 38 | 39 | static_assert(sizeof(cube::VoxelWidget) == 0x390, "cube::VoxelWidget is not the correct size."); 40 | 41 | #endif // CUBE_VOXELWIDGET_H 42 | -------------------------------------------------------------------------------- /cube/World.cpp: -------------------------------------------------------------------------------- 1 | #include "World.h" 2 | #include "Zone.h" 3 | #include "constants.h" 4 | #include "../common/Vector3.h" 5 | #include "../cwsdk.h" 6 | 7 | cube::Zone* cube::World::GetZone(IntVector2 position) { 8 | try { 9 | return this->zones.at(position); 10 | } 11 | catch (const std::out_of_range & oor) { 12 | return nullptr; 13 | } 14 | 15 | } 16 | cube::Zone* cube::World::GetZone(int x, int y) { 17 | IntVector2 position(x, y); 18 | return this->GetZone(position); 19 | } 20 | void cube::World::SetBlock(LongVector3 block_pos, Block block, bool update) { 21 | IntVector2 zonePos = cube::Zone::ZoneCoordsFromBlocks(block_pos.x, block_pos.y); 22 | cube::Zone* zone = this->GetZone(zonePos); 23 | if (!zone) return; 24 | IntVector3 zoneBlockPos(pymod(block_pos.x, cube::BLOCKS_PER_ZONE), pymod(block_pos.y, cube::BLOCKS_PER_ZONE), block_pos.z); 25 | zone->SetBlock(zoneBlockPos, block, update); 26 | 27 | LongVector3 blockInZonePos = LongVector3(pymod(block_pos.x, cube::BLOCKS_PER_ZONE), pymod(block_pos.y, cube::BLOCKS_PER_ZONE), block_pos.z); 28 | 29 | if (update) { 30 | //Update adjacent chunks if needed 31 | if (blockInZonePos.x == 0) { 32 | zone = this->GetZone(IntVector2(zonePos.x - 1, zonePos.y)); 33 | if (zone) zone->chunk.Remesh(); 34 | } else if (blockInZonePos.x == cube::BLOCKS_PER_ZONE - 1) { 35 | zone = this->GetZone(IntVector2(zonePos.x + 1, zonePos.y)); 36 | if (zone) zone->chunk.Remesh(); 37 | } 38 | 39 | 40 | if (blockInZonePos.y == 0) { 41 | zone = this->GetZone(IntVector2(zonePos.x, zonePos.y - 1)); 42 | if (zone) zone->chunk.Remesh(); 43 | } 44 | else if (blockInZonePos.y == cube::BLOCKS_PER_ZONE - 1) { 45 | zone = this->GetZone(IntVector2(zonePos.x, zonePos.y + 1)); 46 | if (zone) zone->chunk.Remesh(); 47 | } 48 | } 49 | 50 | 51 | 52 | } 53 | cube::Block* cube::World::GetBlock(LongVector3 block_pos) { 54 | IntVector2 zonePos = cube::Zone::ZoneCoordsFromBlocks(block_pos.x, block_pos.y); 55 | cube::Zone* zone = this->GetZone(zonePos); 56 | if (!zone) return nullptr; 57 | IntVector3 zoneBlockPos(pymod(block_pos.x, cube::BLOCKS_PER_ZONE), pymod(block_pos.y, cube::BLOCKS_PER_ZONE), block_pos.z); 58 | 59 | return zone->GetBlock(zoneBlockPos); 60 | } 61 | 62 | cube::Block cube::World::GetBlockInterpolated(LongVector3 block_pos) { 63 | IntVector2 zonePos = cube::Zone::ZoneCoordsFromBlocks(block_pos.x, block_pos.y); 64 | cube::Zone* zone = this->GetZone(zonePos); 65 | 66 | if (!zone) { 67 | cube::Block block; 68 | block.red = 255; 69 | block.green = 255; 70 | block.blue = 255; 71 | block.field_3 = 0; 72 | block.type = cube::Block::Air; 73 | block.breakable = 0; 74 | return block; 75 | } 76 | IntVector3 zoneBlockPos(pymod(block_pos.x, cube::BLOCKS_PER_ZONE), pymod(block_pos.y, cube::BLOCKS_PER_ZONE), block_pos.z); 77 | 78 | return zone->GetBlockInterpolated(zoneBlockPos); 79 | } 80 | 81 | cube::Block* cube::World::GetBlock(uint64_t block_x, uint64_t block_y, uint64_t block_z) { 82 | LongVector3 position(block_x, block_y, block_z); 83 | return this->GetBlock(position); 84 | } 85 | 86 | cube::Block cube::World::GetBlockInterpolated(uint64_t block_x, uint64_t block_y, uint64_t block_z) { 87 | LongVector3 position(block_x, block_y, block_z); 88 | return this->GetBlockInterpolated(position); 89 | } 90 | 91 | void cube::World::LockZones() { 92 | EnterCriticalSection(&this->zones_critical_section); 93 | } 94 | void cube::World::UnlockZones() { 95 | LeaveCriticalSection(&this->zones_critical_section); 96 | } 97 | 98 | void cube::World::SetTime(float ms) { 99 | this->state.time = ms; 100 | } 101 | void cube::World::SetTime(int ms) { 102 | this->state.time = (float)ms; 103 | } 104 | void cube::World::SetTime(int hour, int minute) { 105 | this->state.time = (float)((hour * 60 * 60 * 1000) + (minute * 60 * 1000)); 106 | } 107 | float cube::World::GetTime() { 108 | return this->state.time; 109 | } -------------------------------------------------------------------------------- /cube/World.h: -------------------------------------------------------------------------------- 1 | #ifndef WORLD_H 2 | #define WORLD_H 3 | 4 | #include 5 | #include "Database.h" 6 | #include 7 | #include "../IDA/types.h" 8 | #include 9 | #include 10 | #include 11 | #include "SpriteManager.h" 12 | #include "ServerUpdates.h" 13 | #include "../common/Vector2.h" 14 | #include "../common/Vector3.h" 15 | #include "Block.h" 16 | #include "Projectile.h" 17 | 18 | namespace cube { 19 | class Creature; 20 | class Zone; 21 | class World { 22 | public: 23 | class WorldState { 24 | public: 25 | int day; 26 | float time; 27 | std::map some_map_size_0x88; // zone states. 28 | std::map some_map_size_0x28; // dead creatures. 29 | std::map some_map_size_0x28_1; // dropped rewards. 30 | }; 31 | 32 | class AIManager 33 | { 34 | public: 35 | World* world; 36 | std::map AIs; 37 | }; 38 | 39 | class UnkVectors { 40 | public: 41 | cube::World* world; 42 | std::vector unk_vec_0; 43 | std::vector unk_vec_1; 44 | std::vector unk_vec_2; 45 | }; 46 | 47 | virtual ~World(); 48 | 49 | cube::World::WorldState state; 50 | std::list creatures; 51 | std::list unk_list_size_0x18; 52 | std::list projectiles; 53 | cube::SpriteManager* spritemanager; 54 | cube::World::AIManager AI_manager; 55 | cube::ServerUpdates server_updates; 56 | std::map unk_map_0x190; 57 | std::map unk_map_0x1A0; 58 | cube::World::UnkVectors unk_vectors; 59 | std::string world_name; 60 | int seed; 61 | int seeded_rand_buf_0[4]; 62 | int seeded_rand_buf_1[4]; 63 | int seeded_rand_2[1]; 64 | int seeded_rand_buf_3[20]; 65 | int seeded_rand_buf_4[2]; 66 | int seeded_rand_buf_5[2]; 67 | int seeded_rand_buf_6[2]; 68 | int seeded_rand_buf_7[2]; 69 | int seeded_rand_buf_8[8]; 70 | int seeded_rand_buf_9[6]; 71 | int seeded_rand_buf_10[6]; 72 | int seeded_rand_buf_11[10]; 73 | int seeded_rand_buf_12[4]; 74 | int seeded_rand_buf_13[2]; 75 | int seeded_rand_buf_14[2]; 76 | int seeded_rand_buf_15[2]; 77 | __int64 field_358; 78 | std::vector unk_vec_0x360; 79 | std::map unk_map_0x378; 80 | std::vector field_388; 81 | std::vector field_3A0; 82 | cube::Database world_db_database; 83 | CRITICAL_SECTION zones_mesh_critical_section; 84 | CRITICAL_SECTION zones_critical_section; 85 | CRITICAL_SECTION critical_section_2; 86 | __int64 field_440; 87 | cube::Creature* local_creature; 88 | std::map id_to_creature_map; 89 | std::unordered_map zones; 90 | std::vector field_4A0; 91 | std::vector field_4B8; 92 | std::vector field_4D0; 93 | std::vector field_4E8; 94 | std::vector field_500; 95 | std::vector field_518; 96 | std::vector field_530; 97 | 98 | 99 | // Methods 100 | cube::Zone* GetZone(IntVector2 position); 101 | cube::Zone* GetZone(int x, int y); 102 | void SetBlock(LongVector3 block_pos, Block block, bool update=true); 103 | cube::Block* GetBlock(LongVector3 block_pos); 104 | cube::Block* GetBlock(uint64_t block_x, uint64_t block_y, uint64_t block_z); 105 | cube::Block GetBlockInterpolated(uint64_t block_x, uint64_t block_y, uint64_t block_z); 106 | cube::Block GetBlockInterpolated(LongVector3 block_pos); 107 | void LockZones(); 108 | void UnlockZones(); 109 | void SetTime(float ms); 110 | void SetTime(int ms); 111 | void SetTime(int hour, int minute); 112 | float GetTime(); 113 | }; 114 | } 115 | 116 | static_assert(sizeof(cube::World) == 0x548, "cube::World is not the correct size."); 117 | 118 | #endif // WORLD_H 119 | -------------------------------------------------------------------------------- /cube/WorldMap.cpp: -------------------------------------------------------------------------------- 1 | #include "WorldMap.h" 2 | -------------------------------------------------------------------------------- /cube/WorldMap.h: -------------------------------------------------------------------------------- 1 | #ifndef WORLDMAP_H 2 | #define WORLDMAP_H 3 | 4 | #include "../IDA/types.h" 5 | #include 6 | #include "World.h" 7 | #include "../common/Vector3.h" 8 | #include "../plasma/D3D11Engine.h" 9 | 10 | namespace cube { 11 | class WorldMap { 12 | public: 13 | virtual ~WorldMap(); 14 | 15 | cube::World* world; 16 | plasma::D3D11Engine* d3d11engine; 17 | __int64 field_18; 18 | __int64 field_20; 19 | __int64 field_28; 20 | __int64 field_30; 21 | __int64 field_38; 22 | __int64 field_40; 23 | __int64 field_48; 24 | __int64 field_50; 25 | FloatVector3 rotation; 26 | int field_64; 27 | __int64 field_68; 28 | __int64 field_70; 29 | __int64 field_78; 30 | __int64 field_80; 31 | __int64 field_88; 32 | __int64 field_90; 33 | __int64 field_98; 34 | __int64 field_A0; 35 | __int64 field_A8; 36 | __int64 field_B0; 37 | __int64 field_B8; 38 | __int64 field_C0; 39 | int field_C8; 40 | _BYTE gapCC[52]; 41 | LongVector3 cursor_position; 42 | __int64 field_118; 43 | __int64 field_120; 44 | __int64 field_128; 45 | __int64 field_130; 46 | __int64 field_138; 47 | __int64 field_140; 48 | __int64 field_148; 49 | int field_150; 50 | int field_154; 51 | int field_158; 52 | int field_15C; 53 | int field_160; 54 | char flightmaster_mode; 55 | char field_165; 56 | char field_166; 57 | char field_167; 58 | char field_168; 59 | char field_169; 60 | char field_16A; 61 | char field_16B; 62 | char field_16C; 63 | char field_16D; 64 | char field_16E; 65 | char field_16F; 66 | __int64 field_170; 67 | __int64 field_178; 68 | __int64 field_180; 69 | __int64 field_188; 70 | __int64 field_190; 71 | __int64 field_198; 72 | CRITICAL_SECTION critical_section_0; 73 | CRITICAL_SECTION critical_section_1; 74 | }; 75 | } 76 | 77 | static_assert(sizeof(cube::WorldMap) == 0x1F0, "cube::WorldMap is not the correct size."); 78 | 79 | #endif // WORLDMAP_H 80 | -------------------------------------------------------------------------------- /cube/XAudio2Engine.cpp: -------------------------------------------------------------------------------- 1 | #include "XAudio2Engine.h" 2 | -------------------------------------------------------------------------------- /cube/XAudio2Engine.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_XAUDIO2ENGINE_H 2 | #define CUBE_XAUDIO2ENGINE_H 3 | 4 | #include "../IDA/types.h" 5 | #include "Music.h" 6 | 7 | namespace cube { 8 | class XAudio2Engine { 9 | public: 10 | virtual ~XAudio2Engine(); 11 | 12 | void* ppXAudio2; 13 | __int64 field_10; 14 | __int64 field_18; 15 | __int64 field_20; 16 | __int64 field_28; 17 | __int64 field_30; 18 | __int64 field_38; 19 | __int64 field_40; 20 | cube::Music* music1; 21 | cube::Music* music2; 22 | __int64 field_58; 23 | int field_60; 24 | int field_64; 25 | }; 26 | } 27 | 28 | static_assert(sizeof(cube::XAudio2Engine) == 0x68, "cube::XAudio2Engine is not the correct size."); 29 | 30 | #endif // CUBE_XAUDIO2ENGINE_H 31 | -------------------------------------------------------------------------------- /cube/Zone.cpp: -------------------------------------------------------------------------------- 1 | #include "Zone.h" 2 | #include "../cwsdk.h" 3 | #include "Block.h" 4 | 5 | IntVector2 cube::Zone::ZoneCoordsFromDots(LongVector3 position) { 6 | int zone_x = pydiv(pydiv(position.x, cube::DOTS_PER_BLOCK), cube::BLOCKS_PER_ZONE); 7 | int zone_y = pydiv(pydiv(position.y, cube::DOTS_PER_BLOCK), cube::BLOCKS_PER_ZONE); 8 | return IntVector2(zone_x, zone_y); 9 | } 10 | 11 | IntVector2 cube::Zone::ZoneCoordsFromBlocks(int64_t x, int64_t y) { 12 | int zone_x = pydiv(x, cube::BLOCKS_PER_ZONE); 13 | int zone_y = pydiv(y, cube::BLOCKS_PER_ZONE); 14 | return IntVector2(zone_x, zone_y); 15 | } 16 | void cube::Zone::SetBlock(IntVector3 zone_position, cube::Block block, bool update) { 17 | // NOTE: Setting chunk.needs_remesh too often can cause a heap corruption during the rendering process. 18 | // I haven't figured out a solution to this yet, aside from performing the action on the same thread as the chunk remesh 19 | 20 | int fieldIndex = zone_position.x * cube::BLOCKS_PER_ZONE + zone_position.y; 21 | cube::Field* field = &this->fields[fieldIndex]; 22 | 23 | int block_index = zone_position.z - field->base_z; 24 | int end_z = field->base_z + field->blocks.size(); 25 | 26 | if (zone_position.z >= end_z) { //Too high 27 | block_index = zone_position.z - field->base_z; 28 | 29 | int old_count = field->blocks.size(); 30 | field->blocks.resize(block_index + 1); 31 | int new_count = field->blocks.size(); 32 | 33 | void* start_air = &field->blocks[old_count]; 34 | int air_size = (new_count - old_count) * sizeof(cube::Block); 35 | memset(start_air, 0, air_size); 36 | 37 | field->blocks[block_index] = block; 38 | } 39 | else if (zone_position.z < field->base_z) { //Too low 40 | int old_size = field->blocks.size() * sizeof(cube::Block); 41 | char* tmp_blocks = new char[old_size]; 42 | memcpy(tmp_blocks, &field->blocks[0], old_size); 43 | 44 | int difference = field->base_z - zone_position.z; 45 | 46 | // Get interpolated blocks for those which are being created below base z 47 | cube::Block* filler_blocks = new cube::Block[difference]; 48 | IntVector3 fill_location = zone_position; 49 | for (int i = 0; i < difference; i++) { 50 | filler_blocks[i] = this->GetBlockInterpolated(fill_location); 51 | fill_location.z++; 52 | } 53 | 54 | int required_blocks = field->blocks.size() + difference; 55 | 56 | field->blocks.resize(required_blocks); 57 | 58 | //memset(&field->blocks[0], 0, difference * sizeof(cube::Block)); //Air 59 | 60 | memcpy(&field->blocks[0], filler_blocks, difference * sizeof(cube::Block)); 61 | memcpy(&field->blocks[difference], tmp_blocks, old_size); 62 | 63 | 64 | field->blocks[0] = block; 65 | 66 | field->base_z -= difference; 67 | 68 | delete[] tmp_blocks; 69 | delete[] filler_blocks; 70 | } 71 | else { 72 | int block_index = zone_position.z - field->base_z; 73 | field->blocks[block_index] = block; 74 | } 75 | 76 | if (update) { 77 | this->chunk.Remesh(); 78 | } 79 | } 80 | 81 | cube::Block* cube::Zone::GetBlock(IntVector3 zone_position) { 82 | int fieldIndex = zone_position.x * cube::BLOCKS_PER_ZONE + zone_position.y; 83 | cube::Field* field = &this->fields[fieldIndex]; 84 | if (zone_position.z < field->base_z) { 85 | return nullptr; 86 | } 87 | 88 | int block_index = zone_position.z - field->base_z; 89 | 90 | if (block_index >= field->blocks.size()) { 91 | return nullptr; 92 | } 93 | 94 | return &field->blocks[block_index]; 95 | } 96 | 97 | cube::Block cube::Zone::GetBlockInterpolated(IntVector3 zone_position) { 98 | int fieldIndex = zone_position.x * cube::BLOCKS_PER_ZONE + zone_position.y; 99 | cube::Field* field = &this->fields[fieldIndex]; 100 | 101 | if (zone_position.z < field->base_z) { 102 | cube::Block block; 103 | 104 | // This is how blocks below the base-z are interpolated for the renderer. It's black magic to me! 105 | int block_x_coord = this->position.x * cube::BLOCKS_PER_ZONE + zone_position.x; 106 | int block_y_coord = this->position.y * cube::BLOCKS_PER_ZONE + zone_position.y; 107 | 108 | float interpolation_x_minus_1 = ((float(*)(cube::World*, int, int))CWOffset(0x35EA0))(this->world, block_x_coord - 1, block_y_coord); 109 | float interpolation_x_plus_1 = ((float(*)(cube::World*, int, int))CWOffset(0x35EA0))(this->world, block_x_coord + 1, block_y_coord); 110 | float interpolation_y_minus_1 = ((float(*)(cube::World*, int, int))CWOffset(0x35EA0))(this->world, block_x_coord, block_y_coord - 1); 111 | float interpolation_y_plus_1 = ((float(*)(cube::World*, int, int))CWOffset(0x35EA0))(this->world, block_x_coord, block_y_coord + 1); 112 | cube::BlockProperties block_properties; 113 | ((cube::BlockProperties * (*)(cube::World*, cube::BlockProperties*, signed int, signed int, signed int, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float)) 114 | CWOffset(0x2D8E00)) 115 | (this->world, 116 | &block_properties, 117 | block_x_coord, 118 | block_y_coord, 119 | zone_position.z, 120 | field->field_8, 121 | interpolation_x_minus_1, 122 | interpolation_x_plus_1, 123 | interpolation_y_minus_1, 124 | interpolation_y_plus_1, 125 | field->field_14, 126 | field->field_C, 127 | field->field_10, 128 | field->field_28, 129 | 0.0, 130 | field->field_38, 131 | field->field_18, 132 | field->field_1C, 133 | field->field_20, 134 | field->field_30, 135 | field->field_34); 136 | ((void(*)(cube::Block*, cube::BlockProperties*))CWOffset(0xBA820))(&block, &block_properties); 137 | 138 | block.Half(block_properties); 139 | 140 | return block; 141 | } 142 | 143 | int block_index = zone_position.z - field->base_z; 144 | 145 | if (block_index >= field->blocks.size()) { 146 | // Air or water 147 | cube::Block block; 148 | block.red = 255; 149 | block.green = 255; 150 | block.blue = 255; 151 | block.field_3 = 0; 152 | block.type = (zone_position.z > 0) ? cube::Block::Type::Air : cube::Block::Type::Water; 153 | block.breakable = 0; 154 | return block; 155 | } 156 | 157 | // turn sub-0 air blocks into water 158 | cube::Block block = field->blocks[block_index]; 159 | if ( (zone_position.z <= 0) && (block.type == cube::Block::Type::Air) ) { 160 | block.type = cube::Block::Type::Water; 161 | } 162 | 163 | return block; 164 | } -------------------------------------------------------------------------------- /cube/Zone.h: -------------------------------------------------------------------------------- 1 | #ifndef ZONE_H 2 | #define ZONE_H 3 | 4 | #include "../IDA/types.h" 5 | #include "World.h" 6 | #include "Field.h" 7 | #include "../gfx/Chunk.h" 8 | #include "../common/Vector2.h" 9 | #include "../common/Vector3.h" 10 | #include "Block.h" 11 | #include 12 | 13 | namespace cube { 14 | class Zone { 15 | public: 16 | virtual ~Zone(); 17 | 18 | cube::World* world; 19 | IntVector2 position; 20 | _BYTE gap18[72]; 21 | char some_struct; 22 | _BYTE gap61[351]; 23 | gfx::Chunk chunk; 24 | _BYTE gap448[56]; 25 | std::list some_list; 26 | int field_490; 27 | int field_494; 28 | std::list some_list_2; 29 | _BYTE gap4A8[112]; 30 | cube::Field fields[4096]; 31 | 32 | 33 | // Methods 34 | static IntVector2 ZoneCoordsFromDots(LongVector3 position); 35 | static IntVector2 ZoneCoordsFromBlocks(int64_t x, int64_t y); 36 | void SetBlock(IntVector3 zone_position, cube::Block block, bool update=true); 37 | cube::Block* GetBlock(IntVector3 zone_position); 38 | cube::Block GetBlockInterpolated(IntVector3 zone_position); 39 | }; 40 | } 41 | 42 | static_assert(sizeof(cube::Zone) == 0x58518, "cube::Zone is not the correct size."); 43 | 44 | #endif // ZONE_H 45 | -------------------------------------------------------------------------------- /cube/constants.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_CONSTANTS_H 2 | #define CUBE_CONSTANTS_H 3 | namespace cube { 4 | const int DOTS_PER_BLOCK = 65536; 5 | const int BLOCKS_PER_MAP_CHUNK = 20; 6 | const int BLOCKS_PER_ZONE = 64; 7 | } 8 | #endif //CUBE_CONSTANTS_H -------------------------------------------------------------------------------- /cube/cube.cpp: -------------------------------------------------------------------------------- 1 | #include "cube.h" 2 | 3 | cube::Game* cube::GetGame() { 4 | return *(cube::Game**)(CWOffset(0x551A80)); 5 | } 6 | 7 | ID3D11Device* cube::GetID3D11Device() { 8 | return *(ID3D11Device**)(CWOffset(0x551A90)); 9 | } 10 | 11 | ID3D11DeviceContext* cube::GetID3D11DeviceContext() { 12 | return *(ID3D11DeviceContext**)(CWOffset(0x551A98)); 13 | } 14 | 15 | void* cube::GetSteamNetworkingContext() { 16 | return CWOffset(0x5314F0); 17 | } 18 | 19 | void* cube::GetSteamUserContext() { 20 | return CWOffset(0x5314C0); 21 | } 22 | 23 | void* cube::SteamInternal_ContextInit(void* context) { 24 | auto contextInitPtr = *(void**)CWOffset(0x42CD90); 25 | return *((void**(*)(void*))contextInitPtr)(context); 26 | } 27 | 28 | ISteamNetworking* cube::SteamNetworking() { 29 | return (ISteamNetworking*)cube::SteamInternal_ContextInit(cube::GetSteamNetworkingContext()); 30 | } 31 | 32 | ISteamUser* cube::SteamUser() { 33 | return (ISteamUser*)cube::SteamInternal_ContextInit(cube::GetSteamUserContext()); 34 | } -------------------------------------------------------------------------------- /cube/cube.h: -------------------------------------------------------------------------------- 1 | #ifndef CUBE_H 2 | #define CUBE_H 3 | #include "../cwsdk.h" 4 | #include "../steam/isteamnetworking.h" 5 | #include "../steam/isteamuser.h" 6 | 7 | // For data which must be gotten from cube world by offset 8 | 9 | namespace cube { 10 | class Game; 11 | cube::Game* GetGame(); 12 | ID3D11Device* GetID3D11Device(); 13 | ID3D11DeviceContext* GetID3D11DeviceContext(); 14 | 15 | void* GetSteamNetworkingContext(); 16 | void* GetSteamUserContext(); 17 | void* SteamInternal_ContextInit(void* context); 18 | ISteamNetworking* SteamNetworking(); 19 | ISteamUser* SteamUser(); 20 | } 21 | 22 | #endif // CUBE_H 23 | -------------------------------------------------------------------------------- /cwsdk.cpp: -------------------------------------------------------------------------------- 1 | #define MOD_MAJOR_VERSION 7 2 | #define MOD_MINOR_VERSION 1 3 | 4 | #include "cwsdk.h" 5 | #include 6 | 7 | void* moduleBase; 8 | 9 | void* CWBase(){ 10 | return moduleBase; 11 | } 12 | 13 | void* CWOffset(size_t offset) { 14 | return (void*)((char*)moduleBase + offset); 15 | } 16 | 17 | EXPORT void ModPreInitialize(){ 18 | moduleBase = GetModuleHandle(NULL); 19 | } 20 | 21 | EXPORT int ModMajorVersion(){ 22 | return MOD_MAJOR_VERSION; 23 | } 24 | 25 | EXPORT int ModMinorVersion(){ 26 | return MOD_MINOR_VERSION; 27 | } 28 | 29 | void WriteByte(void* location, char val){ 30 | DWORD dwOldProtection; 31 | VirtualProtect(location, 1, PAGE_EXECUTE_READWRITE, &dwOldProtection); 32 | *(char*)location = val; 33 | VirtualProtect(location, 1, dwOldProtection, &dwOldProtection); 34 | } 35 | 36 | void WriteFarJMP(void* source, void* destination) { 37 | DWORD dwOldProtection; 38 | VirtualProtect(source, 14, PAGE_EXECUTE_READWRITE, &dwOldProtection); 39 | char* location = (char*)source; 40 | 41 | // Far jump 42 | *((UINT16*)&location[0]) = 0x25FF; 43 | 44 | // mode 45 | *((UINT32*)&location[2]) = 0x00000000; 46 | 47 | *((UINT64*)&location[6]) = (UINT64)destination; 48 | 49 | VirtualProtect(location, 14, dwOldProtection, &dwOldProtection); 50 | } 51 | 52 | __declspec(noinline) void* operator new(size_t size) { 53 | return ((void*(*)(size_t))CWOffset(0x392BAC))(size); 54 | } 55 | __declspec(noinline) void* operator new[](size_t size) { 56 | return ((void*(*)(size_t))CWOffset(0x392BAC))(size); 57 | } 58 | 59 | __declspec(noinline) void operator delete(void* ptr) noexcept { 60 | ((void(*)(void*))CWOffset(0x392BE8))(ptr); 61 | } 62 | __declspec(noinline) void operator delete[](void* ptr) noexcept { 63 | ((void(*)(void*))CWOffset(0x392BE8))(ptr); 64 | } 65 | -------------------------------------------------------------------------------- /cwsdk.h: -------------------------------------------------------------------------------- 1 | #ifndef CWMODS_H 2 | #define CWMODS_H 3 | 4 | #define EXPORT extern "C" __declspec(dllexport) __declspec(noinline) 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "IDA/types.h" 12 | 13 | #include "cube/cube.h" 14 | 15 | #include "common/BytesIO.h" 16 | #include "common/ColorRGB.h" 17 | #include "common/math.h" 18 | #include "common/Matrix4.h" 19 | #include "common/RGBA.h" 20 | #include "common/types.h" 21 | #include "common/Vector2.h" 22 | #include "common/Vector3.h" 23 | 24 | #include "cube/AdaptionWidget.h" 25 | #include "cube/AI.h" 26 | #include "cube/BaseWidget.h" 27 | #include "cube/Block.h" 28 | #include "cube/BlockProperties.h" 29 | #include "cube/CharacterPreviewWidget.h" 30 | #include "cube/CharacterStyleWidget.h" 31 | #include "cube/CharacterWidget.h" 32 | #include "cube/ChatWidget.h" 33 | #include "cube/Client.h" 34 | #include "cube/Connection.h" 35 | #include "cube/Controls.h" 36 | #include "cube/ControlsWidget.h" 37 | #include "cube/Creature.h" 38 | #include "cube/Database.h" 39 | #include "cube/Field.h" 40 | #include "cube/FormulaDetailsWidget.h" 41 | #include "cube/EnchantWidget.h" 42 | #include "cube/Equipment.h" 43 | #include "cube/Game.h" 44 | #include "cube/GUI.h" 45 | #include "cube/HelpWidget.h" 46 | #include "cube/Host.h" 47 | #include "cube/Interaction.h" 48 | #include "cube/InventoryWidget.h" 49 | #include "cube/Item.h" 50 | #include "cube/ItemStack.h" 51 | #include "cube/MapOverlayWidget.h" 52 | #include "cube/MultiplayerWidget.h" 53 | #include "cube/Music.h" 54 | #include "cube/Options.h" 55 | #include "cube/OptionsWidget.h" 56 | #include "cube/PreviewWidget.h" 57 | #include "cube/Projectile.h" 58 | #include "cube/QuestionWidget.h" 59 | #include "cube/ResolutionInfo.h" 60 | #include "cube/ServerUpdates.h" 61 | #include "cube/Speech.h" 62 | #include "cube/SpeechText.h" 63 | #include "cube/SpeechTextNode.h" 64 | #include "cube/SpeechWidget.h" 65 | #include "cube/Sprite.h" 66 | #include "cube/SpriteManager.h" 67 | #include "cube/SpriteWidget.h" 68 | #include "cube/SystemWidget.h" 69 | #include "cube/TextFX.h" 70 | #include "cube/VoxelWidget.h" 71 | #include "cube/World.h" 72 | #include "cube/WorldMap.h" 73 | #include "cube/XAudio2Engine.h" 74 | #include "cube/Zone.h" 75 | #include "cube/constants.h" 76 | 77 | #include "gfx/Chunk.h" 78 | #include "gfx/ChunkBuffer.h" 79 | #include "gfx/D3D11Graphics.h" 80 | #include "gfx/D3D11Renderer.h" 81 | #include "gfx/D3D11IndexBuffer.h" 82 | #include "gfx/D3D11VertexBuffer.h" 83 | #include "gfx/Graphics.h" 84 | #include "gfx/IndexBuffer.h" 85 | #include "gfx/Renderer.h" 86 | #include "gfx/VertexBuffer.h" 87 | 88 | #include "msvc/_Thrd_t.h" 89 | 90 | #include "plasma/Attribute.h" 91 | #include "plasma/ContinuousAttribute.h" 92 | #include "plasma/D3D11Engine.h" 93 | #include "plasma/DiscreteAttribute.h" 94 | #include "plasma/Display.h" 95 | #include "plasma/Engine.h" 96 | #include "plasma/FontEngine.h" 97 | #include "plasma/Keyable.h" 98 | #include "plasma/NamedObject.h" 99 | #include "plasma/Matrix.h" 100 | #include "plasma/Node.h" 101 | #include "plasma/Object.h" 102 | #include "plasma/ObjectManager.h" 103 | #include "plasma/ScalableFont.h" 104 | #include "plasma/Transformation.h" 105 | #include "plasma/Vector.h" 106 | #include "plasma/Widget.h" 107 | 108 | #include "steam/steam_api_common.h" 109 | 110 | void* CWBase(); 111 | void* CWOffset(size_t offset); 112 | 113 | EXPORT void ModPreInitialize(); 114 | EXPORT int ModMajorVersion(); 115 | EXPORT int ModMinorVersion(); 116 | 117 | void WriteByte(void* location, char val); 118 | void WriteFarJMP(void* source, void* destination); 119 | 120 | __declspec(noinline) void* operator new(size_t size); 121 | __declspec(noinline) void* operator new[](size_t size); 122 | __declspec(noinline) void operator delete(void* ptr) noexcept; 123 | __declspec(noinline) void operator delete[](void* ptr) noexcept; 124 | 125 | class GenericMod { 126 | public: 127 | enum Priority : u8 { 128 | VeryHighPriority = 0, 129 | HighPriority = 1, 130 | NormalPriority = 2, 131 | LowPriority = 3, 132 | VeryLowPriority = 4 133 | }; 134 | 135 | virtual void Initialize() {} 136 | 137 | Priority OnChatPriority = NormalPriority; 138 | virtual int OnChat(std::wstring* message) { return 0; } 139 | 140 | Priority OnCheckInventoryFullPriority = NormalPriority; 141 | virtual int OnCheckInventoryFull(cube::Creature* player, cube::Item* item) { return 0; } 142 | 143 | Priority OnP2PRequestPriority = NormalPriority; 144 | virtual int OnP2PRequest(uint64_t steamID) { return 0; } 145 | 146 | Priority OnGameTickPriority = NormalPriority; 147 | virtual void OnGameTick(cube::Game* game) {} 148 | 149 | Priority OnZoneGeneratedPriority = NormalPriority; 150 | virtual void OnZoneGenerated(cube::Zone* zone) {} 151 | 152 | Priority OnZoneDestroyPriority = NormalPriority; 153 | virtual void OnZoneDestroy(cube::Zone* zone) {} 154 | 155 | Priority OnWindowProcPriority = NormalPriority; 156 | virtual int OnWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { return 0; } 157 | 158 | Priority OnGetKeyboardStatePriority = NormalPriority; 159 | virtual void OnGetKeyboardState(BYTE* diKeys) {} 160 | 161 | Priority OnGetMouseStatePriority = NormalPriority; 162 | virtual void OnGetMouseState(DIMOUSESTATE* diMouse) {} 163 | 164 | Priority OnPresentPriority = NormalPriority; 165 | virtual void OnPresent(IDXGISwapChain* SwapChain, UINT SyncInterval, UINT Flags) {} 166 | 167 | Priority OnCreatureArmorCalculatedPriority = NormalPriority; 168 | virtual void OnCreatureArmorCalculated(cube::Creature* creature, float* armor) {} 169 | 170 | Priority OnCreatureCriticalCalculatedPriority = NormalPriority; 171 | virtual void OnCreatureCriticalCalculated(cube::Creature* creature, float* critical) {} 172 | 173 | Priority OnCreatureAttackPowerCalculatedPriority = NormalPriority; 174 | virtual void OnCreatureAttackPowerCalculated(cube::Creature* creature, float* power) {} 175 | 176 | Priority OnCreatureSpellPowerCalculatedPriority = NormalPriority; 177 | virtual void OnCreatureSpellPowerCalculated(cube::Creature* creature, float* power) {} 178 | 179 | Priority OnCreatureHasteCalculatedPriority = NormalPriority; 180 | virtual void OnCreatureHasteCalculated(cube::Creature* creature, float* haste) {} 181 | 182 | Priority OnCreatureHPCalculatedPriority = NormalPriority; 183 | virtual void OnCreatureHPCalculated(cube::Creature* creature, float* hp) {} 184 | 185 | Priority OnCreatureResistanceCalculatedPriority = NormalPriority; 186 | virtual void OnCreatureResistanceCalculated(cube::Creature* creature, float* resistance) {} 187 | 188 | Priority OnCreatureRegenerationCalculatedPriority = NormalPriority; 189 | virtual void OnCreatureRegenerationCalculated(cube::Creature* creature, float* regeneration) {} 190 | 191 | Priority OnCreatureManaGenerationCalculatedPriority = NormalPriority; 192 | virtual void OnCreatureManaGenerationCalculated(cube::Creature* creature, float* manaGeneration) {} 193 | 194 | Priority OnChunkRemeshPriority = NormalPriority; 195 | virtual void OnChunkRemesh(cube::Zone* zone) {} 196 | 197 | Priority OnChunkRemeshedPriority = NormalPriority; 198 | virtual void OnChunkRemeshed(cube::Zone* zone) {} 199 | 200 | #include "VtablePadding.h" 201 | }; 202 | 203 | #endif // CWMODS_H 204 | -------------------------------------------------------------------------------- /gfx/Chunk.cpp: -------------------------------------------------------------------------------- 1 | #include "Chunk.h" 2 | 3 | #include 4 | 5 | void gfx::Chunk::Remesh() { 6 | remesh_time = timeGetTime(); 7 | needs_remesh = true; 8 | } -------------------------------------------------------------------------------- /gfx/Chunk.h: -------------------------------------------------------------------------------- 1 | #ifndef GFX_CHUNK_H 2 | #define GFX_CHUNK_H 3 | #include "../IDA/types.h" 4 | #include 5 | 6 | namespace gfx { 7 | class ChunkBuffer; 8 | class Chunk { 9 | public: 10 | virtual ~Chunk(); 11 | 12 | //Data members 13 | std::list chunkbuffers; 14 | std::list new_chunkbuffers; 15 | _BYTE gap28[80]; 16 | int remesh_time; 17 | bool needs_remesh; 18 | _BYTE gap7D[519]; 19 | char field_284; 20 | _BYTE gap285[2]; 21 | char end; 22 | 23 | void Remesh(); 24 | }; 25 | } 26 | 27 | 28 | static_assert(sizeof(gfx::Chunk) == 0x288, "gfx::Chunk is not the correct size."); 29 | 30 | #endif // GFX_CHUNK_H 31 | -------------------------------------------------------------------------------- /gfx/ChunkBuffer.cpp: -------------------------------------------------------------------------------- 1 | #include "Chunk.h" 2 | 3 | #include 4 | 5 | void gfx::Chunk::Remesh() { 6 | remesh_time = timeGetTime(); 7 | needs_remesh = true; 8 | } -------------------------------------------------------------------------------- /gfx/ChunkBuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef GFX_CHUNKBUFFER_H 2 | #define GFX_CHUNKBUFFER_H 3 | #include "../IDA/types.h" 4 | 5 | namespace gfx { 6 | class D3D11VertexBuffer; 7 | class D3D11IndexBuffer; 8 | class ChunkBuffer { 9 | public: 10 | virtual ~ChunkBuffer(); 11 | 12 | gfx::D3D11VertexBuffer* vertex_buffer; 13 | gfx::D3D11IndexBuffer* index_buffer; 14 | __int64 field_18; 15 | __int64 field_20; 16 | __int64 field_28; 17 | __int64 field_30; 18 | __int64 field_38; 19 | __int64 field_40; 20 | __int64 field_48; 21 | __int64 field_50; 22 | __int64 field_58; 23 | }; 24 | } 25 | 26 | 27 | static_assert(sizeof(gfx::ChunkBuffer) == 0x60, "gfx::ChunkBuffer is not the correct size."); 28 | 29 | #endif // GFX_CHUNKBUFFER_H 30 | -------------------------------------------------------------------------------- /gfx/D3D11Graphics.cpp: -------------------------------------------------------------------------------- 1 | #include "D3D11Graphics.h" 2 | -------------------------------------------------------------------------------- /gfx/D3D11Graphics.h: -------------------------------------------------------------------------------- 1 | #ifndef D3D11GRAPHICS_H 2 | #define D3D11GRAPHICS_H 3 | 4 | #include "../IDA/types.h" 5 | #include "Graphics.h" 6 | #include 7 | 8 | namespace gfx { 9 | class D3D11Graphics : public Graphics { 10 | public: 11 | virtual ~D3D11Graphics(); 12 | ID3D11Device* pDevice; 13 | ID3D11DeviceContext* pImmediateContext; 14 | }; 15 | } 16 | 17 | static_assert(sizeof(gfx::D3D11Graphics) == 0x18, "gfx::D3D11Graphics is not the correct size."); 18 | 19 | #endif // D3D11GRAPHICS_H 20 | -------------------------------------------------------------------------------- /gfx/D3D11IndexBuffer.cpp: -------------------------------------------------------------------------------- 1 | #include "D3D11IndexBuffer.h" 2 | -------------------------------------------------------------------------------- /gfx/D3D11IndexBuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef D3D11INDEXBUFFER_H 2 | #define D3D11INDEXBUFFER_H 3 | 4 | #include "../IDA/types.h" 5 | #include "IndexBuffer.h" 6 | #include 7 | 8 | namespace gfx { 9 | class D3D11IndexBuffer : public IndexBuffer { 10 | public: 11 | ID3D11DeviceContext* pImmediateContext; 12 | ID3D11Buffer* buffer; 13 | unsigned int format; 14 | int field_1C; 15 | }; 16 | } 17 | 18 | static_assert(sizeof(gfx::D3D11IndexBuffer) == 0x20, "gfx::D3D11IndexBuffer is not the correct size."); 19 | 20 | #endif // D3D11INDEXBUFFER_H 21 | -------------------------------------------------------------------------------- /gfx/D3D11Renderer.cpp: -------------------------------------------------------------------------------- 1 | #include "D3D11Renderer.h" 2 | #include "../cwsdk.h" 3 | 4 | void gfx::D3D11Renderer::RemeshZone(int x, int y) { 5 | ((void(*)(gfx::D3D11Renderer*, int, int))CWOffset(0xE9530))(this, x, y); 6 | } -------------------------------------------------------------------------------- /gfx/D3D11Renderer.h: -------------------------------------------------------------------------------- 1 | #ifndef D3D11RENDERER_H 2 | #define D3D11RENDERER_H 3 | 4 | #include "../IDA/types.h" 5 | #include "Renderer.h" 6 | 7 | namespace gfx { 8 | class D3D11Renderer : public Renderer { 9 | public: 10 | virtual ~D3D11Renderer(); 11 | 12 | _BYTE gap540[1287]; 13 | char end; 14 | 15 | void RemeshZone(int x, int y); 16 | }; 17 | } 18 | 19 | static_assert(sizeof(gfx::D3D11Renderer) == 0xA48, "gfx::D3D11Renderer is not the correct size."); 20 | 21 | #endif // D3D11RENDERER_H 22 | -------------------------------------------------------------------------------- /gfx/D3D11VertexBuffer.cpp: -------------------------------------------------------------------------------- 1 | #include "D3D11VertexBuffer.h" 2 | -------------------------------------------------------------------------------- /gfx/D3D11VertexBuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef D3D11VERTEXBUFFER_H 2 | #define D3D11VERTEXBUFFER_H 3 | 4 | #include "../IDA/types.h" 5 | #include "VertexBuffer.h" 6 | #include 7 | 8 | namespace gfx { 9 | class D3D11VertexBuffer : public VertexBuffer { 10 | public: 11 | virtual ~D3D11VertexBuffer(); 12 | 13 | ID3D11DeviceContext* pImmediateContext; 14 | ID3D11Buffer* buffer; 15 | }; 16 | } 17 | 18 | static_assert(sizeof(gfx::D3D11VertexBuffer) == 0x18, "gfx::D3D11VertexBuffer is not the correct size."); 19 | 20 | #endif // D3D11VERTEXBUFFER_H 21 | -------------------------------------------------------------------------------- /gfx/Graphics.cpp: -------------------------------------------------------------------------------- 1 | #include "Graphics.h" 2 | -------------------------------------------------------------------------------- /gfx/Graphics.h: -------------------------------------------------------------------------------- 1 | #ifndef GFX_GRAPHICS_H 2 | #define GFX_GRAPHICS_H 3 | 4 | #include "../IDA/types.h" 5 | 6 | namespace gfx { 7 | class Graphics { 8 | public: 9 | virtual ~Graphics(); 10 | }; 11 | } 12 | 13 | static_assert(sizeof(gfx::Graphics) == 0x8, "gfx::Graphics is not the correct size."); 14 | 15 | #endif // GFX_GRAPHICS_H 16 | -------------------------------------------------------------------------------- /gfx/IndexBuffer.cpp: -------------------------------------------------------------------------------- 1 | #include "IndexBuffer.h" 2 | -------------------------------------------------------------------------------- /gfx/IndexBuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef INDEXBUFFER_H 2 | #define INDEXBUFFER_H 3 | 4 | #include "../IDA/types.h" 5 | 6 | namespace gfx { 7 | class IndexBuffer { 8 | public: 9 | virtual ~IndexBuffer(); 10 | virtual bool IASetIndexBuffer(); 11 | }; 12 | } 13 | 14 | static_assert(sizeof(gfx::IndexBuffer) == 0x8, "gfx::IndexBuffer is not the correct size."); 15 | 16 | #endif // INDEXBUFFER_H 17 | -------------------------------------------------------------------------------- /gfx/Renderer.cpp: -------------------------------------------------------------------------------- 1 | #include "Renderer.h" 2 | -------------------------------------------------------------------------------- /gfx/Renderer.h: -------------------------------------------------------------------------------- 1 | #ifndef GFX_RENDERER_H 2 | #define GFX_RENDERER_H 3 | 4 | #include "../IDA/types.h" 5 | namespace cube { 6 | class World; 7 | } 8 | 9 | namespace gfx { 10 | class Renderer { 11 | public: 12 | virtual ~Renderer(); 13 | 14 | cube::World* world; 15 | __int64 field_10; 16 | __int64 field_18; 17 | __int64 field_20; 18 | __int64 field_28; 19 | __int64 field_30; 20 | __int64 field_38; 21 | __int64 field_40; 22 | __int64 field_48; 23 | __int64 field_50; 24 | __int64 field_58; 25 | __int64 field_60; 26 | __int64 field_68; 27 | __int64 field_70; 28 | __int64 field_78; 29 | __int64 field_80; 30 | __int64 field_88; 31 | __int64 field_90; 32 | __int64 field_98; 33 | __int64 field_A0; 34 | __int64 field_A8; 35 | __int64 field_B0; 36 | __int64 field_B8; 37 | __int64 field_C0; 38 | __int64 field_C8; 39 | __int64 field_D0; 40 | __int64 field_D8; 41 | __int64 field_E0; 42 | __int64 field_E8; 43 | __int64 field_F0; 44 | __int64 field_F8; 45 | __int64 field_100; 46 | __int64 field_108; 47 | __int64 field_110; 48 | __int64 field_118; 49 | __int64 field_120; 50 | __int64 field_128; 51 | __int64 field_130; 52 | __int64 field_138; 53 | __int64 field_140; 54 | __int64 field_148; 55 | __int64 field_150; 56 | __int64 field_158; 57 | __int64 field_160; 58 | __int64 field_168; 59 | __int64 field_170; 60 | __int64 field_178; 61 | __int64 field_180; 62 | __int64 field_188; 63 | __int64 field_190; 64 | __int64 field_198; 65 | __int64 field_1A0; 66 | __int64 field_1A8; 67 | __int64 field_1B0; 68 | __int64 field_1B8; 69 | __int64 field_1C0; 70 | __int64 field_1C8; 71 | __int64 field_1D0; 72 | __int64 field_1D8; 73 | __int64 field_1E0; 74 | __int64 field_1E8; 75 | __int64 field_1F0; 76 | __int64 field_1F8; 77 | __int64 field_200; 78 | __int64 field_208; 79 | __int64 field_210; 80 | __int64 field_218; 81 | __int64 field_220; 82 | __int64 field_228; 83 | __int64 field_230; 84 | __int64 field_238; 85 | __int64 field_240; 86 | __int64 field_248; 87 | __int64 field_250; 88 | __int64 field_258; 89 | __int64 field_260; 90 | __int64 field_268; 91 | __int64 field_270; 92 | __int64 field_278; 93 | __int64 field_280; 94 | __int64 field_288; 95 | __int64 field_290; 96 | __int64 field_298; 97 | __int64 field_2A0; 98 | __int64 field_2A8; 99 | __int64 field_2B0; 100 | __int64 field_2B8; 101 | __int64 field_2C0; 102 | __int64 field_2C8; 103 | __int64 field_2D0; 104 | __int64 field_2D8; 105 | __int64 field_2E0; 106 | __int64 field_2E8; 107 | __int64 field_2F0; 108 | __int64 field_2F8; 109 | __int64 field_300; 110 | __int64 field_308; 111 | __int64 field_310; 112 | __int64 field_318; 113 | __int64 field_320; 114 | __int64 field_328; 115 | __int64 field_330; 116 | __int64 field_338; 117 | __int64 field_340; 118 | __int64 field_348; 119 | __int64 field_350; 120 | __int64 field_358; 121 | __int64 field_360; 122 | __int64 field_368; 123 | __int64 field_370; 124 | __int64 field_378; 125 | __int64 field_380; 126 | __int64 field_388; 127 | __int64 field_390; 128 | __int64 field_398; 129 | __int64 field_3A0; 130 | __int64 field_3A8; 131 | __int64 field_3B0; 132 | __int64 field_3B8; 133 | __int64 field_3C0; 134 | __int64 field_3C8; 135 | __int64 field_3D0; 136 | __int64 field_3D8; 137 | __int64 field_3E0; 138 | __int64 field_3E8; 139 | __int64 field_3F0; 140 | __int64 field_3F8; 141 | __int64 field_400; 142 | __int64 field_408; 143 | __int64 field_410; 144 | __int64 field_418; 145 | __int64 field_420; 146 | __int64 field_428; 147 | __int64 field_430; 148 | __int64 field_438; 149 | __int64 field_440; 150 | __int64 field_448; 151 | __int64 field_450; 152 | __int64 field_458; 153 | __int64 field_460; 154 | __int64 field_468; 155 | __int64 field_470; 156 | __int64 field_478; 157 | __int64 field_480; 158 | __int64 field_488; 159 | __int64 field_490; 160 | __int64 field_498; 161 | __int64 field_4A0; 162 | __int64 field_4A8; 163 | __int64 field_4B0; 164 | __int64 field_4B8; 165 | __int64 field_4C0; 166 | __int64 field_4C8; 167 | __int64 field_4D0; 168 | __int64 field_4D8; 169 | __int64 field_4E0; 170 | __int64 field_4E8; 171 | __int64 field_4F0; 172 | __int64 field_4F8; 173 | __int64 field_500; 174 | __int64 field_508; 175 | __int64 field_510; 176 | __int64 field_518; 177 | __int64 field_520; 178 | __int64 field_528; 179 | __int64 field_530; 180 | __int32 field_538; 181 | __int16 field_53C; 182 | __int8 field_53E; 183 | __int8 end; 184 | }; 185 | } 186 | 187 | static_assert(sizeof(gfx::Renderer) == 0x540, "gfx::Renderer is not the correct size."); 188 | 189 | #endif // GFX_RENDERER_H 190 | -------------------------------------------------------------------------------- /gfx/VertexBuffer.cpp: -------------------------------------------------------------------------------- 1 | #include "VertexBuffer.h" 2 | -------------------------------------------------------------------------------- /gfx/VertexBuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef VERTEXBUFFER_H 2 | #define VERTEXBUFFER_H 3 | 4 | #include "../IDA/types.h" 5 | 6 | namespace gfx { 7 | class VertexBuffer { 8 | public: 9 | virtual ~VertexBuffer(); 10 | virtual bool IASetVertexBuffers(); 11 | }; 12 | } 13 | 14 | #endif // VERTEXBUFFER_H 15 | -------------------------------------------------------------------------------- /msvc/_Thrd_t.cpp: -------------------------------------------------------------------------------- 1 | #include "_Thrd_t.h" 2 | #include "../cwsdk.h" -------------------------------------------------------------------------------- /msvc/_Thrd_t.h: -------------------------------------------------------------------------------- 1 | #ifndef MSVC__THRD_T_H 2 | #define MSVC__THRD_T_H 3 | 4 | #include 5 | 6 | namespace msvc { 7 | class _Thrd_t { 8 | public: 9 | uintptr_t _Hnd; 10 | unsigned int* _Id; 11 | }; 12 | } 13 | 14 | #endif // MSVC__THRD_T_H 15 | -------------------------------------------------------------------------------- /plasma/Array.cpp: -------------------------------------------------------------------------------- 1 | #include "Array.h" 2 | -------------------------------------------------------------------------------- /plasma/Array.h: -------------------------------------------------------------------------------- 1 | #ifndef ARRAY_H 2 | #define ARRAY_H 3 | 4 | #include "../IDA/types.h" 5 | 6 | namespace plasma { 7 | template 8 | class Array { 9 | public: 10 | T *start; 11 | T *end; 12 | T *cap; 13 | 14 | int Length() { 15 | return (this->end - this->start); 16 | } 17 | 18 | T Get(int i) { 19 | return start[i]; 20 | } 21 | 22 | void Set(int i, T x) { 23 | start[i] = x; 24 | } 25 | }; 26 | } 27 | 28 | #endif // ARRAY_H 29 | -------------------------------------------------------------------------------- /plasma/Attribute.cpp: -------------------------------------------------------------------------------- 1 | #include "Attribute.h" 2 | -------------------------------------------------------------------------------- /plasma/Attribute.h: -------------------------------------------------------------------------------- 1 | #ifndef ATTRIBUTE_H 2 | #define ATTRIBUTE_H 3 | 4 | #include "../IDA/types.h" 5 | #include 6 | 7 | namespace plasma { 8 | class Attribute { 9 | public: 10 | void* vtable; 11 | __int64 some_0x48_ptr; 12 | __int64 field_10; 13 | __int64 some_embedded_struct; 14 | __int64 field_20; 15 | __int64 field_28; 16 | __int64 field_30; 17 | int field_38; 18 | int current_frame; 19 | std::string name; 20 | __int64 field_60; 21 | __int64 field_68; 22 | }; 23 | } 24 | 25 | #endif // ATTRIBUTE_H 26 | -------------------------------------------------------------------------------- /plasma/ContinuousAttribute.cpp: -------------------------------------------------------------------------------- 1 | #include "ContinuousAttribute.h" 2 | -------------------------------------------------------------------------------- /plasma/ContinuousAttribute.h: -------------------------------------------------------------------------------- 1 | #ifndef CONTINUOUSATTRIBUTE_H 2 | #define CONTINUOUSATTRIBUTE_H 3 | 4 | #include "../IDA/types.h" 5 | #include "Attribute.h" 6 | #include 7 | 8 | namespace plasma { 9 | template 10 | class ContinuousAttribute : public plasma::Attribute { 11 | public: 12 | std::vector data; 13 | }; 14 | } 15 | 16 | #endif // CONTINUOUSATTRIBUTE_H 17 | -------------------------------------------------------------------------------- /plasma/D3D11Engine.cpp: -------------------------------------------------------------------------------- 1 | #include "D3D11Engine.h" 2 | -------------------------------------------------------------------------------- /plasma/D3D11Engine.h: -------------------------------------------------------------------------------- 1 | #ifndef D3D11ENGINE_H 2 | #define D3D11ENGINE_H 3 | 4 | #include "../IDA/types.h" 5 | #include "Engine.h" 6 | 7 | namespace plasma { 8 | class D3D11Engine : public plasma::Engine { 9 | public: 10 | char field_290[840]; 11 | }; 12 | } 13 | 14 | #endif // D3D11ENGINE_H 15 | -------------------------------------------------------------------------------- /plasma/DiscreteAttribute.cpp: -------------------------------------------------------------------------------- 1 | #include "DiscreteAttribute.h" 2 | -------------------------------------------------------------------------------- /plasma/DiscreteAttribute.h: -------------------------------------------------------------------------------- 1 | #ifndef DISCRETEATTRIBUTE_H 2 | #define DISCRETEATTRIBUTE_H 3 | 4 | #include "../IDA/types.h" 5 | #include "Attribute.h" 6 | #include 7 | 8 | namespace plasma { 9 | template 10 | class DiscreteAttribute : public plasma::Attribute { 11 | public: 12 | std::vector data; 13 | }; 14 | } 15 | 16 | #endif // DISCRETEATTRIBUTE_H 17 | -------------------------------------------------------------------------------- /plasma/Display.cpp: -------------------------------------------------------------------------------- 1 | #include "Display.h" 2 | 3 | void plasma::Display::SetVisibility(int frame, int value) { 4 | this->visibility.data.at(frame) = value; 5 | } 6 | 7 | int plasma::Display::GetVisibility(int frame) { 8 | return this->visibility.data.at(frame); 9 | } 10 | 11 | int plasma::Display::GetFrameCount() { 12 | return this->visibility.data.size(); 13 | } 14 | -------------------------------------------------------------------------------- /plasma/Display.h: -------------------------------------------------------------------------------- 1 | #ifndef DISPLAY_H 2 | #define DISPLAY_H 3 | 4 | #include "../IDA/types.h" 5 | #include "Keyable.h" 6 | #include "DiscreteAttribute.h" 7 | #include "ContinuousAttribute.h" 8 | #include "Vector.h" 9 | 10 | namespace plasma { 11 | class Display : public plasma::Keyable { 12 | public: 13 | plasma::DiscreteAttribute visibility; 14 | plasma::DiscreteAttribute clipping; 15 | plasma::ContinuousAttribute> fill; 16 | plasma::ContinuousAttribute> stroke; 17 | plasma::ContinuousAttribute blurRadius; 18 | _BYTE gap318[31]; 19 | char end; 20 | 21 | void SetVisibility(int frame, int value); 22 | int GetVisibility(int frame); 23 | int GetFrameCount(); 24 | }; 25 | } 26 | 27 | #endif // DISPLAY_H 28 | -------------------------------------------------------------------------------- /plasma/Engine.cpp: -------------------------------------------------------------------------------- 1 | #include "Engine.h" 2 | -------------------------------------------------------------------------------- /plasma/Engine.h: -------------------------------------------------------------------------------- 1 | #ifndef ENGINE_H 2 | #define ENGINE_H 3 | 4 | #include "../IDA/types.h" 5 | #include "ObjectManager.h" 6 | #include "FontEngine.h" 7 | #include 8 | #include "Node.h" 9 | #include "../common/Vector2.h" 10 | 11 | namespace plasma { 12 | class Engine : public plasma::ObjectManager { 13 | public: 14 | _BYTE gap20[40]; 15 | plasma::FontEngine* font_engine; 16 | _BYTE gap50[64]; 17 | CRITICAL_SECTION critical_section; 18 | _BYTE gapB8[24]; 19 | std::list unk_list_maybe_widgets; 20 | _BYTE gapE0[96]; 21 | plasma::Node* root_node; 22 | _BYTE gap148[40]; 23 | void* unk_ptr; 24 | __int64 field_178; 25 | FloatVector2 mouse_position; 26 | FloatVector2 previous_mouse_position; 27 | _BYTE gap190[255]; 28 | char end; 29 | }; 30 | } 31 | static_assert(sizeof(plasma::Engine) == 0x290, "plasma::Engine is not the correct size."); 32 | #endif // ENGINE_H 33 | -------------------------------------------------------------------------------- /plasma/FontEngine.cpp: -------------------------------------------------------------------------------- 1 | #include "FontEngine.h" 2 | #include "../cwsdk.h" 3 | 4 | plasma::ScalableFont* plasma::FontEngine::LoadFont(std::wstring* fileName) { 5 | return ((plasma::ScalableFont* (*)(plasma::FontEngine*, std::wstring*))CWOffset(0x34D060))(this, fileName); 6 | } -------------------------------------------------------------------------------- /plasma/FontEngine.h: -------------------------------------------------------------------------------- 1 | #ifndef PLASMA_FONTENGINE_H 2 | #define PLASMA_FONTENGINE_H 3 | 4 | #include "../IDA/types.h" 5 | #include 6 | #include 7 | 8 | namespace plasma { 9 | class D3D11Engine; 10 | class ScalableFont; 11 | class FontEngine { 12 | public: 13 | virtual ~FontEngine(); 14 | 15 | plasma::D3D11Engine* d3d11engine; 16 | __int64 field_10; 17 | __int64 field_18; 18 | __int64 field_20; 19 | __int64 field_28; 20 | __int64 field_30; 21 | __int64 field_38; 22 | __int64 field_40; 23 | CRITICAL_SECTION critical_section; 24 | 25 | 26 | plasma::ScalableFont* LoadFont(std::wstring* fileName); 27 | }; 28 | } 29 | 30 | static_assert(sizeof(plasma::FontEngine) == 0x70, "plasma::FontEngine is not the correct size."); 31 | 32 | #endif // PLASMA_FONTENGINE_H 33 | -------------------------------------------------------------------------------- /plasma/Keyable.cpp: -------------------------------------------------------------------------------- 1 | #include "Keyable.h" 2 | -------------------------------------------------------------------------------- /plasma/Keyable.h: -------------------------------------------------------------------------------- 1 | #ifndef KEYABLE_H 2 | #define KEYABLE_H 3 | 4 | #include "../IDA/types.h" 5 | #include "NamedObject.h" 6 | 7 | namespace plasma { 8 | class Keyable : public plasma::NamedObject { 9 | public: 10 | __int64 field_38; 11 | __int64 field_40; 12 | __int64 field_48; 13 | __int64 field_50; 14 | __int64 field_58; 15 | __int64 field_60; 16 | __int64 field_68; 17 | }; 18 | } 19 | 20 | #endif // KEYABLE_H 21 | -------------------------------------------------------------------------------- /plasma/Matrix.h: -------------------------------------------------------------------------------- 1 | #ifndef PLASMA_MATRIX_H 2 | #define PLASMA_MATRIX_H 3 | 4 | // based on http://www.songho.ca/opengl/gl_matrix.html 5 | 6 | #include 7 | 8 | namespace plasma { 9 | //This class has a template, but really it's only implemented for float 10 | //It only has a template to match RTTI information 11 | template 12 | class Matrix 13 | { 14 | public: 15 | // constructors 16 | Matrix(); // init with identity 17 | Matrix(const T src[16]); 18 | Matrix(T m00, T m01, T m02, T m03, // 1st column 19 | T m04, T m05, T m06, T m07, // 2nd column 20 | T m08, T m09, T m10, T m11, // 3rd column 21 | T m12, T m13, T m14, T m15);// 4th column 22 | 23 | void set(const float src[16]); 24 | void set(float m00, float m01, float m02, float m03, // 1st column 25 | float m04, float m05, float m06, float m07, // 2nd column 26 | float m08, float m09, float m10, float m11, // 3rd column 27 | float m12, float m13, float m14, float m15);// 4th column 28 | void setRow(int index, const float row[4]); 29 | 30 | const float* get() const; 31 | const float* getfloatranspose(); // return transposed matrix 32 | float getDeterminant() const; 33 | 34 | Matrix& identity(); 35 | Matrix& transpose(); // transpose itself and return reference 36 | Matrix& invert(); // check best inverse method before inverse 37 | Matrix& invertEuclidean(); // inverse of Euclidean transform matrix 38 | Matrix& invertAffine(); // inverse of affine transform matrix 39 | Matrix& invertProjective(); // inverse of projective matrix using partitioning 40 | Matrix& invertGeneral(); // inverse of generic matrix 41 | 42 | // transform matrix 43 | Matrix& translate(float x, float y, float z); // translation by (x,y,z) 44 | Matrix& rotate(float angle, float x, float y, float z); 45 | Matrix& rotateX(float angle); // rotate on X-axis with degree 46 | Matrix& rotateY(float angle); // rotate on Y-axis with degree 47 | Matrix& rotateZ(float angle); // rotate on Z-axis with degree 48 | Matrix& scale(float scale); // uniform scale 49 | Matrix& scale(float sx, float sy, float sz); // scale by (sx, sy, sz) on each axis 50 | Matrix& lookAt(float tx, float ty, float tz); // face object to the target direction 51 | Matrix& lookAt(float tx, float ty, float tz, float ux, float uy, float uz); 52 | 53 | // operators 54 | Matrix operator+(const Matrix& rhs) const; // add rhs 55 | Matrix operator-(const Matrix& rhs) const; // subtract rhs 56 | Matrix& operator+=(const Matrix& rhs); // add rhs and update this object 57 | Matrix& operator-=(const Matrix& rhs); // subtract rhs and update this object 58 | Matrix operator*(const Matrix& rhs) const; // multiplication: M3 = M1 * M2 59 | Matrix& operator*=(const Matrix& rhs); // multiplication: M1' = M1 * M2 60 | bool operator==(const Matrix& rhs) const; // exact compare, no epsilon 61 | bool operator!=(const Matrix& rhs) const; // exact compare, no epsilon 62 | float operator[](int index) const; // subscript operator v[0], v[1] 63 | float& operator[](int index); // subscript operator v[0], v[1] 64 | 65 | // friends functions 66 | friend Matrix operator-(const Matrix& m); // unary operator (-) 67 | friend Matrix operator*(float scalar, const Matrix& m); // pre-multiplication 68 | friend std::ostream& operator<<(std::ostream& os, const Matrix& m); 69 | 70 | float getCofactor(float m0, float m1, float m2, 71 | float m3, float m4, float m5, 72 | float m6, float m7, float m8) const; 73 | 74 | float m[16]; 75 | }; 76 | 77 | } 78 | 79 | #endif // PLASMA_MATRIX_H 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /plasma/NamedObject.cpp: -------------------------------------------------------------------------------- 1 | #include "NamedObject.h" 2 | -------------------------------------------------------------------------------- /plasma/NamedObject.h: -------------------------------------------------------------------------------- 1 | #ifndef NAMEDOBJECT_H 2 | #define NAMEDOBJECT_H 3 | 4 | #include "../IDA/types.h" 5 | #include "Object.h" 6 | 7 | namespace plasma { 8 | class NamedObject : public plasma::Object { 9 | public: 10 | void *field_18; 11 | __int64 field_20; 12 | __int64 field_28; 13 | __int64 field_30; 14 | }; 15 | } 16 | 17 | #endif // NAMEDOBJECT_H 18 | -------------------------------------------------------------------------------- /plasma/Node.cpp: -------------------------------------------------------------------------------- 1 | #include "Node.h" 2 | #include "../cwsdk.h" 3 | 4 | void plasma::Node::Translate(plasma::Vector<2, float>* base, plasma::Vector<2, float>* offset) { 5 | ((void(*)(plasma::Node*, plasma::Vector<2, float>*, plasma::Vector<2, float>*))CWOffset(0x334510))(this, base, offset); 6 | } 7 | void plasma::Node::Translate(float baseX, float baseY, float offsetX, float offsetY) { 8 | plasma::Vector<2, float> base; 9 | plasma::Vector<2, float> offset; 10 | base.Set(0, baseX); 11 | base.Set(1, baseY); 12 | offset.Set(0, offsetX); 13 | offset.Set(1, offsetY); 14 | this->Translate(&base, &offset); 15 | } 16 | i32 plasma::Node::Draw(u32 flags) { 17 | return ((i32(*)(plasma::Node*, u32))CWOffset(0x330B20))(this, flags); 18 | } -------------------------------------------------------------------------------- /plasma/Node.h: -------------------------------------------------------------------------------- 1 | #ifndef NODE_H 2 | #define NODE_H 3 | 4 | #include "../IDA/types.h" 5 | #include "../common/types.h" 6 | #include "NamedObject.h" 7 | #include "Vector.h" 8 | 9 | namespace plasma { 10 | class Transformation; 11 | class Display; 12 | class Widget; 13 | class Node : public plasma::NamedObject { 14 | public: 15 | __int64 field_38; 16 | plasma::Node* parent; 17 | __int64 field_48; 18 | __int64 field_50; 19 | __int64 field_58; 20 | plasma::Transformation* transformation; 21 | plasma::Display* display; 22 | plasma::Widget* widget1; 23 | plasma::Widget* widget2; 24 | __int64 field_80; 25 | __int64 field_88; 26 | __int64 field_90; 27 | __int64 field_98; 28 | __int64 field_A0; 29 | __int64 field_A8; 30 | __int64 field_B0; 31 | __int64 field_B8; 32 | __int64 field_C0; 33 | 34 | void Translate(plasma::Vector<2, float>* base, plasma::Vector<2, float>* offset); 35 | void Translate(float baseX, float baseY, float offsetX, float offsetY); 36 | i32 Draw(u32 flags); 37 | }; 38 | } 39 | 40 | #endif // NODE_H 41 | -------------------------------------------------------------------------------- /plasma/Object.cpp: -------------------------------------------------------------------------------- 1 | #include "Object.h" 2 | -------------------------------------------------------------------------------- /plasma/Object.h: -------------------------------------------------------------------------------- 1 | #ifndef OBJECT_H 2 | #define OBJECT_H 3 | 4 | #include "../IDA/types.h" 5 | 6 | namespace plasma { 7 | class D3D11Engine; 8 | class Object { 9 | public: 10 | virtual ~Object(); 11 | 12 | plasma::D3D11Engine *d3d11_engine; 13 | __int64 field_10; 14 | }; 15 | } 16 | static_assert(sizeof(plasma::Object) == 0x18, "plasma::Object is not the correct size."); 17 | #endif // OBJECT_H 18 | -------------------------------------------------------------------------------- /plasma/ObjectManager.cpp: -------------------------------------------------------------------------------- 1 | #include "ObjectManager.h" 2 | -------------------------------------------------------------------------------- /plasma/ObjectManager.h: -------------------------------------------------------------------------------- 1 | #ifndef OBJECTMANAGER_H 2 | #define OBJECTMANAGER_H 3 | 4 | #include "../IDA/types.h" 5 | 6 | namespace plasma { 7 | class ObjectManager { 8 | public: 9 | void *vtable; 10 | __int64 field_8; 11 | __int64 field_10; 12 | __int64 field_18; 13 | }; 14 | } 15 | 16 | #endif // OBJECTMANAGER_H 17 | -------------------------------------------------------------------------------- /plasma/ScalableFont.cpp: -------------------------------------------------------------------------------- 1 | #include "ScalableFont.h" 2 | -------------------------------------------------------------------------------- /plasma/ScalableFont.h: -------------------------------------------------------------------------------- 1 | #ifndef PLASMA_SCALABLEFONT_H 2 | #define PLASMA_SCALABLEFONT_H 3 | 4 | #include "../IDA/types.h" 5 | #include 6 | #include "Windows.h" 7 | 8 | namespace plasma { 9 | class D3D11Engine; 10 | class ScalableFont { 11 | public: 12 | virtual ~ScalableFont(); 13 | 14 | plasma::D3D11Engine* d3d11engine; 15 | std::wstring wstring_0; 16 | std::wstring wstring_1; 17 | std::wstring wstring_2; 18 | std::wstring wstring_3; 19 | std::wstring field_90; 20 | __int64 field_B0; 21 | int field_B8; 22 | int field_BC; 23 | float field_C0; 24 | float field_C4; 25 | __int64 field_C8; 26 | int field_D0; 27 | float field_D4; 28 | float field_D8; 29 | int field_DC; 30 | __int64 field_E0; 31 | float field_E8; 32 | float field_EC; 33 | __int64 field_F0; 34 | int field_F8; 35 | float field_FC; 36 | __int64 field_100; 37 | __int64 field_108; 38 | __int64 field_110; 39 | __int64 field_118; 40 | __int64 field_120; 41 | __int64 field_128; 42 | __int64 field_130; 43 | __int64 field_138; 44 | __int64 field_140; 45 | __int64 field_148; 46 | __int64 field_150; 47 | __int64 field_158; 48 | char some_bool; 49 | CRITICAL_SECTION critical_section; 50 | }; 51 | } 52 | 53 | static_assert(sizeof(plasma::ScalableFont) == 0x190, "plasma::ScalableFont is not the correct size."); 54 | 55 | #endif // PLASMA_SCALABLEFONT_H 56 | -------------------------------------------------------------------------------- /plasma/Transformation.cpp: -------------------------------------------------------------------------------- 1 | #include "Transformation.h" 2 | -------------------------------------------------------------------------------- /plasma/Transformation.h: -------------------------------------------------------------------------------- 1 | #ifndef PLASMA_TRANSFORMATION_H 2 | #define PLASMA_TRANSFORMATION_H 3 | 4 | #include "../IDA/types.h" 5 | #include "Keyable.h" 6 | #include "DiscreteAttribute.h" 7 | #include "ContinuousAttribute.h" 8 | #include "Vector.h" 9 | #include "Matrix.h" 10 | 11 | namespace plasma { 12 | class Transformation : public plasma::Keyable { 13 | public: 14 | plasma::ContinuousAttribute> translation; 15 | plasma::ContinuousAttribute> deformation; 16 | plasma::ContinuousAttribute> rotation; 17 | plasma::ContinuousAttribute> pivot; 18 | __int64 field_290; 19 | __int64 field_298; 20 | plasma::Matrix matrix; 21 | __int64 field_2E0; 22 | __int64 field_2E8; 23 | __int64 field_2F0; 24 | __int64 field_2F8; 25 | __int64 field_300; 26 | __int64 field_308; 27 | __int64 field_310; 28 | __int64 field_318; 29 | __int64 field_320; 30 | }; 31 | } 32 | 33 | static_assert(sizeof(plasma::Transformation) == 0x328, "plasma::Transformation is not the correct size."); 34 | 35 | #endif // PLASMA_TRANSFORMATION_H 36 | -------------------------------------------------------------------------------- /plasma/Vector.cpp: -------------------------------------------------------------------------------- 1 | #include "Vector.h" 2 | -------------------------------------------------------------------------------- /plasma/Vector.h: -------------------------------------------------------------------------------- 1 | #ifndef PLASMA_VECTOR_H 2 | #define PLASMA_VECTOR_H 3 | 4 | 5 | namespace plasma { 6 | template 7 | class Vector { 8 | public: 9 | T elements[N]; 10 | 11 | T Get(int i) { 12 | return elements[i]; 13 | } 14 | 15 | void Set(int i, T x) { 16 | elements[i] = x; 17 | } 18 | }; 19 | } 20 | 21 | #endif // PLASMA_VECTOR_H 22 | -------------------------------------------------------------------------------- /plasma/Widget.cpp: -------------------------------------------------------------------------------- 1 | #include "Widget.h" 2 | -------------------------------------------------------------------------------- /plasma/Widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include "../IDA/types.h" 5 | #include "NamedObject.h" 6 | #include "../common/Matrix4.h" 7 | 8 | namespace plasma { 9 | class Node; 10 | class Widget : public plasma::NamedObject { 11 | public: 12 | virtual void Draw(); //I don't know what controls the position where the widget gets drawn 13 | 14 | void* deformer_vtable; 15 | float scale; 16 | _BYTE gap44[20]; 17 | __int64 d3d11_render_surface_ptr; 18 | Matrix4 matrix; 19 | __int64 field_A0; 20 | _BYTE gapA8[208]; 21 | plasma::Node* node; 22 | _BYTE gap180[39]; 23 | char end; 24 | }; 25 | } 26 | 27 | static_assert(sizeof(plasma::Widget) == 0x1A8, "plasma::Widget is not the correct size."); 28 | 29 | #endif // WIDGET_H 30 | -------------------------------------------------------------------------------- /steam/isteamapplist.h: -------------------------------------------------------------------------------- 1 | //====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= 2 | // 3 | // Purpose: interface to app data in Steam 4 | // 5 | //============================================================================= 6 | 7 | #ifndef ISTEAMAPPLIST_H 8 | #define ISTEAMAPPLIST_H 9 | #ifdef _WIN32 10 | #pragma once 11 | #endif 12 | 13 | #include "steam_api_common.h" 14 | #include "steamtypes.h" 15 | 16 | //----------------------------------------------------------------------------- 17 | // Purpose: This is a restricted interface that can only be used by previously approved apps, 18 | // contact your Steam Account Manager if you believe you need access to this API. 19 | // This interface lets you detect installed apps for the local Steam client, useful for debugging tools 20 | // to offer lists of apps to debug via Steam. 21 | //----------------------------------------------------------------------------- 22 | class ISteamAppList 23 | { 24 | public: 25 | virtual uint32 GetNumInstalledApps() = 0; 26 | virtual uint32 GetInstalledApps( AppId_t *pvecAppID, uint32 unMaxAppIDs ) = 0; 27 | 28 | virtual int GetAppName( AppId_t nAppID, STEAM_OUT_STRING() char *pchName, int cchNameMax ) = 0; // returns -1 if no name was found 29 | virtual int GetAppInstallDir( AppId_t nAppID, char *pchDirectory, int cchNameMax ) = 0; // returns -1 if no dir was found 30 | 31 | virtual int GetAppBuildId( AppId_t nAppID ) = 0; // return the buildid of this app, may change at any time based on backend updates to the game 32 | }; 33 | 34 | #define STEAMAPPLIST_INTERFACE_VERSION "STEAMAPPLIST_INTERFACE_VERSION001" 35 | 36 | // Global interface accessor 37 | inline ISteamAppList *SteamAppList(); 38 | STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamAppList *, SteamAppList, STEAMAPPLIST_INTERFACE_VERSION ); 39 | 40 | // callbacks 41 | #if defined( VALVE_CALLBACK_PACK_SMALL ) 42 | #pragma pack( push, 4 ) 43 | #elif defined( VALVE_CALLBACK_PACK_LARGE ) 44 | #pragma pack( push, 8 ) 45 | #else 46 | #error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx 47 | #endif 48 | 49 | 50 | //--------------------------------------------------------------------------------- 51 | // Purpose: Sent when a new app is installed 52 | //--------------------------------------------------------------------------------- 53 | STEAM_CALLBACK_BEGIN( SteamAppInstalled_t, k_iSteamAppListCallbacks + 1 ); 54 | STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs 55 | STEAM_CALLBACK_END(1) 56 | 57 | 58 | //--------------------------------------------------------------------------------- 59 | // Purpose: Sent when an app is uninstalled 60 | //--------------------------------------------------------------------------------- 61 | STEAM_CALLBACK_BEGIN( SteamAppUninstalled_t, k_iSteamAppListCallbacks + 2 ); 62 | STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs 63 | STEAM_CALLBACK_END(1) 64 | 65 | 66 | #pragma pack( pop ) 67 | #endif // ISTEAMAPPLIST_H 68 | -------------------------------------------------------------------------------- /steam/isteamappticket.h: -------------------------------------------------------------------------------- 1 | //====== Copyright 1996-2008, Valve Corporation, All rights reserved. ======= 2 | // 3 | // Purpose: a private, but well versioned, interface to get at critical bits 4 | // of a steam3 appticket - consumed by the simple drm wrapper to let it 5 | // ask about ownership with greater confidence. 6 | // 7 | //============================================================================= 8 | 9 | #ifndef ISTEAMAPPTICKET_H 10 | #define ISTEAMAPPTICKET_H 11 | #pragma once 12 | 13 | //----------------------------------------------------------------------------- 14 | // Purpose: hand out a reasonable "future proof" view of an app ownership ticket 15 | // the raw (signed) buffer, and indices into that buffer where the appid and 16 | // steamid are located. the sizes of the appid and steamid are implicit in 17 | // (each version of) the interface - currently uin32 appid and uint64 steamid 18 | //----------------------------------------------------------------------------- 19 | class ISteamAppTicket 20 | { 21 | public: 22 | virtual uint32 GetAppOwnershipTicketData( uint32 nAppID, void *pvBuffer, uint32 cbBufferLength, uint32 *piAppId, uint32 *piSteamId, uint32 *piSignature, uint32 *pcbSignature ) = 0; 23 | }; 24 | 25 | #define STEAMAPPTICKET_INTERFACE_VERSION "STEAMAPPTICKET_INTERFACE_VERSION001" 26 | 27 | 28 | #endif // ISTEAMAPPTICKET_H 29 | -------------------------------------------------------------------------------- /steam/isteamgamecoordinator.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coremaze/CWSDK/083e67b5e301483c4a222989c046fc2041d134a8/steam/isteamgamecoordinator.h -------------------------------------------------------------------------------- /steam/isteamgameserverstats.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coremaze/CWSDK/083e67b5e301483c4a222989c046fc2041d134a8/steam/isteamgameserverstats.h -------------------------------------------------------------------------------- /steam/isteaminventory.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coremaze/CWSDK/083e67b5e301483c4a222989c046fc2041d134a8/steam/isteaminventory.h -------------------------------------------------------------------------------- /steam/isteammasterserverupdater.h: -------------------------------------------------------------------------------- 1 | #error "This file isn't used any more" 2 | -------------------------------------------------------------------------------- /steam/isteammusic.h: -------------------------------------------------------------------------------- 1 | //============ Copyright (c) Valve Corporation, All rights reserved. ============ 2 | 3 | #ifndef ISTEAMMUSIC_H 4 | #define ISTEAMMUSIC_H 5 | #ifdef _WIN32 6 | #pragma once 7 | #endif 8 | 9 | #include "steam_api_common.h" 10 | 11 | //----------------------------------------------------------------------------- 12 | // Purpose: 13 | //----------------------------------------------------------------------------- 14 | enum AudioPlayback_Status 15 | { 16 | AudioPlayback_Undefined = 0, 17 | AudioPlayback_Playing = 1, 18 | AudioPlayback_Paused = 2, 19 | AudioPlayback_Idle = 3 20 | }; 21 | 22 | 23 | //----------------------------------------------------------------------------- 24 | // Purpose: Functions to control music playback in the steam client 25 | //----------------------------------------------------------------------------- 26 | class ISteamMusic 27 | { 28 | public: 29 | virtual bool BIsEnabled() = 0; 30 | virtual bool BIsPlaying() = 0; 31 | 32 | virtual AudioPlayback_Status GetPlaybackStatus() = 0; 33 | 34 | virtual void Play() = 0; 35 | virtual void Pause() = 0; 36 | virtual void PlayPrevious() = 0; 37 | virtual void PlayNext() = 0; 38 | 39 | // volume is between 0.0 and 1.0 40 | virtual void SetVolume( float flVolume ) = 0; 41 | virtual float GetVolume() = 0; 42 | 43 | }; 44 | 45 | #define STEAMMUSIC_INTERFACE_VERSION "STEAMMUSIC_INTERFACE_VERSION001" 46 | 47 | // Global interface accessor 48 | inline ISteamMusic *SteamMusic(); 49 | STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamMusic *, SteamMusic, STEAMMUSIC_INTERFACE_VERSION ); 50 | 51 | // callbacks 52 | #if defined( VALVE_CALLBACK_PACK_SMALL ) 53 | #pragma pack( push, 4 ) 54 | #elif defined( VALVE_CALLBACK_PACK_LARGE ) 55 | #pragma pack( push, 8 ) 56 | #else 57 | #error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx 58 | #endif 59 | 60 | 61 | STEAM_CALLBACK_BEGIN( PlaybackStatusHasChanged_t, k_iSteamMusicCallbacks + 1 ) 62 | STEAM_CALLBACK_END(0) 63 | 64 | STEAM_CALLBACK_BEGIN( VolumeHasChanged_t, k_iSteamMusicCallbacks + 2 ) 65 | STEAM_CALLBACK_MEMBER( 0, float, m_flNewVolume ) 66 | STEAM_CALLBACK_END(1) 67 | 68 | #pragma pack( pop ) 69 | 70 | 71 | #endif // #define ISTEAMMUSIC_H 72 | -------------------------------------------------------------------------------- /steam/isteammusicremote.h: -------------------------------------------------------------------------------- 1 | //============ Copyright (c) Valve Corporation, All rights reserved. ============ 2 | 3 | #ifndef ISTEAMMUSICREMOTE_H 4 | #define ISTEAMMUSICREMOTE_H 5 | #ifdef _WIN32 6 | #pragma once 7 | #endif 8 | 9 | #include "steam_api_common.h" 10 | #include "isteammusic.h" 11 | 12 | #define k_SteamMusicNameMaxLength 255 13 | #define k_SteamMusicPNGMaxLength 65535 14 | 15 | 16 | class ISteamMusicRemote 17 | { 18 | public: 19 | // Service Definition 20 | virtual bool RegisterSteamMusicRemote( const char *pchName ) = 0; 21 | virtual bool DeregisterSteamMusicRemote() = 0; 22 | virtual bool BIsCurrentMusicRemote() = 0; 23 | virtual bool BActivationSuccess( bool bValue ) = 0; 24 | 25 | virtual bool SetDisplayName( const char *pchDisplayName ) = 0; 26 | virtual bool SetPNGIcon_64x64( void *pvBuffer, uint32 cbBufferLength ) = 0; 27 | 28 | // Abilities for the user interface 29 | virtual bool EnablePlayPrevious(bool bValue) = 0; 30 | virtual bool EnablePlayNext( bool bValue ) = 0; 31 | virtual bool EnableShuffled( bool bValue ) = 0; 32 | virtual bool EnableLooped( bool bValue ) = 0; 33 | virtual bool EnableQueue( bool bValue ) = 0; 34 | virtual bool EnablePlaylists( bool bValue ) = 0; 35 | 36 | // Status 37 | virtual bool UpdatePlaybackStatus( AudioPlayback_Status nStatus ) = 0; 38 | virtual bool UpdateShuffled( bool bValue ) = 0; 39 | virtual bool UpdateLooped( bool bValue ) = 0; 40 | virtual bool UpdateVolume( float flValue ) = 0; // volume is between 0.0 and 1.0 41 | 42 | // Current Entry 43 | virtual bool CurrentEntryWillChange() = 0; 44 | virtual bool CurrentEntryIsAvailable( bool bAvailable ) = 0; 45 | virtual bool UpdateCurrentEntryText( const char *pchText ) = 0; 46 | virtual bool UpdateCurrentEntryElapsedSeconds( int nValue ) = 0; 47 | virtual bool UpdateCurrentEntryCoverArt( void *pvBuffer, uint32 cbBufferLength ) = 0; 48 | virtual bool CurrentEntryDidChange() = 0; 49 | 50 | // Queue 51 | virtual bool QueueWillChange() = 0; 52 | virtual bool ResetQueueEntries() = 0; 53 | virtual bool SetQueueEntry( int nID, int nPosition, const char *pchEntryText ) = 0; 54 | virtual bool SetCurrentQueueEntry( int nID ) = 0; 55 | virtual bool QueueDidChange() = 0; 56 | 57 | // Playlist 58 | virtual bool PlaylistWillChange() = 0; 59 | virtual bool ResetPlaylistEntries() = 0; 60 | virtual bool SetPlaylistEntry( int nID, int nPosition, const char *pchEntryText ) = 0; 61 | virtual bool SetCurrentPlaylistEntry( int nID ) = 0; 62 | virtual bool PlaylistDidChange() = 0; 63 | }; 64 | 65 | #define STEAMMUSICREMOTE_INTERFACE_VERSION "STEAMMUSICREMOTE_INTERFACE_VERSION001" 66 | 67 | // Global interface accessor 68 | inline ISteamMusicRemote *SteamMusicRemote(); 69 | STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamMusicRemote *, SteamMusicRemote, STEAMMUSICREMOTE_INTERFACE_VERSION ); 70 | 71 | // callbacks 72 | #if defined( VALVE_CALLBACK_PACK_SMALL ) 73 | #pragma pack( push, 4 ) 74 | #elif defined( VALVE_CALLBACK_PACK_LARGE ) 75 | #pragma pack( push, 8 ) 76 | #else 77 | #error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx 78 | #endif 79 | 80 | 81 | STEAM_CALLBACK_BEGIN( MusicPlayerRemoteWillActivate_t, k_iSteamMusicRemoteCallbacks + 1) 82 | STEAM_CALLBACK_END(0) 83 | 84 | STEAM_CALLBACK_BEGIN( MusicPlayerRemoteWillDeactivate_t, k_iSteamMusicRemoteCallbacks + 2 ) 85 | STEAM_CALLBACK_END(0) 86 | 87 | STEAM_CALLBACK_BEGIN( MusicPlayerRemoteToFront_t, k_iSteamMusicRemoteCallbacks + 3 ) 88 | STEAM_CALLBACK_END(0) 89 | 90 | STEAM_CALLBACK_BEGIN( MusicPlayerWillQuit_t, k_iSteamMusicRemoteCallbacks + 4 ) 91 | STEAM_CALLBACK_END(0) 92 | 93 | STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlay_t, k_iSteamMusicRemoteCallbacks + 5 ) 94 | STEAM_CALLBACK_END(0) 95 | 96 | STEAM_CALLBACK_BEGIN( MusicPlayerWantsPause_t, k_iSteamMusicRemoteCallbacks + 6 ) 97 | STEAM_CALLBACK_END(0) 98 | 99 | STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlayPrevious_t, k_iSteamMusicRemoteCallbacks + 7 ) 100 | STEAM_CALLBACK_END(0) 101 | 102 | STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlayNext_t, k_iSteamMusicRemoteCallbacks + 8 ) 103 | STEAM_CALLBACK_END(0) 104 | 105 | STEAM_CALLBACK_BEGIN( MusicPlayerWantsShuffled_t, k_iSteamMusicRemoteCallbacks + 9 ) 106 | STEAM_CALLBACK_MEMBER( 0, bool, m_bShuffled ) 107 | STEAM_CALLBACK_END(1) 108 | 109 | STEAM_CALLBACK_BEGIN( MusicPlayerWantsLooped_t, k_iSteamMusicRemoteCallbacks + 10 ) 110 | STEAM_CALLBACK_MEMBER(0, bool, m_bLooped ) 111 | STEAM_CALLBACK_END(1) 112 | 113 | STEAM_CALLBACK_BEGIN( MusicPlayerWantsVolume_t, k_iSteamMusicCallbacks + 11 ) 114 | STEAM_CALLBACK_MEMBER(0, float, m_flNewVolume) 115 | STEAM_CALLBACK_END(1) 116 | 117 | STEAM_CALLBACK_BEGIN( MusicPlayerSelectsQueueEntry_t, k_iSteamMusicCallbacks + 12 ) 118 | STEAM_CALLBACK_MEMBER(0, int, nID ) 119 | STEAM_CALLBACK_END(1) 120 | 121 | STEAM_CALLBACK_BEGIN( MusicPlayerSelectsPlaylistEntry_t, k_iSteamMusicCallbacks + 13 ) 122 | STEAM_CALLBACK_MEMBER(0, int, nID ) 123 | STEAM_CALLBACK_END(1) 124 | 125 | STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlayingRepeatStatus_t, k_iSteamMusicRemoteCallbacks + 14 ) 126 | STEAM_CALLBACK_MEMBER(0, int, m_nPlayingRepeatStatus ) 127 | STEAM_CALLBACK_END(1) 128 | 129 | #pragma pack( pop ) 130 | 131 | 132 | 133 | #endif // #define ISTEAMMUSICREMOTE_H 134 | -------------------------------------------------------------------------------- /steam/isteamparentalsettings.h: -------------------------------------------------------------------------------- 1 | //====== Copyright � 2013-, Valve Corporation, All rights reserved. ======= 2 | // 3 | // Purpose: Interface to Steam parental settings (Family View) 4 | // 5 | //============================================================================= 6 | 7 | #ifndef ISTEAMPARENTALSETTINGS_H 8 | #define ISTEAMPARENTALSETTINGS_H 9 | #ifdef _WIN32 10 | #pragma once 11 | #endif 12 | 13 | #include "steam_api_common.h" 14 | 15 | // Feature types for parental settings 16 | enum EParentalFeature 17 | { 18 | k_EFeatureInvalid = 0, 19 | k_EFeatureStore = 1, 20 | k_EFeatureCommunity = 2, 21 | k_EFeatureProfile = 3, 22 | k_EFeatureFriends = 4, 23 | k_EFeatureNews = 5, 24 | k_EFeatureTrading = 6, 25 | k_EFeatureSettings = 7, 26 | k_EFeatureConsole = 8, 27 | k_EFeatureBrowser = 9, 28 | k_EFeatureParentalSetup = 10, 29 | k_EFeatureLibrary = 11, 30 | k_EFeatureTest = 12, 31 | k_EFeatureMax 32 | }; 33 | 34 | class ISteamParentalSettings 35 | { 36 | public: 37 | virtual bool BIsParentalLockEnabled() = 0; 38 | virtual bool BIsParentalLockLocked() = 0; 39 | 40 | virtual bool BIsAppBlocked( AppId_t nAppID ) = 0; 41 | virtual bool BIsAppInBlockList( AppId_t nAppID ) = 0; 42 | 43 | virtual bool BIsFeatureBlocked( EParentalFeature eFeature ) = 0; 44 | virtual bool BIsFeatureInBlockList( EParentalFeature eFeature ) = 0; 45 | }; 46 | 47 | #define STEAMPARENTALSETTINGS_INTERFACE_VERSION "STEAMPARENTALSETTINGS_INTERFACE_VERSION001" 48 | 49 | // Global interface accessor 50 | inline ISteamParentalSettings *SteamParentalSettings(); 51 | STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamParentalSettings *, SteamParentalSettings, STEAMPARENTALSETTINGS_INTERFACE_VERSION ); 52 | 53 | //----------------------------------------------------------------------------- 54 | // Purpose: Callback for querying UGC 55 | //----------------------------------------------------------------------------- 56 | struct SteamParentalSettingsChanged_t 57 | { 58 | enum { k_iCallback = k_ISteamParentalSettingsCallbacks + 1 }; 59 | }; 60 | 61 | 62 | #endif // ISTEAMPARENTALSETTINGS_H 63 | -------------------------------------------------------------------------------- /steam/isteamps3overlayrenderer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coremaze/CWSDK/083e67b5e301483c4a222989c046fc2041d134a8/steam/isteamps3overlayrenderer.h -------------------------------------------------------------------------------- /steam/isteamremoteplay.h: -------------------------------------------------------------------------------- 1 | //============ Copyright (c) Valve Corporation, All rights reserved. ============ 2 | 3 | #ifndef ISTEAMREMOTEPLAY_H 4 | #define ISTEAMREMOTEPLAY_H 5 | #ifdef _WIN32 6 | #pragma once 7 | #endif 8 | 9 | #include "steam_api_common.h" 10 | 11 | 12 | //----------------------------------------------------------------------------- 13 | // Purpose: The form factor of a device 14 | //----------------------------------------------------------------------------- 15 | enum ESteamDeviceFormFactor 16 | { 17 | k_ESteamDeviceFormFactorUnknown, 18 | k_ESteamDeviceFormFactorPhone, 19 | k_ESteamDeviceFormFactorTablet, 20 | k_ESteamDeviceFormFactorComputer, 21 | k_ESteamDeviceFormFactorTV, 22 | }; 23 | 24 | 25 | //----------------------------------------------------------------------------- 26 | // Purpose: Functions to provide information about Steam Remote Play sessions 27 | //----------------------------------------------------------------------------- 28 | class ISteamRemotePlay 29 | { 30 | public: 31 | // Get the number of currently connected Steam Remote Play sessions 32 | virtual uint32 GetSessionCount() = 0; 33 | 34 | // Get the currently connected Steam Remote Play session ID at the specified index. Returns zero if index is out of bounds. 35 | virtual uint32 GetSessionID( int iSessionIndex ) = 0; 36 | 37 | // Get the SteamID of the connected user 38 | virtual CSteamID GetSessionSteamID( uint32 unSessionID ) = 0; 39 | 40 | // Get the name of the session client device 41 | // This returns NULL if the sessionID is not valid 42 | virtual const char *GetSessionClientName( uint32 unSessionID ) = 0; 43 | 44 | // Get the form factor of the session client device 45 | virtual ESteamDeviceFormFactor GetSessionClientFormFactor( uint32 unSessionID ) = 0; 46 | 47 | // Get the resolution, in pixels, of the session client device 48 | // This is set to 0x0 if the resolution is not available 49 | virtual bool BGetSessionClientResolution( uint32 unSessionID, int *pnResolutionX, int *pnResolutionY ) = 0; 50 | }; 51 | 52 | #define STEAMREMOTEPLAY_INTERFACE_VERSION "STEAMREMOTEPLAY_INTERFACE_VERSION001" 53 | 54 | // Global interface accessor 55 | inline ISteamRemotePlay *SteamRemotePlay(); 56 | STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamRemotePlay *, SteamRemotePlay, STEAMREMOTEPLAY_INTERFACE_VERSION ); 57 | 58 | // callbacks 59 | #if defined( VALVE_CALLBACK_PACK_SMALL ) 60 | #pragma pack( push, 4 ) 61 | #elif defined( VALVE_CALLBACK_PACK_LARGE ) 62 | #pragma pack( push, 8 ) 63 | #else 64 | #error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx 65 | #endif 66 | 67 | 68 | STEAM_CALLBACK_BEGIN( SteamRemotePlaySessionConnected_t, k_iSteamRemotePlayCallbacks + 1 ) 69 | STEAM_CALLBACK_MEMBER( 0, uint32, m_unSessionID ) 70 | STEAM_CALLBACK_END( 0 ) 71 | 72 | 73 | STEAM_CALLBACK_BEGIN( SteamRemotePlaySessionDisconnected_t, k_iSteamRemotePlayCallbacks + 2 ) 74 | STEAM_CALLBACK_MEMBER( 0, uint32, m_unSessionID ) 75 | STEAM_CALLBACK_END( 0 ) 76 | 77 | 78 | #pragma pack( pop ) 79 | 80 | 81 | #endif // #define ISTEAMREMOTEPLAY_H 82 | -------------------------------------------------------------------------------- /steam/isteamscreenshots.h: -------------------------------------------------------------------------------- 1 | //====== Copyright � 1996-2008, Valve Corporation, All rights reserved. ======= 2 | // 3 | // Purpose: public interface to user remote file storage in Steam 4 | // 5 | //============================================================================= 6 | 7 | #ifndef ISTEAMSCREENSHOTS_H 8 | #define ISTEAMSCREENSHOTS_H 9 | #ifdef _WIN32 10 | #pragma once 11 | #endif 12 | 13 | #include "steam_api_common.h" 14 | 15 | const uint32 k_nScreenshotMaxTaggedUsers = 32; 16 | const uint32 k_nScreenshotMaxTaggedPublishedFiles = 32; 17 | const int k_cubUFSTagTypeMax = 255; 18 | const int k_cubUFSTagValueMax = 255; 19 | 20 | // Required with of a thumbnail provided to AddScreenshotToLibrary. If you do not provide a thumbnail 21 | // one will be generated. 22 | const int k_ScreenshotThumbWidth = 200; 23 | 24 | // Handle is valid for the lifetime of your process and no longer 25 | typedef uint32 ScreenshotHandle; 26 | #define INVALID_SCREENSHOT_HANDLE 0 27 | 28 | enum EVRScreenshotType 29 | { 30 | k_EVRScreenshotType_None = 0, 31 | k_EVRScreenshotType_Mono = 1, 32 | k_EVRScreenshotType_Stereo = 2, 33 | k_EVRScreenshotType_MonoCubemap = 3, 34 | k_EVRScreenshotType_MonoPanorama = 4, 35 | k_EVRScreenshotType_StereoPanorama = 5 36 | }; 37 | 38 | //----------------------------------------------------------------------------- 39 | // Purpose: Functions for adding screenshots to the user's screenshot library 40 | //----------------------------------------------------------------------------- 41 | class ISteamScreenshots 42 | { 43 | public: 44 | // Writes a screenshot to the user's screenshot library given the raw image data, which must be in RGB format. 45 | // The return value is a handle that is valid for the duration of the game process and can be used to apply tags. 46 | virtual ScreenshotHandle WriteScreenshot( void *pubRGB, uint32 cubRGB, int nWidth, int nHeight ) = 0; 47 | 48 | // Adds a screenshot to the user's screenshot library from disk. If a thumbnail is provided, it must be 200 pixels wide and the same aspect ratio 49 | // as the screenshot, otherwise a thumbnail will be generated if the user uploads the screenshot. The screenshots must be in either JPEG or TGA format. 50 | // The return value is a handle that is valid for the duration of the game process and can be used to apply tags. 51 | // JPEG, TGA, and PNG formats are supported. 52 | virtual ScreenshotHandle AddScreenshotToLibrary( const char *pchFilename, const char *pchThumbnailFilename, int nWidth, int nHeight ) = 0; 53 | 54 | // Causes the Steam overlay to take a screenshot. If screenshots are being hooked by the game then a ScreenshotRequested_t callback is sent back to the game instead. 55 | virtual void TriggerScreenshot() = 0; 56 | 57 | // Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or the game handles them. If the game is hooking screenshots, 58 | // then the ScreenshotRequested_t callback will be sent if the user presses the hotkey, and the game is expected to call WriteScreenshot or AddScreenshotToLibrary 59 | // in response. 60 | virtual void HookScreenshots( bool bHook ) = 0; 61 | 62 | // Sets metadata about a screenshot's location (for example, the name of the map) 63 | virtual bool SetLocation( ScreenshotHandle hScreenshot, const char *pchLocation ) = 0; 64 | 65 | // Tags a user as being visible in the screenshot 66 | virtual bool TagUser( ScreenshotHandle hScreenshot, CSteamID steamID ) = 0; 67 | 68 | // Tags a published file as being visible in the screenshot 69 | virtual bool TagPublishedFile( ScreenshotHandle hScreenshot, PublishedFileId_t unPublishedFileID ) = 0; 70 | 71 | // Returns true if the app has hooked the screenshot 72 | virtual bool IsScreenshotsHooked() = 0; 73 | 74 | // Adds a VR screenshot to the user's screenshot library from disk in the supported type. 75 | // pchFilename should be the normal 2D image used in the library view 76 | // pchVRFilename should contain the image that matches the correct type 77 | // The return value is a handle that is valid for the duration of the game process and can be used to apply tags. 78 | // JPEG, TGA, and PNG formats are supported. 79 | virtual ScreenshotHandle AddVRScreenshotToLibrary( EVRScreenshotType eType, const char *pchFilename, const char *pchVRFilename ) = 0; 80 | }; 81 | 82 | #define STEAMSCREENSHOTS_INTERFACE_VERSION "STEAMSCREENSHOTS_INTERFACE_VERSION003" 83 | 84 | // Global interface accessor 85 | inline ISteamScreenshots *SteamScreenshots(); 86 | STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamScreenshots *, SteamScreenshots, STEAMSCREENSHOTS_INTERFACE_VERSION ); 87 | 88 | // callbacks 89 | #if defined( VALVE_CALLBACK_PACK_SMALL ) 90 | #pragma pack( push, 4 ) 91 | #elif defined( VALVE_CALLBACK_PACK_LARGE ) 92 | #pragma pack( push, 8 ) 93 | #else 94 | #error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx 95 | #endif 96 | //----------------------------------------------------------------------------- 97 | // Purpose: Screenshot successfully written or otherwise added to the library 98 | // and can now be tagged 99 | //----------------------------------------------------------------------------- 100 | struct ScreenshotReady_t 101 | { 102 | enum { k_iCallback = k_iSteamScreenshotsCallbacks + 1 }; 103 | ScreenshotHandle m_hLocal; 104 | EResult m_eResult; 105 | }; 106 | 107 | //----------------------------------------------------------------------------- 108 | // Purpose: Screenshot has been requested by the user. Only sent if 109 | // HookScreenshots() has been called, in which case Steam will not take 110 | // the screenshot itself. 111 | //----------------------------------------------------------------------------- 112 | struct ScreenshotRequested_t 113 | { 114 | enum { k_iCallback = k_iSteamScreenshotsCallbacks + 2 }; 115 | }; 116 | 117 | #pragma pack( pop ) 118 | 119 | #endif // ISTEAMSCREENSHOTS_H 120 | 121 | -------------------------------------------------------------------------------- /steam/isteamvideo.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coremaze/CWSDK/083e67b5e301483c4a222989c046fc2041d134a8/steam/isteamvideo.h -------------------------------------------------------------------------------- /steam/matchmakingtypes.h: -------------------------------------------------------------------------------- 1 | //========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ 2 | // 3 | // Purpose: 4 | // 5 | // $NoKeywords: $ 6 | //============================================================================= 7 | 8 | #ifndef MATCHMAKINGTYPES_H 9 | #define MATCHMAKINGTYPES_H 10 | 11 | #ifdef _WIN32 12 | #pragma once 13 | #endif 14 | 15 | #ifdef POSIX 16 | #ifndef _snprintf 17 | #define _snprintf snprintf 18 | #endif 19 | #endif 20 | 21 | #include 22 | #include 23 | 24 | // 25 | // Max size (in bytes of UTF-8 data, not in characters) of server fields, including null terminator. 26 | // WARNING: These cannot be changed easily, without breaking clients using old interfaces. 27 | // 28 | const int k_cbMaxGameServerGameDir = 32; 29 | const int k_cbMaxGameServerMapName = 32; 30 | const int k_cbMaxGameServerGameDescription = 64; 31 | const int k_cbMaxGameServerName = 64; 32 | const int k_cbMaxGameServerTags = 128; 33 | const int k_cbMaxGameServerGameData = 2048; 34 | 35 | /// Store key/value pair used in matchmaking queries. 36 | /// 37 | /// Actually, the name Key/Value is a bit misleading. The "key" is better 38 | /// understood as "filter operation code" and the "value" is the operand to this 39 | /// filter operation. The meaning of the operand depends upon the filter. 40 | struct MatchMakingKeyValuePair_t 41 | { 42 | MatchMakingKeyValuePair_t() { m_szKey[0] = m_szValue[0] = 0; } 43 | MatchMakingKeyValuePair_t( const char *pchKey, const char *pchValue ) 44 | { 45 | strncpy( m_szKey, pchKey, sizeof(m_szKey) ); // this is a public header, use basic c library string funcs only! 46 | m_szKey[ sizeof( m_szKey ) - 1 ] = '\0'; 47 | strncpy( m_szValue, pchValue, sizeof(m_szValue) ); 48 | m_szValue[ sizeof( m_szValue ) - 1 ] = '\0'; 49 | } 50 | char m_szKey[ 256 ]; 51 | char m_szValue[ 256 ]; 52 | }; 53 | 54 | 55 | enum EMatchMakingServerResponse 56 | { 57 | eServerResponded = 0, 58 | eServerFailedToRespond, 59 | eNoServersListedOnMasterServer // for the Internet query type, returned in response callback if no servers of this type match 60 | }; 61 | 62 | // servernetadr_t is all the addressing info the serverbrowser needs to know about a game server, 63 | // namely: its IP, its connection port, and its query port. 64 | class servernetadr_t 65 | { 66 | public: 67 | 68 | servernetadr_t() : m_usConnectionPort( 0 ), m_usQueryPort( 0 ), m_unIP( 0 ) {} 69 | 70 | void Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort ); 71 | #ifdef NETADR_H 72 | netadr_t GetIPAndQueryPort(); 73 | #endif 74 | 75 | // Access the query port. 76 | uint16 GetQueryPort() const; 77 | void SetQueryPort( uint16 usPort ); 78 | 79 | // Access the connection port. 80 | uint16 GetConnectionPort() const; 81 | void SetConnectionPort( uint16 usPort ); 82 | 83 | // Access the IP 84 | uint32 GetIP() const; 85 | void SetIP( uint32 ); 86 | 87 | // This gets the 'a.b.c.d:port' string with the connection port (instead of the query port). 88 | const char *GetConnectionAddressString() const; 89 | const char *GetQueryAddressString() const; 90 | 91 | // Comparison operators and functions. 92 | bool operator<(const servernetadr_t &netadr) const; 93 | void operator=( const servernetadr_t &that ) 94 | { 95 | m_usConnectionPort = that.m_usConnectionPort; 96 | m_usQueryPort = that.m_usQueryPort; 97 | m_unIP = that.m_unIP; 98 | } 99 | 100 | 101 | private: 102 | const char *ToString( uint32 unIP, uint16 usPort ) const; 103 | uint16 m_usConnectionPort; // (in HOST byte order) 104 | uint16 m_usQueryPort; 105 | uint32 m_unIP; 106 | }; 107 | 108 | 109 | inline void servernetadr_t::Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort ) 110 | { 111 | m_unIP = ip; 112 | m_usQueryPort = usQueryPort; 113 | m_usConnectionPort = usConnectionPort; 114 | } 115 | 116 | #ifdef NETADR_H 117 | inline netadr_t servernetadr_t::GetIPAndQueryPort() 118 | { 119 | return netadr_t( m_unIP, m_usQueryPort ); 120 | } 121 | #endif 122 | 123 | inline uint16 servernetadr_t::GetQueryPort() const 124 | { 125 | return m_usQueryPort; 126 | } 127 | 128 | inline void servernetadr_t::SetQueryPort( uint16 usPort ) 129 | { 130 | m_usQueryPort = usPort; 131 | } 132 | 133 | inline uint16 servernetadr_t::GetConnectionPort() const 134 | { 135 | return m_usConnectionPort; 136 | } 137 | 138 | inline void servernetadr_t::SetConnectionPort( uint16 usPort ) 139 | { 140 | m_usConnectionPort = usPort; 141 | } 142 | 143 | inline uint32 servernetadr_t::GetIP() const 144 | { 145 | return m_unIP; 146 | } 147 | 148 | inline void servernetadr_t::SetIP( uint32 unIP ) 149 | { 150 | m_unIP = unIP; 151 | } 152 | 153 | inline const char *servernetadr_t::ToString( uint32 unIP, uint16 usPort ) const 154 | { 155 | static char s[4][64]; 156 | static int nBuf = 0; 157 | unsigned char *ipByte = (unsigned char *)&unIP; 158 | #ifdef VALVE_BIG_ENDIAN 159 | _snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[0]), (int)(ipByte[1]), (int)(ipByte[2]), (int)(ipByte[3]), usPort ); 160 | #else 161 | _snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort ); 162 | #endif 163 | const char *pchRet = s[nBuf]; 164 | ++nBuf; 165 | nBuf %= ( (sizeof(s)/sizeof(s[0])) ); 166 | return pchRet; 167 | } 168 | 169 | inline const char* servernetadr_t::GetConnectionAddressString() const 170 | { 171 | return ToString( m_unIP, m_usConnectionPort ); 172 | } 173 | 174 | inline const char* servernetadr_t::GetQueryAddressString() const 175 | { 176 | return ToString( m_unIP, m_usQueryPort ); 177 | } 178 | 179 | inline bool servernetadr_t::operator<(const servernetadr_t &netadr) const 180 | { 181 | return ( m_unIP < netadr.m_unIP ) || ( m_unIP == netadr.m_unIP && m_usQueryPort < netadr.m_usQueryPort ); 182 | } 183 | 184 | //----------------------------------------------------------------------------- 185 | // Purpose: Data describing a single server 186 | //----------------------------------------------------------------------------- 187 | class gameserveritem_t 188 | { 189 | public: 190 | gameserveritem_t(); 191 | 192 | const char* GetName() const; 193 | void SetName( const char *pName ); 194 | 195 | public: 196 | servernetadr_t m_NetAdr; ///< IP/Query Port/Connection Port for this server 197 | int m_nPing; ///< current ping time in milliseconds 198 | bool m_bHadSuccessfulResponse; ///< server has responded successfully in the past 199 | bool m_bDoNotRefresh; ///< server is marked as not responding and should no longer be refreshed 200 | char m_szGameDir[k_cbMaxGameServerGameDir]; ///< current game directory 201 | char m_szMap[k_cbMaxGameServerMapName]; ///< current map 202 | char m_szGameDescription[k_cbMaxGameServerGameDescription]; ///< game description 203 | uint32 m_nAppID; ///< Steam App ID of this server 204 | int m_nPlayers; ///< total number of players currently on the server. INCLUDES BOTS!! 205 | int m_nMaxPlayers; ///< Maximum players that can join this server 206 | int m_nBotPlayers; ///< Number of bots (i.e simulated players) on this server 207 | bool m_bPassword; ///< true if this server needs a password to join 208 | bool m_bSecure; ///< Is this server protected by VAC 209 | uint32 m_ulTimeLastPlayed; ///< time (in unix time) when this server was last played on (for favorite/history servers) 210 | int m_nServerVersion; ///< server version as reported to Steam 211 | 212 | private: 213 | 214 | /// Game server name 215 | char m_szServerName[k_cbMaxGameServerName]; 216 | 217 | // For data added after SteamMatchMaking001 add it here 218 | public: 219 | /// the tags this server exposes 220 | char m_szGameTags[k_cbMaxGameServerTags]; 221 | 222 | /// steamID of the game server - invalid if it's doesn't have one (old server, or not connected to Steam) 223 | CSteamID m_steamID; 224 | }; 225 | 226 | 227 | inline gameserveritem_t::gameserveritem_t() 228 | { 229 | m_szGameDir[0] = m_szMap[0] = m_szGameDescription[0] = m_szServerName[0] = 0; 230 | m_bHadSuccessfulResponse = m_bDoNotRefresh = m_bPassword = m_bSecure = false; 231 | m_nPing = m_nAppID = m_nPlayers = m_nMaxPlayers = m_nBotPlayers = m_ulTimeLastPlayed = m_nServerVersion = 0; 232 | m_szGameTags[0] = 0; 233 | } 234 | 235 | inline const char* gameserveritem_t::GetName() const 236 | { 237 | // Use the IP address as the name if nothing is set yet. 238 | if ( m_szServerName[0] == 0 ) 239 | return m_NetAdr.GetConnectionAddressString(); 240 | else 241 | return m_szServerName; 242 | } 243 | 244 | inline void gameserveritem_t::SetName( const char *pName ) 245 | { 246 | strncpy( m_szServerName, pName, sizeof( m_szServerName ) ); 247 | m_szServerName[ sizeof( m_szServerName ) - 1 ] = '\0'; 248 | } 249 | 250 | 251 | #endif // MATCHMAKINGTYPES_H 252 | -------------------------------------------------------------------------------- /steam/steam_gameserver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coremaze/CWSDK/083e67b5e301483c4a222989c046fc2041d134a8/steam/steam_gameserver.h -------------------------------------------------------------------------------- /steam/steamencryptedappticket.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coremaze/CWSDK/083e67b5e301483c4a222989c046fc2041d134a8/steam/steamencryptedappticket.h -------------------------------------------------------------------------------- /steam/steamhttpenums.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coremaze/CWSDK/083e67b5e301483c4a222989c046fc2041d134a8/steam/steamhttpenums.h -------------------------------------------------------------------------------- /steam/steamps3params.h: -------------------------------------------------------------------------------- 1 | //====== Copyright 1996-2008, Valve Corporation, All rights reserved. ======= 2 | // 3 | // Purpose: 4 | // 5 | //============================================================================= 6 | 7 | #ifndef STEAMPS3PARAMS_H 8 | #define STEAMPS3PARAMS_H 9 | #ifdef _WIN32 10 | #pragma once 11 | #endif 12 | 13 | //----------------------------------------------------------------------------------------------------------------------------------------------------------// 14 | // PlayStation 3 initialization parameters 15 | // 16 | // The following structure must be passed to when loading steam_api_ps3.prx 17 | //----------------------------------------------------------------------------------------------------------------------------------------------------------// 18 | #define STEAM_PS3_PATH_MAX 1055 19 | #define STEAM_PS3_SERVICE_ID_MAX 32 20 | #define STEAM_PS3_COMMUNICATION_ID_MAX 10 21 | #define STEAM_PS3_COMMUNICATION_SIG_MAX 160 22 | #define STEAM_PS3_LANGUAGE_MAX 64 23 | #define STEAM_PS3_REGION_CODE_MAX 16 24 | #define STEAM_PS3_CURRENT_PARAMS_VER 2 25 | struct SteamPS3Params_t 26 | { 27 | uint32 m_unVersion; // set to STEAM_PS3_CURRENT_PARAMS_VER 28 | 29 | void *pReserved; 30 | uint32 m_nAppId; // set to your game's appid 31 | 32 | char m_rgchInstallationPath[ STEAM_PS3_PATH_MAX ]; // directory containing latest steam prx's and sdata. Can be read only (BDVD) 33 | char m_rgchSystemCache[ STEAM_PS3_PATH_MAX ]; // temp working cache, not persistent 34 | char m_rgchGameData[ STEAM_PS3_PATH_MAX ]; // persistent game data path for storing user data 35 | char m_rgchNpServiceID[ STEAM_PS3_SERVICE_ID_MAX ]; 36 | char m_rgchNpCommunicationID[ STEAM_PS3_COMMUNICATION_ID_MAX ]; 37 | char m_rgchNpCommunicationSig[ STEAM_PS3_COMMUNICATION_SIG_MAX ]; 38 | 39 | // Language should be one of the following. must be zero terminated 40 | // danish 41 | // dutch 42 | // english 43 | // finnish 44 | // french 45 | // german 46 | // italian 47 | // korean 48 | // norwegian 49 | // polish 50 | // portuguese 51 | // russian 52 | // schinese 53 | // spanish 54 | // swedish 55 | // tchinese 56 | char m_rgchSteamLanguage[ STEAM_PS3_LANGUAGE_MAX ]; 57 | 58 | // region codes are "SCEA", "SCEE", "SCEJ". must be zero terminated 59 | char m_rgchRegionCode[ STEAM_PS3_REGION_CODE_MAX ]; 60 | 61 | // Should be SYS_TTYP3 through SYS_TTYP10, if it's 0 then Steam won't spawn a 62 | // thread to read console input at all. Using this let's you use Steam console commands 63 | // like: profile_on, profile_off, profile_dump, mem_stats, mem_validate. 64 | unsigned int m_cSteamInputTTY; 65 | 66 | struct Ps3netInit_t 67 | { 68 | bool m_bNeedInit; 69 | void *m_pMemory; 70 | int m_nMemorySize; 71 | int m_flags; 72 | } m_sysNetInitInfo; 73 | 74 | struct Ps3jpgInit_t 75 | { 76 | bool m_bNeedInit; 77 | } m_sysJpgInitInfo; 78 | 79 | struct Ps3pngInit_t 80 | { 81 | bool m_bNeedInit; 82 | } m_sysPngInitInfo; 83 | 84 | struct Ps3sysutilUserInfo_t 85 | { 86 | bool m_bNeedInit; 87 | } m_sysSysUtilUserInfo; 88 | 89 | bool m_bIncludeNewsPage; 90 | }; 91 | 92 | 93 | //----------------------------------------------------------------------------------------------------------------------------------------------------------// 94 | // PlayStation 3 memory structure 95 | //----------------------------------------------------------------------------------------------------------------------------------------------------------// 96 | #define STEAMPS3_MALLOC_INUSE 0x53D04A51 97 | #define STEAMPS3_MALLOC_SYSTEM 0x0D102C48 98 | #define STEAMPS3_MALLOC_OK 0xFFD04A51 99 | struct SteamPS3Memory_t 100 | { 101 | bool m_bSingleAllocation; // If true, Steam will request one 6MB allocation and use the returned memory for all future allocations 102 | // If false, Steam will make call malloc for each allocation 103 | 104 | // required function pointers 105 | void* (*m_pfMalloc)(size_t); 106 | void* (*m_pfRealloc)(void *, size_t); 107 | void (*m_pfFree)(void *); 108 | size_t (*m_pUsable_size)(void*); 109 | }; 110 | 111 | 112 | #endif // STEAMPS3PARAMS_H 113 | -------------------------------------------------------------------------------- /steam/steamtypes.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coremaze/CWSDK/083e67b5e301483c4a222989c046fc2041d134a8/steam/steamtypes.h -------------------------------------------------------------------------------- /steam/steamuniverse.h: -------------------------------------------------------------------------------- 1 | //========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ 2 | // 3 | // Purpose: 4 | // 5 | //============================================================================= 6 | 7 | #ifndef STEAMUNIVERSE_H 8 | #define STEAMUNIVERSE_H 9 | #ifdef _WIN32 10 | #pragma once 11 | #endif 12 | 13 | 14 | // Steam universes. Each universe is a self-contained Steam instance. 15 | enum EUniverse 16 | { 17 | k_EUniverseInvalid = 0, 18 | k_EUniversePublic = 1, 19 | k_EUniverseBeta = 2, 20 | k_EUniverseInternal = 3, 21 | k_EUniverseDev = 4, 22 | // k_EUniverseRC = 5, // no such universe anymore 23 | k_EUniverseMax 24 | }; 25 | 26 | 27 | #endif // STEAMUNIVERSE_H 28 | --------------------------------------------------------------------------------