diff --git a/.github/workflows/update-sdk.yml b/.github/workflows/update-sdk.yml index dc430693c..df28a06b5 100644 --- a/.github/workflows/update-sdk.yml +++ b/.github/workflows/update-sdk.yml @@ -9,14 +9,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Clone server repository - uses: actions/checkout@v3 - with: - clean: true - path: "Server" - submodules: recursive - token: ${{ secrets.CI_TOKEN }} - - name: Clone SDK repository uses: actions/checkout@v3 with: @@ -27,30 +19,16 @@ jobs: submodules: recursive token: ${{ secrets.CI_TOKEN }} - - name: Update SDK files from server repository + - name: Update SDK files from dev branch if: always() shell: bash run: | - rm -rf ./SDK/include/* - mv -f ./Server/SDK/include ./SDK - cd SDK - git config user.name open.mp - git config user.email open.mp@github.com - git add . - git commit -m "Update SDK" -m "with https://github.com/openmultiplayer/open.mp/commit/${{ github.sha }}" || true + git rebase dev git push || true update-network: runs-on: ubuntu-latest steps: - - name: Clone server repository - uses: actions/checkout@v3 - with: - clean: true - path: "Server" - submodules: recursive - token: ${{ secrets.CI_TOKEN }} - - name: Clone Network repository uses: actions/checkout@v3 with: @@ -61,15 +39,9 @@ jobs: submodules: recursive token: ${{ secrets.CI_TOKEN }} - - name: Update Network files from server repository + - name: Update Network files from dev branch if: always() shell: bash run: | - rm -rf ./Network/* - mv -f ./Server/Shared/Network/* ./Network - cd Network - git config user.name open.mp - git config user.email open.mp@github.com - git add . - git commit -m "Update Network" -m "with https://github.com/openmultiplayer/open.mp/commit/${{ github.sha }}" || true + git rebase dev git push || true diff --git a/.gitmodules b/.gitmodules index 4ef7fb6da..5da2c449b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,15 +16,9 @@ [submodule "lib/cmake-conan"] path = lib/cmake-conan url = https://github.com/openmultiplayer/cmake-conan.git -[submodule "SDK/lib/glm"] - path = SDK/lib/glm - url = https://github.com/g-truc/glm -[submodule "SDK/lib/robin-hood-hashing"] - path = SDK/lib/robin-hood-hashing - url = https://github.com/martinus/robin-hood-hashing -[submodule "SDK/lib/span-lite"] - path = SDK/lib/span-lite - url = https://github.com/martinmoene/span-lite -[submodule "SDK/lib/string-view-lite"] - path = SDK/lib/string-view-lite - url = https://github.com/martinmoene/string-view-lite +[submodule "SDK"] + path = SDK + url = https://github.com/openmultiplayer/open.mp-sdk +[submodule "Shared/Network"] + path = Shared/Network + url = https://github.com/openmultiplayer/open.mp-network diff --git a/SDK b/SDK new file mode 160000 index 000000000..3dc9cf854 --- /dev/null +++ b/SDK @@ -0,0 +1 @@ +Subproject commit 3dc9cf854c2a002a683baf50d5845f396c634e2c diff --git a/SDK/CMakeLists.txt b/SDK/CMakeLists.txt deleted file mode 100644 index 85cc04e9f..000000000 --- a/SDK/CMakeLists.txt +++ /dev/null @@ -1,68 +0,0 @@ -cmake_minimum_required(VERSION 3.19) -project(OMP-SDK LANGUAGES CXX DESCRIPTION "Stable classes to write open.mp components with" VERSION 1) - -add_subdirectory(lib/glm) -add_subdirectory(lib/robin-hood-hashing) -add_subdirectory(lib/span-lite) -add_subdirectory(lib/string-view-lite) - -add_library(OMP-SDK INTERFACE) - -if(MSVC) - if(CMAKE_SIZEOF_VOID_P EQUAL 4) - target_compile_options(OMP-SDK INTERFACE - "/fp:strict" - "/arch:SSE2" - ) - else() - target_compile_options(OMP-SDK INTERFACE - "/fp:strict" - ) - endif() -elseif(UNIX) - if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)") - target_compile_options(OMP-SDK INTERFACE - -msse2 - -mfpmath=sse - ) - else() - if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") - target_compile_options(OMP-SDK INTERFACE "-mfpu=neon") - endif() - if(TARGET_BUILD_ARCH) - target_compile_options(OMP-SDK INTERFACE "-march=${TARGET_BUILD_ARCH}") - endif() - endif() -endif() - -if (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC) - target_compile_options(OMP-SDK INTERFACE - -Werror=format - ) -endif() - -target_link_libraries(OMP-SDK INTERFACE - glm::glm - robin_hood - span-lite - string-view-lite -) - -target_compile_definitions(OMP-SDK INTERFACE - GLM_FORCE_QUAT_DATA_WXYZ - NOMINMAX - nssv_CONFIG_SELECT_STRING_VIEW=nssv_STRING_VIEW_NONSTD - span_CONFIG_SELECT_SPAN=span_SPAN_NONSTD -) - -if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)") - target_compile_definitions(OMP-SDK INTERFACE GLM_FORCE_SSE2) -else() - target_compile_definitions(OMP-SDK INTERFACE GLM_FORCE_NEON) -endif() - -target_include_directories(OMP-SDK INTERFACE include/) - -file(GLOB_RECURSE omp_sdk_source_list "*.hpp") - -set_property(TARGET OMP-SDK PROPERTY SOURCES ${omp_sdk_source_list}) diff --git a/SDK/README.md b/SDK/README.md deleted file mode 100644 index 5c2d41d92..000000000 --- a/SDK/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# open.mp SDK - -## Tools - -* [CMake 3.19+](https://cmake.org/) -* [Conan 1.57+](https://conan.io/) (Can't use conan v2.x) - -## Tools on Windows - -* [Visual Studio 2019+](https://www.visualstudio.com/) - -Visual Studio needs the `Desktop development with C++` workload with the `MSVC v142`, `Windows 10 SDK` and `C++ Clang tools for Windows` components. - -## Sources - -```bash -# With HTTPS: -git clone --recursive https://github.com/openmultiplayer/open.mp-sdk -# With SSH: -git clone --recursive git@github.com:openmultiplayer/open.mp-sdk -``` - -Note the use of the `--recursive` argument, because this repository contains submodules. - -## Building on Windows - -```bash -cd open.mp-sdk -mkdir build -cd build -cmake .. -A Win32 -T ClangCL -``` - -Open Visual Studio and build the solution. diff --git a/SDK/include/Impl/events_impl.hpp b/SDK/include/Impl/events_impl.hpp deleted file mode 100644 index 1c4921be0..000000000 --- a/SDK/include/Impl/events_impl.hpp +++ /dev/null @@ -1,268 +0,0 @@ -#pragma once - -#include "../events.hpp" - -/* Implementation, NOT to be passed around */ - -namespace Impl -{ - -template -struct DefaultEventHandlerStorageEntry -{ - event_order_t priority; - EventHandlerType* handler; - - DefaultEventHandlerStorageEntry(event_order_t priority, EventHandlerType* handler) - : priority(priority) - , handler(handler) - { - } -}; - -template -struct DefaultEventHandlerStorage -{ - using Entry = DefaultEventHandlerStorageEntry; - - template - struct Func - { - Fn& fn; - constexpr Func(Fn& fn) - : fn(fn) - { - } - - constexpr Ret operator()(const Entry& entry) - { - return fn(entry.handler); - } - }; - - bool insert(EventHandlerType* handler, event_order_t priority) - { - auto insertIter = entries.end(); - for (auto it = entries.begin(); it != entries.end(); ++it) - { - if (handler == it->handler) - { - return false; - } - if (priority < it->priority && insertIter == entries.end()) - { - insertIter = it; - } - } - - entries.emplace(insertIter, priority, handler); - return true; - } - - bool has(EventHandlerType* handler, event_order_t& priority) const - { - for (auto it = entries.begin(); it != entries.end(); ++it) - { - if (handler == it->handler) - { - priority = it->priority; - return true; - } - } - return false; - } - - bool erase(EventHandlerType* handler) - { - for (auto it = entries.begin(); it != entries.end(); ++it) - { - if (handler == it->handler) - { - entries.erase(it); - return true; - } - } - return false; - } - - size_t count() const - { - return entries.size(); - } - - typename DynamicArray::iterator begin() - { - return entries.begin(); - } - - typename DynamicArray::iterator end() - { - return entries.end(); - } - -private: - DynamicArray entries; -}; - -template -struct DefaultEventDispatcher final : public IEventDispatcher, public NoCopy -{ - using Storage = DefaultEventHandlerStorage; - - bool addEventHandler(EventHandlerType* handler, event_order_t priority = EventPriority_Default) override - { - return handlers.insert(handler, priority); - } - - bool removeEventHandler(EventHandlerType* handler) override - { - return handlers.erase(handler); - } - - bool hasEventHandler(EventHandlerType* handler, event_order_t& priority) override - { - return handlers.has(handler, priority); - } - - template - void dispatch(Return (EventHandlerType::*mf)(Params...), Args&&... args) - { - for (const typename Storage::Entry& storage : handlers) - { - EventHandlerType* handler = storage.handler; - (handler->*mf)(std::forward(args)...); - } - } - - template - void all(Fn fn) - { - std::for_each(handlers.begin(), handlers.end(), typename Storage::template Func(fn)); - } - - template - auto stopAtFalse(Fn fn) - { - return std::all_of(handlers.begin(), handlers.end(), typename Storage::template Func(fn)); - } - - template - auto anyTrue(Fn fn) - { - // `anyTrue` should still CALL them call, don't short-circuit. - bool ret = false; - std::for_each(handlers.begin(), handlers.end(), typename Storage::template Func([&fn, &ret]() - { - ret = fn() || ret; - })); - return ret; - } - - template - auto stopAtTrue(Fn fn) - { - return std::any_of(handlers.begin(), handlers.end(), typename Storage::template Func(fn)); - } - - template - auto allTrue(Fn fn) - { - bool ret = true; - std::for_each(handlers.begin(), handlers.end(), typename Storage::template Func([&fn, &ret]() - { - ret = fn() && ret; - })); - return ret; - } - - size_t count() const override - { - return handlers.count(); - } - -private: - Storage handlers; -}; - -template -struct DefaultIndexedEventDispatcher final : public IIndexedEventDispatcher, public NoCopy -{ - using Storage = DefaultEventHandlerStorage; - - DefaultIndexedEventDispatcher(size_t max) - : handlers(max) - { - } - - size_t count() const override - { - return handlers.size(); - } - - size_t count(size_t index) const override - { - if (index >= handlers.size()) - { - return 0; - } - return handlers[index].count(); - } - - bool addEventHandler(EventHandlerType* handler, size_t index, event_order_t priority = EventPriority_Default) override - { - if (index >= handlers.size()) - { - return false; - } - return handlers[index].insert(handler, priority); - } - - bool removeEventHandler(EventHandlerType* handler, size_t index) override - { - if (index >= handlers.size()) - { - return false; - } - return handlers[index].erase(handler); - } - - bool hasEventHandler(EventHandlerType* handler, size_t index, event_order_t& priority) override - { - if (index >= handlers.size()) - { - return false; - } - return handlers[index].has(handler, priority); - } - - template - void dispatch(size_t index, Return (EventHandlerType::*mf)(Params...), Args&&... args) - { - if (index >= handlers.size()) - { - return; - } - for (const typename Storage::Entry& storage : handlers[index]) - { - EventHandlerType* handler = storage.handler; - (handler->*mf)(std::forward(args)...); - } - } - - template - void all(size_t index, Fn fn) - { - std::for_each(handlers[index].begin(), handlers[index].end(), typename Storage::template Func(fn)); - } - - template - bool stopAtFalse(size_t index, Fn fn) - { - return std::all_of(handlers[index].begin(), handlers[index].end(), typename Storage::template Func(fn)); - } - -private: - DynamicArray handlers; -}; - -} diff --git a/SDK/include/Impl/network_impl.hpp b/SDK/include/Impl/network_impl.hpp deleted file mode 100644 index 8eac50804..000000000 --- a/SDK/include/Impl/network_impl.hpp +++ /dev/null @@ -1,65 +0,0 @@ -#pragma once - -#include "../network.hpp" -#include "events_impl.hpp" - -/* Implementation, NOT to be passed around */ - -namespace Impl -{ - -struct Network : public INetwork, public NoCopy -{ - DefaultEventDispatcher networkEventDispatcher; - DefaultEventDispatcher inEventDispatcher; - DefaultIndexedEventDispatcher rpcInEventDispatcher; - DefaultIndexedEventDispatcher packetInEventDispatcher; - DefaultEventDispatcher outEventDispatcher; - DefaultIndexedEventDispatcher rpcOutEventDispatcher; - DefaultIndexedEventDispatcher packetOutEventDispatcher; - - Network(size_t packetCount, size_t rpcCount) - : rpcInEventDispatcher(rpcCount) - , packetInEventDispatcher(packetCount) - , rpcOutEventDispatcher(rpcCount) - , packetOutEventDispatcher(packetCount) - { - } - - IEventDispatcher& getEventDispatcher() override - { - return networkEventDispatcher; - } - - IEventDispatcher& getInEventDispatcher() override - { - return inEventDispatcher; - } - - IIndexedEventDispatcher& getPerRPCInEventDispatcher() override - { - return rpcInEventDispatcher; - } - - IIndexedEventDispatcher& getPerPacketInEventDispatcher() override - { - return packetInEventDispatcher; - } - - IEventDispatcher& getOutEventDispatcher() override - { - return outEventDispatcher; - } - - IIndexedEventDispatcher& getPerRPCOutEventDispatcher() override - { - return rpcOutEventDispatcher; - } - - IIndexedEventDispatcher& getPerPacketOutEventDispatcher() override - { - return packetOutEventDispatcher; - } -}; - -} diff --git a/SDK/include/Impl/pool_impl.hpp b/SDK/include/Impl/pool_impl.hpp deleted file mode 100644 index 7384bd483..000000000 --- a/SDK/include/Impl/pool_impl.hpp +++ /dev/null @@ -1,690 +0,0 @@ -#pragma once - -#include "../pool.hpp" -#include "events_impl.hpp" - -/* Implementation, NOT to be passed around */ - -namespace Impl -{ - -template -struct ScopedPoolReleaseLock -{ - IPool& pool; - int index; - T* entry; - - ScopedPoolReleaseLock(IPool& pool, int index) - : pool(pool) - , index(index) - , entry(pool.get(index)) - { - if (entry) - { - pool.lock(index); - } - } - - template >> - ScopedPoolReleaseLock(IPool& pool, U& provider) - : pool(pool) - , index(provider.getID()) - , entry(&provider) - { - pool.lock(index); - } - - ~ScopedPoolReleaseLock() - { - if (entry) - { - pool.unlock(index); - } - } -}; - -template -struct UniqueIDArray : public NoCopy -{ - int findFreeIndex(int from) const - { - for (int i = from; i < Size; ++i) - { - if (!valid_[i]) - { - return i; - } - } - return -1; - } - - void add(int index) - { - assert(index < Size); - valid_.set(index); - } - - void add(int index, T& data) - { - assert(index < Size); - valid_.set(index); - entries_.insert(&data); - } - - /// Attempt to remove data for element at index and return the next iterator in the entries list - typename FlatPtrHashSet::iterator remove(int index, T& data) - { - valid_.reset(index); - auto it = entries_.find(&data); - if (it == entries_.end()) - { - return it; - } - return entries_.erase(it); - } - - void clear() - { - valid_.reset(); - entries_.clear(); - } - - bool valid(int index) const - { - if (index < 0) - { - return false; - } - if (index >= Size) - { - return false; - } - return valid_.test(index); - } - - const FlatPtrHashSet& entries() const - { - return entries_; - } - - FlatPtrHashSet& entries() - { - return entries_; - } - -private: - StaticBitset valid_; - FlatPtrHashSet entries_; -}; - -template -struct UniqueEntryArray : public NoCopy -{ - void add(T& data) - { - entries_.insert(&data); - } - - /// Attempt to remove data for element at index and return the next iterator in the entries list - typename FlatPtrHashSet::iterator remove(T& data) - { - auto it = entries_.find(&data); - if (it == entries_.end()) - { - return it; - } - return entries_.erase(it); - } - - void clear() - { - entries_.clear(); - } - - const FlatPtrHashSet& entries() const - { - return entries_; - } - - FlatPtrHashSet& entries() - { - return entries_; - } - -private: - FlatPtrHashSet entries_; -}; - -struct PoolIDProvider -{ - int poolID; - - PoolIDProvider() - : poolID(-1) - { - } - - ~PoolIDProvider() - { - poolID = -1; - } -}; - -template -struct StaticPoolStorageBase : public NoCopy -{ - constexpr static const size_t Lower = Min; - constexpr static const size_t Upper = Max; - constexpr static const size_t Capacity = Upper - Lower; - using Interface = Iface; - - constexpr static int toInternalIndex(int index) - { - return index - Min; - } - - constexpr static int fromInternalIndex(int index) - { - return index + Min; - } - - template - Type* emplace(Args&&... args) - { - int freeIdx = findFreeIndex(); - if (freeIdx < Min) - { - // No free index - return nullptr; - } - - int pid = claimHint(freeIdx, std::forward(args)...); - if (pid < Min) - { - // No free index - return nullptr; - } - - return get(pid); - } - - int findFreeIndex() - { - return findFreeIndex(lowestFreeIndex_); - } - - int findFreeIndex(int from) - { - return fromInternalIndex(allocated_.findFreeIndex(toInternalIndex(from))); - } - - template - int claim(Args&&... args) - { - const int freeIdx = findFreeIndex(); - const int internalIdx = toInternalIndex(freeIdx); - if (internalIdx >= 0) - { - if (freeIdx == lowestFreeIndex_) - { - ++lowestFreeIndex_; - } - new (getPtr(internalIdx)) Type(std::forward(args)...); - allocated_.add(internalIdx, *getPtr(internalIdx)); - if constexpr (std::is_base_of::value) - { - getPtr(internalIdx)->poolID = freeIdx; - } - eventDispatcher_.dispatch(&PoolEventHandler::onPoolEntryCreated, *getPtr(internalIdx)); - } - return freeIdx; - } - - template - int claimHint(int hint, Args&&... args) - { - if (hint >= Min && hint < Max && !valid(hint)) - { - if (hint == lowestFreeIndex_) - { - ++lowestFreeIndex_; - } - const int idx = toInternalIndex(hint); - new (getPtr(idx)) Type(std::forward(args)...); - allocated_.add(idx, *getPtr(idx)); - if constexpr (std::is_base_of::value) - { - getPtr(idx)->poolID = hint; - } - eventDispatcher_.dispatch(&PoolEventHandler::onPoolEntryCreated, *getPtr(idx)); - return hint; - } - else - { - return claim(std::forward(args)...); - } - } - - Type* get(int index) - { - if (!valid(index)) - { - return nullptr; - } - return getPtr(toInternalIndex(index)); - } - - const Type* get(int index) const - { - if (!valid(index)) - { - return nullptr; - } - return getPtr(toInternalIndex(index)); - } - - Pair::iterator> remove(int index) - { - if (!valid(index)) - { - return std::make_pair(false, allocated_.entries().end()); - } - if (index < lowestFreeIndex_) - { - lowestFreeIndex_ = index; - } - index = toInternalIndex(index); - auto it = allocated_.remove(index, *getPtr(index)); - eventDispatcher_.dispatch(&PoolEventHandler::onPoolEntryDestroyed, *getPtr(index)); - getPtr(index)->~Type(); - return std::make_pair(true, it); - } - - ~StaticPoolStorageBase() - { - // Placement destructor. - for (Interface* const ptr : allocated_.entries()) - { - eventDispatcher_.dispatch(&PoolEventHandler::onPoolEntryDestroyed, *ptr); - static_cast(ptr)->~Type(); - } - } - - /// Empty the array. - void clear() - { - // Destroy everything in the array. - for (Interface* const ptr : allocated_.entries()) - { - eventDispatcher_.dispatch(&PoolEventHandler::onPoolEntryDestroyed, *ptr); - static_cast(ptr)->~Type(); - } - allocated_.clear(); - lowestFreeIndex_ = Lower; - } - - /// Get the raw entries list - /// Don't use this for looping through entries. Use the custom iterators instead. - const FlatPtrHashSet& _entries() - { - return allocated_.entries(); - } - - /// Get the raw entries list - /// Don't use this for looping through entries. Use the custom iterators instead. - const FlatPtrHashSet& _entries() const - { - return allocated_.entries(); - } - - DefaultEventDispatcher>& getEventDispatcher() - { - return eventDispatcher_; - } - -protected: - bool valid(int index) const - { - return allocated_.valid(toInternalIndex(index)); - } - - inline Type* getPtr(int index) - { - return reinterpret_cast(&pool_[index * CEILDIV(sizeof(Type), alignof(Type)) * alignof(Type)]); - } - - StaticArray pool_; - UniqueIDArray allocated_; - int lowestFreeIndex_ = Lower; - /// Implementation of the pool event dispatcher - DefaultEventDispatcher> eventDispatcher_; -}; - -template -struct DynamicPoolStorageBase : public NoCopy -{ - constexpr static const size_t Lower = Min; - constexpr static const size_t Upper = Max; - constexpr static const size_t Capacity = Upper - Lower; - using Interface = Iface; - - constexpr static int toInternalIndex(int index) - { - return index - Min; - } - - constexpr static int fromInternalIndex(int index) - { - return index + Min; - } - - template - Type* emplace(Args&&... args) - { - int freeIdx = findFreeIndex(); - if (freeIdx < Min) - { - // No free index - return nullptr; - } - - int pid = claimHint(freeIdx, std::forward(args)...); - if (pid < Min) - { - // No free index - return nullptr; - } - - return get(pid); - } - - DynamicPoolStorageBase() - : pool_ { nullptr } - { - } - - ~DynamicPoolStorageBase() - { - for (Interface* const ptr : allocated_.entries()) - { - eventDispatcher_.dispatch(&PoolEventHandler::onPoolEntryDestroyed, *ptr); - delete static_cast(ptr); - } - } - - int findFreeIndex() - { - return findFreeIndex(lowestFreeIndex_); - } - - int findFreeIndex(int from) - { - for (int i = toInternalIndex(from); i < Capacity; ++i) - { - if (pool_[i] == nullptr) - { - return fromInternalIndex(i); - } - } - return fromInternalIndex(-1); - } - - template - int claim(Args&&... args) - { - const int freeIdx = findFreeIndex(); - const int internalIdx = toInternalIndex(freeIdx); - if (internalIdx >= 0) - { - if (freeIdx == lowestFreeIndex_) - { - ++lowestFreeIndex_; - } - pool_[internalIdx] = new Type(std::forward(args)...); - allocated_.add(*pool_[internalIdx]); - if constexpr (std::is_base_of::value) - { - pool_[internalIdx]->poolID = freeIdx; - } - eventDispatcher_.dispatch(&PoolEventHandler::onPoolEntryCreated, *pool_[internalIdx]); - } - return freeIdx; - } - - template - int claimHint(int hint, Args&&... args) - { - if (hint >= Min && hint < Max && !valid(hint)) - { - if (hint == lowestFreeIndex_) - { - ++lowestFreeIndex_; - } - const int internalIdx = toInternalIndex(hint); - pool_[internalIdx] = new Type(std::forward(args)...); - allocated_.add(*pool_[internalIdx]); - if constexpr (std::is_base_of::value) - { - pool_[internalIdx]->poolID = hint; - } - eventDispatcher_.dispatch(&PoolEventHandler::onPoolEntryCreated, *pool_[internalIdx]); - return hint; - } - else - { - return claim(std::forward(args)...); - } - } - - Type* get(int index) - { - if (!valid(index)) - { - return nullptr; - } - return pool_[toInternalIndex(index)]; - } - - const Type* get(int index) const - { - if (!valid(index)) - { - return nullptr; - } - return pool_[toInternalIndex(index)]; - } - - Pair::iterator> remove(int index) - { - if (!valid(index)) - { - return std::make_pair(false, allocated_.entries().end()); - } - if (index < lowestFreeIndex_) - { - lowestFreeIndex_ = index; - } - index = toInternalIndex(index); - auto it = allocated_.remove(*pool_[index]); - eventDispatcher_.dispatch(&PoolEventHandler::onPoolEntryDestroyed, *pool_[index]); - delete pool_[index]; - pool_[index] = nullptr; - return std::make_pair(true, it); - } - - /// Empty the array. - void clear() - { - // Destroy everything in the array. - for (Interface* const ptr : allocated_.entries()) - { - eventDispatcher_.dispatch(&PoolEventHandler::onPoolEntryDestroyed, *ptr); - delete static_cast(ptr); - } - pool_.fill(nullptr); - allocated_.clear(); - lowestFreeIndex_ = Lower; - } - - /// Get the raw entries list - /// Don't use this for looping through entries. Use the custom iterators instead. - const FlatPtrHashSet& _entries() const - { - return allocated_.entries(); - } - - DefaultEventDispatcher>& getEventDispatcher() - { - return eventDispatcher_; - } - -protected: - bool valid(int index) const - { - index = toInternalIndex(index); - if (index < 0 || index >= Capacity) - { - return false; - } - return pool_[index] != nullptr; - } - - StaticArray pool_; - UniqueEntryArray allocated_; - int lowestFreeIndex_ = Lower; - /// Implementation of the pool event dispatcher - DefaultEventDispatcher> eventDispatcher_; -}; - -template -struct ImmediatePoolStorageLifetimeBase final : public PoolBase -{ - inline void release(int index) - { - PoolBase::remove(index); - } - - /// Get the entries list - FlatPtrHashSet& entries() - { - return PoolBase::allocated_.entries(); - } - - /// Get the entries list - const FlatPtrHashSet& entries() const - { - return PoolBase::allocated_.entries(); - } -}; - -template -struct MarkedPoolStorageLifetimeBase final : public PoolBase -{ - using Iterator = MarkedPoolIterator>; - - /// Return the begin iterator - inline Iterator begin() - { - return Iterator(*this, PoolBase::_entries(), PoolBase::_entries().begin()); - } - - /// Return the end iterator - inline Iterator end() - { - return Iterator(*this, PoolBase::_entries(), PoolBase::_entries().end()); - } - - MarkedPoolStorageLifetimeBase() - : refs_ {} - { - } - - void lock(int index) - { - if (index < PoolBase::Lower) - { - return; - } - if (index >= PoolBase::Upper) - { - return; - } - - // Increase number of lock refs - ++refs_[index]; - assert(refs_[index] < std::numeric_limits::max()); - } - - bool unlock(int index) - { - if (index < PoolBase::Lower) - { - return false; - } - if (index >= PoolBase::Upper) - { - return false; - } - - assert(refs_[index] > 0); - // If marked for deletion on unlock, release - if (--refs_[index] == 0 && deleted_.test(index)) - { - release(index, true); - return true; - } - return false; - } - - void release(int index, bool force) - { - if (index < PoolBase::Lower) - { - return; - } - if (index >= PoolBase::Upper) - { - return; - } - - // If locked, mark for deletion on unlock - if (refs_[index] > 0) - { - deleted_.set(index); - } - else - { // If not locked, immediately delete - deleted_.reset(index); - PoolBase::remove(index); - } - } - -private: - /// List signifying whether an entry is marked for deletion - StaticBitset deleted_; - /// List signifying the number of references held for the entry; if 0 and marked for deletion, it's deleted - StaticArray refs_; -}; - -/// Pool storage which doesn't mark entries for release but immediately releases -/// Allocates contents statically -template -using PoolStorage = ImmediatePoolStorageLifetimeBase>; - -/// Pool storage which doesn't mark entries for release but immediately releases -/// Allocates contents dynamically -template -using DynamicPoolStorage = ImmediatePoolStorageLifetimeBase>; - -/// Pool storage which marks entries for release if locked -/// Allocates contents statically -template -using MarkedPoolStorage = MarkedPoolStorageLifetimeBase, RefCountType>; - -/// Pool storage which marks entries for release if locked -/// Allocates contents dynamically -template -using MarkedDynamicPoolStorage = MarkedPoolStorageLifetimeBase, RefCountType>; - -} diff --git a/SDK/include/Server/Components/Actors/actors.hpp b/SDK/include/Server/Components/Actors/actors.hpp deleted file mode 100644 index f3be7a1c4..000000000 --- a/SDK/include/Server/Components/Actors/actors.hpp +++ /dev/null @@ -1,76 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include - -struct ActorSpawnData -{ - Vector3 position; - float facingAngle; - int skin; -}; - -/// Actor interace -struct IActor : public IExtensible, public IEntity -{ - /// Sets the actor's skin - virtual void setSkin(int id) = 0; - - /// Gets the actor's model - virtual int getSkin() const = 0; - - /// Apply an animation for the actor - virtual void applyAnimation(const AnimationData& animation) = 0; - - /// Get the actor's applied animation - virtual const AnimationData& getAnimation() const = 0; - - /// Clear the actor's animations - virtual void clearAnimations() = 0; - - /// Set the actor's health - virtual void setHealth(float health) = 0; - - /// Get the actor's health - virtual float getHealth() const = 0; - - /// Set whether the actor is invulnerable - virtual void setInvulnerable(bool invuln) = 0; - - /// Get whether the actor is invulnerable - virtual bool isInvulnerable() const = 0; - - /// Checks if actor is streamed for a player - virtual bool isStreamedInForPlayer(const IPlayer& player) const = 0; - - /// Streams actor for a player - virtual void streamInForPlayer(IPlayer& player) = 0; - - /// Streams out actor for a player - virtual void streamOutForPlayer(IPlayer& player) = 0; - - /// Get actor spawn data - virtual const ActorSpawnData& getSpawnData() = 0; -}; - -struct ActorEventHandler -{ - virtual void onPlayerGiveDamageActor(IPlayer& player, IActor& actor, float amount, unsigned weapon, BodyPart part) { } - virtual void onActorStreamOut(IActor& actor, IPlayer& forPlayer) { } - virtual void onActorStreamIn(IActor& actor, IPlayer& forPlayer) { } -}; - -static const UID ActorsComponent_UID = UID(0xc81ca021eae2ad5c); -struct IActorsComponent : public IPoolComponent -{ - PROVIDE_UID(ActorsComponent_UID); - - /// Get the ActorEventHandler event dispatcher - virtual IEventDispatcher& getEventDispatcher() = 0; - - /// Create an actor - virtual IActor* create(int skin, Vector3 pos, float angle) = 0; -}; diff --git a/SDK/include/Server/Components/Checkpoints/checkpoints.hpp b/SDK/include/Server/Components/Checkpoints/checkpoints.hpp deleted file mode 100644 index ebdfe7f93..000000000 --- a/SDK/include/Server/Components/Checkpoints/checkpoints.hpp +++ /dev/null @@ -1,71 +0,0 @@ -#pragma once - -#include - -/// The type of the checkpoint: https://open.mp/docs/scripting/functions/SetPlayerRaceCheckpoint -/// Note: checkpoint types are not restricted to any type of vehicle/on foot -enum class RaceCheckpointType -{ - RACE_NORMAL = 0, // Must have nextPosition, else it shows as RACE_FINISH - RACE_FINISH, // Must have no nextPosition, else it shows as RACE_NORMAL - RACE_NOTHING, - RACE_AIR_NORMAL, - RACE_AIR_FINISH, - RACE_AIR_ONE, - RACE_AIR_TWO, - RACE_AIR_THREE, - RACE_AIR_FOUR, - RACE_NONE, -}; - -struct ICheckpointDataBase -{ - virtual Vector3 getPosition() const = 0; - virtual void setPosition(const Vector3& position) = 0; - virtual float getRadius() const = 0; - virtual void setRadius(float radius) = 0; - virtual bool isPlayerInside() const = 0; - virtual void setPlayerInside(bool inside) = 0; - - virtual void enable() = 0; - virtual void disable() = 0; - virtual bool isEnabled() const = 0; -}; - -struct ICheckpointData : public ICheckpointDataBase -{ -}; - -struct IRaceCheckpointData : public ICheckpointDataBase -{ - virtual RaceCheckpointType getType() const = 0; - virtual void setType(RaceCheckpointType type) = 0; - virtual Vector3 getNextPosition() const = 0; - virtual void setNextPosition(const Vector3& nextPosition) = 0; -}; - -static const UID PlayerCheckpointData_UID = UID(0xbc07576aa3591a66); -struct IPlayerCheckpointData : public IExtension -{ - PROVIDE_EXT_UID(PlayerCheckpointData_UID); - - virtual IRaceCheckpointData& getRaceCheckpoint() = 0; - virtual ICheckpointData& getCheckpoint() = 0; -}; - -struct PlayerCheckpointEventHandler -{ - virtual void onPlayerEnterCheckpoint(IPlayer& player) { } - virtual void onPlayerLeaveCheckpoint(IPlayer& player) { } - virtual void onPlayerEnterRaceCheckpoint(IPlayer& player) { } - virtual void onPlayerLeaveRaceCheckpoint(IPlayer& player) { } -}; - -static const UID CheckpointsComponent_UID = UID(0x44a937350d611dde); -struct ICheckpointsComponent : public IComponent -{ - PROVIDE_UID(CheckpointsComponent_UID) - - // Access to event dispatchers for other components to add handlers to - virtual IEventDispatcher& getEventDispatcher() = 0; -}; diff --git a/SDK/include/Server/Components/Classes/classes.hpp b/SDK/include/Server/Components/Classes/classes.hpp deleted file mode 100644 index 701e0105f..000000000 --- a/SDK/include/Server/Components/Classes/classes.hpp +++ /dev/null @@ -1,60 +0,0 @@ -#pragma once - -#include - -/// Player class interface -struct PlayerClass -{ - int team; ///< The class's team - int skin; ///< The class's skin ID - Vector3 spawn; ///< The class's spawn position - float angle; ///< The class's angle - WeaponSlots weapons; ///< The class's weapons - - PlayerClass(int skin, int team, Vector3 spawn, float angle, const WeaponSlots& weapons) - : team(team) - , skin(skin) - , spawn(spawn) - , angle(angle) - , weapons(weapons) - { - } -}; - -/// The class interface returned by the class pool -struct IClass : public IExtensible, public IIDProvider -{ - /// Get the player class associated with the class interface - virtual const PlayerClass& getClass() = 0; - - /// Set the player class data - virtual void setClass(const PlayerClass& data) = 0; -}; - -static const UID PlayerClassData_UID = UID(0x185655ded843788b); -struct IPlayerClassData : public IExtension -{ - PROVIDE_EXT_UID(PlayerClassData_UID) - - virtual const PlayerClass& getClass() = 0; - virtual void setSpawnInfo(const PlayerClass& info) = 0; - virtual void spawnPlayer() = 0; -}; - -/// The player class event handler -struct ClassEventHandler -{ - virtual bool onPlayerRequestClass(IPlayer& player, unsigned int classId) { return true; } -}; - -static const UID ClassesComponent_UID = UID(0x8cfb3183976da208); -struct IClassesComponent : public IPoolComponent -{ - PROVIDE_UID(ClassesComponent_UID) - - virtual IEventDispatcher& getEventDispatcher() = 0; - - /// Attempt to create a new class from params - /// @return A pointer to the new class or nullptr if unable to create - virtual IClass* create(int skin, int team, Vector3 spawn, float angle, const WeaponSlots& weapons) = 0; -}; diff --git a/SDK/include/Server/Components/Console/console.hpp b/SDK/include/Server/Components/Console/console.hpp deleted file mode 100644 index 56d9989f5..000000000 --- a/SDK/include/Server/Components/Console/console.hpp +++ /dev/null @@ -1,81 +0,0 @@ -#pragma once -#include -#include - -/// Used for custom handling of messages received by the console -struct ConsoleMessageHandler -{ - virtual void handleConsoleMessage(StringView message) = 0; -}; - -/// The command sender types -enum class ConsoleCommandSender -{ - Console, - Player, - Custom -}; - -/// Data attached to the command sender types -struct ConsoleCommandSenderData -{ - ConsoleCommandSender sender; - union - { - IPlayer* player; ///< The player who sent the command, only available with ConsoleCommandSender::Player - ConsoleMessageHandler* handler; ///< The handler of the command sender, only available with ConsoleCommandSender::Custom - }; - - /// Console sender constructor - ConsoleCommandSenderData() - : sender(ConsoleCommandSender::Console) - , player(nullptr) - { - } - - /// Player sender constructor - ConsoleCommandSenderData(IPlayer& player) - : sender(ConsoleCommandSender::Player) - , player(&player) - { - } - - /// Custom sender constructor - ConsoleCommandSenderData(ConsoleMessageHandler& handler) - : sender(ConsoleCommandSender::Custom) - , handler(&handler) - { - } -}; - -struct ConsoleEventHandler -{ - virtual bool onConsoleText(StringView command, StringView parameters, const ConsoleCommandSenderData& sender) { return false; } - virtual void onRconLoginAttempt(IPlayer& player, StringView password, bool success) { } - virtual void onConsoleCommandListRequest(FlatHashSet& commands) { } -}; - -static const UID ConsoleComponent_UID = UID(0xbfa24e49d0c95ee4); -struct IConsoleComponent : public IComponent -{ - PROVIDE_UID(ConsoleComponent_UID); - - /// Get the ConsoleEventHandler event dispatcher - virtual IEventDispatcher& getEventDispatcher() = 0; - - /// Send a console command - virtual void send(StringView command, const ConsoleCommandSenderData& sender = ConsoleCommandSenderData()) = 0; - virtual void sendMessage(const ConsoleCommandSenderData& recipient, StringView message) = 0; -}; - -static const UID PlayerConsoleData_UID = UID(0x9f8d20f2f471cbae); -struct IPlayerConsoleData : public IExtension -{ - PROVIDE_EXT_UID(PlayerConsoleData_UID); - - /// Check if player has console access - virtual bool hasConsoleAccess() const = 0; - - /// Set player's console accessibility - virtual void setConsoleAccessibility(bool set) = 0; -}; diff --git a/SDK/include/Server/Components/CustomModels/custommodels.hpp b/SDK/include/Server/Components/CustomModels/custommodels.hpp deleted file mode 100644 index 46ac1f86d..000000000 --- a/SDK/include/Server/Components/CustomModels/custommodels.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once - -#include -#include -#include - -enum class ModelType : uint8_t -{ - Skin = 1, - Object -}; - -enum class ModelDownloadType : uint8_t -{ - NONE = 0, - DFF = 1, - TXD = 2 -}; - -struct PlayerModelsEventHandler -{ - virtual void onPlayerFinishedDownloading(IPlayer& player) { } - virtual bool onPlayerRequestDownload(IPlayer& player, ModelDownloadType type, uint32_t checksum) { return true; } -}; - -/// Player models data -struct IPlayerCustomModelsData : public IExtension -{ - PROVIDE_EXT_UID(0xD3E2F572B38FB3F2) - - /// Get the player's custom skin - /// Returns 0 if they aren't using a custom skin - virtual uint32_t getCustomSkin() const = 0; - - // Set the player's custom skin - virtual void setCustomSkin(const uint32_t skinModel) = 0; - - // Send download url of current requested file. - virtual bool sendDownloadUrl(StringView url) const = 0; -}; - -static const UID ModelsComponent_UID = UID(0x15E3CB1E7C77FFFF); -struct ICustomModelsComponent : public IComponent -{ - PROVIDE_UID(ModelsComponent_UID); - - virtual bool addCustomModel(ModelType type, int32_t id, int32_t baseId, StringView dffName, StringView txdName, int32_t virtualWorld = -1, uint8_t timeOn = 0, uint8_t timeOff = 0) = 0; - virtual bool getBaseModel(uint32_t& baseModelIdOrInput, uint32_t& customModel) = 0; - virtual IEventDispatcher& getEventDispatcher() = 0; - virtual StringView getModelNameFromChecksum(uint32_t checksum) const = 0; - virtual bool isValidCustomModel(int32_t modelId) const = 0; - virtual bool getCustomModelPath(int32_t modelId, StringView& dffPath, StringView& txdPath) const = 0; -}; diff --git a/SDK/include/Server/Components/Databases/databases.hpp b/SDK/include/Server/Components/Databases/databases.hpp deleted file mode 100644 index 13a542e24..000000000 --- a/SDK/include/Server/Components/Databases/databases.hpp +++ /dev/null @@ -1,179 +0,0 @@ -#pragma once - -#include - -/// Result set, backwards-compatible with some memory hacking PAWN includes -struct LegacyDBResult -{ - int rows; - int columns; - char** results; -}; - -struct IDatabaseResultSetRow -{ - - /// Gets the number of fields - /// @returns Number of fields - virtual std::size_t getFieldCount() const = 0; - - /// Is field name available - /// @param fieldName Field name - /// @returns "true" if field name is available, otherwise "false" - virtual bool isFieldNameAvailable(StringView fieldName) const = 0; - - /// Gets the name of the field by the specified field index - /// @param fieldIndex Field index - /// @returns Name of the field - virtual StringView getFieldName(std::size_t fieldIndex) const = 0; - - /// Gets the string of the field by the specified field index - /// @param fieldIndex Field index - /// @returns String - virtual StringView getFieldString(std::size_t fieldIndex) const = 0; - - /// Gets the integer of the field by the specified field index - /// @param fieldIndex Field index - /// @returns Integer - virtual long getFieldInt(std::size_t fieldIndex) const = 0; - - /// Gets the floating point number of the field by the specified field index - /// @param fieldIndex Field index - /// @returns Floating point number - virtual double getFieldFloat(std::size_t fieldIndex) const = 0; - - /// Gets the string of the field by the specified field name - /// @param fieldName Field name - /// @returns String - virtual StringView getFieldStringByName(StringView fieldName) const = 0; - - /// Gets the integer of the field by the specified field name - /// @param fieldName Field name - /// @returns Integer - virtual long getFieldIntByName(StringView fieldName) const = 0; - - /// Gets the floating point number of the field by the specified field name - /// @param fieldName Field name - /// @returns Floating point number - virtual double getFieldFloatByName(StringView fieldName) const = 0; -}; - -struct IDatabaseResultSet : public IExtensible, public IIDProvider -{ - - /// Gets the number of rows - /// @returns Number of rows - virtual std::size_t getRowCount() const = 0; - - /// Selects next row - /// @returns "true" if next row has been selected successfully, otherwise "false" - virtual bool selectNextRow() = 0; - - /// Gets the number of fields - /// @returns Number of fields - virtual std::size_t getFieldCount() const = 0; - - /// Is field name available - /// @param fieldName Field name - /// @returns "true" if field name is available, otherwise "false" - virtual bool isFieldNameAvailable(StringView fieldName) const = 0; - - /// Gets the name of the field by the specified field index - /// @param fieldIndex Field index - /// @returns Name of the field - virtual StringView getFieldName(std::size_t fieldIndex) const = 0; - - /// Gets the string of the field by the specified field index - /// @param fieldIndex Field index - /// @returns String - virtual StringView getFieldString(std::size_t fieldIndex) const = 0; - - /// Gets the integer of the field by the specified field index - /// @param fieldIndex Field index - /// @returns Integer - virtual long getFieldInt(std::size_t fieldIndex) const = 0; - - /// Gets the floating point number of the field by the specified field index - /// @param fieldIndex Field index - /// @returns Floating point number - virtual double getFieldFloat(std::size_t fieldIndex) const = 0; - - /// Gets the string of the field by the specified field name - /// @param fieldName Field name - /// @returns String - virtual StringView getFieldStringByName(StringView fieldName) const = 0; - - /// Gets the integer of the field by the specified field name - /// @param fieldName Field name - /// @returns Integer - virtual long getFieldIntByName(StringView fieldName) const = 0; - - /// Gets the floating point number of the field by the specified field name - /// @param fieldName Field name - /// @returns Floating point number - virtual double getFieldFloatByName(StringView fieldName) const = 0; - - virtual LegacyDBResult& getLegacyDBResult() = 0; -}; - -struct IDatabaseConnection : public IExtensible, public IIDProvider -{ - - /// Closes this database connection - /// @returns "true" if connection has been successfully closed, otherwise "false" - virtual bool close() = 0; - - /// Executes the specified query - /// @param query Query to execute - /// @returns Result set - virtual IDatabaseResultSet* executeQuery(StringView query) = 0; -}; - -static const UID DatabasesComponent_UID = UID(0x80092e7eb5821a96 /*0x80092e7eb5821a969640def7747a231a*/); -struct IDatabasesComponent : public IComponent -{ - PROVIDE_UID(DatabasesComponent_UID); - - /// Opens a new database connection - /// @param path Path to the database - /// @returns Database if successful, otherwise "nullptr" - virtual IDatabaseConnection* open(StringView path, int flags = 0) = 0; - - /// Closes the specified database connection - /// @param connection Database connection - /// @returns "true" if database connection has been successfully closed, otherwise "false" - virtual bool close(IDatabaseConnection& connection) = 0; - - /// Frees the specified result set - /// @param resultSet Result set - /// @returns "true" if result set has been successfully freed, otherwise "false" - virtual bool freeResultSet(IDatabaseResultSet& resultSet) = 0; - - /// Gets the number of database connections - /// @returns Number of database connections - virtual std::size_t getDatabaseConnectionCount() const = 0; - - /// Is database connection ID valid - /// @param databaseConnectionID Database connection ID - /// @returns "true" if database connection ID is valid, otherwise "false" - virtual bool isDatabaseConnectionIDValid(int databaseConnectionID) const = 0; - - /// Gets a database connection by ID - /// @param databaseConnectionID Database connection ID - /// @returns Database connection - virtual IDatabaseConnection& getDatabaseConnectionByID(int databaseConnectionID) = 0; - - /// Gets the number of database result sets - /// @returns Number of result sets - virtual std::size_t getDatabaseResultSetCount() const = 0; - - /// Is database result set ID valid - /// @param databaseResultSetID Database result set ID - /// @returns "true" if database result set ID is valid, otherwise "false" - virtual bool isDatabaseResultSetIDValid(int databaseResultSetID) const = 0; - - /// Gets a database result set by ID - /// @param databaseResultSetID Database result set ID - /// @returns Database result set - virtual IDatabaseResultSet& getDatabaseResultSetByID(int databaseResultSetID) = 0; -}; diff --git a/SDK/include/Server/Components/Dialogs/dialogs.hpp b/SDK/include/Server/Components/Dialogs/dialogs.hpp deleted file mode 100644 index 4757e3e13..000000000 --- a/SDK/include/Server/Components/Dialogs/dialogs.hpp +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -#include - -/// The style of the dialog: https://open.mp/docs/scripting/resources/dialogstyles -enum DialogStyle -{ - DialogStyle_MSGBOX = 0, - DialogStyle_INPUT, - DialogStyle_LIST, - DialogStyle_PASSWORD, - DialogStyle_TABLIST, - DialogStyle_TABLIST_HEADERS -}; - -enum DialogResponse -{ - DialogResponse_Right = 0, - DialogResponse_Left -}; - -static const UID DialogData_UID = UID(0xbc03376aa3591a11); -struct IPlayerDialogData : public IExtension -{ - PROVIDE_EXT_UID(DialogData_UID); - - /// Hide a dialog from a player - virtual void hide(IPlayer& player) = 0; - - /// Show a dialog to a player - virtual void show(IPlayer& player, int id, DialogStyle style, StringView title, StringView body, StringView button1, StringView button2) = 0; - - /// Get a player's current dialog data. - virtual void get(int& id, DialogStyle& style, StringView& title, StringView& body, StringView& button1, StringView& button2) = 0; - - /// Get player's active dialog - virtual int getActiveID() const = 0; -}; - -struct PlayerDialogEventHandler -{ - virtual void onDialogResponse(IPlayer& player, int dialogId, DialogResponse response, int listItem, StringView inputText) { } -}; - -static const UID DialogsComponent_UID = UID(0x44a111350d611dde); -struct IDialogsComponent : public IComponent -{ - PROVIDE_UID(DialogsComponent_UID); - - /// Access to event dispatchers for other components to add handlers to - virtual IEventDispatcher& getEventDispatcher() = 0; -}; diff --git a/SDK/include/Server/Components/Fixes/fixes.hpp b/SDK/include/Server/Components/Fixes/fixes.hpp deleted file mode 100644 index 14bc186e6..000000000 --- a/SDK/include/Server/Components/Fixes/fixes.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public License, - * v. 2.0. If a copy of the MPL was not distributed with this file, You can - * obtain one at http://mozilla.org/MPL/2.0/. - * - * The original code is copyright (c) 2022, open.mp team and contributors. - */ - -#pragma once - -#include - -static const UID FixesData_UID = UID(0x672d5d6fbb094ef7); -struct IPlayerFixesData : public IExtension -{ - PROVIDE_EXT_UID(FixesData_UID); - - /// Send a game text message to the player - virtual bool sendGameText(StringView message, Milliseconds time, int style) = 0; - - /// Hide a game text message from the player - virtual bool hideGameText(int style) = 0; - - /// Check if the player can currently see this game text. - virtual bool hasGameText(int style) = 0; - - /// Get the data for this gametext, if they have one. - virtual bool getGameText(int style, StringView& message, Milliseconds& time, Milliseconds& remaining) = 0; - - // Apply animation to fix animation library not being loaded for the first time - virtual void applyAnimation(IPlayer* player, IActor* actor, AnimationData const* animation) = 0; -}; - -static const UID FixesComponent_UID = UID(0xb5c615eff0329ff7); -struct IFixesComponent : public IComponent -{ - PROVIDE_UID(FixesComponent_UID); - - /// sendGameText for all players - virtual bool sendGameTextToAll(StringView message, Milliseconds time, int style) = 0; - - /// hideGameText for all players - virtual bool hideGameTextForAll(int style) = 0; - - // Cleat a player's or an actor's animation reapply storage - virtual void clearAnimation(IPlayer* player, IActor* actor) = 0; -}; diff --git a/SDK/include/Server/Components/GangZones/gangzones.hpp b/SDK/include/Server/Components/GangZones/gangzones.hpp deleted file mode 100644 index 26c1763bb..000000000 --- a/SDK/include/Server/Components/GangZones/gangzones.hpp +++ /dev/null @@ -1,144 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include - -struct GangZonePos -{ - Vector2 min = { 0.0f, 0.0f }; - Vector2 max = { 0.0f, 0.0f }; -}; - -/// Gangzone interace -struct IBaseGangZone : public IExtensible, public IIDProvider -{ - /// Check if a gangzone is shown for player - virtual bool isShownForPlayer(const IPlayer& player) const = 0; - - /// Check if a gangzone is flashing for player - virtual bool isFlashingForPlayer(const IPlayer& player) const = 0; - - /// Show a gangzone for player - virtual void showForPlayer(IPlayer& player, const Colour& colour) = 0; - - /// Hide a gangzone for player - virtual void hideForPlayer(IPlayer& player) = 0; - - /// Flashing a gangzone for player - virtual void flashForPlayer(IPlayer& player, const Colour& colour) = 0; - - /// Stop flashing a gangzone for player - virtual void stopFlashForPlayer(IPlayer& player) = 0; - - /// Get position of gangzone. Returns a structure of vec2 min and vec2 max coordinates - virtual GangZonePos getPosition() const = 0; - - /// Set position of gangzone. Takes a structure of vec2 min and vec2 max coordinates - virtual void setPosition(const GangZonePos& position) = 0; - - /// Check if specified player is within gangzone bounds (only works with IGangZonesComponent::useGangZoneCheck). - virtual bool isPlayerInside(const IPlayer& player) const = 0; - - /// get a list of players gangzone is shown for - virtual const FlatHashSet& getShownFor() = 0; - - /// get gangzone flashing color for a player - virtual const Colour getFlashingColourForPlayer(IPlayer& player) const = 0; - - /// get gangzone color for a player - virtual const Colour getColourForPlayer(IPlayer& player) const = 0; - - /// Used by legacy per-player gangzones for ID mapping. - virtual void setLegacyPlayer(IPlayer* player) = 0; - - /// Used by legacy per-player gangzones for ID mapping. - virtual IPlayer* getLegacyPlayer() const = 0; -}; - -struct IGangZone : public IBaseGangZone -{ -}; - -struct IPlayerGangZone : public IBaseGangZone -{ -}; - -struct GangZoneEventHandler -{ - virtual void onPlayerEnterGangZone(IPlayer& player, IGangZone& zone) { } - virtual void onPlayerLeaveGangZone(IPlayer& player, IGangZone& zone) { } - virtual void onPlayerClickGangZone(IPlayer& player, IGangZone& zone) { } -}; - -static const UID GangZoneComponent_UID = UID(0xb3351d11ee8d8056); - -struct IGangZonesComponent : public IPoolComponent -{ - PROVIDE_UID(GangZoneComponent_UID); - - /// Get the event dispatcher - virtual IEventDispatcher& getEventDispatcher() = 0; - - /// Create a gang zone - virtual IGangZone* create(GangZonePos pos) = 0; - - /// Get list of gangzones that need to be checked for enter/leave events - virtual const FlatHashSet& getCheckingGangZones() const = 0; - - /// add gangzone to checking list to loop through on player update, see if player enters or leaves - virtual void useGangZoneCheck(IGangZone& zone, bool enable) = 0; - - /// Get the ID of this zone as used in old pools (i.e. in pawn). - virtual int toLegacyID(int real) const = 0; - - /// Get the ID of this zone as used in the SDK. - virtual int fromLegacyID(int legacy) const = 0; - - /// Release the ID used in limited pools. - virtual void releaseLegacyID(int legacy) = 0; - - /// Return an ID not yet used in pawn (et al) to represent this gang zone. - virtual int reserveLegacyID() = 0; - - /// Assign a full ID to the legacy ID reserved earlier. - virtual void setLegacyID(int legacy, int real) = 0; -}; - -static const UID GangZoneData_UID = UID(0xee8d8056b3351d11); -struct IPlayerGangZoneData : public IExtension -{ - PROVIDE_EXT_UID(GangZoneData_UID); - - /// Get the ID of this zone as used in old pools (i.e. in pawn). - virtual int toLegacyID(int real) const = 0; - - /// Get the ID of this zone as used in the SDK. - virtual int fromLegacyID(int legacy) const = 0; - - /// Release the ID used in limited pools. - virtual void releaseLegacyID(int legacy) = 0; - - /// Return an ID not yet used in pawn (et al) to represent this gang zone. - virtual int reserveLegacyID() = 0; - - /// Assign a full ID to the legacy ID reserved earlier. - virtual void setLegacyID(int legacy, int real) = 0; - - /// Get the ID of this zone as used internally (i.e. sent to the client). - virtual int toClientID(int real) const = 0; - - /// Get the ID of this zone as used in the SDK. - virtual int fromClientID(int legacy) const = 0; - - /// Release the ID used on the client. - virtual void releaseClientID(int legacy) = 0; - - /// Return an ID not yet used on the client to represent this gang zone. - virtual int reserveClientID() = 0; - - /// Assign a full ID to the legacy ID reserved earlier. - virtual void setClientID(int legacy, int real) = 0; -}; diff --git a/SDK/include/Server/Components/LegacyConfig/legacyconfig.hpp b/SDK/include/Server/Components/LegacyConfig/legacyconfig.hpp deleted file mode 100644 index 013f8bad7..000000000 --- a/SDK/include/Server/Components/LegacyConfig/legacyconfig.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include -#include - -static const UID LegacyConfigComponent_UID = UID(0x24ef6216838f9ffc); -/// The text label component which is a global text label pool -struct ILegacyConfigComponent : public IComponent -{ - PROVIDE_UID(LegacyConfigComponent_UID); - - /// Look up the new config by legacy name (empty if none). - virtual StringView getConfig(StringView legacyName) = 0; - - /// Look up the legacy config by new name (empty if none). - virtual StringView getLegacy(StringView configName) = 0; -}; diff --git a/SDK/include/Server/Components/Menus/menus.hpp b/SDK/include/Server/Components/Menus/menus.hpp deleted file mode 100644 index ed9518b70..000000000 --- a/SDK/include/Server/Components/Menus/menus.hpp +++ /dev/null @@ -1,87 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -typedef uint8_t MenuRow; -typedef uint8_t MenuColumn; - -/// Pickup interace -struct IMenu : public IExtensible, public IIDProvider -{ - /// Sets given column's header title - virtual void setColumnHeader(StringView header, MenuColumn column) = 0; - - /// Adds an item to given column - virtual int addCell(StringView itemText, MenuColumn column) = 0; - - /// Disables a specific row in menu - virtual void disableRow(MenuRow row) = 0; - - /// Check if menu is enabled - virtual bool isRowEnabled(MenuRow row) const = 0; - - /// Disables menu - virtual void disable() = 0; - - /// Check if menu is enabled - virtual bool isEnabled() const = 0; - - /// Get position - virtual const Vector2& getPosition() const = 0; - - /// Get menu item count in a specific column - virtual int getRowCount(MenuColumn column) const = 0; - - /// Get menu item count - virtual int getColumnCount() const = 0; - - /// Get columns width - virtual Vector2 getColumnWidths() const = 0; - - /// Get column header - virtual const StringView getColumnHeader(MenuColumn column) const = 0; - - /// Get column header - virtual const StringView getCell(MenuColumn column, MenuRow row) const = 0; - - /// Initialise menu for a player - virtual void initForPlayer(IPlayer& player) = 0; - - /// Show menu for a player - virtual void showForPlayer(IPlayer& player) = 0; - - /// Hide menu for a player - virtual void hideForPlayer(IPlayer& player) = 0; -}; - -struct MenuEventHandler -{ - virtual void onPlayerSelectedMenuRow(IPlayer& player, MenuRow row) { } - virtual void onPlayerExitedMenu(IPlayer& player) { } -}; - -static const UID PlayerMenuData_UID = UID(0x01d8e934e9791b99); -struct IPlayerMenuData : public IExtension -{ - PROVIDE_EXT_UID(PlayerMenuData_UID) - - /// Get Player's current menu id - virtual uint8_t getMenuID() const = 0; - - /// Set Player's current menu id - virtual void setMenuID(uint8_t id) = 0; -}; - -static const UID MenusComponent_UID = UID(0x621e219eb97ee0b2); -struct IMenusComponent : public IPoolComponent -{ - PROVIDE_UID(MenusComponent_UID); - - virtual IEventDispatcher& getEventDispatcher() = 0; - - /// Create a menu - virtual IMenu* create(StringView title, Vector2 position, uint8_t columns, float col1Width, float col2Width) = 0; -}; diff --git a/SDK/include/Server/Components/Objects/objects.hpp b/SDK/include/Server/Components/Objects/objects.hpp deleted file mode 100644 index 17bec8959..000000000 --- a/SDK/include/Server/Components/Objects/objects.hpp +++ /dev/null @@ -1,299 +0,0 @@ -#pragma once - -#include - -struct IVehicle; - -/// Object material text align values -enum ObjectMaterialSize -{ - ObjectMaterialSize_32x32 = 10, - ObjectMaterialSize_64x32 = 20, - ObjectMaterialSize_64x64 = 30, - ObjectMaterialSize_128x32 = 40, - ObjectMaterialSize_128x64 = 50, - ObjectMaterialSize_128x128 = 60, - ObjectMaterialSize_256x32 = 70, - ObjectMaterialSize_256x64 = 80, - ObjectMaterialSize_256x128 = 90, - ObjectMaterialSize_256x256 = 100, - ObjectMaterialSize_512x64 = 110, - ObjectMaterialSize_512x128 = 120, - ObjectMaterialSize_512x256 = 130, - ObjectMaterialSize_512x512 = 140 -}; - -/// Object material text align values -enum ObjectMaterialTextAlign -{ - ObjectMaterialTextAlign_Left, - ObjectMaterialTextAlign_Center, - ObjectMaterialTextAlign_Right -}; - -/// Object selection type -enum ObjectSelectType -{ - ObjectSelectType_None, - ObjectSelectType_Global, - ObjectSelectType_Player -}; - -/// Object edit responses -enum ObjectEditResponse -{ - ObjectEditResponse_Cancel, - ObjectEditResponse_Final, - ObjectEditResponse_Update -}; - -/// Player bones for attaching objects -enum PlayerBone -{ - PlayerBone_None, - PlayerBone_Spine, - PlayerBone_Head, - PlayerBone_LeftUpperArm, - PlayerBone_RightUpperArm, - PlayerBone_LeftHand, - PlayerBone_RightHand, - PlayerBone_LeftThigh, - PlayerBone_RightThigh, - PlayerBone_LeftFoot, - PlayerBone_RightFoot, - PlayerBone_RightCalf, - PlayerBone_LeftCalf, - PlayerBone_LeftForearm, - PlayerBone_RightForearm, - PlayerBone_LeftShoulder, - PlayerBone_RightShoulder, - PlayerBone_Neck, - PlayerBone_Jaw -}; - -/* Interfaces, to be passed around */ - -/// Trivial object material data -struct ObjectMaterialData -{ - enum Type : uint8_t - { - None, - Default, - Text - }; - - union - { - int model; // Default - struct - { // Text - uint8_t materialSize; - uint8_t fontSize; - uint8_t alignment; - bool bold; - }; - }; - - union - { - Colour materialColour; // Default - Colour fontColour; // Text - }; - - Colour backgroundColour; // Text - - HybridString<32> textOrTXD; // Text or TXD - HybridString<32> fontOrTexture; // Font or texture - - Type type; // Shared - bool used; // Shared - - ObjectMaterialData() - : used(false) - { - } -}; - -/// Object attachment data -struct ObjectAttachmentData -{ - enum class Type : uint8_t - { - None, - Vehicle, - Object, - Player - } type; - bool syncRotation; - int ID; - Vector3 offset; - Vector3 rotation; -}; - -/// Player slot object attachment data -struct ObjectAttachmentSlotData -{ - int model; - int bone; - Vector3 offset; - Vector3 rotation; - Vector3 scale; - Colour colour1; - Colour colour2; -}; - -/// Object move data -struct ObjectMoveData -{ - Vector3 targetPos; - Vector3 targetRot; - float speed; -}; - -/// Base object class -struct IBaseObject : public IExtensible, public IEntity -{ - /// Set the draw distance of the object - virtual void setDrawDistance(float drawDistance) = 0; - - /// Get the object's draw distance - virtual float getDrawDistance() const = 0; - - /// Set the model of the object - virtual void setModel(int model) = 0; - - /// Get the object's model - virtual int getModel() const = 0; - - /// Set whether the object has camera collision - virtual void setCameraCollision(bool collision) = 0; - - /// Get whether the object has camera collision - virtual bool getCameraCollision() const = 0; - - /// Start moving the object - virtual void move(const ObjectMoveData& data) = 0; - - /// Get whether the object is moving - virtual bool isMoving() const = 0; - - /// Stop moving the object prematurely - virtual void stop() = 0; - - /// Get object moving data - virtual const ObjectMoveData& getMovingData() const = 0; - - /// Attach the object to a vehicle - virtual void attachToVehicle(IVehicle& vehicle, Vector3 offset, Vector3 rotation) = 0; - - /// Reset any attachment data about the object - virtual void resetAttachment() = 0; - - /// Get the object's attachment data - virtual const ObjectAttachmentData& getAttachmentData() const = 0; - - /// Get the object's material data - virtual bool getMaterialData(uint32_t materialIndex, const ObjectMaterialData*& out) const = 0; - - /// Set the object's material to a texture - virtual void setMaterial(uint32_t materialIndex, int model, StringView textureLibrary, StringView textureName, Colour colour) = 0; - - /// Set the object's material to some text - virtual void setMaterialText(uint32_t materialIndex, StringView text, ObjectMaterialSize materialSize, StringView fontFace, int fontSize, bool bold, Colour fontColour, Colour backgroundColour, ObjectMaterialTextAlign align) = 0; -}; - -/// An object interface -struct IObject : public IBaseObject -{ - /// Attach the object to a player - virtual void attachToPlayer(IPlayer& player, Vector3 offset, Vector3 rotation) = 0; - - /// Attach the object to another object - virtual void attachToObject(IObject& object, Vector3 offset, Vector3 rotation, bool syncRotation) = 0; -}; - -struct IPlayerObject : public IBaseObject -{ - virtual void attachToObject(IPlayerObject& object, Vector3 offset, Vector3 rotation) = 0; - - /// Attach the object to a player - virtual void attachToPlayer(IPlayer& player, Vector3 offset, Vector3 rotation) = 0; -}; - -struct ObjectEventHandler; - -/// An object pool -static const UID ObjectsComponent_UID = UID(0x59f8415f72da6160); -struct IObjectsComponent : public IPoolComponent -{ - PROVIDE_UID(ObjectsComponent_UID) - - /// Get the object event dispatcher - virtual IEventDispatcher& getEventDispatcher() = 0; - - /// Set the default camera collision for new objects - virtual void setDefaultCameraCollision(bool collision) = 0; - - /// Get the default camera collision for new objects - virtual bool getDefaultCameraCollision() const = 0; - - /// Create a new object - /// @return A pointer if succeeded or nullptr on failure - virtual IObject* create(int modelID, Vector3 position, Vector3 rotation, float drawDist = 0.f) = 0; -}; - -/// An object event handler -struct ObjectEventHandler -{ - virtual void onMoved(IObject& object) { } - virtual void onPlayerObjectMoved(IPlayer& player, IPlayerObject& object) { } - virtual void onObjectSelected(IPlayer& player, IObject& object, int model, Vector3 position) { } - virtual void onPlayerObjectSelected(IPlayer& player, IPlayerObject& object, int model, Vector3 position) { } - virtual void onObjectEdited(IPlayer& player, IObject& object, ObjectEditResponse response, Vector3 offset, Vector3 rotation) { } - virtual void onPlayerObjectEdited(IPlayer& player, IPlayerObject& object, ObjectEditResponse response, Vector3 offset, Vector3 rotation) { } - virtual void onPlayerAttachedObjectEdited(IPlayer& player, int index, bool saved, const ObjectAttachmentSlotData& data) { } -}; - -static const UID PlayerObjectData_UID = UID(0x93d4ed2344b07456); -struct IPlayerObjectData : public IExtension, public IPool -{ - PROVIDE_EXT_UID(PlayerObjectData_UID); - - /// Create a new player object - /// @return A pointer if succeeded or nullptr on failure - virtual IPlayerObject* create(int modelID, Vector3 position, Vector3 rotation, float drawDist = 0.f) = 0; - - /// Set the player's attached object in an attachment slot - virtual void setAttachedObject(int index, const ObjectAttachmentSlotData& data) = 0; - - /// Remove the player's attached object in an attachment slot - virtual void removeAttachedObject(int index) = 0; - - /// Check if the player has an attached object in an attachment slot - virtual bool hasAttachedObject(int index) const = 0; - - /// Get the player's attached object in an attachment slot - virtual const ObjectAttachmentSlotData& getAttachedObject(int index) const = 0; - - /// Initiate object selection for the player - virtual void beginSelecting() = 0; - - /// Get whether the player is selecting objects - virtual bool selectingObject() const = 0; - - /// End selection and editing objects for the player - virtual void endEditing() = 0; - - /// Edit the object for the player - virtual void beginEditing(IObject& object) = 0; - - /// Edit the player object for the player - virtual void beginEditing(IPlayerObject& object) = 0; - - /// Check if the player is editing an object - virtual bool editingObject() const = 0; - - /// Edit an attached object in an attachment slot for the player - virtual void editAttachedObject(int index) = 0; -}; diff --git a/SDK/include/Server/Components/Pawn/Impl/pawn_impl.hpp b/SDK/include/Server/Components/Pawn/Impl/pawn_impl.hpp deleted file mode 100644 index eec60d2f1..000000000 --- a/SDK/include/Server/Components/Pawn/Impl/pawn_impl.hpp +++ /dev/null @@ -1,471 +0,0 @@ -#pragma once - -// This file should only be included in one place. -#include - -#if defined PAWN_NATIVES_HAS_FUNC -#include - -static IComponentList* components_; -static PawnLookup lookups_; - -void setAmxLookups() -{ - // Refresh the list. - if (components_) - { - lookups_.actors = components_->queryComponent(); - lookups_.checkpoints = components_->queryComponent(); - lookups_.classes = components_->queryComponent(); - lookups_.console = components_->queryComponent(); - lookups_.databases = components_->queryComponent(); - lookups_.dialogs = components_->queryComponent(); - lookups_.fixes = components_->queryComponent(); - lookups_.gangzones = components_->queryComponent(); - lookups_.menus = components_->queryComponent(); - lookups_.objects = components_->queryComponent(); - lookups_.pickups = components_->queryComponent(); - lookups_.recordings = components_->queryComponent(); - lookups_.textdraws = components_->queryComponent(); - lookups_.textlabels = components_->queryComponent(); - lookups_.timers = components_->queryComponent(); - lookups_.vars = components_->queryComponent(); - lookups_.vehicles = components_->queryComponent(); - lookups_.models = components_->queryComponent(); - } -} - -void setAmxLookups(IComponentList* components) -{ - components_ = components; - setAmxLookups(); -} - -void setAmxLookups(ICore* core) -{ - lookups_.core = core; - lookups_.config = &core->getConfig(); - lookups_.players = &core->getPlayers(); - setAmxLookups(); -} - -PawnLookup* getAmxLookups() -{ - return &lookups_; -} -#endif - -static std::array funcs_; - -void setAmxFunctions(std::array const& funcs) -{ - funcs_ = funcs; -} - -void setAmxFunctions() -{ - funcs_.fill(nullptr); -} - -constexpr int AMX_FUNC_Align16 = 0; -constexpr int AMX_FUNC_Align32 = 1; - -#if defined _I64_MAX || defined HAVE_I64 -constexpr int AMX_FUNC_Align64 = 2; -#endif - -constexpr int AMX_FUNC_Allot = 3; -constexpr int AMX_FUNC_Callback = 4; -constexpr int AMX_FUNC_Cleanup = 5; -constexpr int AMX_FUNC_Clone = 6; -constexpr int AMX_FUNC_Exec = 7; -constexpr int AMX_FUNC_FindNative = 8; -constexpr int AMX_FUNC_FindPublic = 9; -constexpr int AMX_FUNC_FindPubVar = 10; -constexpr int AMX_FUNC_FindTagId = 11; -constexpr int AMX_FUNC_Flags = 12; -constexpr int AMX_FUNC_GetAddr = 13; -constexpr int AMX_FUNC_GetNative = 14; -constexpr int AMX_FUNC_GetPublic = 15; -constexpr int AMX_FUNC_GetPubVar = 16; -constexpr int AMX_FUNC_GetString = 17; -constexpr int AMX_FUNC_GetTag = 18; -constexpr int AMX_FUNC_GetUserData = 19; -constexpr int AMX_FUNC_Init = 20; -constexpr int AMX_FUNC_InitJIT = 21; -constexpr int AMX_FUNC_MemInfo = 22; -constexpr int AMX_FUNC_NameLength = 23; -constexpr int AMX_FUNC_NativeInfo = 24; -constexpr int AMX_FUNC_NumNatives = 25; -constexpr int AMX_FUNC_NumPublics = 26; -constexpr int AMX_FUNC_NumPubVars = 27; -constexpr int AMX_FUNC_NumTags = 28; -constexpr int AMX_FUNC_Push = 29; -constexpr int AMX_FUNC_PushArray = 30; -constexpr int AMX_FUNC_PushString = 31; -constexpr int AMX_FUNC_RaiseError = 32; -constexpr int AMX_FUNC_Register = 33; -constexpr int AMX_FUNC_Release = 34; -constexpr int AMX_FUNC_SetCallback = 35; -constexpr int AMX_FUNC_SetDebugHook = 36; -constexpr int AMX_FUNC_SetString = 37; -constexpr int AMX_FUNC_SetUserData = 38; -constexpr int AMX_FUNC_StrLen = 39; -constexpr int AMX_FUNC_UTF8Check = 40; -constexpr int AMX_FUNC_UTF8Get = 41; -constexpr int AMX_FUNC_UTF8Len = 42; -constexpr int AMX_FUNC_UTF8Put = 43; -constexpr int AMX_FUNC_PushStringLen = 44; -constexpr int AMX_FUNC_SetStringLen = 45; - -#if PAWN_CELL_SIZE == 16 -constexpr int AMX_FUNC_Swap16 = 46; -#endif - -#if PAWN_CELL_SIZE == 32 -constexpr int AMX_FUNC_Swap32 = 47; -#endif - -#if PAWN_CELL_SIZE == 64 && (defined _I64_MAX || defined INT64_MAX || defined HAVE_I64) -constexpr int AMX_FUNC_Swap64 = 48; -#endif - -constexpr int AMX_FUNC_GetNativeByIndex = 49; -constexpr int AMX_FUNC_MakeAddr = 50; -constexpr int AMX_FUNC_StrSize = 51; - -typedef uint16_t* (*amx_Align16_t)(uint16_t* v); -typedef uint32_t* (*amx_Align32_t)(uint32_t* v); - -#if defined _I64_MAX || defined HAVE_I64 -typedef uint64_t* (*amx_Align64_t)(uint64_t* v); -#endif - -typedef int (*amx_Allot_t)(AMX* amx, int cells, cell* amx_addr, cell** phys_addr); -typedef int (*amx_Callback_t)(AMX* amx, cell index, cell* result, const cell* params); -typedef int (*amx_Cleanup_t)(AMX* amx); -typedef int (*amx_Clone_t)(AMX* amxClone, AMX* amxSource, void* data); -typedef int (*amx_Exec_t)(AMX* amx, cell* retval, int index); -typedef int (*amx_FindNative_t)(AMX* amx, const char* name, int* index); -typedef int (*amx_FindPublic_t)(AMX* amx, const char* funcname, int* index); -typedef int (*amx_FindPubVar_t)(AMX* amx, const char* varname, cell* amx_addr); -typedef int (*amx_FindTagId_t)(AMX* amx, cell tag_id, char* tagname); -typedef int (*amx_Flags_t)(AMX* amx, uint16_t* flags); -typedef int (*amx_GetAddr_t)(AMX* amx, cell amx_addr, cell** phys_addr); -typedef int (*amx_GetNative_t)(AMX* amx, int index, char* funcname); -typedef int (*amx_GetPublic_t)(AMX* amx, int index, char* funcname); -typedef int (*amx_GetPubVar_t)(AMX* amx, int index, char* varname, cell* amx_addr); -typedef int (*amx_GetString_t)(char* dest, const cell* source, int use_wchar, size_t size); -typedef int (*amx_GetTag_t)(AMX* amx, int index, char* tagname, cell* tag_id); -typedef int (*amx_GetUserData_t)(AMX* amx, long tag, void** ptr); -typedef int (*amx_Init_t)(AMX* amx, void* program); -typedef int (*amx_InitJIT_t)(AMX* amx, void* reloc_table, void* native_code); -typedef int (*amx_MemInfo_t)(AMX* amx, long* codesize, long* datasize, long* stackheap); -typedef int (*amx_NameLength_t)(AMX* amx, int* length); -typedef AMX_NATIVE_INFO* (*amx_NativeInfo_t)(const char* name, AMX_NATIVE func); -typedef int (*amx_NumNatives_t)(AMX* amx, int* number); -typedef int (*amx_NumPublics_t)(AMX* amx, int* number); -typedef int (*amx_NumPubVars_t)(AMX* amx, int* number); -typedef int (*amx_NumTags_t)(AMX* amx, int* number); -typedef int (*amx_Push_t)(AMX* amx, cell value); -typedef int (*amx_PushArray_t)(AMX* amx, cell* amx_addr, cell** phys_addr, const cell array[], int numcells); -typedef int (*amx_PushString_t)(AMX* amx, cell* amx_addr, cell** phys_addr, const char* string, int pack, int use_wchar); -typedef int (*amx_PushStringLen_t)(AMX* amx, cell* amx_addr, cell** phys_addr, const char* string, int length, int pack, int use_wchar); -typedef int (*amx_RaiseError_t)(AMX* amx, int error); -typedef int (*amx_Register_t)(AMX* amx, const AMX_NATIVE_INFO* nativelist, int number); -typedef int (*amx_Release_t)(AMX* amx, cell amx_addr); -typedef int (*amx_SetCallback_t)(AMX* amx, AMX_CALLBACK callback); -typedef int (*amx_SetDebugHook_t)(AMX* amx, AMX_DEBUG debug); -typedef int (*amx_SetString_t)(cell* dest, const char* source, int pack, int use_wchar, size_t size); -typedef int (*amx_SetStringLen_t)(cell* dest, const char* source, int length, int pack, int use_wchar, size_t size); -typedef int (*amx_SetUserData_t)(AMX* amx, long tag, void* ptr); -typedef int (*amx_StrLen_t)(const cell* cstring, int* length); -typedef int (*amx_UTF8Check_t)(const char* string, int* length); -typedef int (*amx_UTF8Get_t)(const char* string, const char** endptr, cell* value); -typedef int (*amx_UTF8Len_t)(const cell* cstr, int* length); -typedef int (*amx_UTF8Put_t)(char* string, char** endptr, int maxchars, cell value); -typedef int (*amx_GetNativeByIndex_t)(AMX const* amx, int index, AMX_NATIVE_INFO* ret); -typedef int (*amx_MakeAddr_t)(AMX* amx, cell* phys_addr, cell* amx_addr); -typedef int (*amx_StrSize_t)(const cell* cstr, int* length); - -#if PAWN_CELL_SIZE == 16 -typedef void (*amx_Swap16(uint16_t* v); -#endif -#if PAWN_CELL_SIZE == 32 -typedef void (*amx_Swap32_t)(uint32_t* v); -#endif -#if PAWN_CELL_SIZE == 64 && (defined _I64_MAX || defined INT64_MAX || defined HAVE_I64) -typedef void (*amx_Swap64_t)(uint64_t* v); -#endif - -uint16_t* AMXAPI amx_Align16(uint16_t* v) -{ - return ((amx_Align16_t)funcs_[AMX_FUNC_Align16])(v); -} - -uint32_t* AMXAPI amx_Align32(uint32_t* v) -{ - return ((amx_Align32_t)funcs_[AMX_FUNC_Align32])(v); -} - -#if defined _I64_MAX || defined HAVE_I64 -uint64_t* AMXAPI amx_Align64(uint64_t* v) -{ - return ((amx_Align64_t)funcs_[AMX_FUNC_Align64])(v); -} -#endif - -int AMXAPI amx_Allot(AMX* amx, int cells, cell* amx_addr, cell** phys_addr) -{ - return ((amx_Allot_t)funcs_[AMX_FUNC_Allot])(amx, cells, amx_addr, phys_addr); -} - -int AMXAPI amx_Callback(AMX* amx, cell index, cell* result, const cell* params) -{ - return ((amx_Callback_t)funcs_[AMX_FUNC_Callback])(amx, index, result, params); -} - -int AMXAPI amx_Cleanup(AMX* amx) -{ - return ((amx_Cleanup_t)funcs_[AMX_FUNC_Cleanup])(amx); -} - -int AMXAPI amx_Clone(AMX* amxClone, AMX* amxSource, void* data) -{ - return ((amx_Clone_t)funcs_[AMX_FUNC_Clone])(amxClone, amxSource, data); -} - -int AMXAPI amx_Exec(AMX* amx, cell* retval, int index) -{ - return ((amx_Exec_t)funcs_[AMX_FUNC_Exec])(amx, retval, index); -} - -int AMXAPI amx_FindNative(AMX* amx, const char* name, int* index) -{ - return ((amx_FindNative_t)funcs_[AMX_FUNC_FindNative])(amx, name, index); -} - -int AMXAPI amx_FindPublic(AMX* amx, const char* funcname, int* index) -{ - return ((amx_FindPublic_t)funcs_[AMX_FUNC_FindPublic])(amx, funcname, index); -} - -int AMXAPI amx_FindPubVar(AMX* amx, const char* varname, cell* amx_addr) -{ - return ((amx_FindPubVar_t)funcs_[AMX_FUNC_FindPubVar])(amx, varname, amx_addr); -} - -int AMXAPI amx_FindTagId(AMX* amx, cell tag_id, char* tagname) -{ - return ((amx_FindTagId_t)funcs_[AMX_FUNC_FindTagId])(amx, tag_id, tagname); -} - -int AMXAPI amx_Flags(AMX* amx, uint16_t* flags) -{ - return ((amx_Flags_t)funcs_[AMX_FUNC_Flags])(amx, flags); -} - -int AMXAPI amx_GetAddr(AMX* amx, cell amx_addr, cell** phys_addr) -{ - return ((amx_GetAddr_t)funcs_[AMX_FUNC_GetAddr])(amx, amx_addr, phys_addr); -} - -int AMXAPI amx_GetNative(AMX* amx, int index, char* funcname) -{ - return ((amx_GetNative_t)funcs_[AMX_FUNC_GetNative])(amx, index, funcname); -} - -int AMXAPI amx_GetPublic(AMX* amx, int index, char* funcname) -{ - return ((amx_GetPublic_t)funcs_[AMX_FUNC_GetPublic])(amx, index, funcname); -} - -int AMXAPI amx_GetPubVar(AMX* amx, int index, char* varname, cell* amx_addr) -{ - return ((amx_GetPubVar_t)funcs_[AMX_FUNC_GetPubVar])(amx, index, varname, amx_addr); -} - -int AMXAPI amx_GetString(char* dest, const cell* source, int use_wchar, size_t size) -{ - return ((amx_GetString_t)funcs_[AMX_FUNC_GetString])(dest, source, use_wchar, size); -} - -int AMXAPI amx_GetTag(AMX* amx, int index, char* tagname, cell* tag_id) -{ - return ((amx_GetTag_t)funcs_[AMX_FUNC_GetTag])(amx, index, tagname, tag_id); -} - -int AMXAPI amx_GetUserData(AMX* amx, long tag, void** ptr) -{ - return ((amx_GetUserData_t)funcs_[AMX_FUNC_GetUserData])(amx, tag, ptr); -} - -int AMXAPI amx_Init(AMX* amx, void* program) -{ - return ((amx_Init_t)funcs_[AMX_FUNC_Init])(amx, program); -} - -int AMXAPI amx_InitJIT(AMX* amx, void* reloc_table, void* native_code) -{ - return ((amx_InitJIT_t)funcs_[AMX_FUNC_InitJIT])(amx, reloc_table, native_code); -} - -int AMXAPI amx_MemInfo(AMX* amx, long* codesize, long* datasize, long* stackheap) -{ - return ((amx_MemInfo_t)funcs_[AMX_FUNC_MemInfo])(amx, codesize, datasize, stackheap); -} - -int AMXAPI amx_NameLength(AMX* amx, int* length) -{ - return ((amx_NameLength_t)funcs_[AMX_FUNC_NameLength])(amx, length); -} - -AMX_NATIVE_INFO* AMXAPI amx_NativeInfo(const char* name, AMX_NATIVE func) -{ - return ((amx_NativeInfo_t)funcs_[AMX_FUNC_NativeInfo])(name, func); -} - -int AMXAPI amx_NumNatives(AMX* amx, int* number) -{ - return ((amx_NumNatives_t)funcs_[AMX_FUNC_NumNatives])(amx, number); -} - -int AMXAPI amx_NumPublics(AMX* amx, int* number) -{ - return ((amx_NumPublics_t)funcs_[AMX_FUNC_NumPublics])(amx, number); -} - -int AMXAPI amx_NumPubVars(AMX* amx, int* number) -{ - return ((amx_NumPubVars_t)funcs_[AMX_FUNC_NumPubVars])(amx, number); -} - -int AMXAPI amx_NumTags(AMX* amx, int* number) -{ - return ((amx_NumTags_t)funcs_[AMX_FUNC_NumTags])(amx, number); -} - -int AMXAPI amx_Push(AMX* amx, cell value) -{ - return ((amx_Push_t)funcs_[AMX_FUNC_Push])(amx, value); -} - -int AMXAPI amx_PushArray(AMX* amx, cell* amx_addr, cell** phys_addr, const cell array[], int numcells) -{ - return ((amx_PushArray_t)funcs_[AMX_FUNC_PushArray])(amx, amx_addr, phys_addr, array, numcells); -} - -int AMXAPI amx_PushString(AMX* amx, cell* amx_addr, cell** phys_addr, const char* string, int pack, int use_wchar) -{ - return ((amx_PushString_t)funcs_[AMX_FUNC_PushString])(amx, amx_addr, phys_addr, string, pack, use_wchar); -} - -int AMXAPI amx_PushStringLen(AMX* amx, cell* amx_addr, cell** phys_addr, const char* string, int length, int pack, int use_wchar) -{ - return ((amx_PushStringLen_t)funcs_[AMX_FUNC_PushStringLen])(amx, amx_addr, phys_addr, string, length, pack, use_wchar); -} - -int AMXAPI amx_RaiseError(AMX* amx, int error) -{ - return ((amx_RaiseError_t)funcs_[AMX_FUNC_RaiseError])(amx, error); -} - -int AMXAPI amx_Register(AMX* amx, const AMX_NATIVE_INFO* nativelist, int number) -{ - return ((amx_Register_t)funcs_[AMX_FUNC_Register])(amx, nativelist, number); -} - -int AMXAPI amx_Release(AMX* amx, cell amx_addr) -{ - return ((amx_Release_t)funcs_[AMX_FUNC_Release])(amx, amx_addr); -} - -int AMXAPI amx_SetCallback(AMX* amx, AMX_CALLBACK callback) -{ - return ((amx_SetCallback_t)funcs_[AMX_FUNC_SetCallback])(amx, callback); -} - -int AMXAPI amx_SetDebugHook(AMX* amx, AMX_DEBUG debug) -{ - return ((amx_SetDebugHook_t)funcs_[AMX_FUNC_SetDebugHook])(amx, debug); -} - -int AMXAPI amx_SetString(cell* dest, const char* source, int pack, int use_wchar, size_t size) -{ - return ((amx_SetString_t)funcs_[AMX_FUNC_SetString])(dest, source, pack, use_wchar, size); -} - -int AMXAPI amx_SetStringLen(cell* dest, const char* source, int length, int pack, int use_wchar, size_t size) -{ - return ((amx_SetStringLen_t)funcs_[AMX_FUNC_SetStringLen])(dest, source, length, pack, use_wchar, size); -} - -int AMXAPI amx_SetUserData(AMX* amx, long tag, void* ptr) -{ - return ((amx_SetUserData_t)funcs_[AMX_FUNC_SetUserData])(amx, tag, ptr); -} - -int AMXAPI amx_StrLen(const cell* cstring, int* length) -{ - return ((amx_StrLen_t)funcs_[AMX_FUNC_StrLen])(cstring, length); -} - -int AMXAPI amx_UTF8Check(const char* string, int* length) -{ - return ((amx_UTF8Check_t)funcs_[AMX_FUNC_UTF8Check])(string, length); -} - -int AMXAPI amx_UTF8Get(const char* string, const char** endptr, cell* value) -{ - return ((amx_UTF8Get_t)funcs_[AMX_FUNC_UTF8Get])(string, endptr, value); -} - -int AMXAPI amx_UTF8Len(const cell* cstr, int* length) -{ - return ((amx_UTF8Len_t)funcs_[AMX_FUNC_UTF8Len])(cstr, length); -} - -int AMXAPI amx_UTF8Put(char* string, char** endptr, int maxchars, cell value) -{ - return ((amx_UTF8Put_t)funcs_[AMX_FUNC_UTF8Put])(string, endptr, maxchars, value); -} - -#if PAWN_CELL_SIZE == 16 -void amx_Swap16(uint16_t* v) -{ - return ((amx_Swap16_t)funcs_[AMX_FUNC_Swap16])(v); -} -#endif - -#if PAWN_CELL_SIZE == 32 -void amx_Swap32(uint32_t* v) -{ - return ((amx_Swap32_t)funcs_[AMX_FUNC_Swap32])(v); -} -#endif - -#if PAWN_CELL_SIZE == 64 && (defined _I64_MAX || defined INT64_MAX || defined HAVE_I64) -void amx_Swap64(uint64_t* v) -{ - return ((amx_Swap64_t)funcs_[AMX_FUNC_Swap64])(v); -} -#endif - -int AMXAPI amx_GetNativeByIndex(AMX const* amx, int index, AMX_NATIVE_INFO* ret) -{ - return ((amx_GetNativeByIndex_t)funcs_[AMX_FUNC_GetNativeByIndex])(amx, index, ret); -} - -int AMXAPI amx_MakeAddr(AMX* amx, cell* phys_addr, cell* amx_addr) -{ - return ((amx_MakeAddr_t)funcs_[AMX_FUNC_MakeAddr])(amx, phys_addr, amx_addr); -} - -int AMXAPI amx_StrSize(const cell* cstr, int* length) -{ - return ((amx_StrSize_t)funcs_[AMX_FUNC_StrSize])(cstr, length); -} - -#if defined __LINUX__ || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__ -#include -#endif diff --git a/SDK/include/Server/Components/Pawn/Impl/pawn_natives.hpp b/SDK/include/Server/Components/Pawn/Impl/pawn_natives.hpp deleted file mode 100644 index a90be2b05..000000000 --- a/SDK/include/Server/Components/Pawn/Impl/pawn_natives.hpp +++ /dev/null @@ -1,1366 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public License, - * v. 2.0. If a copy of the MPL was not distributed with this file, You can - * obtain one at http://mozilla.org/MPL/2.0/. - * - * The original code is copyright (c) 2022, open.mp team and contributors. - */ - -#pragma once - -#include -#include - -#include - -/// The bool is used because variant is initialised to index 0 by default -using OutputOnlyString = std::variant; - -/// Macro to define a script param for a pool entry -/// Example with IPlayer from the players pool: -/// Using IPlayer& in a script function throws an exception if the player with the specified ID doesn't exist -/// Using IPlayer* in a script function makes the IPlayer entry optional and is nullptr if the player with the specified ID doesn't exist -#define POOL_PARAM(type, poolPtr) \ - template <> \ - struct ParamLookup \ - { \ - static type* Val(cell ref) noexcept \ - { \ - auto pool = getAmxLookups()->poolPtr; \ - if (pool) \ - { \ - return pool->get(ref); \ - } \ - return nullptr; \ - } \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX* amx, cell* params, int idx) noexcept \ - { \ - value_ = ParamLookup::Val(params[idx]); \ - } \ - \ - ~ParamCast() \ - { \ - } \ - \ - ParamCast(ParamCast const&) = delete; \ - ParamCast(ParamCast&&) = delete; \ - \ - operator type*() \ - { \ - return value_; \ - } \ - \ - bool Error() const \ - { \ - return false; \ - } \ - \ - static constexpr int Size = 1; \ - \ - private: \ - type* value_; \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX* amx, cell* params, int idx) \ - { \ - value_ = ParamLookup::Val(params[idx]); \ - if (value_ == nullptr) \ - { \ - error_ = true; \ - } \ - } \ - \ - ~ParamCast() \ - { \ - } \ - \ - ParamCast(ParamCast const&) = delete; \ - ParamCast(ParamCast&&) = delete; \ - \ - operator type&() \ - { \ - return *value_; \ - } \ - \ - bool Error() const \ - { \ - return error_; \ - } \ - \ - static constexpr int Size = 1; \ - \ - private: \ - type* value_; \ - bool error_ = false; \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX*, cell*, int) = delete; \ - ParamCast() = delete; \ - }; - -/// Macro to define a script param for a player pool entry -/// Always throws if the player ID specified in the first parameter is invalid as it's required to get the IPlayerObjectData pool -/// Example with IPlayerObject from the IPlayerObjectData pool: -/// Using IPlayerObject& in a script function throws an exception if the object with the specified ID doesn't exist -/// Using IPlayerObject* in a script function makes the IPlayerObject entry optional and is nullptr if the object with the specified ID doesn't exist -#define PLAYER_POOL_PARAM(type, dataType) \ - template <> \ - struct ParamLookup \ - { \ - static type* Val(IPlayer* player, cell ref) noexcept \ - { \ - if (player == nullptr) \ - { \ - return nullptr; \ - } \ - \ - auto data = queryExtension(player); \ - if (data) \ - { \ - return data->get(ref); \ - } \ - return nullptr; \ - } \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX* amx, cell* params, int idx) \ - { \ - auto player = ParamLookup::Val(params[1] /* first param is always playerid */); \ - value_ = ParamLookup::Val(player, params[idx]); \ - } \ - \ - ~ParamCast() \ - { \ - } \ - \ - ParamCast(ParamCast const&) = delete; \ - ParamCast(ParamCast&&) = delete; \ - \ - operator type*() \ - { \ - return value_; \ - } \ - \ - bool Error() const \ - { \ - return false; \ - } \ - \ - static constexpr int Size = 1; \ - \ - private: \ - type* value_; \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX* amx, cell* params, int idx) = delete; \ - ParamCast() = delete; \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX* amx, cell* params, int idx) \ - { \ - auto player = ParamLookup::Val(params[1] /* first param is always playerid */); \ - value_ = ParamLookup::Val(player, params[idx]); \ - if (value_ == nullptr) \ - { \ - error_ = true; \ - } \ - } \ - \ - ~ParamCast() \ - { \ - } \ - \ - ParamCast(ParamCast const&) = delete; \ - ParamCast(ParamCast&&) = delete; \ - \ - operator type&() \ - { \ - return *value_; \ - } \ - \ - bool Error() const \ - { \ - return error_; \ - } \ - \ - static constexpr int Size = 1; \ - \ - private: \ - type* value_; \ - bool error_ = false; \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX*, cell*, int) = delete; \ - ParamCast() = delete; \ - }; - -/// Macro to define a script param for a player data extension. -/// Throws an exception when playerid is invalid or player data's retrieval fails. -/// Unless it is casting to a pointer which becomes nullptr if either player id or player data is invalid. -#define PLAYER_DATA_PARAM(type) \ - template <> \ - struct ParamLookup \ - { \ - static type* Val(IPlayer* player) noexcept \ - { \ - if (player == nullptr) \ - { \ - return nullptr; \ - } \ - return queryExtension(player); \ - } \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX* amx, cell* params, int idx) \ - { \ - value_ = ParamLookup::Val(ParamLookup::Val(params[idx])); \ - } \ - \ - ~ParamCast() \ - { \ - } \ - \ - ParamCast(ParamCast const&) = delete; \ - ParamCast(ParamCast&&) = delete; \ - \ - operator type*() \ - { \ - return value_; \ - } \ - \ - bool Error() const \ - { \ - return false; \ - } \ - \ - static constexpr int Size = 1; \ - \ - private: \ - type* value_; \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX* amx, cell* params, int idx) = delete; \ - ParamCast() = delete; \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX* amx, cell* params, int idx) \ - { \ - auto player = ParamLookup::Val(params[idx]); \ - value_ = ParamLookup::Val(player); \ - if (value_ == nullptr) \ - { \ - error_ = true; \ - } \ - } \ - \ - ~ParamCast() \ - { \ - } \ - \ - ParamCast(ParamCast const&) = delete; \ - ParamCast(ParamCast&&) = delete; \ - \ - operator type&() \ - { \ - return *value_; \ - } \ - \ - bool Error() const \ - { \ - return error_; \ - } \ - \ - static constexpr int Size = 1; \ - \ - private: \ - type* value_; \ - bool error_ = false; \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX*, cell*, int) = delete; \ - ParamCast() = delete; \ - }; - -/// Macro to define a script param for a mixed pool's global entry -#define GLOBAL_MIXED_POOL_PARAM(type, poolPtr) \ - template <> \ - struct ParamLookup \ - { \ - static type* Val(cell ref) noexcept \ - { \ - auto pool = getAmxLookups()->poolPtr; \ - if (pool) \ - { \ - return pool->get(pool->fromLegacyID(ref)); \ - } \ - return nullptr; \ - } \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX* amx, cell* params, int idx) noexcept \ - { \ - value_ = ParamLookup::Val(params[idx]); \ - } \ - \ - ~ParamCast() \ - { \ - } \ - \ - ParamCast(ParamCast const&) = delete; \ - ParamCast(ParamCast&&) = delete; \ - \ - operator type*() \ - { \ - return value_; \ - } \ - \ - bool Error() const \ - { \ - return false; \ - } \ - \ - static constexpr int Size = 1; \ - \ - private: \ - type* value_; \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX* amx, cell* params, int idx) \ - { \ - value_ = ParamLookup::Val(params[idx]); \ - if (value_ == nullptr) \ - { \ - error_ = true; \ - } \ - } \ - \ - ~ParamCast() \ - { \ - } \ - \ - ParamCast(ParamCast const&) = delete; \ - ParamCast(ParamCast&&) = delete; \ - \ - operator type&() \ - { \ - return *value_; \ - } \ - \ - bool Error() const \ - { \ - return error_; \ - } \ - \ - static constexpr int Size = 1; \ - \ - private: \ - type* value_; \ - bool error_ = false; \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX*, cell*, int) = delete; \ - ParamCast() = delete; \ - }; - -/// Macro to define a script param for a mixed pool's player entry -#define PLAYER_MIXED_POOL_PARAM(type, dataType, poolPtr) \ - template <> \ - struct ParamLookup \ - { \ - static type* Val(IPlayer* player, cell ref) noexcept \ - { \ - if (player == nullptr) \ - { \ - return nullptr; \ - } \ - \ - auto data = queryExtension(player); \ - auto pool = getAmxLookups()->poolPtr; \ - if (pool && data) \ - { \ - return reinterpret_cast(pool->get(data->fromLegacyID(ref))); \ - } \ - return nullptr; \ - } \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX* amx, cell* params, int idx) \ - { \ - auto player = ParamLookup::Val(params[1] /* first param is always playerid */); \ - value_ = ParamLookup::Val(player, params[idx]); \ - } \ - \ - ~ParamCast() \ - { \ - } \ - \ - ParamCast(ParamCast const&) = delete; \ - ParamCast(ParamCast&&) = delete; \ - \ - operator type*() \ - { \ - return value_; \ - } \ - \ - bool Error() const \ - { \ - return false; \ - } \ - \ - static constexpr int Size = 1; \ - \ - private: \ - type* value_; \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX* amx, cell* params, int idx) = delete; \ - ParamCast() = delete; \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX* amx, cell* params, int idx) \ - { \ - auto player = ParamLookup::Val(params[1] /* first param is always playerid */); \ - value_ = ParamLookup::Val(player, params[idx]); \ - if (value_ == nullptr) \ - { \ - error_ = true; \ - } \ - } \ - \ - ~ParamCast() \ - { \ - } \ - \ - ParamCast(ParamCast const&) = delete; \ - ParamCast(ParamCast&&) = delete; \ - \ - operator type&() \ - { \ - return *value_; \ - } \ - \ - bool Error() const \ - { \ - return error_; \ - } \ - \ - static constexpr int Size = 1; \ - \ - private: \ - type* value_; \ - bool error_ = false; \ - }; \ - \ - template <> \ - class ParamCast \ - { \ - public: \ - ParamCast(AMX*, cell*, int) = delete; \ - ParamCast() = delete; \ - }; - -// custom ParamCasts here to use custom types in native declarations -namespace pawn_natives -{ - -POOL_PARAM(IPlayer, players); -POOL_PARAM(IActor, actors); -POOL_PARAM(IClass, classes); -POOL_PARAM(IMenu, menus); -POOL_PARAM(IObject, objects); -POOL_PARAM(ITextDraw, textdraws); -POOL_PARAM(ITextLabel, textlabels); -POOL_PARAM(IVehicle, vehicles); - -PLAYER_POOL_PARAM(IPlayerObject, IPlayerObjectData); -PLAYER_POOL_PARAM(IPlayerTextDraw, IPlayerTextDrawData); -PLAYER_POOL_PARAM(IPlayerTextLabel, IPlayerTextLabelData); - -PLAYER_DATA_PARAM(IPlayerVehicleData); -PLAYER_DATA_PARAM(IPlayerCheckpointData); -PLAYER_DATA_PARAM(IPlayerObjectData); -PLAYER_DATA_PARAM(IPlayerTextDrawData); -PLAYER_DATA_PARAM(IPlayerConsoleData); -PLAYER_DATA_PARAM(IPlayerDialogData); - -GLOBAL_MIXED_POOL_PARAM(IPickup, pickups); -PLAYER_MIXED_POOL_PARAM(IPlayerPickup, IPlayerPickupData, pickups); -GLOBAL_MIXED_POOL_PARAM(IGangZone, gangzones); -PLAYER_MIXED_POOL_PARAM(IPlayerGangZone, IPlayerGangZoneData, gangzones); - -/// A parameter used for only writing data to an output string -/// Greatly speeds up code as there's no need for reading the input string -/// and faster amx_SetString function is used which works well with string views -template <> -class ParamCast -{ -public: - ParamCast(AMX* amx, cell* params, int idx) - : len_((int)params[idx + 1]) - { - if (len_ < 0) - throw std::length_error("Invalid string length."); - if (len_) - { - // This is a rare case where we don't check that the address is valid and throw a - // param cast error. Instead we just don't write the string back later. - amx_GetAddr(amx, params[idx], &addr_); - } - else - { - addr_ = nullptr; - } - } - - ~ParamCast() - { - const size_t idx = value_.index(); - // Write data if there's a string written (index is 1 or 2) - if (addr_ && idx != 0 && idx != std::variant_npos) - { - StringView str = (idx == 1 ? std::get(value_) : std::get(value_)); - amx_SetStringLen(addr_, str.data(), str.length(), 0, 0, len_); - } - } - - ParamCast(ParamCast const&) = delete; - ParamCast(ParamCast&&) = delete; - - operator OutputOnlyString&() - { - return value_; - } - - bool Error() const - { - return false; - } - - static constexpr int Size = 2; - -private: - int - len_; - - cell* - addr_; - - OutputOnlyString - value_; -}; - -// Database IDatabaseConnection param lookups -template <> -struct ParamLookup -{ - static IDatabaseConnection* Val(cell ref) noexcept - { - IDatabasesComponent* databases_component = getAmxLookups()->databases; - IDatabaseConnection* connection = nullptr; - if (databases_component && databases_component->isDatabaseConnectionIDValid(static_cast(ref))) - { - connection = &databases_component->getDatabaseConnectionByID(static_cast(ref)); - } - return connection; - } -}; - -template <> -class ParamCast -{ -public: - ParamCast(AMX* amx, cell* params, int idx) - { - value_ = ParamLookup::Val(params[idx]); - if (value_ == nullptr) - { - error_ = true; - } - } - - ~ParamCast() - { - } - - ParamCast(ParamCast const&) = delete; - ParamCast(ParamCast&&) = delete; - - operator IDatabaseConnection&() - { - return *value_; - } - - bool Error() const - { - return error_; - } - - static constexpr int Size = 1; - -private: - IDatabaseConnection* value_; - bool error_ = false; -}; - -template <> -class ParamCast -{ -public: - ParamCast(AMX* amx, cell* params, int idx) noexcept - { - value_ = ParamLookup::Val(params[idx]); - } - - ~ParamCast() - { - } - - ParamCast(ParamCast const&) = delete; - ParamCast(ParamCast&&) = delete; - - operator IDatabaseConnection*() - { - return value_; - } - - bool Error() const - { - return false; - } - - static constexpr int Size = 1; - -private: - IDatabaseConnection* value_; -}; - -// Database IDatabaseResultSet param lookups -template <> -struct ParamLookup -{ - static IDatabaseResultSet* Val(cell ref) noexcept - { - IDatabasesComponent* databases_component = getAmxLookups()->databases; - IDatabaseResultSet* resultSet = nullptr; - if (databases_component && databases_component->isDatabaseResultSetIDValid(static_cast(ref))) - { - resultSet = &databases_component->getDatabaseResultSetByID(static_cast(ref)); - } - return resultSet; - } -}; - -template <> -class ParamCast -{ -public: - ParamCast(AMX* amx, cell* params, int idx) - { - value_ = ParamLookup::Val(params[idx]); - if (value_ == nullptr) - { - error_ = true; - } - } - - ~ParamCast() - { - } - - ParamCast(ParamCast const&) = delete; - ParamCast(ParamCast&&) = delete; - - operator IDatabaseResultSet&() - { - return *value_; - } - - bool Error() const - { - return error_; - } - - static constexpr int Size = 1; - -private: - IDatabaseResultSet* value_; - bool error_ = false; -}; - -template <> -class ParamCast -{ -public: - ParamCast(AMX* amx, cell* params, int idx) noexcept - { - value_ = ParamLookup::Val(params[idx]); - } - - ~ParamCast() - { - } - - ParamCast(ParamCast const&) = delete; - ParamCast(ParamCast&&) = delete; - - operator IDatabaseResultSet*() - { - return value_; - } - - bool Error() const - { - return false; - } - - static constexpr int Size = 1; - -private: - IDatabaseResultSet* value_; -}; - -// Disable the ref version. -template <> -class ParamCast -{ -public: - ParamCast(AMX*, cell*, int) = delete; - ParamCast() = delete; -}; - -template <> -class ParamCast -{ -public: - ParamCast(AMX*, cell*, int) = delete; - ParamCast() = delete; -}; - -template <> -class ParamCast -{ -public: - ParamCast(AMX*, cell*, int) = delete; - ParamCast() = delete; -}; - -template <> -class ParamCast -{ -public: - ParamCast([[maybe_unused]] AMX* amx, cell* params, int idx) - : value_ { amx_ctof(params[idx + 0]), amx_ctof(params[idx + 1]), amx_ctof(params[idx + 2]) } - { - } - - ~ParamCast() - { - } - - operator Vector3() const - { - return value_; - } - - bool Error() const - { - return false; - } - - static constexpr int Size = 3; - - using type = Vector3; - -private: - Vector3 - value_; -}; - -template <> -class ParamCast -{ -public: - ParamCast(AMX* amx, cell* params, int idx) - { - amx_GetAddr(amx, params[idx + 0], &x_); - amx_GetAddr(amx, params[idx + 1], &y_); - amx_GetAddr(amx, params[idx + 2], &z_); - if (x_ == nullptr || y_ == nullptr || z_ == nullptr) - { - error_ = true; - } - else - { - value_.x = amx_ctof(*x_); - value_.y = amx_ctof(*y_); - value_.z = amx_ctof(*z_); - } - } - - ~ParamCast() - { - // Write the value back in to memory. - *x_ = amx_ftoc(value_.x); - *y_ = amx_ftoc(value_.y); - *z_ = amx_ftoc(value_.z); - } - - operator Vector3&() - { - return value_; - } - - bool Error() const - { - return error_; - } - - static constexpr int Size = 3; - - using type = Vector3&; - -private: - Vector3 value_; - cell *x_, *y_, *z_; - bool error_ = false; -}; - -template <> -class ParamCast -{ -public: - ParamCast(AMX*, cell*, int) = delete; - ParamCast() = delete; -}; - -template <> -class ParamCast -{ -public: - ParamCast(AMX*, cell*, int) = delete; - ParamCast() = delete; -}; - -template <> -class ParamCast -{ -public: - ParamCast([[maybe_unused]] AMX* amx, cell* params, int idx) - : value_ { amx_ctof(params[idx + 0]), amx_ctof(params[idx + 1]) } - { - } - - ~ParamCast() - { - } - - operator Vector2() const - { - return value_; - } - - bool Error() const - { - return false; - } - - static constexpr int Size = 2; - - using type = Vector2; - -private: - Vector2 value_; -}; - -template <> -class ParamCast -{ -public: - ParamCast(AMX* amx, cell* params, int idx) - { - amx_GetAddr(amx, params[idx + 0], &x_); - amx_GetAddr(amx, params[idx + 1], &y_); - if (x_ == nullptr || y_ == nullptr) - { - error_ = true; - } - else - { - value_.x = amx_ctof(*x_); - value_.y = amx_ctof(*y_); - } - } - - ~ParamCast() - { - // Write the value back in to memory. - *x_ = amx_ftoc(value_.x); - *y_ = amx_ftoc(value_.y); - } - - operator Vector2&() - { - return value_; - } - - bool Error() const - { - return error_; - } - - static constexpr int Size = 2; - - using type = Vector2&; - -private: - Vector2 value_; - cell *x_, *y_; - bool error_ = false; -}; - -template <> -class ParamCast -{ -public: - ParamCast(AMX*, cell*, int) = delete; - ParamCast() = delete; -}; - -template <> -class ParamCast -{ -public: - ParamCast(AMX*, cell*, int) = delete; - ParamCast() = delete; -}; - -template <> -class ParamCast -{ -public: - ParamCast([[maybe_unused]] AMX* amx, cell* params, int idx) - : value_ { amx_ctof(params[idx + 0]), amx_ctof(params[idx + 1]), amx_ctof(params[idx + 2]), amx_ctof(params[idx + 3]) } - { - } - - ~ParamCast() - { - } - - operator Vector4() const - { - return value_; - } - - bool Error() const - { - return false; - } - - static constexpr int Size = 4; - - using type = Vector4; - -private: - Vector4 value_; -}; - -template <> -class ParamCast -{ -public: - ParamCast(AMX* amx, cell* params, int idx) - { - amx_GetAddr(amx, params[idx + 0], &x_); - amx_GetAddr(amx, params[idx + 1], &y_); - amx_GetAddr(amx, params[idx + 2], &z_); - amx_GetAddr(amx, params[idx + 3], &w_); - if (w_ == nullptr || x_ == nullptr || y_ == nullptr || z_ == nullptr) - { - error_ = true; - } - else - { - value_.x = amx_ctof(*x_); - value_.y = amx_ctof(*y_); - value_.z = amx_ctof(*z_); - value_.w = amx_ctof(*w_); - } - } - - ~ParamCast() - { - // Write the value back in to memory. - *x_ = amx_ftoc(value_.x); - *y_ = amx_ftoc(value_.y); - *z_ = amx_ftoc(value_.z); - *w_ = amx_ftoc(value_.w); - } - - operator Vector4&() - { - return value_; - } - - bool Error() const - { - return error_; - } - - static constexpr int Size = 4; - - using type = Vector4&; - -private: - Vector4 value_; - cell *x_, *y_, *z_, *w_; - bool error_ = false; -}; - -template <> -class ParamCast -{ -public: - ParamCast(AMX*, cell*, int) = delete; - ParamCast() = delete; -}; - -template <> -class ParamCast -{ -public: - ParamCast(AMX*, cell*, int) = delete; - ParamCast() = delete; -}; - -template <> -class ParamCast -{ -public: - ParamCast([[maybe_unused]] AMX* amx, cell* params, int idx) - : value_(amx_ctof(params[idx + 0]), amx_ctof(params[idx + 1]), amx_ctof(params[idx + 2]), amx_ctof(params[idx + 3])) - { - } - - ~ParamCast() - { - } - - operator GTAQuat() const - { - return value_; - } - - bool Error() const - { - return false; - } - - static constexpr int Size = 4; - - using type = GTAQuat; - -private: - GTAQuat value_; -}; - -template <> -class ParamCast -{ -public: - ParamCast(AMX* amx, cell* params, int idx) - { - amx_GetAddr(amx, params[idx + 0], &w_); - amx_GetAddr(amx, params[idx + 1], &x_); - amx_GetAddr(amx, params[idx + 2], &y_); - amx_GetAddr(amx, params[idx + 3], &z_); - if (w_ == nullptr || x_ == nullptr || y_ == nullptr || z_ == nullptr) - { - error_ = true; - } - else - { - value_.q.w = amx_ctof(*w_); - value_.q.x = amx_ctof(*x_); - value_.q.y = amx_ctof(*y_); - value_.q.z = amx_ctof(*z_); - } - } - - ~ParamCast() - { - // Write the value back in to memory. - *w_ = amx_ftoc(value_.q.w); - *x_ = amx_ftoc(value_.q.x); - *y_ = amx_ftoc(value_.q.y); - *z_ = amx_ftoc(value_.q.z); - } - - operator GTAQuat&() - { - return value_; - } - - bool Error() const - { - return error_; - } - - static constexpr int Size = 4; - - using type = GTAQuat&; - -private: - GTAQuat value_; - cell *w_, *x_, *y_, *z_; - bool error_ = false; -}; - -template -class ParamCast const&> -{ -public: - ParamCast(AMX* amx, cell* params, int idx) - : data_(nullptr) - , len_((int)params[idx + 1]) - , value_() - { - value_.resize(len_); - amx_GetAddr(amx, params[idx + 0], &data_); - if (data_ == nullptr) - { - error_ = true; - } - else - { - cell* input = data_; - // Copy the data out. - for (size_t idx = 0; idx != len_; ++idx) - { - value_[idx] = static_cast(input[idx]); - } - } - } - - ~ParamCast() - { - // No writing back for constants. - } - - ParamCast(ParamCast const&> const&) = delete; - ParamCast(ParamCast const&>&&) = delete; - - // clang-format off - // Adding this here because clang formatter (locally, even using format.bat) - // Keeps adding a space between `const` and `&` and according to our `.clang-format` - // Style guide, it's not acceptable, since `PointerAlignment` is set to `Left` - operator Impl::DynamicArray const& () - // clang-format on - { - return value_; - } - - bool Error() const - { - return error_; - } - - static constexpr int Size = 2; - -private: - cell* data_; - int len_; - Impl::DynamicArray value_; - bool error_ = false; -}; - -template -class ParamCast> -{ -public: - ParamCast(AMX* amx, cell* params, int idx) - : data_(nullptr) - , len_((int)params[idx + 1]) - , value_() - { - value_.resize(len_); - amx_GetAddr(amx, params[idx + 0], &data_); - if (data_ == nullptr) - { - error_ = true; - } - else - { - cell* input = data_; - // Copy the data out. - for (size_t idx = 0; idx != len_; ++idx) - { - value_[idx] = static_cast(input[idx]); - } - } - } - - ~ParamCast() - { - } - - ParamCast(ParamCast> const&) = delete; - ParamCast(ParamCast>&&) = delete; - - operator Impl::DynamicArray() - { - return value_; - } - - bool Error() const - { - return error_; - } - - static constexpr int Size = 2; - -private: - cell* data_; - int len_; - Impl::DynamicArray value_; - bool error_ = false; -}; - -template -class ParamCast&> -{ -public: - ParamCast(AMX* amx, cell* params, int idx) - : data_(nullptr) - , len_((int)params[idx + 1]) - , value_() - { - value_.resize(len_); - amx_GetAddr(amx, params[idx + 0], &data_); - if (data_ == nullptr) - { - error_ = true; - } - else - { - cell* input = data_; - // Copy the data out. - for (size_t idx = 0; idx != len_; ++idx) - { - value_[idx] = static_cast(input[idx]); - } - } - } - - ~ParamCast() - { - // Write the data back - cell* input = data_; - // Copy the data out. - for (size_t idx = 0; idx != len_; ++idx) - { - input[idx] = static_cast(value_[idx]); - } - } - - ParamCast(ParamCast&> const&) = delete; - ParamCast(ParamCast&>&&) = delete; - - operator Impl::DynamicArray&() - { - return value_; - } - - bool Error() const - { - return error_; - } - - static constexpr int Size = 2; - -private: - cell* data_; - int len_; - Impl::DynamicArray value_; - bool error_ = false; -}; - -class NotImplemented : public std::logic_error -{ -public: - NotImplemented() - : std::logic_error { "Pawn native not yet implemented." } - { - } -}; -} diff --git a/SDK/include/Server/Components/Pawn/pawn.hpp b/SDK/include/Server/Components/Pawn/pawn.hpp deleted file mode 100644 index 4d96b52b0..000000000 --- a/SDK/include/Server/Components/Pawn/pawn.hpp +++ /dev/null @@ -1,293 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define SCRIPT_API(name, prototype) PAWN_NATIVE(openmp_scripting, name, prototype) -#define SCRIPT_API_FAILRET(name, failret, prototype) PAWN_NATIVE_FAILRET(openmp_scripting, failret, name, prototype) -#define EXTERN_API(name, prototype) PAWN_NATIVE_DECL(openmp_scripting, name, prototype) - -constexpr int NUM_AMX_FUNCS = 52; - -int AMXAPI amx_GetNativeByIndex(AMX const* amx, int index, AMX_NATIVE_INFO* ret); -int AMXAPI amx_MakeAddr(AMX* amx, cell* phys_addr, cell* amx_addr); -int AMXAPI amx_StrSize(const cell* cstr, int* length); - -enum DefaultReturnValue -{ - DefaultReturnValue_False, - DefaultReturnValue_True -}; - -struct PawnLookup -{ - ICore* core = nullptr; - IConfig* config = nullptr; - IPlayerPool* players = nullptr; - IActorsComponent* actors = nullptr; - ICheckpointsComponent* checkpoints = nullptr; - IClassesComponent* classes = nullptr; - IConsoleComponent* console = nullptr; - IDatabasesComponent* databases = nullptr; - IDialogsComponent* dialogs = nullptr; - IGangZonesComponent* gangzones = nullptr; - IFixesComponent* fixes = nullptr; - IMenusComponent* menus = nullptr; - IObjectsComponent* objects = nullptr; - IPickupsComponent* pickups = nullptr; - IRecordingsComponent* recordings = nullptr; - ITextDrawsComponent* textdraws = nullptr; - ITextLabelsComponent* textlabels = nullptr; - ITimersComponent* timers = nullptr; - IVariablesComponent* vars = nullptr; - IVehiclesComponent* vehicles = nullptr; - ICustomModelsComponent* models = nullptr; -}; - -PawnLookup* getAmxLookups(); - -struct IPawnScript -{ - // Wrap the AMX API. - virtual int Allot(int cells, cell* amx_addr, cell** phys_addr) = 0; - virtual int Callback(cell index, cell* result, const cell* params) = 0; - virtual int Cleanup() = 0; - virtual int Clone(AMX* amxClone, void* data) const = 0; - virtual int Exec(cell* retval, int index) = 0; - virtual int FindNative(char const* name, int* index) const = 0; - virtual int FindPublic(char const* funcname, int* index) const = 0; - virtual int FindPubVar(char const* varname, cell* amx_addr) const = 0; - virtual int FindTagId(cell tag_id, char* tagname) const = 0; - virtual int Flags(uint16_t* flags) const = 0; - virtual int GetAddr(cell amx_addr, cell** phys_addr) const = 0; - virtual int GetNative(int index, char* funcname) const = 0; - virtual int GetNativeByIndex(int index, AMX_NATIVE_INFO* ret) const = 0; - virtual int GetPublic(int index, char* funcname) const = 0; - virtual int GetPubVar(int index, char* varname, cell* amx_addr) const = 0; - virtual int GetString(char const* dest, const cell* source, bool use_wchar, size_t size) const = 0; - virtual int GetString(char* dest, const cell* source, bool use_wchar, size_t size) = 0; - virtual int GetTag(int index, char* tagname, cell* tag_id) const = 0; - virtual int GetUserData(long tag, void** ptr) const = 0; - virtual int Init(void* program) = 0; - virtual int InitJIT(void* reloc_table, void* native_code) = 0; - virtual int MakeAddr(cell* phys_addr, cell* amx_addr) const = 0; - virtual int MemInfo(long* codesize, long* datasize, long* stackheap) const = 0; - virtual int NameLength(int* length) const = 0; - virtual AMX_NATIVE_INFO* NativeInfo(char const* name, AMX_NATIVE func) const = 0; - virtual int NumNatives(int* number) const = 0; - virtual int NumPublics(int* number) const = 0; - virtual int NumPubVars(int* number) const = 0; - virtual int NumTags(int* number) const = 0; - virtual int Push(cell value) = 0; - virtual int PushArray(cell* amx_addr, cell** phys_addr, const cell array[], int numcells) = 0; - virtual int PushString(cell* amx_addr, cell** phys_addr, StringView string, bool pack, bool use_wchar) = 0; - virtual int RaiseError(int error) = 0; - virtual int Register(const AMX_NATIVE_INFO* nativelist, int number) = 0; - - // Don't forget: - // - // using IPawnScript::Register; - // - // In inheriting classes. - inline int Register(char const* name, AMX_NATIVE func) - { - AMX_NATIVE_INFO nativelist = { name, func }; - return Register(&nativelist, 1); - } - - virtual int Release(cell amx_addr) = 0; - virtual int SetCallback(AMX_CALLBACK callback) = 0; - virtual int SetDebugHook(AMX_DEBUG debug) = 0; - virtual int SetString(cell* dest, StringView source, bool pack, bool use_wchar, size_t size) const = 0; - virtual int SetUserData(long tag, void* ptr) = 0; - virtual int StrLen(const cell* cstring, int* length) const = 0; - virtual int StrSize(const cell* cstr, int* length) const = 0; - virtual int UTF8Check(char const* string, int* length) const = 0; - virtual int UTF8Get(char const* string, char const** endptr, cell* value) const = 0; - virtual int UTF8Len(const cell* cstr, int* length) const = 0; - virtual int UTF8Put(char* string, char** endptr, int maxchars, cell value) const = 0; - - virtual cell GetCIP() const = 0; - virtual cell GetHEA() const = 0; - virtual cell GetSTP() const = 0; - virtual cell GetSTK() const = 0; - virtual cell GetHLW() const = 0; - virtual cell GetFRM() const = 0; - - virtual void SetCIP(cell v) = 0; - virtual void SetHEA(cell v) = 0; - virtual void SetSTP(cell v) = 0; - virtual void SetSTK(cell v) = 0; - virtual void SetHLW(cell v) = 0; - virtual void SetFRM(cell v) = 0; - - virtual AMX* GetAMX() = 0; - - virtual void PrintError(int err) = 0; - - virtual int GetID() const = 0; - virtual bool IsLoaded() const = 0; - - template - void Call(cell& ret, int idx, T... args) - { - // Check if the public exists. - if (idx == INT_MAX) - { - return; - } - int err = CallChecked(idx, ret, args...); - // Step 1: Try call a crashdetect-like callback, but don't get caught in a loop. - - // Step 2: Print it. - if (err != AMX_ERR_NONE) - { - PrintError(err); - } - } - - template - cell Call(char const* name, DefaultReturnValue defaultRetValue, T... args) - { - int idx; - cell ret = defaultRetValue; - if (!FindPublic(name, &idx)) - { - Call(ret, idx, args...); - } - return ret; - } - - template - inline cell Call(std::string const& name, DefaultReturnValue defaultRetValue, T... args) - { - return Call(name.c_str(), defaultRetValue, args...); - } - - // Call a function using an idx we know is correct. - template - int CallChecked(int idx, cell& ret, T... args) - { - cell amx_addr = GetHEA(); - // Push all the arguments, using templates to resolve the correct function to use. - int err = PushOne(args...); - if (err == AMX_ERR_NONE) - err = Exec(&ret, idx); - // Release everything at once. Technically all that `Release` does is reset the heap back - // to where it was before the call to any memory-allocating functions. You could do that - // for every allocating parameter in reverse order, or just do it once for all of them together. - Release(amx_addr); - return err; - } - - inline int PushOne() - { - return AMX_ERR_NONE; - } - - template - inline int PushOne(O arg, T... args) - { - int ret = PushOne(args...); - if (ret == AMX_ERR_NONE) - return Push((cell)arg); - return ret; - } - - template - inline int PushOne(float arg, T... args) - { - int ret = PushOne(args...); - if (ret == AMX_ERR_NONE) - return Push(amx_ftoc(arg)); - return ret; - } - - template - inline int PushOne(double arg, T... args) - { - int ret = PushOne(args...); - if (ret == AMX_ERR_NONE) - { - float a = (float)arg; - return Push(amx_ftoc(a)); - } - return ret; - } - - // TL;DR: BAD - template - inline int PushOne(char* arg, T... args) = delete; - - template - inline int PushOne(StringView arg, T... args) - { - int ret = PushOne(args...); - if (ret == AMX_ERR_NONE) - return PushString(nullptr, nullptr, arg, false, false); - return ret; - } - - template - inline int PushOne(StaticArray const& arg, T... args) - { - int ret = PushOne(args...); - if (ret == AMX_ERR_NONE) - return PushArray(nullptr, nullptr, arg.data(), arg.size()); - return ret; - } - - template - inline int PushOne(std::vector const& arg, T... args) - { - int ret = PushOne(args...); - if (ret == AMX_ERR_NONE) - return PushArray(nullptr, nullptr, arg.data(), arg.size()); - return ret; - } -}; - -struct PawnEventHandler -{ - virtual void onAmxLoad(IPawnScript& script) = 0; - virtual void onAmxUnload(IPawnScript& script) = 0; -}; - -static const UID PawnComponent_UID = UID(0x78906cd9f19c36a6); -struct IPawnComponent : public IComponent -{ - PROVIDE_UID(PawnComponent_UID); - - /// Get the PawnEventHandler event dispatcher - virtual IEventDispatcher& getEventDispatcher() = 0; - - virtual const StaticArray& getAmxFunctions() const = 0; - virtual IPawnScript const* getScript(AMX* amx) const = 0; - virtual IPawnScript* getScript(AMX* amx) = 0; - - /// Get a set of all the available scripts. - virtual IPawnScript* mainScript() = 0; - virtual const Span sideScripts() = 0; -}; diff --git a/SDK/include/Server/Components/Pickups/pickups.hpp b/SDK/include/Server/Components/Pickups/pickups.hpp deleted file mode 100644 index 38b828ce6..000000000 --- a/SDK/include/Server/Components/Pickups/pickups.hpp +++ /dev/null @@ -1,123 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -typedef uint8_t PickupType; - -/// Pickup base interface -struct IBasePickup : public IExtensible, public IEntity -{ - /// Sets pickup's type and restreams - virtual void setType(PickupType type, bool update = true) = 0; - - /// Gets pickup's type - virtual PickupType getType() const = 0; - - /// Sets pickup's position but don't restream - virtual void setPositionNoUpdate(Vector3 position) = 0; - - /// Sets pickup's model and restreams - virtual void setModel(int id, bool update = true) = 0; - - /// Gets pickup's model - virtual int getModel() const = 0; - - /// Checks if pickup is streamed for a player - virtual bool isStreamedInForPlayer(const IPlayer& player) const = 0; - - /// Streams pickup for a player - virtual void streamInForPlayer(IPlayer& player) = 0; - - /// Streams out pickup for a player - virtual void streamOutForPlayer(IPlayer& player) = 0; - - /// Set pickup state hidden or shown for a player (only process streaming if pickup is not hidden) - virtual void setPickupHiddenForPlayer(IPlayer& player, bool hidden) = 0; - - /// Check if given pickup has hidden state for player (only process streaming if pickup is not hidden) - virtual bool isPickupHiddenForPlayer(IPlayer& player) const = 0; - - /// Used by legacy per-player pickups for ID mapping. - virtual void setLegacyPlayer(IPlayer* player) = 0; - - /// Used by legacy per-player pickups for ID mapping. - virtual IPlayer* getLegacyPlayer() const = 0; -}; - -struct IPickup : public IBasePickup -{ -}; - -struct IPlayerPickup : public IBasePickup -{ -}; - -struct PickupEventHandler -{ - virtual void onPlayerPickUpPickup(IPlayer& player, IPickup& pickup) { } -}; - -static const UID PickupsComponent_UID = UID(0xcf304faa363dd971); -struct IPickupsComponent : public IPoolComponent -{ - PROVIDE_UID(PickupsComponent_UID); - - virtual IEventDispatcher& getEventDispatcher() = 0; - - /// Create a pickup - virtual IPickup* create(int modelId, PickupType type, Vector3 pos, uint32_t virtualWorld, bool isStatic) = 0; - - /// Get the ID of this pickup as used in old pools (i.e. in pawn). - virtual int toLegacyID(int real) const = 0; - - /// Get the ID of this pickup as used in the SDK. - virtual int fromLegacyID(int legacy) const = 0; - - /// Release the ID used in limited pools. - virtual void releaseLegacyID(int legacy) = 0; - - /// Return an ID not yet used in pawn (et al) to represent this pickup. - virtual int reserveLegacyID() = 0; - - /// Assign a full ID to the legacy ID reserved earlier. - virtual void setLegacyID(int legacy, int real) = 0; -}; - -static const UID PickupData_UID = UID(0x98376F4428D7B70B); -struct IPlayerPickupData : public IExtension -{ - PROVIDE_EXT_UID(PickupData_UID); - - /// Get the ID of this pickup as used in old pools (i.e. in pawn). - virtual int toLegacyID(int real) const = 0; - - /// Get the ID of this pickup as used in the SDK. - virtual int fromLegacyID(int legacy) const = 0; - - /// Release the ID used in limited pools. - virtual void releaseLegacyID(int legacy) = 0; - - /// Return an ID not yet used in pawn (et al) to represent this pickup. - virtual int reserveLegacyID() = 0; - - /// Assign a full ID to the legacy ID reserved earlier. - virtual void setLegacyID(int legacy, int real) = 0; - - /// Get the ID of this pickup as used internally (i.e. sent to the client). - virtual int toClientID(int real) const = 0; - - /// Get the ID of this pickup as used in the SDK. - virtual int fromClientID(int legacy) const = 0; - - /// Release the ID used on the client. - virtual void releaseClientID(int legacy) = 0; - - /// Return an ID not yet used on the client to represent this pickup. - virtual int reserveClientID() = 0; - - /// Assign a full ID to the legacy ID reserved earlier. - virtual void setClientID(int legacy, int real) = 0; -}; diff --git a/SDK/include/Server/Components/Recordings/recordings.hpp b/SDK/include/Server/Components/Recordings/recordings.hpp deleted file mode 100644 index 1f997d725..000000000 --- a/SDK/include/Server/Components/Recordings/recordings.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include - -/// The type of the recording: https://open.mp/docs/scripting/resources/recordtypes -enum PlayerRecordingType -{ - PlayerRecordingType_None, - PlayerRecordingType_Driver, - PlayerRecordingType_OnFoot -}; - -static const UID RecordingData_UID = UID(0x34DB532857286482); -struct IPlayerRecordingData : public IExtension -{ - PROVIDE_EXT_UID(RecordingData_UID); - - /// Start recording the player's data to a file - virtual void start(PlayerRecordingType type, StringView file) = 0; - - /// Stop recording the player's data to a file - virtual void stop() = 0; -}; - -static const UID RecordingsComponent_UID = UID(0x871144D399F5F613); -struct IRecordingsComponent : public IComponent -{ - PROVIDE_UID(RecordingsComponent_UID); -}; diff --git a/SDK/include/Server/Components/TextDraws/textdraws.hpp b/SDK/include/Server/Components/TextDraws/textdraws.hpp deleted file mode 100644 index d05018170..000000000 --- a/SDK/include/Server/Components/TextDraws/textdraws.hpp +++ /dev/null @@ -1,220 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -/// Text draw's text alignment -enum TextDrawAlignmentTypes -{ - TextDrawAlignment_Default, - TextDrawAlignment_Left, - TextDrawAlignment_Center, - TextDrawAlignment_Right -}; - -/// Textdraw's drawing style -enum TextDrawStyle -{ - TextDrawStyle_0, ///< Font type - TextDrawStyle_1, ///< Font type - TextDrawStyle_2, ///< Font type - TextDrawStyle_3, ///< Font type - TextDrawStyle_4, ///< TXD sprite - TextDrawStyle_5, ///< Model preview - TextDrawStyle_FontBeckettRegular = 0, ///< Font type - TextDrawStyle_FontAharoniBold, ///< Font type - TextDrawStyle_FontBankGothic, ///< Font type - TextDrawStyle_FontPricedown, ///< Font type - TextDrawStyle_Sprite, ///< TXD sprite - TextDrawStyle_Preview ///< Model preview -}; - -/// Text label base interface -struct ITextDrawBase : public IExtensible, public IIDProvider -{ - /// Get the textdraw's position - virtual Vector2 getPosition() const = 0; - - /// Set the textdraw's position - virtual ITextDrawBase& setPosition(Vector2 position) = 0; - - /// Set the textdraw's text - virtual void setText(StringView text) = 0; - - /// Get the textdraw's text - virtual StringView getText() const = 0; - - /// Set the letter size - virtual ITextDrawBase& setLetterSize(Vector2 size) = 0; - - /// Get the letter size - virtual Vector2 getLetterSize() const = 0; - - /// Set the text size - virtual ITextDrawBase& setTextSize(Vector2 size) = 0; - - /// Get the text size - virtual Vector2 getTextSize() const = 0; - - /// Set the text alignment - virtual ITextDrawBase& setAlignment(TextDrawAlignmentTypes alignment) = 0; - - /// Get the text alignment - virtual TextDrawAlignmentTypes getAlignment() const = 0; - - /// Set the letters' colour - virtual ITextDrawBase& setColour(Colour colour) = 0; - - /// Get the letters' colour - virtual Colour getLetterColour() const = 0; - - /// Set whether the textdraw uses a box - virtual ITextDrawBase& useBox(bool use) = 0; - - /// Get whether the textdraw uses a box - virtual bool hasBox() const = 0; - - /// Set the textdraw box's colour - virtual ITextDrawBase& setBoxColour(Colour colour) = 0; - - /// Get the textdraw box's colour - virtual Colour getBoxColour() const = 0; - - /// Set the textdraw's shadow strength - virtual ITextDrawBase& setShadow(int shadow) = 0; - - /// Get the textdraw's shadow strength - virtual int getShadow() const = 0; - - /// Set the textdraw's outline - virtual ITextDrawBase& setOutline(int outline) = 0; - - /// Get the textdraw's outline - virtual int getOutline() const = 0; - - /// Set the textdraw's background colour - virtual ITextDrawBase& setBackgroundColour(Colour colour) = 0; - - /// Get the textdraw's background colour - virtual Colour getBackgroundColour() const = 0; - - /// Set the textdraw's drawing style - virtual ITextDrawBase& setStyle(TextDrawStyle style) = 0; - - /// Get the textdraw's drawing style - virtual TextDrawStyle getStyle() const = 0; - - /// Set whether the textdraw is proportional - virtual ITextDrawBase& setProportional(bool proportional) = 0; - - /// Get whether the textdraw is proportional - virtual bool isProportional() const = 0; - - /// Set whether the textdraw is selectable - virtual ITextDrawBase& setSelectable(bool selectable) = 0; - - /// Get whether the textdraw is selectable - virtual bool isSelectable() const = 0; - - /// Set the textdraw's preview model - virtual ITextDrawBase& setPreviewModel(int model) = 0; - - /// Get the textdraw's preview model - virtual int getPreviewModel() const = 0; - - /// Set the textdraw's preview rotation - virtual ITextDrawBase& setPreviewRotation(Vector3 rotation) = 0; - - /// Get the textdraw's preview rotation - virtual Vector3 getPreviewRotation() const = 0; - - /// Set the textdraw's preview vehicle colours - virtual ITextDrawBase& setPreviewVehicleColour(int colour1, int colour2) = 0; - - /// Get the textdraw's preview vehicle colours - virtual Pair getPreviewVehicleColour() const = 0; - - /// Set the textdraw's preview zoom factor - virtual ITextDrawBase& setPreviewZoom(float zoom) = 0; - - /// Get the textdraw's preview zoom factor - virtual float getPreviewZoom() const = 0; - - /// Restream the textdraw - virtual void restream() = 0; -}; - -struct ITextDraw : public ITextDrawBase -{ - /// Show the textdraw for a player - virtual void showForPlayer(IPlayer& player) = 0; - - /// Hide the textdraw for a player - virtual void hideForPlayer(IPlayer& player) = 0; - - /// Get whether the textdraw is shown for a player - virtual bool isShownForPlayer(const IPlayer& player) const = 0; - - /// Set the textdraw's text for one player - virtual void setTextForPlayer(IPlayer& player, StringView text) = 0; -}; - -struct IPlayerTextDraw : public ITextDrawBase -{ - /// Show the textdraw for its player - virtual void show() = 0; - - /// Hide the textdraw for its player - virtual void hide() = 0; - - /// Get whether the textdraw is shown for its player - virtual bool isShown() const = 0; -}; - -struct TextDrawEventHandler -{ - virtual void onPlayerClickTextDraw(IPlayer& player, ITextDraw& td) { } - virtual void onPlayerClickPlayerTextDraw(IPlayer& player, IPlayerTextDraw& td) { } - virtual bool onPlayerCancelTextDrawSelection(IPlayer& player) { return false; } - virtual bool onPlayerCancelPlayerTextDrawSelection(IPlayer& player) { return false; } -}; - -static const UID TextDrawsComponent_UID = UID(0x9b5dc2b1d15c992a); -/// The textdraw component which is a global textdraw pool -struct ITextDrawsComponent : public IPoolComponent -{ - PROVIDE_UID(TextDrawsComponent_UID); - - /// Get the textdraw event dispatcher - virtual IEventDispatcher& getEventDispatcher() = 0; - - /// Create a new textdraw with some text - virtual ITextDraw* create(Vector2 position, StringView text) = 0; - - /// Create a new textdraw with some preview model - virtual ITextDraw* create(Vector2 position, int model) = 0; -}; - -static const UID PlayerTextDrawData_UID = UID(0xbf08495682312400); -/// The textdraw player data which is a player textdraw pool -struct IPlayerTextDrawData : public IExtension, public IPool -{ - PROVIDE_EXT_UID(PlayerTextDrawData_UID); - - /// Begin selecting textdraws for the player - virtual void beginSelection(Colour highlight) = 0; - - /// Get whether the player is selecting textdraws - virtual bool isSelecting() const = 0; - - /// Stop selecting textdraws for the player - virtual void endSelection() = 0; - - /// Create a new textdraw with some text - virtual IPlayerTextDraw* create(Vector2 position, StringView text) = 0; - - /// Create a new textdraw with some preview model - virtual IPlayerTextDraw* create(Vector2 position, int model) = 0; -}; diff --git a/SDK/include/Server/Components/TextLabels/textlabels.hpp b/SDK/include/Server/Components/TextLabels/textlabels.hpp deleted file mode 100644 index 2543927b9..000000000 --- a/SDK/include/Server/Components/TextLabels/textlabels.hpp +++ /dev/null @@ -1,111 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -struct IVehicle; - -/// Text label attachment data -struct TextLabelAttachmentData -{ - int playerID = INVALID_PLAYER_ID; - int vehicleID = INVALID_VEHICLE_ID; -}; - -/// Text label base interface -struct ITextLabelBase : public IExtensible, public IEntity -{ - /// Set the text label's text - virtual void setText(StringView text) = 0; - - /// Get the text label's text - virtual StringView getText() const = 0; - - /// Set the text label's colour - virtual void setColour(Colour colour) = 0; - - /// Get the text label's colour - virtual Colour getColour() const = 0; - - /// Set the text label's draw distance - virtual void setDrawDistance(float dist) = 0; - - /// Get the text label's draw distance - virtual float getDrawDistance() = 0; - - /// Attach the text label to a player with an offset - virtual void attachToPlayer(IPlayer& player, Vector3 offset) = 0; - - /// Attach the text label to a vehicle with an offset - virtual void attachToVehicle(IVehicle& vehicle, Vector3 offset) = 0; - - /// Get the text label's attachment data - virtual const TextLabelAttachmentData& getAttachmentData() const = 0; - - /// Detach the text label from the player and set its position or offset - virtual void detachFromPlayer(Vector3 position) = 0; - - /// Detach the text label from the vehicle and set its position or offset - virtual void detachFromVehicle(Vector3 position) = 0; - - // Set the text label's los check. - virtual void setTestLOS(bool status) = 0; - - // Get the text label's los check status. - virtual bool getTestLOS() const = 0; - - // Used to update both colour and text with one single network packet being sent. - virtual void setColourAndText(Colour colour, StringView text) = 0; -}; - -/// A global text label -struct ITextLabel : public ITextLabelBase -{ - /// Checks if player has the text label streamed in for themselves - virtual bool isStreamedInForPlayer(const IPlayer& player) const = 0; - - /// Streams in the text label for a specific player - virtual void streamInForPlayer(IPlayer& player) = 0; - - /// Streams out the text label for a specific player - virtual void streamOutForPlayer(IPlayer& player) = 0; -}; - -/// A player text label -struct IPlayerTextLabel : public ITextLabelBase -{ -}; - -static const UID TextLabelsComponent_UID = UID(0xa0c57ea80a009742); -/// The text label component which is a global text label pool -struct ITextLabelsComponent : public IPoolComponent -{ - PROVIDE_UID(TextLabelsComponent_UID); - - /// Create a text label - virtual ITextLabel* create(StringView text, Colour colour, Vector3 pos, float drawDist, int vw, bool los) = 0; - - /// Create a text label and attach it to a player - virtual ITextLabel* create(StringView text, Colour colour, Vector3 pos, float drawDist, int vw, bool los, IPlayer& attach) = 0; - - /// Create a text label and attach it to a vehicle - virtual ITextLabel* create(StringView text, Colour colour, Vector3 pos, float drawDist, int vw, bool los, IVehicle& attach) = 0; -}; - -static const UID PlayerTextLabelData_UID = UID(0xb9e2bd0dc5148c3c); -/// The text label player data which is a player text label pool -struct IPlayerTextLabelData : public IExtension, public IPool -{ - PROVIDE_EXT_UID(PlayerTextLabelData_UID); - - /// Create a player text label - virtual IPlayerTextLabel* create(StringView text, Colour colour, Vector3 pos, float drawDist, bool los) = 0; - - /// Create a player text label and attach it to a player - virtual IPlayerTextLabel* create(StringView text, Colour colour, Vector3 pos, float drawDist, bool los, IPlayer& attach) = 0; - - /// Create a player text label and attach it to a vehicle - virtual IPlayerTextLabel* create(StringView text, Colour colour, Vector3 pos, float drawDist, bool los, IVehicle& attach) = 0; -}; diff --git a/SDK/include/Server/Components/Timers/Impl/timers_impl.hpp b/SDK/include/Server/Components/Timers/Impl/timers_impl.hpp deleted file mode 100644 index 8437eeb39..000000000 --- a/SDK/include/Server/Components/Timers/Impl/timers_impl.hpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "../timers.hpp" -#include - -namespace Impl -{ - -class SimpleTimerHandler final : public TimerTimeOutHandler -{ -private: - std::function handler_; - - // Ensure only `free` can delete this. - ~SimpleTimerHandler() - { - } - -public: - SimpleTimerHandler(std::function const& handler) - : handler_(handler) - { - } - - SimpleTimerHandler(std::function&& handler) - : handler_(std::move(handler)) - { - } - - void timeout(ITimer& timer) override - { - handler_(); - } - - void free(ITimer& timer) override - { - delete this; - } -}; - -} diff --git a/SDK/include/Server/Components/Timers/timers.hpp b/SDK/include/Server/Components/Timers/timers.hpp deleted file mode 100644 index c3c76e4da..000000000 --- a/SDK/include/Server/Components/Timers/timers.hpp +++ /dev/null @@ -1,64 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -struct TimerTimeOutHandler; - -struct ITimer : public IExtensible -{ - /// Get whether the timer is running or has been killed - virtual bool running() const = 0; - - /// Get the remaining time until time out - virtual Milliseconds remaining() const = 0; - - /// Get how many calls there are left. - virtual unsigned int calls() const = 0; - - /// Get the timer's interval - virtual Milliseconds interval() const = 0; - - /// Mark the timer as being called now. Returns `true` when there are more - /// calls to make after this one. - virtual bool trigger() = 0; - - /// Immediately kill the timer - virtual void kill() = 0; - - /// Get the handler associated with the timer - virtual TimerTimeOutHandler* handler() const = 0; -}; - -struct TimerTimeOutHandler -{ - /// Called when a timer times out (can be multiple times per timer if it's repeating) - virtual void timeout(ITimer& timer) = 0; - - /// Called when a timer is about to be destroyed, used for deallocating handler - virtual void free(ITimer& timer) = 0; -}; - -static const UID TimersComponent_UID = UID(0x2ad8124c5ea257a3); -struct ITimersComponent : public IComponent -{ - PROVIDE_UID(TimersComponent_UID); - - /// Create a new timer handled by a handler which times out after a certain time - /// @param handler The handler which handlers time out - /// @param interval The time after which the timer will time out - /// @param repeating Whether the timer repeats when it times out - virtual ITimer* create(TimerTimeOutHandler* handler, Milliseconds interval, bool repeating) = 0; - - /// Create a new timer handled by a handler which times out after a certain time - /// @param handler The handler which handlers time out. - /// @param initial The time before the first trigger. - /// @param interval The time after which the timer will time out. - /// @param count The number of times to call the timer, 0 = infinite. - virtual ITimer* create(TimerTimeOutHandler* handler, Milliseconds initial, Milliseconds interval, unsigned int count) = 0; - - /// Returns running timers count. - virtual const size_t count() const = 0; -}; diff --git a/SDK/include/Server/Components/Unicode/unicode.hpp b/SDK/include/Server/Components/Unicode/unicode.hpp deleted file mode 100644 index dd57f71f7..000000000 --- a/SDK/include/Server/Components/Unicode/unicode.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#include -#include - -static const UID UnicodeComponent_UID = UID(0x8ffb446f8353922b); -struct IUnicodeComponent : public IComponent -{ - PROVIDE_UID(UnicodeComponent_UID); - - virtual OptimisedString toUTF8(StringView input) = 0; -}; diff --git a/SDK/include/Server/Components/Variables/variables.hpp b/SDK/include/Server/Components/Variables/variables.hpp deleted file mode 100644 index 841f472f4..000000000 --- a/SDK/include/Server/Components/Variables/variables.hpp +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -enum VariableType -{ - VariableType_None, - VariableType_Int, - VariableType_String, - VariableType_Float -}; - -struct IVariableStorageBase -{ - /// Set a variable to a string - virtual void setString(StringView key, StringView value) = 0; - - /// Get a variable as a string - virtual const StringView getString(StringView key) const = 0; - - /// Set a variable to an int - virtual void setInt(StringView key, int value) = 0; - - /// Get a variable as an int - virtual int getInt(StringView key) const = 0; - - /// Set a variable to a float - virtual void setFloat(StringView key, float value) = 0; - - /// Get a variable as a float - virtual float getFloat(StringView key) const = 0; - - /// Get a variable's type - virtual VariableType getType(StringView key) const = 0; - - /// Erase a variable by setting its type to None and freeing its memory if it's a string - virtual bool erase(StringView key) = 0; - - /// Get variable name (key) by index - virtual bool getKeyAtIndex(int index, StringView& key) const = 0; - - /// Get variables map size - virtual int size() const = 0; -}; - -static const UID VariablesComponent_UID = UID(0x75e121848bc01fa2); -struct IVariablesComponent : public IComponent, public IVariableStorageBase -{ - PROVIDE_UID(VariablesComponent_UID); -}; - -static const UID PlayerVariableData_UID = UID(0x12debbc8a3bd23ad); -struct IPlayerVariableData : public IExtension, public IVariableStorageBase -{ - PROVIDE_EXT_UID(PlayerVariableData_UID); -}; diff --git a/SDK/include/Server/Components/Vehicles/Impl/vehicle_models.hpp b/SDK/include/Server/Components/Vehicles/Impl/vehicle_models.hpp deleted file mode 100644 index 1295af310..000000000 --- a/SDK/include/Server/Components/Vehicles/Impl/vehicle_models.hpp +++ /dev/null @@ -1,280 +0,0 @@ -#pragma once - -#include "vehicles.hpp" -#include - -static const StaticArray allModelInfo = { { { { 2.329999f, 5.119999f, 1.639999f }, { 0.330000f, 0.029999f, -0.200000f }, { 0.439999f, -0.699999f, -0.219999f }, { -1.100000f, -2.059999f, -0.070000f }, { 0.879999f, 1.379999f, -0.610000f }, { 0.879999f, -1.389999f, -0.610000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.490000f, -0.460000f }, - { { 2.569999f, 5.829999f, 1.710000f }, { 0.500000f, -0.059999f, -0.119999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.090000f, -0.939999f, 0.000000f }, { 0.980000f, 1.629999f, -0.349999f }, { 0.980000f, -1.490000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.109999f }, - { { 2.410000f, 5.800000f, 1.529999f }, { 0.540000f, -0.349999f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.039999f, -1.919999f, 0.140000f }, { 0.970000f, 1.519999f, -0.349999f }, { 0.970000f, -1.549999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.479999f, -0.310000f }, - { { 3.150000f, 9.220000f, 4.179999f }, { 0.430000f, 1.450000f, 0.340000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.450000f, 0.070000f, -0.800000f }, { 1.120000f, 3.559999f, -0.949999f }, { 1.120000f, -3.450000f, -0.949999f }, { 1.120000f, -2.250000f, -0.949999f }, -0.699999f, -50.000000f }, - { { 2.200000f, 5.809999f, 1.840000f }, { 0.460000f, -0.129999f, -0.029999f }, { 0.469999f, -1.070000f, -0.009999f }, { -0.939999f, -2.359999f, -0.009999f }, { 0.800000f, 1.539999f, -0.330000f }, { 0.800000f, -1.570000f, -0.330000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.140000f, -0.150000f }, - { { 2.349999f, 6.000000f, 1.490000f }, { 0.430000f, 0.000000f, -0.189999f }, { 0.400000f, -0.980000f, -0.239999f }, { -1.039999f, -2.180000f, -0.039999f }, { 0.839999f, 1.639999f, -0.449999f }, { 0.839999f, -1.639999f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.200000f, -0.200000f }, - { { 5.269999f, 11.590000f, 4.420000f }, { 1.379999f, 2.559999f, 0.779999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 2.009999f, 3.200000f, -1.250000f }, { 2.009999f, -1.970000f, -1.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.849999f, 8.960000f, 2.700000f }, { 0.600000f, 2.890000f, 0.200000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.110000f, -3.660000f, -0.540000f }, { 1.049999f, 2.450000f, -0.699999f }, { 1.049999f, -2.049999f, -0.699999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.500000f, -50.000000f }, - { { 3.119999f, 10.689999f, 3.910000f }, { 0.439999f, 2.730000f, -0.109999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.230000f, 1.299999f, -0.660000f }, { 1.090000f, 4.039999f, -0.970000f }, { 1.090000f, -2.220000f, -0.970000f }, { 1.090000f, -1.080000f, -0.970000f }, -0.529999f, -50.000000f }, - { { 2.369999f, 8.180000f, 1.529999f }, { 0.460000f, 1.059999f, -0.140000f }, { 0.460000f, -1.870000f, -0.219999f }, { -0.980000f, -2.829999f, 0.119999f }, { 0.889999f, 2.750000f, -0.349999f }, { 0.889999f, -2.740000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.310000f, -0.310000f }, - { { 2.259999f, 5.010000f, 1.799999f }, { 0.419999f, -0.170000f, -0.050000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.019999f, -1.669999f, 0.209999f }, { 0.819999f, 1.389999f, -0.289999f }, { 0.819999f, -1.379999f, -0.289999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.039999f, -0.009999f }, - { { 2.390000f, 5.780000f, 1.370000f }, { 0.490000f, 0.050000f, -0.209999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.090000f, -2.099999f, 0.090000f }, { 0.949999f, 1.710000f, -0.349999f }, { 0.949999f, -1.710000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.509999f, -0.370000f }, - { { 2.450000f, 7.309999f, 1.389999f }, { 0.460000f, -0.129999f, -0.230000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, -3.549999f, -0.170000f }, { 0.930000f, 1.889999f, -0.349999f }, { 0.930000f, -1.879999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.360000f, -0.349999f }, - { { 2.279999f, 5.880000f, 2.230000f }, { 0.490000f, 0.779999f, 0.059999f }, { 0.529999f, -1.740000f, -0.019999f }, { -1.049999f, 0.340000f, -0.529999f }, { 0.879999f, 1.799999f, -0.639999f }, { 0.920000f, -1.850000f, -0.639999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.319999f, -0.319999f }, - { { 2.519999f, 7.070000f, 4.599999f }, { 0.439999f, 0.959999f, 0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.920000f, -0.740000f, -0.699999f }, { 0.910000f, 2.140000f, -0.620000f }, { 0.910000f, -2.130000f, -0.620000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.400000f, -0.280000f }, - { { 2.319999f, 5.510000f, 1.139999f }, { 0.419999f, 0.000000f, -0.330000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.129999f, -2.069999f, 0.019999f }, { 0.910000f, 1.570000f, -0.360000f }, { 0.910000f, -1.610000f, -0.360000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.070000f }, - { { 2.730000f, 8.010000f, 3.400000f }, { 0.419999f, 0.949999f, 0.059999f }, { 0.850000f, -2.730000f, 0.079999f }, { -1.350000f, -2.740000f, -0.189999f }, { 0.959999f, 2.220000f, -0.670000f }, { 1.179999f, -2.180000f, -0.670000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.340000f, -50.000000f }, - { { 5.449999f, 23.270000f, 6.610000f }, { 0.439999f, 3.269999f, 0.600000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.569999f, 5.670000f, 2.140000f }, { 0.519999f, 0.460000f, -0.129999f }, { 0.449999f, -0.680000f, -0.239999f }, { 1.210000f, -1.570000f, -0.079999f }, { 1.009999f, 1.799999f, -0.680000f }, { 1.009999f, -1.700000f, -0.680000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.490000f, -0.490000f }, - { { 2.400000f, 6.219999f, 1.409999f }, { 0.409999f, -0.209999f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.080000f, -1.990000f, 0.029999f }, { 0.899999f, 1.620000f, -0.430000f }, { 0.899999f, -1.620000f, -0.430000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.419999f, -0.360000f }, - { { 2.410000f, 5.909999f, 1.769999f }, { 0.519999f, 0.059999f, -0.140000f }, { 0.519999f, -1.029999f, -0.109999f }, { -1.100000f, -2.150000f, 0.100000f }, { 0.920000f, 1.639999f, -0.349999f }, { 0.920000f, -1.639999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.319999f }, - { { 2.250000f, 6.389999f, 1.370000f }, { 0.449999f, 0.109999f, -0.230000f }, { 0.430000f, -1.080000f, -0.230000f }, { -1.070000f, -2.440000f, -0.170000f }, { 0.839999f, 1.740000f, -0.479999f }, { 0.839999f, -1.740000f, -0.479999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.330000f, -0.289999f }, - { { 2.269999f, 5.380000f, 1.549999f }, { 0.409999f, 0.070000f, -0.180000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.080000f, -0.419999f, -0.200000f }, { 0.860000f, 1.490000f, -0.550000f }, { 0.860000f, -1.490000f, -0.550000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.310000f, -0.360000f }, - { { 2.319999f, 4.840000f, 4.909999f }, { 0.579999f, 0.670000f, 0.200000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.169999f, -1.899999f, -0.319999f }, { 0.910000f, 1.710000f, -0.629999f }, { 0.889999f, -1.299999f, -0.629999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.560000f, -0.620000f }, - { { 2.460000f, 3.859999f, 1.779999f }, { 0.389999f, -0.090000f, -0.090000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.180000f, 1.080000f, 0.430000f }, { 1.000000f, 1.090000f, -0.280000f }, { 1.000000f, -1.080000f, -0.280000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.360000f, 0.009999f }, - { { 5.159999f, 18.629999f, 5.190000f }, { 0.000000f, 2.549999f, 0.189999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.410000f, 5.909999f, 1.769999f }, { 0.519999f, 0.059999f, -0.140000f }, { 0.519999f, -1.029999f, -0.109999f }, { -1.100000f, -2.150000f, 0.090000f }, { 0.920000f, 1.639999f, -0.349999f }, { 0.920000f, -1.639999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.319999f }, - { { 2.640000f, 8.199999f, 3.230000f }, { 0.379999f, 1.100000f, 0.250000f }, { 0.709999f, -2.759999f, 0.140000f }, { -1.269999f, -3.200000f, -0.159999f }, { 0.910000f, 2.519999f, -0.529999f }, { 1.009999f, -2.289999f, -0.529999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.409999f, -50.000000f }, - { { 2.730000f, 6.280000f, 3.480000f }, { 0.649999f, 0.649999f, 0.140000f }, { 0.750000f, -2.420000f, 0.209999f }, { -1.009999f, -3.059999f, -0.490000f }, { 0.910000f, 1.950000f, -0.639999f }, { 1.029999f, -1.750000f, -0.639999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.519999f, -50.000000f }, - { { 2.210000f, 5.179999f, 1.279999f }, { 0.490000f, -0.500000f, -0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.990000f, -2.140000f, 0.140000f }, { 0.870000f, 1.570000f, -0.250000f }, { 0.870000f, -1.570000f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.259999f }, - { { 4.769999f, 16.899999f, 5.920000f }, { 0.400000f, 0.519999f, 0.980000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.009999f, 12.210000f, 4.420000f }, { 0.709999f, 4.730000f, 0.379999f }, { 0.750000f, 5.139999f, -0.529999f }, { -1.450000f, -5.469999f, -0.129999f }, { 1.110000f, 3.940000f, -0.500000f }, { 1.110000f, -3.900000f, -0.500000f }, { 1.110000f, -2.859999f, -0.500000f }, -0.389999f, -0.389999f }, - { { 4.300000f, 9.170000f, 3.880000f }, { 0.379999f, 2.769999f, -0.189999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.629999f, 3.099999f, -0.349999f }, { 1.629999f, -3.099999f, -0.349999f }, { 1.629999f, 0.000000f, -0.349999f }, -50.000000f, -50.000000f }, - { { 3.400000f, 10.000000f, 4.860000f }, { 0.490000f, 1.159999f, 0.519999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.519999f, 0.159999f, -0.680000f }, { 1.289999f, 2.990000f, -0.800000f }, { 1.289999f, -2.990000f, -0.800000f }, { 1.289999f, -1.559999f, -0.800000f }, -0.360000f, -0.050000f }, - { { 2.289999f, 4.570000f, 1.720000f }, { 0.259999f, -0.449999f, -0.330000f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.730000f, -1.580000f, 0.289999f }, { 0.899999f, 1.799999f, -0.589999f }, { 1.019999f, -1.389999f, -0.500000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.160000f, 13.529999f, 4.769999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.009999f, -1.440000f, -0.949999f }, { 1.009999f, -2.730000f, -0.949999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.279999f, 5.510000f, 1.720000f }, { 0.400000f, -0.170000f, -0.079999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.070000f, -1.820000f, 0.140000f }, { 0.850000f, 1.379999f, -0.349999f }, { 0.850000f, -1.399999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.070000f, -0.070000f }, - { { 3.039999f, 11.760000f, 4.010000f }, { 0.209999f, 4.289999f, 1.000000f }, { 0.750000f, 2.710000f, -0.529999f }, { -1.490000f, -4.969999f, -0.500000f }, { 1.220000f, 3.950000f, -0.500000f }, { 1.220000f, -3.940000f, -0.500000f }, { 1.220000f, -2.829999f, -0.500000f }, -0.379999f, -0.439999f }, - { { 2.410000f, 5.820000f, 1.720000f }, { 0.460000f, 0.419999f, -0.289999f }, { 0.460000f, -0.610000f, -0.289999f }, { -1.090000f, -1.929999f, -0.019999f }, { 0.949999f, 1.919999f, -0.550000f }, { 0.949999f, -1.909999f, -0.550000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.579999f, -0.579999f }, - { { 2.220000f, 5.289999f, 1.470000f }, { 0.490000f, -0.540000f, -0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.110000f, -1.509999f, 0.059999f }, { 0.879999f, 1.559999f, -0.449999f }, { 0.879999f, -1.509999f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.349999f, -0.129999f }, - { { 2.309999f, 5.559999f, 2.759999f }, { 0.500000f, 0.750000f, -0.050000f }, { 0.540000f, -1.789999f, -0.090000f }, { -1.090000f, -0.460000f, -0.419999f }, { 0.879999f, 1.779999f, -0.750000f }, { 0.879999f, -1.850000f, -0.750000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.589999f, -0.629999f }, - { { 0.870000f, 1.409999f, 1.019999f }, { 0.059999f, -0.070000f, 0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.259999f, 0.400000f, 0.029999f }, { 0.259999f, -0.400000f, 0.029999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.609999f, 6.679999f, 1.759999f }, { 0.490000f, 0.270000f, -0.189999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.210000f, -2.210000f, 0.059999f }, { 0.980000f, 2.000000f, -0.460000f }, { 0.980000f, -2.000000f, -0.460000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.330000f, -0.200000f }, - { { 4.159999f, 20.049999f, 4.429999f }, { 0.389999f, 2.880000f, 0.319999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.529999f, 1.240000f, -0.899999f }, { 1.220000f, 4.860000f, -0.959999f }, { 1.220000f, -5.170000f, -0.959999f }, { 1.220000f, -4.039999f, -0.959999f }, -0.740000f, -50.000000f }, - { { 3.660000f, 6.019999f, 3.289999f }, { 0.540000f, 0.349999f, 0.600000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, -2.599999f, -0.059999f }, { 1.370000f, 1.909999f, -0.449999f }, { 1.370000f, -1.909999f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.299999f, 5.860000f, 1.750000f }, { 0.479999f, -0.029999f, -0.159999f }, { 0.479999f, -1.139999f, -0.159999f }, { -1.039999f, -1.940000f, 0.129999f }, { 0.910000f, 1.740000f, -0.460000f }, { 0.910000f, -1.740000f, -0.460000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.370000f, -0.340000f }, - { { 4.769999f, 17.020000f, 4.309999f }, { 0.689999f, 0.250000f, 1.070000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.420000f, 14.800000f, 3.150000f }, { 0.419999f, 0.949999f, -0.070000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.709999f, 2.190000f, 1.629999f }, { 0.000000f, -0.340000f, 0.419999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.680000f, -0.270000f }, { 0.000000f, -0.670000f, -0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.029999f, 9.029999f, 4.989999f }, { 0.460000f, 3.359999f, -0.300000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.069999f, 13.510000f, 3.720000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.009999f, -1.440000f, -0.949999f }, { 1.009999f, -2.730000f, -0.949999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.319999f, 5.469999f, 1.220000f }, { 0.529999f, -0.200000f, -0.319999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.059999f, -1.220000f, -0.039999f }, { 0.899999f, 1.299999f, -0.209999f }, { 0.879999f, -1.700000f, -0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.129999f, -50.000000f }, - { { 3.609999f, 14.569999f, 3.289999f }, { 0.500000f, 2.980000f, 0.819999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 5.139999f, 13.770000f, 9.289999f }, { 0.409999f, 1.570000f, 1.429999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 6.619999f, 19.049999f, 13.840000f }, { -0.560000f, 2.730000f, 3.109999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.319999f, 9.699999f, 3.630000f }, { 0.490000f, 1.169999f, 0.600000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.529999f, -0.009999f, -0.759999f }, { 1.289999f, 2.990000f, -0.800000f }, { 1.289999f, -2.990000f, -0.800000f }, { 1.289999f, -1.559999f, -0.800000f }, -0.560000f, -0.250000f }, - { { 3.230000f, 9.520000f, 4.980000f }, { 0.419999f, 1.389999f, 0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.790000f, -0.050000f, -0.610000f }, { 1.019999f, 2.559999f, -0.579999f }, { 1.129999f, -2.769999f, -0.579999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.239999f, -0.509999f }, - { { 1.830000f, 2.609999f, 2.720000f }, { 0.340000f, -0.270000f, 0.200000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.550000f, 0.970000f, -0.349999f }, { 0.550000f, -0.980000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -0.280000f }, - { { 2.410000f, 6.139999f, 1.470000f }, { 0.449999f, 0.140000f, -0.230000f }, { 0.430000f, -1.019999f, -0.219999f }, { -1.110000f, -2.049999f, -0.109999f }, { 0.939999f, 1.700000f, -0.439999f }, { 0.939999f, -1.720000f, -0.439999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.239999f, -0.239999f }, - { { 2.299999f, 5.719999f, 2.230000f }, { 0.490000f, 0.779999f, 0.059999f }, { 0.670000f, -1.740000f, 0.000000f }, { -1.049999f, -2.289999f, 0.219999f }, { 0.879999f, 1.799999f, -0.639999f }, { 0.920000f, -1.850000f, -0.639999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.319999f, -0.319999f }, - { { 10.850000f, 13.550000f, 4.440000f }, { 0.319999f, 0.280000f, -0.039999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.699999f, 2.460000f, 1.679999f }, { 0.000000f, -0.400000f, 0.469999f }, { 0.000000f, -0.850000f, 0.600000f }, { 0.000000f, 0.140000f, 0.540000f }, { 0.000000f, 0.709999f, -0.180000f }, { 0.000000f, -0.889999f, -0.180000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.709999f, 2.190000f, 1.629999f }, { 0.000000f, -0.340000f, 0.419999f }, { 0.000000f, -0.620000f, 0.379999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.680000f, -0.270000f }, { 0.000000f, -0.670000f, -0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.699999f, 2.420000f, 1.340000f }, { 0.000000f, -0.409999f, 0.150000f }, { 0.000000f, -0.839999f, 0.340000f }, { 0.000000f, 0.170000f, 0.469999f }, { 0.000000f, 0.920000f, -0.180000f }, { 0.000000f, -0.920000f, -0.180000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 1.580000f, 1.549999f, 1.149999f }, { 0.000000f, 0.000000f, -0.360000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.400000f, 0.219999f, -0.280000f }, { 0.100000f, -0.750000f, -0.059999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.870000f, 1.409999f, 1.019999f }, { 0.000000f, 0.000000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.300000f, 0.500000f, -0.250000f }, { 0.300000f, -0.349999f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.529999f, 6.170000f, 1.649999f }, { 0.500000f, 0.150000f, -0.140000f }, { 0.460000f, -0.769999f, -0.140000f }, { 0.000000f, -3.000000f, -0.129999f }, { 0.920000f, 1.789999f, -0.349999f }, { 0.920000f, -1.779999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.289999f, -0.310000f }, - { { 2.529999f, 6.360000f, 1.669999f }, { 0.460000f, 0.109999f, -0.140000f }, { 0.460000f, -0.870000f, -0.159999f }, { -1.070000f, -2.299999f, 0.119999f }, { 0.899999f, 1.799999f, -0.349999f }, { 0.899999f, -1.779999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.319999f, -0.319999f }, - { { 0.709999f, 2.230000f, 1.419999f }, { 0.000000f, -0.200000f, 0.400000f }, { 0.000000f, -0.529999f, 0.419999f }, { 0.000000f, 0.009999f, 0.409999f }, { 0.000000f, 0.819999f, -0.259999f }, { 0.000000f, -0.750000f, -0.289999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.420000f, 14.800000f, 3.150000f }, { 0.419999f, 0.949999f, -0.070000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.660000f, 5.480000f, 2.099999f }, { 0.529999f, -0.039999f, 0.090000f }, { 0.479999f, -0.959999f, 0.090000f }, { -1.259999f, -2.380000f, 0.239999f }, { 1.029999f, 1.649999f, -0.310000f }, { 1.029999f, -1.889999f, -0.310000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.289999f, -0.100000f }, - { { 1.419999f, 2.000000f, 1.710000f }, { 0.000000f, -0.349999f, 0.389999f }, { 0.000000f, -0.670000f, 0.389999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.409999f, 0.610000f, -0.129999f }, { 0.409999f, -0.610000f, -0.129999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.670000f, 9.340000f, 4.869999f }, { -0.200000f, -0.159999f, 1.070000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.900000f, 5.400000f, 2.220000f }, { 0.000000f, 0.579999f, 0.889999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.430000f, 6.030000f, 1.690000f }, { 0.490000f, -0.300000f, -0.140000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.949999f, 1.809999f, -0.349999f }, { 0.949999f, -1.809999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.469999f, -0.400000f }, - { { 2.450000f, 5.780000f, 1.480000f }, { 0.419999f, -0.129999f, -0.200000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.070000f, -1.600000f, 0.129999f }, { 0.920000f, 1.539999f, -0.349999f }, { 0.930000f, -1.549999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.300000f, -0.239999f }, - { { 11.029999f, 11.289999f, 3.289999f }, { 0.000000f, -0.449999f, -0.319999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.670000f, 5.929999f, 1.399999f }, { 0.550000f, -0.250000f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.200000f, -1.529999f, 0.239999f }, { 1.019999f, 1.700000f, -0.319999f }, { 1.019999f, -1.620000f, -0.319999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -0.079999f }, - { { 2.450000f, 5.570000f, 1.740000f }, { 0.439999f, 0.090000f, -0.059999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.090000f, -0.340000f, 0.230000f }, { 0.870000f, 1.490000f, -0.550000f }, { 0.870000f, -1.620000f, -0.550000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.379999f, -0.379999f }, - { { 2.250000f, 6.150000f, 1.990000f }, { 0.490000f, -0.070000f, 0.000000f }, { 0.469999f, -1.080000f, 0.039999f }, { -1.090000f, -1.970000f, 0.029999f }, { 0.910000f, 1.700000f, -0.379999f }, { 0.910000f, -1.590000f, -0.379999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.270000f, -0.270000f }, - { { 2.269999f, 5.260000f, 1.419999f }, { 0.409999f, -0.280000f, -0.150000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.000000f, -0.879999f, 0.100000f }, { 0.910000f, 1.330000f, -0.349999f }, { 0.910000f, -1.330000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.330000f }, - { { 0.709999f, 1.879999f, 1.320000f }, { -0.009999f, -0.340000f, 0.430000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.550000f, -0.239999f }, { 0.000000f, -0.589999f, -0.239999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.339999f, 5.699999f, 1.870000f }, { 0.469999f, 0.529999f, -0.129999f }, { 0.529999f, -1.570000f, -0.150000f }, { 1.070000f, -2.190000f, 0.000000f }, { 0.879999f, 1.779999f, -0.649999f }, { 0.879999f, -1.789999f, -0.649999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.509999f, -0.600000f }, - { { 2.049999f, 6.190000f, 2.109999f }, { 0.379999f, 1.649999f, -0.180000f }, { 0.300000f, 0.059999f, -0.209999f }, { 0.930000f, -2.509999f, -0.039999f }, { 0.790000f, 1.700000f, -0.670000f }, { 0.779999f, -2.059999f, -0.670000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.740000f, -0.720000f }, - { { 5.349999f, 26.200000f, 7.159999f }, { 0.000000f, -5.010000f, 1.740000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 1.970000f, 4.070000f, 1.440000f }, { 0.150000f, -0.449999f, 0.370000f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.889999f, 0.720000f, 0.019999f }, { 0.629999f, 1.320000f, -0.300000f }, { 0.629999f, -0.990000f, -0.300000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.250000f, -0.250000f }, - { { 4.340000f, 7.840000f, 4.449999f }, { 0.000000f, -0.389999f, 1.129999f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.699999f, -3.170000f, 0.579999f }, { 1.240000f, 1.679999f, -0.349999f }, { 1.240000f, -1.679999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.329999f, 15.039999f, 4.670000f }, { 0.460000f, 1.620000f, -0.090000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.329999f, 12.609999f, 4.650000f }, { 0.449999f, 0.730000f, -0.090000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.539999f, 5.699999f, 2.140000f }, { 0.500000f, -0.090000f, 0.059999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.159999f, -0.740000f, 0.000000f }, { 1.029999f, 1.720000f, -0.660000f }, { 1.029999f, -1.470000f, -0.660000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.379999f, -0.340000f }, - { { 2.920000f, 6.929999f, 2.140000f }, { 0.529999f, 0.460000f, 0.059999f }, { 0.529999f, -0.620000f, 0.059999f }, { 1.370000f, -1.250000f, 0.000000f }, { 1.029999f, 2.289999f, -0.660000f }, { 1.029999f, -1.929999f, -0.660000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.379999f, -0.340000f }, - { { 2.309999f, 6.329999f, 1.289999f }, { 0.430000f, -0.280000f, -0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.070000f, -2.180000f, 0.000000f }, { 0.829999f, 1.570000f, -0.419999f }, { 0.829999f, -1.570000f, -0.419999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.230000f, -0.239999f }, - { { 2.349999f, 6.179999f, 1.789999f }, { 0.460000f, 0.140000f, -0.100000f }, { 0.460000f, -0.910000f, -0.100000f }, { -0.980000f, -2.240000f, 0.119999f }, { 0.930000f, 1.710000f, -0.349999f }, { 0.920000f, -1.700000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.300000f, -0.289999f }, - { { 4.769999f, 17.829999f, 3.849999f }, { -0.670000f, 0.600000f, 0.899999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.250000f, 6.489999f, 1.500000f }, { 0.479999f, -0.289999f, -0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.019999f, -2.200000f, 0.119999f }, { 0.829999f, 1.450000f, -0.400000f }, { 0.829999f, -1.779999f, -0.400000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.289999f }, - { { 2.779999f, 5.449999f, 1.990000f }, { 0.490000f, 0.000000f, -0.079999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.210000f, -1.909999f, -0.100000f }, { 1.139999f, 1.679999f, -0.759999f }, { 1.139999f, -1.309999f, -0.759999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.430000f, -0.430000f }, - { { 2.279999f, 4.750000f, 1.789999f }, { 0.479999f, -0.250000f, -0.119999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.059999f, -1.860000f, 0.150000f }, { 0.899999f, 1.440000f, -0.319999f }, { 0.899999f, -1.389999f, -0.319999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.050000f, -0.059999f }, - { { 2.329999f, 15.039999f, 4.659999f }, { 0.460000f, 1.620000f, -0.109999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.900000f, 6.599999f, 4.280000f }, { 0.730000f, 1.379999f, 0.300000f }, { 0.600000f, -2.460000f, 0.039999f }, { -1.299999f, -0.009999f, 0.090000f }, { 1.090000f, 2.410000f, -0.579999f }, { 0.990000f, -1.740000f, -0.579999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.469999f, -0.560000f }, - { { 2.640000f, 7.199999f, 3.750000f }, { 0.449999f, 0.209999f, -0.009999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.110000f, -1.070000f, -0.349999f }, { 0.860000f, 1.700000f, -0.550000f }, { 0.860000f, -2.130000f, -0.550000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.330000f, -0.259999f }, - { { 2.289999f, 5.010000f, 1.850000f }, { 0.449999f, -0.239999f, -0.059999f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.980000f, -1.710000f, -0.070000f }, { 0.870000f, 1.590000f, -0.620000f }, { 0.870000f, -1.169999f, -0.620000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.349999f, -0.330000f }, - { { 0.870000f, 1.409999f, 1.019999f }, { 0.000000f, 0.000000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.300000f, 0.500000f, -0.250000f }, { 0.300000f, -0.349999f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.349999f, 5.969999f, 1.519999f }, { 0.419999f, -0.119999f, -0.280000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.080000f, -1.879999f, 0.140000f }, { 0.870000f, 1.620000f, -0.400000f }, { 0.870000f, -1.490000f, -0.400000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.100000f }, - { { 2.210000f, 6.139999f, 1.629999f }, { 0.409999f, -0.289999f, -0.289999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.100000f, -2.049999f, 0.029999f }, { 0.870000f, 1.450000f, -0.400000f }, { 0.870000f, -1.649999f, -0.400000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.250000f }, - { { 2.529999f, 6.039999f, 1.649999f }, { 0.460000f, 0.180000f, -0.140000f }, { 0.460000f, -0.769999f, -0.140000f }, { -1.159999f, -1.830000f, 0.109999f }, { 0.920000f, 1.789999f, -0.349999f }, { 0.920000f, -1.779999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.289999f, -0.310000f }, - { { 2.539999f, 5.699999f, 2.140000f }, { 0.500000f, -0.090000f, 0.059999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.159999f, -0.740000f, 0.000000f }, { 1.029999f, 1.720000f, -0.660000f }, { 1.029999f, -1.470000f, -0.660000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.379999f, -0.340000f }, - { { 2.250000f, 5.219999f, 1.169999f }, { 0.469999f, -0.340000f, -0.259999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.049999f, -1.110000f, -0.050000f }, { 0.889999f, 1.220000f, -0.340000f }, { 0.889999f, -1.659999f, -0.340000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.189999f, -0.180000f }, - { { 2.569999f, 6.590000f, 1.620000f }, { 0.540000f, 0.050000f, -0.250000f }, { 0.540000f, -1.149999f, -0.259999f }, { -1.169999f, -2.299999f, 0.109999f }, { 1.039999f, 1.799999f, -0.449999f }, { 1.039999f, -1.809999f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.409999f, -0.409999f }, - { { 2.960000f, 8.050000f, 3.339999f }, { 0.540000f, 1.419999f, -0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.379999f, -3.049999f, -0.670000f }, { 0.990000f, 2.289999f, -0.899999f }, { 1.220000f, -2.289999f, -0.899999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.879999f, -0.870000f }, - { { 0.709999f, 1.899999f, 1.320000f }, { 0.000000f, -0.479999f, 0.460000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.639999f, -0.239999f }, { 0.000000f, -0.589999f, -0.189999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.720000f, 1.740000f, 1.120000f }, { 0.000000f, -0.270000f, 0.540000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.600000f, -0.259999f }, { 0.000000f, -0.569999f, -0.259999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 21.219999f, 21.190000f, 5.059999f }, { 0.419999f, 2.009999f, -0.819999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 11.159999f, 6.159999f, 2.990000f }, { 0.000000f, -0.219999f, -0.100000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 8.699999f, 9.000000f, 2.230000f }, { 0.000000f, -0.910000f, -0.439999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.190000f, 10.069999f, 3.059999f }, { 0.449999f, 1.600000f, 0.189999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.429999f, 0.379999f, -0.649999f }, { 1.230000f, 3.529999f, -0.949999f }, { 1.230000f, -4.429999f, -0.949999f }, { 1.230000f, -3.269999f, -0.949999f }, -0.860000f, -50.000000f }, - { { 3.549999f, 9.949999f, 3.420000f }, { 0.560000f, 1.340000f, 0.090000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.450000f, 0.479999f, -1.309999f }, { 1.440000f, 3.490000f, -1.389999f }, { 1.440000f, -4.079999f, -1.389999f }, { 1.440000f, -2.640000f, -1.389999f }, -1.159999f, -50.000000f }, - { { 2.599999f, 6.239999f, 1.710000f }, { 0.469999f, 0.070000f, -0.150000f }, { 0.490000f, -0.990000f, -0.129999f }, { -1.100000f, -2.450000f, -0.029999f }, { 0.910000f, 1.669999f, -0.419999f }, { 0.910000f, -1.600000f, -0.419999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.170000f, -0.170000f }, - { { 2.529999f, 6.329999f, 1.649999f }, { 0.509999f, -0.019999f, -0.180000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.179999f, -1.950000f, 0.070000f }, { 0.920000f, 1.679999f, -0.409999f }, { 0.920000f, -1.480000f, -0.409999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.310000f, -0.219999f }, - { { 2.430000f, 6.000000f, 1.570000f }, { 0.509999f, 0.070000f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.210000f, -2.190000f, -0.070000f }, { 0.939999f, 1.809999f, -0.259999f }, { 0.980000f, -1.460000f, -0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.330000f, -0.230000f }, - { { 20.309999f, 19.290000f, 6.940000f }, { 0.349999f, 5.179999f, -0.119999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 8.750000f, 14.319999f, 2.160000f }, { 0.000000f, 2.839999f, 0.090000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.699999f, 2.460000f, 1.679999f }, { 0.000000f, -0.400000f, 0.469999f }, { 0.000000f, -0.850000f, 0.600000f }, { 0.000000f, 0.129999f, 0.610000f }, { 0.000000f, 0.759999f, -0.159999f }, { 0.000000f, -0.850000f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.699999f, 2.460000f, 1.679999f }, { 0.000000f, -0.400000f, 0.469999f }, { 0.000000f, -0.850000f, 0.629999f }, { 0.000000f, 0.140000f, 0.610000f }, { 0.000000f, 0.759999f, -0.159999f }, { 0.000000f, -0.879999f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.699999f, 2.470000f, 1.679999f }, { 0.000000f, -0.400000f, 0.469999f }, { 0.000000f, -0.680000f, 0.550000f }, { 0.000000f, 0.150000f, 0.550000f }, { 0.000000f, 0.759999f, -0.159999f }, { 0.000000f, -0.850000f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.589999f, 8.840000f, 3.640000f }, { 0.490000f, 1.450000f, -0.140000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.529999f, 0.479999f, -0.990000f }, { 1.279999f, 2.950000f, -1.240000f }, { 1.330000f, -2.980000f, -1.309999f }, { 1.330000f, -1.860000f, -1.309999f }, -1.000000f, -0.230000f }, - { { 3.049999f, 6.469999f, 3.289999f }, { 0.509999f, 0.259999f, 0.340000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.389999f, -0.509999f, -0.090000f }, { 1.029999f, 2.089999f, -0.379999f }, { 1.100000f, -2.099999f, -0.379999f }, { 0.000000f, 0.000000f, 0.000000f }, 0.050000f, -50.000000f }, - { { 2.200000f, 5.400000f, 1.259999f }, { 0.469999f, -0.079999f, -0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.990000f, -1.960000f, 0.059999f }, { 0.870000f, 1.490000f, -0.400000f }, { 0.879999f, -1.500000f, -0.400000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.379999f, -0.310000f }, - { { 2.430000f, 5.719999f, 1.740000f }, { 0.409999f, -0.019999f, -0.079999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.139999f, -1.690000f, 0.140000f }, { 0.910000f, 1.610000f, -0.349999f }, { 0.910000f, -1.340000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.079999f, -0.079999f }, - { { 2.549999f, 5.550000f, 2.140000f }, { 0.500000f, -0.140000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.090000f, -2.029999f, 0.119999f }, { 0.949999f, 1.740000f, -0.610000f }, { 0.949999f, -1.539999f, -0.610000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.490000f, -0.389999f }, - { { 2.380000f, 5.630000f, 1.860000f }, { 0.490000f, -0.079999f, -0.039999f }, { 0.490000f, -1.039999f, -0.039999f }, { -1.200000f, -2.220000f, 0.200000f }, { 0.949999f, 1.450000f, -0.250000f }, { 0.949999f, -1.659999f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.019999f, -0.029999f }, - { { 1.580000f, 4.230000f, 2.680000f }, { 0.000000f, -0.319999f, 0.389999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.490000f, 0.569999f, -0.379999f }, { 0.509999f, -0.709999f, -0.419999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 1.960000f, 3.700000f, 1.669999f }, { 0.000000f, -0.460000f, 0.070000f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.009999f, 0.819999f, 0.430000f }, { 0.829999f, 1.429999f, -0.620000f }, { 0.709999f, -1.070000f, -0.300000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 8.619999f, 11.390000f, 4.179999f }, { 1.009999f, 3.000000f, 0.589999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 2.880000f, 3.690000f, -1.710000f }, { 1.759999f, -1.669999f, -1.500000f }, { 1.820000f, 1.669999f, -1.149999f }, -50.000000f, -50.000000f }, - { { 2.380000f, 5.420000f, 1.490000f }, { 0.479999f, -0.239999f, -0.119999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.019999f, -1.960000f, 0.140000f }, { 0.889999f, 1.570000f, -0.349999f }, { 0.889999f, -1.570000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.239999f, -0.239999f }, - { { 2.180000f, 6.269999f, 1.159999f }, { 0.589999f, 0.029999f, -0.280000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.039999f, -0.819999f, -0.200000f }, { 0.930000f, 1.860000f, -0.270000f }, { 0.930000f, -1.529999f, -0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.400000f, -0.330000f }, - { { 2.670000f, 5.480000f, 1.580000f }, { 0.419999f, 0.009999f, -0.150000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.200000f, -0.560000f, 0.270000f }, { 0.970000f, 1.590000f, -0.330000f }, { 0.970000f, -1.620000f, -0.330000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.370000f, -50.000000f }, - { { 2.460000f, 6.420000f, 1.299999f }, { 0.519999f, -0.219999f, -0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.070000f, -1.690000f, 0.090000f }, { 0.899999f, 1.750000f, -0.349999f }, { 0.899999f, -1.730000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.340000f, -0.370000f }, - { { 3.329999f, 18.430000f, 5.199999f }, { 0.460000f, 5.130000f, 0.529999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.269999f, 16.590000f, 4.949999f }, { 0.709999f, 5.989999f, 0.370000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.500000f, 3.869999f, 2.559999f }, { 0.000000f, 0.349999f, 0.109999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.589999f, 6.070000f, 1.500000f }, { 0.519999f, -0.059999f, -0.259999f }, { 0.550000f, -1.350000f, -0.259999f }, { -1.169999f, -2.519999f, -0.019999f }, { 1.000000f, 1.799999f, -0.469999f }, { 1.000000f, -1.899999f, -0.469999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.209999f, -0.209999f }, - { { 2.269999f, 4.949999f, 1.240000f }, { 0.479999f, -0.119999f, -0.209999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.009999f, -1.990000f, 0.150000f }, { 0.899999f, 1.500000f, -0.250000f }, { 0.899999f, -1.500000f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.300000f, -0.239999f }, - { { 2.480000f, 6.400000f, 1.700000f }, { 0.509999f, -0.150000f, -0.119999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.120000f, -1.919999f, 0.310000f }, { 0.889999f, 1.620000f, -0.370000f }, { 0.889999f, -1.580000f, -0.370000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.129999f, 0.059999f }, - { { 2.380000f, 5.730000f, 1.860000f }, { 0.449999f, 0.090000f, -0.050000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.100000f, -0.949999f, 0.000000f }, { 0.930000f, 1.580000f, -0.449999f }, { 0.930000f, -1.580000f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.389999f, -0.330000f }, - { { 2.809999f, 12.859999f, 3.890000f }, { 0.600000f, 2.509999f, 0.289999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.299999f, 2.069999f, 0.319999f }, { 1.049999f, 2.450000f, -0.699999f }, { 1.049999f, -2.049999f, -0.699999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.620000f, -50.000000f }, - { { 2.190000f, 4.809999f, 1.690000f }, { 0.330000f, -0.340000f, -0.170000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, -2.220000f, -0.319999f }, { 0.850000f, 1.419999f, -0.449999f }, { 0.850000f, -1.419999f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.529999f, -0.529999f }, - { { 2.569999f, 5.860000f, 1.669999f }, { 0.569999f, -0.159999f, -0.140000f }, { 0.509999f, -1.159999f, -0.109999f }, { 1.090000f, -2.029999f, 0.150000f }, { 0.990000f, 1.629999f, -0.340000f }, { 0.970000f, -1.919999f, -0.340000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.070000f, -0.050000f }, - { { 2.490000f, 5.840000f, 1.769999f }, { 0.519999f, 0.000000f, -0.059999f }, { 0.519999f, -1.000000f, -0.059999f }, { -1.169999f, -2.009999f, 0.119999f }, { 0.920000f, 1.610000f, -0.349999f }, { 0.920000f, -1.480000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.079999f, -0.070000f }, - { { 4.179999f, 24.420000f, 4.909999f }, { 0.649999f, 4.570000f, -0.810000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.200000f, 5.389999f, -2.430000f }, { 1.669999f, -1.500000f, -2.430000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.400000f, 5.530000f, 1.429999f }, { 0.469999f, 0.250000f, -0.150000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.080000f, -1.179999f, 0.219999f }, { 0.970000f, 1.740000f, -0.360000f }, { 0.970000f, -1.460000f, -0.360000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.129999f, -0.119999f }, - { { 2.539999f, 5.889999f, 1.539999f }, { 0.519999f, 0.050000f, -0.189999f }, { 0.519999f, -0.920000f, -0.230000f }, { -1.070000f, -2.490000f, 0.039999f }, { 0.980000f, 1.679999f, -0.419999f }, { 0.980000f, -1.870000f, -0.419999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.289999f }, - { { 2.660000f, 6.719999f, 1.769999f }, { 0.490000f, 0.109999f, -0.129999f }, { 0.490000f, -1.059999f, -0.109999f }, { -1.149999f, -2.670000f, 0.090000f }, { 0.939999f, 1.830000f, -0.419999f }, { 0.939999f, -1.769999f, -0.430000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.150000f, -0.140000f }, - { { 2.650000f, 6.719999f, 3.559999f }, { 0.620000f, 0.639999f, 0.330000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.289999f, -0.959999f, 0.490000f }, { 1.039999f, 2.259999f, -0.180000f }, { 1.039999f, -1.429999f, -0.180000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.029999f, -50.000000f }, - { { 28.739999f, 23.489999f, 7.389999f }, { 0.430000f, 9.529999f, -0.100000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.680000f, 6.170000f, 2.089999f }, { 0.540000f, 0.100000f, -0.029999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.210000f, -2.390000f, 0.119999f }, { 1.100000f, 1.679999f, -0.569999f }, { 1.100000f, -1.700000f, -0.569999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.340000f, -0.360000f }, - { { 2.000000f, 5.130000f, 1.419999f }, { 0.439999f, -0.170000f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.790000f, -1.500000f, 0.180000f }, { 0.759999f, 1.529999f, -0.330000f }, { 0.720000f, -1.539999f, -0.330000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.660000f, 6.369999f, 3.289999f }, { 0.540000f, 0.100000f, 0.639999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.389999f, 1.710000f, -0.449999f }, { 1.389999f, -1.710000f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, 0.270000f, 0.270000f }, - { { 3.660000f, 6.260000f, 3.289999f }, { 0.540000f, 0.000000f, 0.629999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.190000f, -2.569999f, 0.850000f }, { 1.389999f, 1.669999f, -0.449999f }, { 1.389999f, -1.659999f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, 0.270000f, 0.250000f }, - { { 2.230000f, 5.250000f, 1.750000f }, { 0.540000f, -0.239999f, -0.019999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.090000f, -1.940000f, 0.270000f }, { 0.889999f, 1.350000f, -0.250000f }, { 0.889999f, -1.519999f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, 0.050000f, 0.039999f }, - { { 2.279999f, 5.480000f, 1.399999f }, { 0.479999f, -0.189999f, -0.200000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.080000f, -1.710000f, 0.270000f }, { 0.939999f, 1.460000f, -0.250000f }, { 0.930000f, -1.460000f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.100000f, 0.009999f }, - { { 2.319999f, 5.400000f, 1.620000f }, { 0.479999f, 0.109999f, -0.079999f }, { 0.509999f, -0.750000f, -0.090000f }, { 1.139999f, -1.899999f, 0.129999f }, { 0.949999f, 1.549999f, -0.250000f }, { 0.949999f, -1.450000f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, 0.019999f, 0.029999f }, - { { 2.500000f, 5.800000f, 1.789999f }, { 0.519999f, 0.090000f, -0.129999f }, { 0.519999f, -0.819999f, -0.129999f }, { 1.110000f, -2.299999f, 0.109999f }, { 0.930000f, 1.710000f, -0.409999f }, { 0.910000f, -1.409999f, -0.409999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.180000f, -0.189999f }, - { { 2.259999f, 5.309999f, 1.509999f }, { 0.509999f, -0.050000f, -0.140000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.039999f, -0.699999f, 0.070000f }, { 0.899999f, 1.549999f, -0.310000f }, { 0.910000f, -1.299999f, -0.310000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.050000f, -0.019999f }, - { { 3.390000f, 18.620000f, 4.710000f }, { 0.419999f, 2.640000f, -0.340000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.870000f, 1.409999f, 1.019999f }, { 0.059999f, -0.070000f, 0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.259999f, 0.400000f, 0.029999f }, { 0.259999f, -0.400000f, 0.029999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.029999f, 4.820000f, 1.500000f }, { 0.479999f, -0.059999f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.910000f, -0.870000f, 0.029999f }, { 0.829999f, 1.389999f, -0.270000f }, { 0.829999f, -1.389999f, -0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.070000f, -0.059999f }, - { { 2.509999f, 6.460000f, 1.659999f }, { 0.540000f, 0.090000f, -0.170000f }, { 0.540000f, -1.059999f, -0.180000f }, { 1.080000f, -2.440000f, 0.019999f }, { 0.980000f, 1.710000f, -0.349999f }, { 0.980000f, -1.710000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.250000f, -0.270000f }, - { { 2.710000f, 6.630000f, 1.580000f }, { 0.509999f, 0.250000f, -0.270000f }, { 0.509999f, -1.000000f, -0.270000f }, { 0.000000f, -2.859999f, -0.460000f }, { 1.000000f, 2.069999f, -0.479999f }, { 1.000000f, -1.480000f, -0.479999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.430000f, -0.449999f }, - { { 2.710000f, 4.610000f, 1.419999f }, { 0.000000f, -0.029999f, -0.189999f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.500000f, -0.660000f, 0.379999f }, { 0.850000f, 1.750000f, -0.500000f }, { 0.870000f, -0.910000f, -0.430000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.259999f, 18.430000f, 5.030000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.470000f, 21.069999f, 5.190000f }, { 0.000000f, 1.960000f, -1.129999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 1.570000f, 2.329999f, 1.580000f }, { 0.000000f, -0.180000f, -0.100000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.189999f, 0.019999f }, { 0.519999f, 0.569999f, -0.159999f }, { 0.550000f, -0.629999f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.170000f, -50.000000f }, - { { 1.659999f, 2.349999f, 2.019999f }, { 0.000000f, -0.620000f, 0.310000f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.379999f, -0.970000f, 0.159999f }, { 0.479999f, 0.689999f, -0.349999f }, { 0.479999f, -0.689999f, -0.289999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.930000f, 7.380000f, 3.160000f }, { 0.560000f, 2.029999f, 0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.179999f, 0.479999f, -0.479999f }, { 1.049999f, 1.769999f, -0.930000f }, { 0.959999f, -1.759999f, -0.930000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.629999f, -0.730000f }, - { { 1.620000f, 3.849999f, 2.500000f }, { 0.230000f, 0.550000f, 0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.750000f, -0.970000f, 0.280000f }, { 0.569999f, 0.800000f, -0.439999f }, { 0.569999f, -0.800000f, -0.439999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.300000f, -0.300000f }, - { { 2.490000f, 5.829999f, 1.929999f }, { 0.500000f, 0.059999f, 0.009999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, -2.779999f, -0.050000f }, { 0.920000f, 1.710000f, -0.250000f }, { 0.920000f, -1.710000f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.209999f }, - { { 2.420000f, 6.360000f, 1.850000f }, { 0.469999f, -0.159999f, -0.090000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, -3.160000f, -0.250000f }, { 0.930000f, 1.710000f, -0.250000f }, { 0.920000f, -1.710000f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.310000f, -0.270000f }, - { { 62.490001f, 61.439998f, 34.950000f }, { 1.289999f, 21.059999f, 4.119999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.150000f, 11.789999f, 2.779999f }, { 0.469999f, 3.430000f, 0.059999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.240000f, 2.910000f, -0.019999f }, { 1.250000f, 3.000000f, -1.000000f }, { 1.250000f, -3.980000f, -1.000000f }, { 1.250000f, -2.750000f, -1.000000f }, -0.860000f, -50.000000f }, - { { 2.470000f, 6.210000f, 2.559999f }, { 0.460000f, -0.159999f, 0.219999f }, { 0.430000f, -1.230000f, 0.239999f }, { 1.220000f, -2.299999f, 0.170000f }, { 0.959999f, 1.580000f, -0.439999f }, { 0.959999f, -1.580000f, -0.439999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.180000f, -0.180000f }, - { { 2.660000f, 5.769999f, 2.240000f }, { 0.540000f, -0.009999f, 0.059999f }, { 0.430000f, -0.910000f, 0.050000f }, { 1.190000f, -1.820000f, 0.239999f }, { 1.080000f, 1.779999f, -0.300000f }, { 1.080000f, -1.779999f, -0.300000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.349999f, -0.259999f }, - { { 0.699999f, 2.460000f, 1.679999f }, { 0.000000f, -0.400000f, 0.469999f }, { 0.000000f, -0.850000f, 0.600000f }, { 0.000000f, 0.129999f, 0.540000f }, { 0.000000f, 0.759999f, -0.159999f }, { 0.000000f, -0.819999f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.440000f, 7.219999f, 3.190000f }, { 0.419999f, 0.560000f, -0.039999f }, { 0.550000f, -2.490000f, -0.079999f }, { -1.059999f, 0.140000f, -0.280000f }, { 0.899999f, 1.860000f, -0.620000f }, { 0.899999f, -2.069999f, -0.620000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.449999f, -0.460000f }, - { { 1.669999f, 3.660000f, 3.210000f }, { 0.000000f, -1.009999f, 0.610000f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.759999f, 0.409999f, -0.059999f }, { 0.629999f, 1.129999f, -0.219999f }, { 0.620000f, -1.120000f, -0.140000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.029999f, -50.000000f }, - { { 3.549999f, 15.909999f, 3.400000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.129999f, -2.640000f, -1.450000f }, { 1.129999f, -3.779999f, -1.450000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.440000f, 6.530000f, 2.059999f }, { 0.469999f, 0.000000f, 0.070000f }, { 0.430000f, -1.049999f, 0.050000f }, { 1.139999f, -2.299999f, 0.200000f }, { 1.009999f, 1.799999f, -0.230000f }, { 1.009999f, -1.799999f, -0.230000f }, { 0.000000f, 0.000000f, 0.000000f }, 0.019999f, 0.070000f }, - { { 0.699999f, 2.799999f, 1.960000f }, { 0.000000f, -0.419999f, 0.379999f }, { 0.000000f, -0.769999f, 0.490000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.850000f, -0.159999f }, { 0.000000f, -0.839999f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.609999f, 5.760000f, 1.450000f }, { 0.519999f, -0.239999f, -0.230000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.230000f, -1.220000f, 0.100000f }, { 0.980000f, 1.480000f, -0.360000f }, { 0.980000f, -1.620000f, -0.360000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.150000f, -0.059999f }, - { { 3.079999f, 8.619999f, 7.530000f }, { 0.699999f, 2.289999f, 0.469999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.460000f, -2.160000f, 0.219999f }, { 1.289999f, 2.130000f, -0.469999f }, { 1.289999f, -2.119999f, -0.469999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.560000f, -0.560000f }, - { { 2.259999f, 5.090000f, 2.119999f }, { 0.419999f, -0.019999f, 0.050000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.980000f, -0.889999f, 0.119999f }, { 0.959999f, 1.639999f, -0.230000f }, { 0.959999f, -1.629999f, -0.230000f }, { 0.000000f, 0.000000f, 0.000000f }, 0.009999f, 0.009999f }, - { { 3.440000f, 18.399999f, 5.030000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.180000f, 13.630000f, 4.659999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.009999f, -1.440000f, -0.949999f }, { 1.009999f, -2.730000f, -0.949999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 44.450000f, 57.569999f, 18.430000f }, { 0.560000f, 12.510000f, -0.419999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 12.590000f, 13.550000f, 3.569999f }, { 0.319999f, 0.029999f, -0.070000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.500000f, 0.920000f, 0.300000f }, { 0.059999f, -0.070000f, 0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.219999f, 0.150000f, 0.070000f }, { 0.219999f, -0.150000f, 0.070000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.849999f, 13.470000f, 2.210000f }, { 0.479999f, 0.899999f, -0.009999f }, { -0.019999f, -4.289999f, 0.469999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.410000f, 5.909999f, 1.769999f }, { 0.519999f, 0.059999f, -0.140000f }, { 0.519999f, -1.029999f, -0.109999f }, { -1.110000f, -2.160000f, 0.100000f }, { 0.920000f, 1.639999f, -0.349999f }, { 0.920000f, -1.639999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.319999f }, - { { 2.410000f, 5.909999f, 1.769999f }, { 0.519999f, 0.059999f, -0.140000f }, { 0.519999f, -1.029999f, -0.109999f }, { -1.100000f, -2.150000f, 0.100000f }, { 0.920000f, 1.639999f, -0.349999f }, { 0.920000f, -1.639999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.319999f }, - { { 2.410000f, 5.789999f, 1.769999f }, { 0.519999f, 0.059999f, -0.059999f }, { 0.519999f, -1.029999f, -0.109999f }, { -1.080000f, -1.960000f, 0.159999f }, { 0.959999f, 1.639999f, -0.349999f }, { 0.959999f, -1.639999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.219999f, -0.200000f }, - { { 2.920000f, 6.159999f, 2.140000f }, { 0.500000f, -0.090000f, 0.059999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.159999f, -0.740000f, 0.000000f }, { 1.029999f, 1.720000f, -0.660000f }, { 1.029999f, -1.470000f, -0.660000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.379999f, -0.340000f }, - { { 2.400000f, 6.059999f, 1.559999f }, { 0.519999f, 0.059999f, -0.100000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.090000f, -2.029999f, 0.079999f }, { 0.959999f, 1.830000f, -0.340000f }, { 0.959999f, -1.409999f, -0.340000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.310000f, -0.310000f }, - { { 3.079999f, 6.960000f, 3.829999f }, { 0.529999f, -0.300000f, 0.419999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.330000f, -1.690000f, 0.920000f }, { 0.930000f, 1.679999f, -0.070000f }, { 0.920000f, -1.669999f, -0.070000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.319999f, 5.539999f, 1.289999f }, { 0.479999f, -0.119999f, -0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.090000f, -1.990000f, 0.109999f }, { 0.930000f, 1.539999f, -0.400000f }, { 0.930000f, -1.529999f, -0.400000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.419999f, -0.360000f }, - { { 2.640000f, 6.070000f, 1.429999f }, { 0.519999f, -0.419999f, -0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.179999f, -2.190000f, -0.079999f }, { 1.019999f, 1.600000f, -0.409999f }, { 1.019999f, -1.580000f, -0.409999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.310000f, -0.259999f }, - { { 2.529999f, 6.170000f, 1.649999f }, { 0.500000f, 0.150000f, -0.140000f }, { 0.460000f, -0.769999f, -0.140000f }, { 0.000000f, -3.000000f, -0.129999f }, { 0.920000f, 1.789999f, -0.349999f }, { 0.920000f, -1.779999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.289999f, -0.310000f }, - { { 2.380000f, 5.730000f, 1.860000f }, { 0.449999f, 0.090000f, -0.050000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.100000f, -0.949999f, 0.000000f }, { 0.930000f, 1.580000f, -0.449999f }, { 0.930000f, -1.580000f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.389999f, -0.330000f }, - { { 2.930000f, 3.380000f, 1.970000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.639999f, 1.169999f, -0.689999f }, { 0.639999f, -1.169999f, -0.689999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.019999f, 3.259999f, 1.600000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.639999f, 1.190000f, -0.699999f }, { 0.639999f, -1.000000f, -0.699999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 1.450000f, 4.650000f, 6.360000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.740000f, 1.240000f, -1.169999f }, { 0.740000f, -1.269999f, -1.169999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.900000f, 6.599999f, 4.219999f }, { 0.730000f, 1.379999f, 0.300000f }, { 0.600000f, -2.460000f, 0.039999f }, { -1.299999f, 0.000000f, 0.100000f }, { 1.090000f, 2.410000f, -0.579999f }, { 0.990000f, -1.740000f, -0.579999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.469999f, -0.560000f }, - { { 2.480000f, 1.429999f, 1.629999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.139999f, -0.409999f, -0.140000f }, { 1.139999f, -0.720000f, -0.140000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.130000f, 3.160000f, 1.830000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.930000f, 0.340000f, -0.250000f }, { 0.930000f, -0.379999f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f } } }; - -static bool getVehicleModelInfo(int model, VehicleModelInfoType type, Vector3& out) -{ - if (!Impl::isValidVehicleModel(model)) - { - return false; - } - - model -= 400; - switch (type) - { - case VehicleModelInfo_Size: - { - out = allModelInfo[model].Size; - break; - } - case VehicleModelInfo_FrontSeat: - { - out = allModelInfo[model].FrontSeat; - break; - } - case VehicleModelInfo_RearSeat: - { - out = allModelInfo[model].RearSeat; - break; - } - case VehicleModelInfo_PetrolCap: - { - out = allModelInfo[model].PetrolCap; - break; - } - case VehicleModelInfo_WheelsFront: - { - out = allModelInfo[model].FrontWheel; - break; - } - case VehicleModelInfo_WheelsRear: - { - out = allModelInfo[model].RearWheel; - break; - } - case VehicleModelInfo_WheelsMid: - { - out = allModelInfo[model].MidWheel; - break; - } - case VehicleModelInfo_FrontBumperZ: - { - out.x = out.y = out.z = allModelInfo[model].FrontBumperZ; - break; - } - case VehicleModelInfo_RearBumperZ: - { - out.x = out.y = out.z = allModelInfo[model].RearBumperZ; - break; - } - default: - { - return false; - } - } - return true; -} diff --git a/SDK/include/Server/Components/Vehicles/vehicle_colours.hpp b/SDK/include/Server/Components/Vehicles/vehicle_colours.hpp deleted file mode 100644 index d8f802cf6..000000000 --- a/SDK/include/Server/Components/Vehicles/vehicle_colours.hpp +++ /dev/null @@ -1,743 +0,0 @@ -#include - -namespace Impl -{ - -inline void getRandomVehicleColour(int modelid, int& colour1, int& colour2, int& colour3, int& colour4) -{ - static const uint16_t vehicleIndexes[212 + 1] = { - 0, // 400 - landstal - 8, // 401 - bravura - 16, // 402 - buffalo - 24, // 403 - linerun - 32, // 404 - peren - 40, // 405 - sentinel - 48, // 406 - dumper - 49, // 407 - firetruk - 50, // 408 - trash - 51, // 409 - stretch - 52, // 410 - manana - 60, // 411 - infernus - 68, // 412 - voodoo - 76, // 413 - pony - 84, // 414 - mule - 92, // 415 - cheetah - 100, // 416 - ambulan - 101, // 417 - leviathn - 101, // 418 - moonbeam - 109, // 419 - esperant - 117, // 420 - taxi - 118, // 421 - washing - 126, // 422 - bobcat - 133, // 423 - mrwhoop - 139, // 424 - bfinject - 147, // 425 - hunter - 148, // 426 - premier - 156, // 427 - enforcer - 157, // 428 - securica - 158, // 429 - banshee - 166, // 430 - predator - 167, // 431 - bus - 175, // 432 - rhino - 176, // 433 - barracks - 177, // 434 - hotknife - 184, // 435 - artict1 - 185, // 436 - previon - 192, // 437 - coach - 200, // 438 - cabbie - 201, // 439 - stallion - 209, // 440 - rumpo - 217, // 441 - rcbandit - 225, // 442 - romero - 233, // 443 - packer - 241, // 444 - monster - 247, // 445 - admiral - 255, // 446 - squalo - 263, // 447 - seaspar - 264, // 448 - pizzaboy - 265, // 449 - tram - 266, // 450 - artict2 - 267, // 451 - turismo - 275, // 452 - speeder - 283, // 453 - reefer - 284, // 454 - tropic - 285, // 455 - flatbed - 293, // 456 - yankee - 301, // 457 - caddy - 309, // 458 - solair - 317, // 459 - topfun - 325, // 460 - skimmer - 333, // 461 - pcj600 - 341, // 462 - faggio - 349, // 463 - freeway - 357, // 464 - rcbaron - 358, // 465 - rcraider - 359, // 466 - glendale - 367, // 467 - oceanic - 375, // 468 - sanchez - 379, // 469 - sparrow - 380, // 470 - patriot - 381, // 471 - quad - 389, // 472 - coastg - 391, // 473 - dinghy - 393, // 474 - hermes - 401, // 475 - sabre - 409, // 476 - rustler - 417, // 477 - zr350 - 425, // 478 - walton - 433, // 479 - regina - 441, // 480 - comet - 448, // 481 - bmx - 456, // 482 - burrito - 464, // 483 - camper - 472, // 484 - marquis - 476, // 485 - baggage - 483, // 486 - dozer - 484, // 487 - maverick - 492, // 488 - vcnmav - 494, // 489 - rancher - 500, // 490 - fbiranch - 501, // 491 - virgo - 507, // 492 - greenwoo - 515, // 493 - jetmax - 516, // 494 - hotring - 524, // 495 - sandking - 532, // 496 - blistac - 540, // 497 - polmav - 541, // 498 - boxville - 549, // 499 - benson - 557, // 500 - mesa - 565, // 501 - rcgoblin - 566, // 502 - hotrina - 574, // 503 - hotrinb - 582, // 504 - bloodra - 590, // 505 - rnchlure - 596, // 506 - supergt - 601, // 507 - elegant - 609, // 508 - journey - 610, // 509 - bike - 618, // 510 - mtbike - 626, // 511 - beagle - 634, // 512 - cropdust - 642, // 513 - stunt - 650, // 514 - petro - 658, // 515 - rdtrain - 666, // 516 - nebula - 674, // 517 - majestic - 682, // 518 - buccanee - 690, // 519 - shamal - 691, // 520 - hydra - 691, // 521 - fcr900 - 699, // 522 - nrg500 - 707, // 523 - copbike - 707, // 524 - cement - 715, // 525 - towtruck - 722, // 526 - fortune - 730, // 527 - cadrona - 738, // 528 - fbitruck - 738, // 529 - willard - 746, // 530 - forklift - 754, // 531 - tractor - 760, // 532 - combine - 760, // 533 - feltzer - 768, // 534 - remingtn - 776, // 535 - slamvan - 784, // 536 - blade - 792, // 537 - freight - 793, // 538 - streak - 794, // 539 - vortex - 801, // 540 - vincent - 809, // 541 - bullet - 817, // 542 - clover - 825, // 543 - sadler - 833, // 544 - firela - 834, // 545 - hustler - 842, // 546 - intruder - 850, // 547 - primo - 858, // 548 - cargobob - 859, // 549 - tampa - 867, // 550 - sunrise - 875, // 551 - merit - 883, // 552 - utility - 886, // 553 - nevada - 894, // 554 - yosemite - 902, // 555 - windsor - 910, // 556 - monstera - 911, // 557 - monsterb - 912, // 558 - uranus - 920, // 559 - jester - 928, // 560 - sultan - 936, // 561 - stratum - 944, // 562 - elegy - 952, // 563 - raindanc - 953, // 564 - rctiger - 953, // 565 - flash - 961, // 566 - tahoma - 969, // 567 - savanna - 977, // 568 - bandito - 985, // 569 - freiflat - 985, // 570 - streakc - 986, // 571 - kart - 992, // 572 - mower - 1000, // 573 - duneride - 1008, // 574 - sweeper - 1009, // 575 - broadway - 1017, // 576 - tornado - 1025, // 577 - at400 - 1031, // 578 - dft30 - 1032, // 579 - huntley - 1040, // 580 - stafford - 1049, // 581 - bf400 - 1057, // 582 - newsvan - 1065, // 583 - tug - 1066, // 584 - petrotr - 1067, // 585 - emperor - 1075, // 586 - wayfarer - 1083, // 587 - euros - 1091, // 588 - hotdog - 1092, // 589 - club - 1100, // 590 - freibox - 1100, // 591 - artict3 - 1101, // 592 - androm - 1102, // 593 - dodo - 1110, // 594 - rccam - 1110, // 595 - launch - 1111, // 596 - copcarla - 1112, // 597 - copcarsf - 1113, // 598 - copcarvg - 1114, // 599 - copcarru - 1115, // 600 - picador - 1123, // 601 - swatvan - 1124, // 602 - alpha - 1132, // 603 - phoenix - 1140, // 604 - glenshit - 1148, // 605 - sadlshit - 1156, // 606 - bagboxa - 1156, // 607 - bagboxb - 1156, // 608 - tugstair - 1157, // 609 - boxburg - 1158, // 610 - farmtr1 - 1158, // 611 - utiltr1 - 1158 - }; - - static const uint8_t vehiclePrimaryColours[1158] = { - 4, 123, 113, 101, 75, 62, 40, 36, // 400 - landstal - 41, 47, 52, 66, 74, 87, 91, 113, // 401 - bravura - 10, 13, 22, 30, 39, 90, 98, 110, // 402 - buffalo - 36, 37, 30, 28, 25, 40, 101, 113, // 403 - linerun - 113, 119, 123, 109, 101, 95, 83, 66, // 404 - peren - 11, 24, 36, 40, 75, 91, 123, 4, // 405 - sentinel - 1, // 406 - dumper - 3, // 407 - firetruk - 26, // 408 - trash - 1, // 409 - stretch - 4, 9, 10, 25, 36, 40, 45, 84, // 410 - manana - 12, 64, 123, 116, 112, 106, 80, 75, // 411 - infernus - 9, 10, 11, 25, 27, 29, 30, 37, // 412 - voodoo - 87, 88, 91, 105, 109, 119, 4, 25, // 413 - pony - 25, 28, 43, 67, 72, 9, 95, 24, // 414 - mule - 20, 25, 36, 40, 62, 75, 92, 0, // 415 - cheetah - 1, // 416 - ambulan - // 417 - leviathn - 119, 117, 114, 108, 95, 81, 61, 41, // 418 - moonbeam - 45, 47, 33, 13, 54, 69, 59, 87, // 419 - esperant - 6, // 420 - taxi - 4, 13, 25, 30, 36, 40, 75, 95, // 421 - washing - 96, 97, 101, 111, 113, 83, 67, // 422 - bobcat - 1, 1, 1, 1, 1, 1, // 423 - mrwhoop - 1, 2, 3, 3, 6, 15, 24, 35, // 424 - bfinject - 43, // 425 - hunter - 37, 42, 53, 62, 7, 10, 11, 15, // 426 - premier - 0, // 427 - enforcer - 4, // 428 - securica - 12, 13, 14, 1, 2, 1, 3, 10, // 429 - banshee - 46, // 430 - predator - 71, 75, 92, 47, 55, 59, 71, 82, // 431 - bus - 43, // 432 - rhino - 43, // 433 - barracks - 1, 12, 2, 6, 4, 46, 53, // 434 - hotknife - 1, // 435 - artict1 - 83, 87, 92, 95, 109, 119, 11, // 436 - previon - 54, 79, 87, 95, 98, 105, 123, 125, // 437 - coach - 6, // 438 - cabbie - 57, 8, 43, 54, 67, 37, 65, 25, // 439 - stallion - 34, 32, 20, 110, 66, 84, 118, 121, // 440 - rumpo - 2, 79, 82, 67, 126, 70, 110, 67, // 441 - rcbandit - 0, 11, 25, 36, 40, 75, 0, 0, // 442 - romero - 4, 20, 24, 25, 36, 40, 54, 84, // 443 - packer - 32, 32, 32, 32, 32, 32, // 444 - monster - 34, 35, 37, 39, 41, 43, 45, 47, // 445 - admiral - 0, 1, 3, 1, 1, 1, 1, 1, // 446 - squalo - 75, // 447 - seaspar - 3, // 448 - pizzaboy - 1, // 449 - tram - 1, // 450 - artict2 - 123, 125, 36, 16, 18, 46, 61, 75, // 451 - turismo - 1, 1, 1, 1, 1, 1, 1, 1, // 452 - speeder - 56, // 453 - reefer - 26, // 454 - tropic - 84, 84, 84, 32, 43, 1, 77, 32, // 455 - flatbed - 84, 91, 102, 105, 110, 121, 12, 23, // 456 - yankee - 58, 2, 63, 18, 32, 45, 13, 34, // 457 - caddy - 91, 101, 109, 113, 4, 25, 30, 36, // 458 - solair - 26, 28, 44, 51, 57, 72, 106, 112, // 459 - topfun - 1, 1, 1, 1, 17, 46, 46, 57, // 460 - skimmer - 36, 37, 43, 53, 61, 75, 79, 88, // 461 - pcj600 - 12, 13, 14, 1, 2, 1, 3, 10, // 462 - faggio - 79, 84, 7, 11, 19, 22, 36, 53, // 463 - freeway - 14, // 464 - rcbaron - 14, // 465 - rcraider - 67, 68, 78, 2, 16, 18, 25, 45, // 466 - glendale - 51, 58, 60, 68, 2, 13, 22, 36, // 467 - oceanic - 6, 46, 53, 3, // 468 - sanchez - 1, // 469 - sparrow - 43, // 470 - patriot - 120, 103, 120, 74, 120, 74, 120, 66, // 471 - quad - 56, 56, // 472 - coastg - 56, 56, // 473 - dinghy - 97, 81, 105, 110, 91, 74, 84, 83, // 474 - hermes - 2, 9, 17, 21, 33, 37, 41, 56, // 475 - sabre - 6, 7, 1, 89, 119, 103, 77, 71, // 476 - rustler - 92, 94, 101, 121, 0, 22, 36, 75, // 477 - zr350 - 72, 66, 59, 45, 40, 39, 35, 20, // 478 - walton - 27, 59, 60, 55, 54, 49, 45, 40, // 479 - regina - 73, 12, 2, 6, 4, 46, 53, // 480 - comet - 1, 3, 6, 46, 65, 14, 12, 26, // 481 - bmx - 41, 48, 52, 64, 71, 85, 10, 62, // 482 - burrito - 1, 1, 1, 1, 0, 3, 16, 17, // 483 - camper - 12, 50, 40, 66, // 484 - marquis - 1, 1, 1, 1, 1, 1, 1, // 485 - baggage - 1, // 486 - dozer - 26, 29, 26, 54, 26, 3, 12, 74, // 487 - maverick - 2, 2, // 488 - vcnmav - 13, 14, 120, 112, 84, 76, // 489 - rancher - 0, // 490 - fbiranch - 40, 71, 52, 64, 30, 60, // 491 - virgo - 30, 77, 81, 24, 28, 49, 52, 71, // 492 - greenwoo - 36, // 493 - jetmax - 36, 36, 42, 42, 54, 75, 92, 98, // 494 - hotring - 123, 119, 118, 116, 114, 101, 88, 5, // 495 - sandking - 74, 66, 53, 37, 22, 20, 9, 0, // 496 - blistac - 0, // 497 - polmav - 11, 13, 20, 24, 27, 36, 37, 43, // 498 - boxville - 109, 109, 112, 10, 30, 32, 84, 84, // 499 - benson - 75, 40, 40, 28, 25, 21, 13, 4, // 500 - mesa - 14, // 501 - rcgoblin - 7, 36, 51, 53, 58, 75, 75, 79, // 502 - hotrina - 83, 87, 87, 98, 101, 103, 117, 123, // 503 - hotrinb - 51, 57, 45, 34, 65, 14, 12, 26, // 504 - bloodra - 13, 14, 120, 112, 84, 76, // 505 - rnchlure - 3, 6, 7, 52, 76, // 506 - supergt - 37, 42, 53, 62, 7, 10, 11, 15, // 507 - elegant - 1, // 508 - journey - 7, 74, 61, 16, 25, 30, 36, 53, // 509 - bike - 43, 46, 39, 28, 16, 6, 5, 2, // 510 - mtbike - 3, 4, 7, 8, 12, 27, 34, 37, // 511 - beagle - 17, 15, 32, 45, 52, 57, 61, 96, // 512 - cropdust - 38, 21, 21, 30, 54, 55, 48, 51, // 513 - stunt - 10, 25, 28, 36, 40, 54, 75, 113, // 514 - petro - 13, 24, 63, 42, 54, 39, 11, 62, // 515 - rdtrain - 116, 119, 122, 4, 9, 24, 27, 36, // 516 - nebula - 37, 36, 40, 43, 47, 51, 54, 55, // 517 - majestic - 2, 9, 17, 21, 33, 37, 41, 56, // 518 - buccanee - 1, // 519 - shamal - // 520 - hydra - 74, 75, 87, 92, 115, 25, 36, 118, // 521 - fcr900 - 3, 3, 6, 7, 8, 36, 39, 51, // 522 - nrg500 - // 523 - copbike - 60, 61, 65, 61, 81, 62, 83, 83, // 524 - cement - 1, 17, 18, 22, 36, 44, 52, // 525 - towtruck - 2, 9, 17, 21, 33, 37, 41, 56, // 526 - fortune - 52, 53, 66, 75, 76, 81, 95, 109, // 527 - cadrona - // 528 - fbitruck - 37, 42, 53, 62, 7, 10, 11, 15, // 529 - willard - 110, 111, 112, 114, 119, 122, 4, 13, // 530 - forklift - 2, 36, 51, 91, 11, 40, // 531 - tractor - // 532 - combine - 73, 74, 75, 77, 79, 83, 84, 91, // 533 - feltzer - 37, 42, 53, 62, 7, 10, 11, 15, // 534 - remingtn - 3, 28, 31, 55, 66, 97, 123, 118, // 535 - slamvan - 9, 12, 26, 30, 32, 37, 57, 71, // 536 - blade - 1, // 537 - freight - 1, // 538 - streak - 96, 86, 79, 70, 61, 75, 75, // 539 - vortex - 37, 42, 53, 62, 7, 10, 11, 15, // 540 - vincent - 51, 58, 60, 68, 2, 13, 22, 36, // 541 - bullet - 13, 24, 31, 32, 45, 113, 119, 122, // 542 - clover - 76, 32, 43, 67, 11, 8, 2, 83, // 543 - sadler - 3, // 544 - firela - 50, 47, 44, 40, 39, 30, 28, 9, // 545 - hustler - 62, 78, 2, 3, 2, 113, 119, 7, // 546 - intruder - 122, 123, 125, 10, 24, 37, 55, 66, // 547 - primo - 1, // 548 - cargobob - 74, 72, 75, 79, 83, 84, 89, 91, // 549 - tampa - 37, 42, 53, 62, 7, 10, 11, 15, // 550 - sunrise - 67, 72, 75, 83, 91, 101, 109, 20, // 551 - merit - 56, 49, 26, // 552 - utility - 38, 55, 61, 71, 91, 98, 102, 111, // 553 - nevada - 53, 15, 45, 34, 65, 14, 12, 43, // 554 - yosemite - 51, 58, 60, 68, 2, 13, 22, 36, // 555 - windsor - 1, // 556 - monstera - 1, // 557 - monsterb - 112, 116, 117, 24, 30, 35, 36, 40, // 558 - uranus - 51, 58, 60, 68, 2, 13, 22, 36, // 559 - jester - 52, 9, 17, 21, 33, 37, 41, 56, // 560 - sultan - 57, 8, 43, 54, 67, 37, 65, 25, // 561 - stratum - 36, 35, 17, 11, 116, 113, 101, 92, // 562 - elegy - 1, // 563 - raindanc - // 564 - rctiger - 37, 42, 53, 62, 7, 10, 11, 15, // 565 - flash - 109, 30, 95, 84, 83, 72, 71, 52, // 566 - tahoma - 97, 88, 90, 93, 97, 99, 102, 114, // 567 - savanna - 2, 9, 17, 21, 33, 37, 41, 56, // 568 - bandito - // 569 - freiflat - 1, // 570 - streakc - 2, 36, 51, 91, 11, 40, // 571 - kart - 94, 101, 116, 117, 4, 25, 30, 37, // 572 - mower - 91, 115, 85, 79, 78, 77, 79, 86, // 573 - duneride - 26, // 574 - sweeper - 12, 19, 31, 25, 38, 51, 57, 66, // 575 - broadway - 67, 68, 72, 74, 75, 76, 79, 84, // 576 - tornado - 1, 8, 8, 8, 23, 40, // 577 - at400 - 1, // 578 - dft30 - 37, 42, 53, 62, 7, 10, 11, 15, // 579 - huntley - 92, 81, 67, 66, 61, 53, 51, 47, 43, // 580 - stafford - 54, 58, 66, 72, 75, 87, 101, 36, // 581 - bf400 - 41, 41, 49, 56, 110, 112, 114, 119, // 582 - newsvan - 1, // 583 - tug - 1, // 584 - petrotr - 37, 42, 53, 62, 7, 10, 11, 15, // 585 - emperor - 119, 122, 8, 10, 13, 25, 27, 32, // 586 - wayfarer - 36, 40, 43, 53, 72, 75, 95, 101, // 587 - euros - 1, // 588 - hotdog - 37, 31, 23, 22, 7, 124, 114, 112, // 589 - club - // 590 - freibox - 1, // 591 - artict3 - 1, // 592 - androm - 51, 58, 60, 68, 2, 13, 22, 36, // 593 - dodo - // 594 - rccam - 112, // 595 - launch - 0, // 596 - copcarla - 0, // 597 - copcarsf - 0, // 598 - copcarvg - 0, // 599 - copcarru - 81, 32, 43, 67, 11, 8, 2, 83, // 600 - picador - 1, // 601 - swatvan - 58, 69, 75, 18, 32, 45, 13, 34, // 602 - alpha - 58, 69, 75, 18, 32, 45, 13, 34, // 603 - phoenix - 67, 68, 78, 2, 16, 18, 25, 45, // 604 - glenshit - 61, 32, 43, 67, 11, 8, 2, 83, // 605 - sadlshit - // 606 - bagboxa - // 607 - bagboxb - 1, // 608 - tugstair - 36 // 609 - boxburg - // 610 - farmtr1 - // 611 - utiltr1 - }; - - static const uint16_t vehicleSecondaryColours[1158] = { - 1, 1, 1, 1, 1, 1, 1, 1, // 400 - landstal - 41, 47, 52, 66, 74, 87, 91, 113, // 401 - bravura - 10, 13, 22, 30, 39, 90, 98, 110, // 402 - buffalo - 1, 1, 1, 1, 1, 1, 1, 1, // 403 - linerun - 39, 50, 92, 100, 101, 105, 110, 25, // 404 - peren - 1, 1, 1, 1, 1, 1, 1, 1, // 405 - sentinel - 1, // 406 - dumper - 1, // 407 - firetruk - 26, // 408 - trash - 1, // 409 - stretch - 1, 1, 1, 1, 1, 1, 1, 1, // 410 - manana - 1, 1, 1, 1, 1, 1, 1, 1, // 411 - infernus - 1, 8, 1, 8, 1, 8, 1, 8, // 412 - voodoo - 1, 1, 1, 1, 1, 1, 1, 1, // 413 - pony - 1, 1, 1, 1, 1, 1, 1, 1, // 414 - mule - 1, 1, 1, 1, 1, 1, 1, 1, // 415 - cheetah - 3, // 416 - ambulan - // 417 - leviathn - 119, 227, 114, 108, 95, 81, 61, 41, // 418 - moonbeam - 75, 76, 75, 76, 75, 76, 75, 76, // 419 - esperant - 1, // 420 - taxi - 1, 1, 1, 1, 1, 1, 1, 1, // 421 - washing - 25, 25, 25, 31, 36, 57, 59, // 422 - bobcat - 16, 56, 17, 53, 5, 35, // 423 - mrwhoop - 0, 2, 2, 6, 16, 30, 53, 61, // 424 - bfinject - 0, // 425 - hunter - 37, 42, 53, 62, 7, 10, 11, 15, // 426 - premier - 1, // 427 - enforcer - 75, // 428 - securica - 12, 13, 14, 2, 1, 3, 1, 10, // 429 - banshee - 26, // 430 - predator - 59, 59, 72, 74, 83, 83, 87, 87, // 431 - bus - 0, // 432 - rhino - 0, // 433 - barracks - 1, 12, 2, 6, 4, 46, 53, // 434 - hotknife - 1, // 435 - artict1 - 1, 1, 1, 1, 1, 45, 1, // 436 - previon - 7, 7, 7, 16, 20, 20, 20, 21, // 437 - coach - 76, // 438 - cabbie - 8, 17, 21, 38, 8, 78, 79, 78, // 439 - stallion - 34, 32, 20, 110, 66, 84, 118, 121, // 440 - rumpo - 96, 42, 54, 86, 96, 96, 54, 98, // 441 - rcbandit - 0, 105, 109, 0, 36, 36, 36, 109, // 442 - romero - 1, 1, 1, 1, 1, 1, 1, 1, // 443 - packer - 36, 42, 53, 66, 14, 32, // 444 - monster - 34, 35, 37, 39, 41, 43, 45, 47, // 445 - admiral - 0, 5, 3, 22, 35, 44, 53, 57, // 446 - squalo - 2, // 447 - seaspar - 6, // 448 - pizzaboy - 74, // 449 - tram - 1, // 450 - artict2 - 123, 125, 36, 16, 18, 46, 61, 75, // 451 - turismo - 3, 5, 16, 22, 35, 44, 53, 57, // 452 - speeder - 56, // 453 - reefer - 26, // 454 - tropic - 15, 58, 31, 74, 31, 31, 31, 74, // 455 - flatbed - 63, 63, 65, 72, 93, 93, 95, 1, // 456 - yankee - 1, 1, 1, 1, 1, 1, 1, 1, // 457 - caddy - 1, 1, 1, 1, 1, 1, 1, 1, // 458 - solair - 26, 28, 44, 51, 57, 72, 106, 112, // 459 - topfun - 3, 9, 18, 30, 23, 23, 32, 34, // 460 - skimmer - 1, 1, 1, 1, 1, 1, 1, 1, // 461 - pcj600 - 12, 13, 14, 2, 1, 3, 1, 10, // 462 - faggio - 79, 84, 7, 11, 19, 22, 36, 53, // 463 - freeway - 75, // 464 - rcbaron - 75, // 465 - rcraider - 76, 76, 76, 76, 76, 76, 76, 88, // 466 - glendale - 1, 8, 1, 8, 1, 8, 1, 8, // 467 - oceanic - 6, 46, 53, 3, // 468 - sanchez - 3, // 469 - sparrow - 0, // 470 - patriot - 117, 111, 114, 91, 112, 83, 113, 71, // 471 - quad - 15, 53, // 472 - coastg - 15, 53, // 473 - dinghy - 1, 1, 1, 1, 1, 1, 1, 1, // 474 - hermes - 39, 39, 1, 1, 0, 0, 29, 29, // 475 - sabre - 7, 6, 6, 91, 117, 102, 87, 77, // 476 - rustler - 1, 1, 1, 1, 1, 1, 1, 1, // 477 - zr350 - 1, 1, 1, 1, 1, 1, 1, 1, // 478 - walton - 36, 36, 35, 41, 31, 23, 32, 29, // 479 - regina - 45, 12, 2, 6, 4, 46, 53, // 480 - comet - 1, 3, 6, 46, 9, 1, 9, 1, // 481 - bmx - 41, 48, 52, 64, 71, 85, 10, 62, // 482 - burrito - 31, 31, 20, 5, 6, 6, 0, 0, // 483 - camper - 35, 32, 26, 36, // 484 - marquis - 73, 74, 75, 76, 77, 78, 79, // 485 - baggage - 1, // 486 - dozer - 14, 42, 57, 29, 3, 29, 39, 35, // 487 - maverick - 26, 29, // 488 - vcnmav - 118, 123, 123, 120, 110, 102, // 489 - rancher - 0, // 490 - fbiranch - 65, 72, 66, 72, 72, 72, // 491 - virgo - 26, 26, 27, 55, 56, 59, 69, 107, // 492 - greenwoo - 13, // 493 - jetmax - 117, 13, 30, 33, 36, 79, 101, 109, // 494 - hotring - 124, 122, 117, 115, 108, 106, 99, 6, // 495 - sandking - 72, 72, 56, 19, 22, 20, 14, 0, // 496 - blistac - 1, // 497 - polmav - 123, 120, 117, 112, 107, 105, 107, 93, // 498 - boxville - 25, 32, 32, 32, 44, 52, 66, 69, // 499 - benson - 84, 84, 110, 119, 119, 119, 119, 119, // 500 - mesa - 75, // 501 - rcgoblin - 94, 88, 75, 75, 67, 67, 61, 62, // 502 - hotrina - 66, 74, 75, 83, 100, 101, 116, 36, // 503 - hotrinb - 39, 38, 29, 9, 9, 1, 9, 1, // 504 - bloodra - 118, 123, 123, 120, 110, 102, // 505 - rnchlure - 3, 6, 7, 52, 76, // 506 - supergt - 37, 42, 53, 62, 7, 10, 11, 15, // 507 - elegant - 1, // 508 - journey - 1, 1, 1, 1, 1, 1, 1, 1, // 509 - bike - 43, 46, 39, 28, 16, 6, 5, 2, // 510 - mtbike - 90, 90, 68, 66, 60, 97, 51, 51, // 511 - beagle - 39, 123, 112, 88, 71, 67, 96, 96, // 512 - cropdust - 51, 36, 34, 34, 34, 20, 18, 6, // 513 - stunt - 1, 1, 1, 1, 1, 1, 1, 1, // 514 - petro - 76, 77, 78, 76, 77, 78, 76, 77, // 515 - rdtrain - 1, 1, 1, 1, 1, 1, 1, 1, // 516 - nebula - 36, 36, 36, 41, 41, 72, 75, 84, // 517 - majestic - 39, 39, 1, 1, 0, 0, 29, 29, // 518 - buccanee - 1, // 519 - shamal - // 520 - hydra - 74, 13, 118, 3, 118, 118, 0, 118, // 521 - fcr900 - 3, 8, 25, 79, 82, 105, 106, 118, // 522 - nrg500 - // 523 - copbike - 24, 27, 31, 61, 35, 61, 66, 64, // 524 - cement - 1, 20, 20, 30, 43, 51, 54, // 525 - towtruck - 39, 39, 1, 1, 0, 0, 29, 29, // 526 - fortune - 1, 1, 1, 1, 1, 1, 1, 1, // 527 - cadrona - // 528 - fbitruck - 37, 42, 53, 62, 7, 10, 11, 15, // 529 - willard - 1, 1, 1, 1, 1, 1, 1, 1, // 530 - forklift - 35, 2, 53, 2, 22, 35, // 531 - tractor - // 532 - combine - 1, 1, 1, 1, 1, 1, 1, 1, // 533 - feltzer - 37, 42, 53, 62, 7, 10, 11, 15, // 534 - remingtn - 1, 1, 1, 1, 1, 1, 1, 1, // 535 - slamvan - 1, 1, 96, 96, 1, 1, 96, 96, // 536 - blade - 1, // 537 - freight - 1, // 538 - streak - 67, 70, 74, 86, 98, 75, 91, // 539 - vortex - 37, 42, 53, 62, 7, 10, 11, 15, // 540 - vincent - 1, 8, 1, 8, 1, 8, 1, 8, // 541 - bullet - 118, 118, 93, 92, 92, 92, 113, 113, // 542 - clover - 8, 8, 8, 8, 11, 90, 2, 13, // 543 - sadler - 1, // 544 - firela - 1, 1, 96, 96, 1, 1, 96, 96, // 545 - hustler - 37, 38, 62, 87, 78, 78, 62, 78, // 546 - intruder - 1, 1, 1, 1, 1, 1, 1, 1, // 547 - primo - 1, // 548 - cargobob - 39, 39, 39, 39, 36, 36, 35, 35, // 549 - tampa - 37, 42, 53, 62, 7, 10, 11, 15, // 550 - sunrise - 1, 1, 1, 1, 1, 1, 1, 1, // 551 - merit - 56, 49, 124, // 552 - utility - 9, 23, 74, 87, 87, 114, 119, 3, // 553 - nevada - 32, 32, 32, 30, 32, 32, 32, 32, // 554 - yosemite - 1, 1, 1, 1, 1, 1, 1, 1, // 555 - windsor - 1, // 556 - monstera - 1, // 557 - monsterb - 1, 1, 1, 1, 1, 1, 1, 1, // 558 - uranus - 1, 8, 1, 8, 1, 8, 1, 8, // 559 - jester - 39, 39, 1, 1, 0, 0, 29, 29, // 560 - sultan - 8, 17, 21, 38, 8, 78, 79, 78, // 561 - stratum - 1, 1, 1, 1, 1, 1, 1, 1, // 562 - elegy - 6, // 563 - raindanc - // 564 - rctiger - 37, 42, 53, 62, 7, 10, 11, 15, // 565 - flash - 1, 8, 1, 8, 1, 8, 1, 8, // 566 - tahoma - 96, 64, 96, 64, 96, 81, 114, 1, // 567 - savanna - 39, 39, 1, 1, 0, 0, 29, 29, // 568 - bandito - // 569 - freiflat - 1, // 570 - streakc - 35, 2, 53, 2, 22, 35, // 571 - kart - 1, 1, 1, 1, 1, 1, 1, 1, // 572 - mower - 38, 43, 6, 7, 8, 18, 18, 24, // 573 - duneride - 26, // 574 - sweeper - 1, 96, 64, 96, 1, 96, 1, 96, // 575 - broadway - 1, 96, 1, 8, 96, 8, 1, 96, // 576 - tornado - 3, 7, 10, 16, 31, 44, // 577 - at400 - 1, // 578 - dft30 - 37, 42, 53, 62, 7, 10, 11, 15, // 579 - huntley - 92, 81, 67, 66, 61, 53, 51, 47, 43, // 580 - stafford - 1, 1, 1, 1, 1, 1, 1, 1, // 581 - bf400 - 10, 20, 11, 123, 113, 116, 118, 101, // 582 - newsvan - 1, // 583 - tug - 1, // 584 - petrotr - 37, 42, 53, 62, 7, 10, 11, 15, // 585 - emperor - 1, 1, 1, 1, 1, 1, 1, 1, // 586 - wayfarer - 1, 1, 1, 1, 1, 1, 1, 1, // 587 - euros - 1, // 588 - hotdog - 37, 31, 23, 22, 7, 124, 114, 112, // 589 - club - // 590 - freibox - 1, // 591 - artict3 - 1, // 592 - androm - 1, 8, 1, 8, 1, 8, 1, 8, // 593 - dodo - // 594 - rccam - 20, // 595 - launch - 1, // 596 - copcarla - 1, // 597 - copcarsf - 1, // 598 - copcarvg - 1, // 599 - copcarru - 8, 8, 8, 8, 11, 90, 2, 13, // 600 - picador - 1, // 601 - swatvan - 1, 1, 77, 1, 1, 45, 1, 1, // 602 - alpha - 1, 1, 77, 1, 1, 45, 1, 1, // 603 - phoenix - 76, 76, 76, 76, 76, 76, 76, 88, // 604 - glenshit - 8, 8, 8, 8, 11, 90, 2, 13, // 605 - sadlshit - // 606 - bagboxa - // 607 - bagboxb - 1, // 608 - tugstair - 36 // 609 - boxburg - // 610 - farmtr1 - // 611 - utiltr1 - }; - - static const uint8_t colour3Camper[8] = { 0x01, 0x01, 0x03, 0x00, 0x03, 0x03, 0x08, 0x78 }; - static const uint8_t colour4Camper[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - static const uint8_t colour3Cement[8] = { 0x17, 0x7B, 0x1F, 0x1E, 0x17, 0x3E, 0x40, 0x40 }; - static const uint8_t colour4Cement[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - static const uint8_t colour3Squalo[8] = { 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }; - static const uint8_t colour4Squalo[8] = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }; - - if (modelid > 611 || modelid < 400) - { - colour1 = 127; - colour2 = 127; - } - else - { - uint16_t start = vehicleIndexes[modelid - 400]; - uint16_t end = vehicleIndexes[modelid - 399]; - - // Choosing a random index in [start, end) interval - // Ternary operator is used because rand() % 0 is an invalid operation. - uint16_t index = end == start ? start : (rand() % (end - start) + start); - - colour1 = vehiclePrimaryColours[index]; - colour2 = vehicleSecondaryColours[index]; - switch (modelid) - { - case 83: - colour3 = colour3Camper[index], - colour4 = colour4Camper[index]; - break; - case 124: - colour3 = colour3Cement[index], - colour4 = colour4Cement[index]; - break; - case 46: - colour3 = colour3Squalo[index], - colour4 = colour4Squalo[index]; - break; - } - } -} - -inline void getRandomVehicleColour(int modelid, int& colour1, int& colour2) -{ - int colour3, colour4; - return getRandomVehicleColour(modelid, colour1, colour2, colour3, colour4); -} - -inline uint32_t carColourIndexToColour(int index, uint32_t alpha = 0xFF) -{ - static const uint32_t vehicleColours[256] = { - 0x00000000, 0xF5F5F500, 0x2A77A100, 0x84041000, 0x26373900, 0x86446E00, 0xD78E1000, 0x4C75B700, - 0xBDBEC600, 0x5E707200, 0x46597A00, 0x656A7900, 0x5D7E8D00, 0x58595A00, 0xD6DAD600, 0x9CA1A300, - 0x335F3F00, 0x730E1A00, 0x7B0A2A00, 0x9F9D9400, 0x3B4E7800, 0x732E3E00, 0x691E3B00, 0x96918C00, - 0x51545900, 0x3F3E4500, 0xA5A9A700, 0x635C5A00, 0x3D4A6800, 0x97959200, 0x421F2100, 0x5F272B00, - 0x8494AB00, 0x767B7C00, 0x64646400, 0x5A575200, 0x25252700, 0x2D3A3500, 0x93A39600, 0x6D7A8800, - 0x22191800, 0x6F675F00, 0x7C1C2A00, 0x5F0A1500, 0x19382600, 0x5D1B2000, 0x9D987200, 0x7A756000, - 0x98958600, 0xADB0B000, 0x84898800, 0x304F4500, 0x4D626800, 0x16224800, 0x272F4B00, 0x7D625600, - 0x9EA4AB00, 0x9C8D7100, 0x6D182200, 0x4E688100, 0x9C9C9800, 0x91734700, 0x661C2600, 0x949D9F00, - 0xA4A7A500, 0x8E8C4600, 0x341A1E00, 0x6A7A8C00, 0xAAAD8E00, 0xAB988F00, 0x851F2E00, 0x6F829700, - 0x58585300, 0x9AA79000, 0x601A2300, 0x20202C00, 0xA4A09600, 0xAA9D8400, 0x78222B00, 0x0E316D00, - 0x722A3F00, 0x7B715E00, 0x741D2800, 0x1E2E3200, 0x4D322F00, 0x7C1B4400, 0x2E5B2000, 0x395A8300, - 0x6D283700, 0xA7A28F00, 0xAFB1B100, 0x36415500, 0x6D6C6E00, 0x0F6A8900, 0x204B6B00, 0x2B3E5700, - 0x9B9F9D00, 0x6C849500, 0x4D849500, 0xAE9B7F00, 0x406C8F00, 0x1F253B00, 0xAB927600, 0x13457300, - 0x96816C00, 0x64686A00, 0x10508200, 0xA1998300, 0x38569400, 0x52566100, 0x7F695600, 0x8C929A00, - 0x596E8700, 0x47353200, 0x44624F00, 0x730A2700, 0x22345700, 0x640D1B00, 0xA3ADC600, 0x69585300, - 0x9B8B8000, 0x620B1C00, 0x5B5D5E00, 0x62442800, 0x73182700, 0x1B376D00, 0xEC6AAE00, 0x00000000, - 0x17751700, 0x21060600, 0x12547800, 0x452A0D00, 0x571E1E00, 0x01070100, 0x25225A00, 0x2C89AA00, - 0x8A4DBD00, 0x35963A00, 0xB7B7B700, 0x464C8D00, 0x84888C00, 0x81786700, 0x817A2600, 0x6A506F00, - 0x583E6F00, 0x8CB97200, 0x824F7800, 0x6D276A00, 0x1E1D1300, 0x1E130600, 0x1F251800, 0x2C453100, - 0x1E4C9900, 0x2E5F4300, 0x1E994800, 0x1E999900, 0x99997600, 0x7C849900, 0x992E1E00, 0x2C1E0800, - 0x14240700, 0x993E4D00, 0x1E4C9900, 0x19818100, 0x1A292A00, 0x16616F00, 0x1B668700, 0x6C3F9900, - 0x481A0E00, 0x7A739900, 0x746D9900, 0x53387E00, 0x22240700, 0x3E190C00, 0x46210E00, 0x991E1E00, - 0x8D4C8D00, 0x805B8000, 0x7B3E7E00, 0x3C173700, 0x73351700, 0x78181800, 0x83341A00, 0x8E2F1C00, - 0x7E3E5300, 0x7C6D7C00, 0x020C0200, 0x07240700, 0x16301200, 0x16301B00, 0x642B4F00, 0x36845200, - 0x99959000, 0x818D9600, 0x99991E00, 0x7F994C00, 0x83929200, 0x78822200, 0x2B3C9900, 0x3A3A0B00, - 0x8A794E00, 0x0E1F4900, 0x15371C00, 0x15273A00, 0x37577500, 0x06082000, 0x07132600, 0x20394B00, - 0x2C508900, 0x15426C00, 0x10325000, 0x24166300, 0x69201500, 0x8C8D9400, 0x51601300, 0x090F0200, - 0x8C573A00, 0x52888E00, 0x995C5200, 0x99581E00, 0x993A6300, 0x998F4E00, 0x99311E00, 0x0D184200, - 0x521E1E00, 0x42420D00, 0x4C991E00, 0x082A1D00, 0x96821D00, 0x197F1900, 0x3B141F00, 0x74521700, - 0x893F8D00, 0x7E1A6C00, 0x0B370B00, 0x27450D00, 0x071F2400, 0x78457300, 0x8A653A00, 0x73261700, - 0x31949000, 0x56941D00, 0x59163D00, 0x1B8A2F00, 0x38160B00, 0x04180400, 0x355D8E00, 0x2E3F5B00, - 0x561A2800, 0x4E0E2700, 0x706C6700, 0x3B3E4200, 0x2E2D3300, 0x7B7E7D00, 0x4A444200, 0x28344E00 - }; - if (0 <= index && index < 256) - { - return vehicleColours[index]; - } - return 0; -} -} diff --git a/SDK/include/Server/Components/Vehicles/vehicle_components.hpp b/SDK/include/Server/Components/Vehicles/vehicle_components.hpp deleted file mode 100644 index ede0972af..000000000 --- a/SDK/include/Server/Components/Vehicles/vehicle_components.hpp +++ /dev/null @@ -1,472 +0,0 @@ -#pragma once - -#include "vehicles.hpp" -#include - -namespace Impl -{ - -inline bool isValidComponentForVehicleModel(int vehicleModel, int componentId) -{ - // * This is a bit array of all the valid mods (-1000) for all vehicles (-400) - // * EXCEPT for vehicle 576 (Tornado), which has just TWO extra mods on it, - // * that should spill over in to an extra cell of data (requiring an extra - // * 848 bytes of data total to make the array work). Instead this (hopefully - // * rare) case is handled explicitly in "OnVehicleMod". It seems that most - // * vehicles are: - // * - // * 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - // * - // * I don't know yet if this can be used to our advantage to improve the code - // * somehow - it seems like that would require more explicit model handling. - - static const StaticArray componentValidVehicleModel = { - 0x033C2700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x021A27FA, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x023B2785, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02BC4703, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x03BA278A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x028E078A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02310744, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x0228073A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02BD4701, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x023A2780, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x0228077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x027A27CA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x0282278A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x023E07C0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x03703730, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x031D2775, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02BE4788, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, - 0x02010771, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x029A0FCE, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x03382700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x023F8795, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x029F078C, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, - 0x029627EA, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x0236C782, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x029E1FCA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0xFC000437, 0x00000000, 0x021C0000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x03FE6007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00001B87, 0x00000001, 0x01E00000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x039E07D2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x023CC700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00030000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x038E07D6, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, - 0x023D0709, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x029E1F8A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, - 0x029C077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, - 0x02BD076C, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0xFFFFFE00, 0x00000007, 0x00000000, 0x000001F8, - 0x02000700, 0x00000000, 0x00FFFFFE, 0x00000007, 0xC0000000, 0x00002007, - 0xFE000700, 0x00000003, 0x00FFFE00, 0x00000007, 0x00003C00, 0x00000600, - 0xCE000700, 0xFF800000, 0x00FFFE01, 0x00000007, 0x3C000000, 0x00000000, - 0x02000700, 0x000003FC, 0x00FFFE00, 0x00000007, 0x003C0000, 0x00001800, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x007FE000, 0x00FFFE00, 0x00000007, 0x03C00000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000047, 0x0000003E, 0x3C000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00001C00, 0x00FFFE00, 0x0000000F, 0x00000000, 0x0003C000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x000003C0, 0xC0000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x029607C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x03FFE7CF, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x031727F1, 0x00000000, 0x00FFFE00, 0x00000007, 0x00030000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x025627F0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x039E07C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, - 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000 - }; - - if ((componentId == 1192 || componentId == 1193) && (vehicleModel == 576)) - { - // This save a whole word off EVERY other vehicle! This is the ONLY vehicle with any mods over - // "6 * 32 + 999" (1191), the highest value you can fit in 6 cells of a bit array (minus 1000). - return true; - } - - componentId -= 1000; - if (componentId < 0 || componentId >= MAX_VEHICLE_COMPONENTS - 2) - { - // `- 2` because the last two are handled separately. - return false; - } - - vehicleModel -= 400; - if (vehicleModel < 0 || vehicleModel >= MAX_VEHICLE_MODELS) - { - return false; - } - - if (componentValidVehicleModel[(static_cast(vehicleModel)) * 6 + (static_cast(componentId) >> 5)] & (1 << (static_cast(componentId) & 0x1F))) - { - return true; - } - return false; -} - -inline int getVehicleComponentSlot(int component) -{ - static const StaticArray allComponentSlots = { - VehicleComponent_Spoiler, // 1000 - VehicleComponent_Spoiler, // 1001 - VehicleComponent_Spoiler, // 1002 - VehicleComponent_Spoiler, // 1003 - VehicleComponent_Hood, // 1004 - VehicleComponent_Hood, // 1005 - VehicleComponent_Roof, // 1006 - VehicleComponent_SideSkirt, // 1007 - VehicleComponent_Nitro, // 1008 - VehicleComponent_Nitro, // 1009 - VehicleComponent_Nitro, // 1010 - VehicleComponent_Hood, // 1011 - VehicleComponent_Hood, // 1012 - VehicleComponent_Lamps, // 1013 - VehicleComponent_Spoiler, // 1014 - VehicleComponent_Spoiler, // 1015 - VehicleComponent_Spoiler, // 1016 - VehicleComponent_SideSkirt, // 1017 - VehicleComponent_Exhaust, // 1018 - VehicleComponent_Exhaust, // 1019 - VehicleComponent_Exhaust, // 1020 - VehicleComponent_Exhaust, // 1021 - VehicleComponent_Exhaust, // 1022 - VehicleComponent_Spoiler, // 1023 - VehicleComponent_Lamps, // 1024 - VehicleComponent_Wheels, // 1025 - VehicleComponent_SideSkirt, // 1026 - VehicleComponent_SideSkirt, // 1027 - VehicleComponent_Exhaust, // 1028 - VehicleComponent_Exhaust, // 1029 - VehicleComponent_SideSkirt, // 1030 - VehicleComponent_SideSkirt, // 1031 - VehicleComponent_Roof, // 1032 - VehicleComponent_Roof, // 1033 - VehicleComponent_Exhaust, // 1034 - VehicleComponent_Roof, // 1035 - VehicleComponent_SideSkirt, // 1036 - VehicleComponent_Exhaust, // 1037 - VehicleComponent_Roof, // 1038 - VehicleComponent_SideSkirt, // 1039 - VehicleComponent_SideSkirt, // 1040 - VehicleComponent_SideSkirt, // 1041 - VehicleComponent_SideSkirt, // 1042 - VehicleComponent_Exhaust, // 1043 - VehicleComponent_Exhaust, // 1044 - VehicleComponent_Exhaust, // 1045 - VehicleComponent_Exhaust, // 1046 - VehicleComponent_SideSkirt, // 1047 - VehicleComponent_SideSkirt, // 1048 - VehicleComponent_Spoiler, // 1049 - VehicleComponent_Spoiler, // 1050 - VehicleComponent_SideSkirt, // 1051 - VehicleComponent_SideSkirt, // 1052 - VehicleComponent_Roof, // 1053 - VehicleComponent_Roof, // 1054 - VehicleComponent_Roof, // 1055 - VehicleComponent_SideSkirt, // 1056 - VehicleComponent_SideSkirt, // 1057 - VehicleComponent_Spoiler, // 1058 - VehicleComponent_Exhaust, // 1059 - VehicleComponent_Spoiler, // 1060 - VehicleComponent_Roof, // 1061 - VehicleComponent_SideSkirt, // 1062 - VehicleComponent_SideSkirt, // 1063 - VehicleComponent_Exhaust, // 1064 - VehicleComponent_Exhaust, // 1065 - VehicleComponent_Exhaust, // 1066 - VehicleComponent_Roof, // 1067 - VehicleComponent_Roof, // 1068 - VehicleComponent_SideSkirt, // 1069 - VehicleComponent_SideSkirt, // 1070 - VehicleComponent_SideSkirt, // 1071 - VehicleComponent_SideSkirt, // 1072 - VehicleComponent_Wheels, // 1073 - VehicleComponent_Wheels, // 1074 - VehicleComponent_Wheels, // 1075 - VehicleComponent_Wheels, // 1076 - VehicleComponent_Wheels, // 1077 - VehicleComponent_Wheels, // 1078 - VehicleComponent_Wheels, // 1079 - VehicleComponent_Wheels, // 1080 - VehicleComponent_Wheels, // 1081 - VehicleComponent_Wheels, // 1082 - VehicleComponent_Wheels, // 1083 - VehicleComponent_Wheels, // 1084 - VehicleComponent_Wheels, // 1085 - VehicleComponent_Stereo, // 1086 - VehicleComponent_Hydraulics, // 1087 - VehicleComponent_Roof, // 1088 - VehicleComponent_Exhaust, // 1089 - VehicleComponent_SideSkirt, // 1090 - VehicleComponent_Roof, // 1091 - VehicleComponent_Exhaust, // 1092 - VehicleComponent_SideSkirt, // 1093 - VehicleComponent_SideSkirt, // 1094 - VehicleComponent_SideSkirt, // 1095 - VehicleComponent_Wheels, // 1096 - VehicleComponent_Wheels, // 1097 - VehicleComponent_Wheels, // 1098 - VehicleComponent_SideSkirt, // 1099 - VehicleComponent_FrontBullbar, // 1100 - VehicleComponent_SideSkirt, // 1101 - VehicleComponent_SideSkirt, // 1102 - VehicleComponent_Roof, // 1103 - VehicleComponent_Exhaust, // 1104 - VehicleComponent_Exhaust, // 1105 - VehicleComponent_SideSkirt, // 1106 - VehicleComponent_SideSkirt, // 1107 - VehicleComponent_SideSkirt, // 1108 - VehicleComponent_RearBullbar, // 1109 - VehicleComponent_RearBullbar, // 1110 - VehicleComponent_FrontBumper, // 1111 - VehicleComponent_FrontBumper, // 1112 - VehicleComponent_Exhaust, // 1113 - VehicleComponent_Exhaust, // 1114 - VehicleComponent_FrontBullbar, // 1115 - VehicleComponent_FrontBullbar, // 1116 - VehicleComponent_FrontBumper, // 1117 - VehicleComponent_SideSkirt, // 1118 - VehicleComponent_SideSkirt, // 1119 - VehicleComponent_SideSkirt, // 1120 - VehicleComponent_SideSkirt, // 1121 - VehicleComponent_SideSkirt, // 1122 - VehicleComponent_FrontBullbar, // 1123 - VehicleComponent_SideSkirt, // 1124 - VehicleComponent_FrontBullbar, // 1125 - VehicleComponent_Exhaust, // 1126 - VehicleComponent_Exhaust, // 1127 - VehicleComponent_Roof, // 1128 - VehicleComponent_Exhaust, // 1129 - VehicleComponent_Roof, // 1130 - VehicleComponent_Roof, // 1131 - VehicleComponent_Exhaust, // 1132 - VehicleComponent_SideSkirt, // 1133 - VehicleComponent_SideSkirt, // 1134 - VehicleComponent_Exhaust, // 1135 - VehicleComponent_Exhaust, // 1136 - VehicleComponent_SideSkirt, // 1137 - VehicleComponent_Spoiler, // 1138 - VehicleComponent_Spoiler, // 1139 - VehicleComponent_RearBumper, // 1140 - VehicleComponent_RearBumper, // 1141 - VehicleComponent_VentLeft, // 1142 - VehicleComponent_VentRight, // 1143 - VehicleComponent_VentLeft, // 1144 - VehicleComponent_VentRight, // 1145 - VehicleComponent_Spoiler, // 1146 - VehicleComponent_Spoiler, // 1147 - VehicleComponent_RearBumper, // 1148 - VehicleComponent_RearBumper, // 1149 - VehicleComponent_RearBumper, // 1150 - VehicleComponent_RearBumper, // 1151 - VehicleComponent_FrontBumper, // 1152 - VehicleComponent_FrontBumper, // 1153 - VehicleComponent_RearBumper, // 1154 - VehicleComponent_FrontBumper, // 1155 - VehicleComponent_RearBumper, // 1156 - VehicleComponent_FrontBumper, // 1157 - VehicleComponent_Spoiler, // 1158 - VehicleComponent_RearBumper, // 1159 - VehicleComponent_FrontBumper, // 1160 - VehicleComponent_RearBumper, // 1161 - VehicleComponent_Spoiler, // 1162 - VehicleComponent_Spoiler, // 1163 - VehicleComponent_Spoiler, // 1164 - VehicleComponent_FrontBumper, // 1165 - VehicleComponent_FrontBumper, // 1166 - VehicleComponent_RearBumper, // 1167 - VehicleComponent_RearBumper, // 1168 - VehicleComponent_FrontBumper, // 1169 - VehicleComponent_FrontBumper, // 1170 - VehicleComponent_FrontBumper, // 1171 - VehicleComponent_FrontBumper, // 1172 - VehicleComponent_FrontBumper, // 1173 - VehicleComponent_FrontBumper, // 1174 - VehicleComponent_FrontBumper, // 1175 - VehicleComponent_RearBumper, // 1176 - VehicleComponent_RearBumper, // 1177 - VehicleComponent_RearBumper, // 1178 - VehicleComponent_FrontBumper, // 1179 - VehicleComponent_RearBumper, // 1180 - VehicleComponent_FrontBumper, // 1181 - VehicleComponent_FrontBumper, // 1182 - VehicleComponent_RearBumper, // 1183 - VehicleComponent_RearBumper, // 1184 - VehicleComponent_FrontBumper, // 1185 - VehicleComponent_RearBumper, // 1186 - VehicleComponent_RearBumper, // 1187 - VehicleComponent_FrontBumper, // 1188 - VehicleComponent_FrontBumper, // 1189 - VehicleComponent_FrontBumper, // 1190 - VehicleComponent_FrontBumper, // 1191 - VehicleComponent_RearBumper, // 1192 - VehicleComponent_RearBumper // 1193 - }; - - component -= 1000; - if (0 <= component && component < MAX_VEHICLE_COMPONENTS) - { - return allComponentSlots[component]; - } - return VehicleComponent_None; -}; - -} diff --git a/SDK/include/Server/Components/Vehicles/vehicle_models.hpp b/SDK/include/Server/Components/Vehicles/vehicle_models.hpp deleted file mode 100644 index 951c8a6cd..000000000 --- a/SDK/include/Server/Components/Vehicles/vehicle_models.hpp +++ /dev/null @@ -1,285 +0,0 @@ -#pragma once - -#include "vehicles.hpp" -#include - -namespace Impl -{ - -inline bool getVehicleModelInfo(int model, VehicleModelInfoType type, Vector3& out) -{ - if (!isValidVehicleModel(model)) - { - return false; - } - - static const StaticArray allModelInfo = { { { { 2.329999f, 5.119999f, 1.639999f }, { 0.330000f, 0.029999f, -0.200000f }, { 0.439999f, -0.699999f, -0.219999f }, { -1.100000f, -2.059999f, -0.070000f }, { 0.879999f, 1.379999f, -0.610000f }, { 0.879999f, -1.389999f, -0.610000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.490000f, -0.460000f }, - { { 2.569999f, 5.829999f, 1.710000f }, { 0.500000f, -0.059999f, -0.119999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.090000f, -0.939999f, 0.000000f }, { 0.980000f, 1.629999f, -0.349999f }, { 0.980000f, -1.490000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.109999f }, - { { 2.410000f, 5.800000f, 1.529999f }, { 0.540000f, -0.349999f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.039999f, -1.919999f, 0.140000f }, { 0.970000f, 1.519999f, -0.349999f }, { 0.970000f, -1.549999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.479999f, -0.310000f }, - { { 3.150000f, 9.220000f, 4.179999f }, { 0.430000f, 1.450000f, 0.340000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.450000f, 0.070000f, -0.800000f }, { 1.120000f, 3.559999f, -0.949999f }, { 1.120000f, -3.450000f, -0.949999f }, { 1.120000f, -2.250000f, -0.949999f }, -0.699999f, -50.000000f }, - { { 2.200000f, 5.809999f, 1.840000f }, { 0.460000f, -0.129999f, -0.029999f }, { 0.469999f, -1.070000f, -0.009999f }, { -0.939999f, -2.359999f, -0.009999f }, { 0.800000f, 1.539999f, -0.330000f }, { 0.800000f, -1.570000f, -0.330000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.140000f, -0.150000f }, - { { 2.349999f, 6.000000f, 1.490000f }, { 0.430000f, 0.000000f, -0.189999f }, { 0.400000f, -0.980000f, -0.239999f }, { -1.039999f, -2.180000f, -0.039999f }, { 0.839999f, 1.639999f, -0.449999f }, { 0.839999f, -1.639999f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.200000f, -0.200000f }, - { { 5.269999f, 11.590000f, 4.420000f }, { 1.379999f, 2.559999f, 0.779999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 2.009999f, 3.200000f, -1.250000f }, { 2.009999f, -1.970000f, -1.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.849999f, 8.960000f, 2.700000f }, { 0.600000f, 2.890000f, 0.200000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.110000f, -3.660000f, -0.540000f }, { 1.049999f, 2.450000f, -0.699999f }, { 1.049999f, -2.049999f, -0.699999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.500000f, -50.000000f }, - { { 3.119999f, 10.689999f, 3.910000f }, { 0.439999f, 2.730000f, -0.109999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.230000f, 1.299999f, -0.660000f }, { 1.090000f, 4.039999f, -0.970000f }, { 1.090000f, -2.220000f, -0.970000f }, { 1.090000f, -1.080000f, -0.970000f }, -0.529999f, -50.000000f }, - { { 2.369999f, 8.180000f, 1.529999f }, { 0.460000f, 1.059999f, -0.140000f }, { 0.460000f, -1.870000f, -0.219999f }, { -0.980000f, -2.829999f, 0.119999f }, { 0.889999f, 2.750000f, -0.349999f }, { 0.889999f, -2.740000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.310000f, -0.310000f }, - { { 2.259999f, 5.010000f, 1.799999f }, { 0.419999f, -0.170000f, -0.050000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.019999f, -1.669999f, 0.209999f }, { 0.819999f, 1.389999f, -0.289999f }, { 0.819999f, -1.379999f, -0.289999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.039999f, -0.009999f }, - { { 2.390000f, 5.780000f, 1.370000f }, { 0.490000f, 0.050000f, -0.209999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.090000f, -2.099999f, 0.090000f }, { 0.949999f, 1.710000f, -0.349999f }, { 0.949999f, -1.710000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.509999f, -0.370000f }, - { { 2.450000f, 7.309999f, 1.389999f }, { 0.460000f, -0.129999f, -0.230000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, -3.549999f, -0.170000f }, { 0.930000f, 1.889999f, -0.349999f }, { 0.930000f, -1.879999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.360000f, -0.349999f }, - { { 2.279999f, 5.880000f, 2.230000f }, { 0.490000f, 0.779999f, 0.059999f }, { 0.529999f, -1.740000f, -0.019999f }, { -1.049999f, 0.340000f, -0.529999f }, { 0.879999f, 1.799999f, -0.639999f }, { 0.920000f, -1.850000f, -0.639999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.319999f, -0.319999f }, - { { 2.519999f, 7.070000f, 4.599999f }, { 0.439999f, 0.959999f, 0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.920000f, -0.740000f, -0.699999f }, { 0.910000f, 2.140000f, -0.620000f }, { 0.910000f, -2.130000f, -0.620000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.400000f, -0.280000f }, - { { 2.319999f, 5.510000f, 1.139999f }, { 0.419999f, 0.000000f, -0.330000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.129999f, -2.069999f, 0.019999f }, { 0.910000f, 1.570000f, -0.360000f }, { 0.910000f, -1.610000f, -0.360000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.070000f }, - { { 2.730000f, 8.010000f, 3.400000f }, { 0.419999f, 0.949999f, 0.059999f }, { 0.850000f, -2.730000f, 0.079999f }, { -1.350000f, -2.740000f, -0.189999f }, { 0.959999f, 2.220000f, -0.670000f }, { 1.179999f, -2.180000f, -0.670000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.340000f, -50.000000f }, - { { 5.449999f, 23.270000f, 6.610000f }, { 0.439999f, 3.269999f, 0.600000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.569999f, 5.670000f, 2.140000f }, { 0.519999f, 0.460000f, -0.129999f }, { 0.449999f, -0.680000f, -0.239999f }, { 1.210000f, -1.570000f, -0.079999f }, { 1.009999f, 1.799999f, -0.680000f }, { 1.009999f, -1.700000f, -0.680000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.490000f, -0.490000f }, - { { 2.400000f, 6.219999f, 1.409999f }, { 0.409999f, -0.209999f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.080000f, -1.990000f, 0.029999f }, { 0.899999f, 1.620000f, -0.430000f }, { 0.899999f, -1.620000f, -0.430000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.419999f, -0.360000f }, - { { 2.410000f, 5.909999f, 1.769999f }, { 0.519999f, 0.059999f, -0.140000f }, { 0.519999f, -1.029999f, -0.109999f }, { -1.100000f, -2.150000f, 0.100000f }, { 0.920000f, 1.639999f, -0.349999f }, { 0.920000f, -1.639999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.319999f }, - { { 2.250000f, 6.389999f, 1.370000f }, { 0.449999f, 0.109999f, -0.230000f }, { 0.430000f, -1.080000f, -0.230000f }, { -1.070000f, -2.440000f, -0.170000f }, { 0.839999f, 1.740000f, -0.479999f }, { 0.839999f, -1.740000f, -0.479999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.330000f, -0.289999f }, - { { 2.269999f, 5.380000f, 1.549999f }, { 0.409999f, 0.070000f, -0.180000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.080000f, -0.419999f, -0.200000f }, { 0.860000f, 1.490000f, -0.550000f }, { 0.860000f, -1.490000f, -0.550000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.310000f, -0.360000f }, - { { 2.319999f, 4.840000f, 4.909999f }, { 0.579999f, 0.670000f, 0.200000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.169999f, -1.899999f, -0.319999f }, { 0.910000f, 1.710000f, -0.629999f }, { 0.889999f, -1.299999f, -0.629999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.560000f, -0.620000f }, - { { 2.460000f, 3.859999f, 1.779999f }, { 0.389999f, -0.090000f, -0.090000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.180000f, 1.080000f, 0.430000f }, { 1.000000f, 1.090000f, -0.280000f }, { 1.000000f, -1.080000f, -0.280000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.360000f, 0.009999f }, - { { 5.159999f, 18.629999f, 5.190000f }, { 0.000000f, 2.549999f, 0.189999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.410000f, 5.909999f, 1.769999f }, { 0.519999f, 0.059999f, -0.140000f }, { 0.519999f, -1.029999f, -0.109999f }, { -1.100000f, -2.150000f, 0.090000f }, { 0.920000f, 1.639999f, -0.349999f }, { 0.920000f, -1.639999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.319999f }, - { { 2.640000f, 8.199999f, 3.230000f }, { 0.379999f, 1.100000f, 0.250000f }, { 0.709999f, -2.759999f, 0.140000f }, { -1.269999f, -3.200000f, -0.159999f }, { 0.910000f, 2.519999f, -0.529999f }, { 1.009999f, -2.289999f, -0.529999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.409999f, -50.000000f }, - { { 2.730000f, 6.280000f, 3.480000f }, { 0.649999f, 0.649999f, 0.140000f }, { 0.750000f, -2.420000f, 0.209999f }, { -1.009999f, -3.059999f, -0.490000f }, { 0.910000f, 1.950000f, -0.639999f }, { 1.029999f, -1.750000f, -0.639999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.519999f, -50.000000f }, - { { 2.210000f, 5.179999f, 1.279999f }, { 0.490000f, -0.500000f, -0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.990000f, -2.140000f, 0.140000f }, { 0.870000f, 1.570000f, -0.250000f }, { 0.870000f, -1.570000f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.259999f }, - { { 4.769999f, 16.899999f, 5.920000f }, { 0.400000f, 0.519999f, 0.980000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.009999f, 12.210000f, 4.420000f }, { 0.709999f, 4.730000f, 0.379999f }, { 0.750000f, 5.139999f, -0.529999f }, { -1.450000f, -5.469999f, -0.129999f }, { 1.110000f, 3.940000f, -0.500000f }, { 1.110000f, -3.900000f, -0.500000f }, { 1.110000f, -2.859999f, -0.500000f }, -0.389999f, -0.389999f }, - { { 4.300000f, 9.170000f, 3.880000f }, { 0.379999f, 2.769999f, -0.189999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.629999f, 3.099999f, -0.349999f }, { 1.629999f, -3.099999f, -0.349999f }, { 1.629999f, 0.000000f, -0.349999f }, -50.000000f, -50.000000f }, - { { 3.400000f, 10.000000f, 4.860000f }, { 0.490000f, 1.159999f, 0.519999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.519999f, 0.159999f, -0.680000f }, { 1.289999f, 2.990000f, -0.800000f }, { 1.289999f, -2.990000f, -0.800000f }, { 1.289999f, -1.559999f, -0.800000f }, -0.360000f, -0.050000f }, - { { 2.289999f, 4.570000f, 1.720000f }, { 0.259999f, -0.449999f, -0.330000f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.730000f, -1.580000f, 0.289999f }, { 0.899999f, 1.799999f, -0.589999f }, { 1.019999f, -1.389999f, -0.500000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.160000f, 13.529999f, 4.769999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.009999f, -1.440000f, -0.949999f }, { 1.009999f, -2.730000f, -0.949999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.279999f, 5.510000f, 1.720000f }, { 0.400000f, -0.170000f, -0.079999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.070000f, -1.820000f, 0.140000f }, { 0.850000f, 1.379999f, -0.349999f }, { 0.850000f, -1.399999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.070000f, -0.070000f }, - { { 3.039999f, 11.760000f, 4.010000f }, { 0.209999f, 4.289999f, 1.000000f }, { 0.750000f, 2.710000f, -0.529999f }, { -1.490000f, -4.969999f, -0.500000f }, { 1.220000f, 3.950000f, -0.500000f }, { 1.220000f, -3.940000f, -0.500000f }, { 1.220000f, -2.829999f, -0.500000f }, -0.379999f, -0.439999f }, - { { 2.410000f, 5.820000f, 1.720000f }, { 0.460000f, 0.419999f, -0.289999f }, { 0.460000f, -0.610000f, -0.289999f }, { -1.090000f, -1.929999f, -0.019999f }, { 0.949999f, 1.919999f, -0.550000f }, { 0.949999f, -1.909999f, -0.550000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.579999f, -0.579999f }, - { { 2.220000f, 5.289999f, 1.470000f }, { 0.490000f, -0.540000f, -0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.110000f, -1.509999f, 0.059999f }, { 0.879999f, 1.559999f, -0.449999f }, { 0.879999f, -1.509999f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.349999f, -0.129999f }, - { { 2.309999f, 5.559999f, 2.759999f }, { 0.500000f, 0.750000f, -0.050000f }, { 0.540000f, -1.789999f, -0.090000f }, { -1.090000f, -0.460000f, -0.419999f }, { 0.879999f, 1.779999f, -0.750000f }, { 0.879999f, -1.850000f, -0.750000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.589999f, -0.629999f }, - { { 0.870000f, 1.409999f, 1.019999f }, { 0.059999f, -0.070000f, 0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.259999f, 0.400000f, 0.029999f }, { 0.259999f, -0.400000f, 0.029999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.609999f, 6.679999f, 1.759999f }, { 0.490000f, 0.270000f, -0.189999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.210000f, -2.210000f, 0.059999f }, { 0.980000f, 2.000000f, -0.460000f }, { 0.980000f, -2.000000f, -0.460000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.330000f, -0.200000f }, - { { 4.159999f, 20.049999f, 4.429999f }, { 0.389999f, 2.880000f, 0.319999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.529999f, 1.240000f, -0.899999f }, { 1.220000f, 4.860000f, -0.959999f }, { 1.220000f, -5.170000f, -0.959999f }, { 1.220000f, -4.039999f, -0.959999f }, -0.740000f, -50.000000f }, - { { 3.660000f, 6.019999f, 3.289999f }, { 0.540000f, 0.349999f, 0.600000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, -2.599999f, -0.059999f }, { 1.370000f, 1.909999f, -0.449999f }, { 1.370000f, -1.909999f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.299999f, 5.860000f, 1.750000f }, { 0.479999f, -0.029999f, -0.159999f }, { 0.479999f, -1.139999f, -0.159999f }, { -1.039999f, -1.940000f, 0.129999f }, { 0.910000f, 1.740000f, -0.460000f }, { 0.910000f, -1.740000f, -0.460000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.370000f, -0.340000f }, - { { 4.769999f, 17.020000f, 4.309999f }, { 0.689999f, 0.250000f, 1.070000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.420000f, 14.800000f, 3.150000f }, { 0.419999f, 0.949999f, -0.070000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.709999f, 2.190000f, 1.629999f }, { 0.000000f, -0.340000f, 0.419999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.680000f, -0.270000f }, { 0.000000f, -0.670000f, -0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.029999f, 9.029999f, 4.989999f }, { 0.460000f, 3.359999f, -0.300000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.069999f, 13.510000f, 3.720000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.009999f, -1.440000f, -0.949999f }, { 1.009999f, -2.730000f, -0.949999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.319999f, 5.469999f, 1.220000f }, { 0.529999f, -0.200000f, -0.319999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.059999f, -1.220000f, -0.039999f }, { 0.899999f, 1.299999f, -0.209999f }, { 0.879999f, -1.700000f, -0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.129999f, -50.000000f }, - { { 3.609999f, 14.569999f, 3.289999f }, { 0.500000f, 2.980000f, 0.819999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 5.139999f, 13.770000f, 9.289999f }, { 0.409999f, 1.570000f, 1.429999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 6.619999f, 19.049999f, 13.840000f }, { -0.560000f, 2.730000f, 3.109999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.319999f, 9.699999f, 3.630000f }, { 0.490000f, 1.169999f, 0.600000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.529999f, -0.009999f, -0.759999f }, { 1.289999f, 2.990000f, -0.800000f }, { 1.289999f, -2.990000f, -0.800000f }, { 1.289999f, -1.559999f, -0.800000f }, -0.560000f, -0.250000f }, - { { 3.230000f, 9.520000f, 4.980000f }, { 0.419999f, 1.389999f, 0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.790000f, -0.050000f, -0.610000f }, { 1.019999f, 2.559999f, -0.579999f }, { 1.129999f, -2.769999f, -0.579999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.239999f, -0.509999f }, - { { 1.830000f, 2.609999f, 2.720000f }, { 0.340000f, -0.270000f, 0.200000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.550000f, 0.970000f, -0.349999f }, { 0.550000f, -0.980000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -0.280000f }, - { { 2.410000f, 6.139999f, 1.470000f }, { 0.449999f, 0.140000f, -0.230000f }, { 0.430000f, -1.019999f, -0.219999f }, { -1.110000f, -2.049999f, -0.109999f }, { 0.939999f, 1.700000f, -0.439999f }, { 0.939999f, -1.720000f, -0.439999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.239999f, -0.239999f }, - { { 2.299999f, 5.719999f, 2.230000f }, { 0.490000f, 0.779999f, 0.059999f }, { 0.670000f, -1.740000f, 0.000000f }, { -1.049999f, -2.289999f, 0.219999f }, { 0.879999f, 1.799999f, -0.639999f }, { 0.920000f, -1.850000f, -0.639999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.319999f, -0.319999f }, - { { 10.850000f, 13.550000f, 4.440000f }, { 0.319999f, 0.280000f, -0.039999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.699999f, 2.460000f, 1.679999f }, { 0.000000f, -0.400000f, 0.469999f }, { 0.000000f, -0.850000f, 0.600000f }, { 0.000000f, 0.140000f, 0.540000f }, { 0.000000f, 0.709999f, -0.180000f }, { 0.000000f, -0.889999f, -0.180000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.709999f, 2.190000f, 1.629999f }, { 0.000000f, -0.340000f, 0.419999f }, { 0.000000f, -0.620000f, 0.379999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.680000f, -0.270000f }, { 0.000000f, -0.670000f, -0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.699999f, 2.420000f, 1.340000f }, { 0.000000f, -0.409999f, 0.150000f }, { 0.000000f, -0.839999f, 0.340000f }, { 0.000000f, 0.170000f, 0.469999f }, { 0.000000f, 0.920000f, -0.180000f }, { 0.000000f, -0.920000f, -0.180000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 1.580000f, 1.549999f, 1.149999f }, { 0.000000f, 0.000000f, -0.360000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.400000f, 0.219999f, -0.280000f }, { 0.100000f, -0.750000f, -0.059999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.870000f, 1.409999f, 1.019999f }, { 0.000000f, 0.000000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.300000f, 0.500000f, -0.250000f }, { 0.300000f, -0.349999f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.529999f, 6.170000f, 1.649999f }, { 0.500000f, 0.150000f, -0.140000f }, { 0.460000f, -0.769999f, -0.140000f }, { 0.000000f, -3.000000f, -0.129999f }, { 0.920000f, 1.789999f, -0.349999f }, { 0.920000f, -1.779999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.289999f, -0.310000f }, - { { 2.529999f, 6.360000f, 1.669999f }, { 0.460000f, 0.109999f, -0.140000f }, { 0.460000f, -0.870000f, -0.159999f }, { -1.070000f, -2.299999f, 0.119999f }, { 0.899999f, 1.799999f, -0.349999f }, { 0.899999f, -1.779999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.319999f, -0.319999f }, - { { 0.709999f, 2.230000f, 1.419999f }, { 0.000000f, -0.200000f, 0.400000f }, { 0.000000f, -0.529999f, 0.419999f }, { 0.000000f, 0.009999f, 0.409999f }, { 0.000000f, 0.819999f, -0.259999f }, { 0.000000f, -0.750000f, -0.289999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.420000f, 14.800000f, 3.150000f }, { 0.419999f, 0.949999f, -0.070000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.660000f, 5.480000f, 2.099999f }, { 0.529999f, -0.039999f, 0.090000f }, { 0.479999f, -0.959999f, 0.090000f }, { -1.259999f, -2.380000f, 0.239999f }, { 1.029999f, 1.649999f, -0.310000f }, { 1.029999f, -1.889999f, -0.310000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.289999f, -0.100000f }, - { { 1.419999f, 2.000000f, 1.710000f }, { 0.000000f, -0.349999f, 0.389999f }, { 0.000000f, -0.670000f, 0.389999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.409999f, 0.610000f, -0.129999f }, { 0.409999f, -0.610000f, -0.129999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.670000f, 9.340000f, 4.869999f }, { -0.200000f, -0.159999f, 1.070000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.900000f, 5.400000f, 2.220000f }, { 0.000000f, 0.579999f, 0.889999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.430000f, 6.030000f, 1.690000f }, { 0.490000f, -0.300000f, -0.140000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.949999f, 1.809999f, -0.349999f }, { 0.949999f, -1.809999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.469999f, -0.400000f }, - { { 2.450000f, 5.780000f, 1.480000f }, { 0.419999f, -0.129999f, -0.200000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.070000f, -1.600000f, 0.129999f }, { 0.920000f, 1.539999f, -0.349999f }, { 0.930000f, -1.549999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.300000f, -0.239999f }, - { { 11.029999f, 11.289999f, 3.289999f }, { 0.000000f, -0.449999f, -0.319999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.670000f, 5.929999f, 1.399999f }, { 0.550000f, -0.250000f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.200000f, -1.529999f, 0.239999f }, { 1.019999f, 1.700000f, -0.319999f }, { 1.019999f, -1.620000f, -0.319999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -0.079999f }, - { { 2.450000f, 5.570000f, 1.740000f }, { 0.439999f, 0.090000f, -0.059999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.090000f, -0.340000f, 0.230000f }, { 0.870000f, 1.490000f, -0.550000f }, { 0.870000f, -1.620000f, -0.550000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.379999f, -0.379999f }, - { { 2.250000f, 6.150000f, 1.990000f }, { 0.490000f, -0.070000f, 0.000000f }, { 0.469999f, -1.080000f, 0.039999f }, { -1.090000f, -1.970000f, 0.029999f }, { 0.910000f, 1.700000f, -0.379999f }, { 0.910000f, -1.590000f, -0.379999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.270000f, -0.270000f }, - { { 2.269999f, 5.260000f, 1.419999f }, { 0.409999f, -0.280000f, -0.150000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.000000f, -0.879999f, 0.100000f }, { 0.910000f, 1.330000f, -0.349999f }, { 0.910000f, -1.330000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.330000f }, - { { 0.709999f, 1.879999f, 1.320000f }, { -0.009999f, -0.340000f, 0.430000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.550000f, -0.239999f }, { 0.000000f, -0.589999f, -0.239999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.339999f, 5.699999f, 1.870000f }, { 0.469999f, 0.529999f, -0.129999f }, { 0.529999f, -1.570000f, -0.150000f }, { 1.070000f, -2.190000f, 0.000000f }, { 0.879999f, 1.779999f, -0.649999f }, { 0.879999f, -1.789999f, -0.649999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.509999f, -0.600000f }, - { { 2.049999f, 6.190000f, 2.109999f }, { 0.379999f, 1.649999f, -0.180000f }, { 0.300000f, 0.059999f, -0.209999f }, { 0.930000f, -2.509999f, -0.039999f }, { 0.790000f, 1.700000f, -0.670000f }, { 0.779999f, -2.059999f, -0.670000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.740000f, -0.720000f }, - { { 5.349999f, 26.200000f, 7.159999f }, { 0.000000f, -5.010000f, 1.740000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 1.970000f, 4.070000f, 1.440000f }, { 0.150000f, -0.449999f, 0.370000f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.889999f, 0.720000f, 0.019999f }, { 0.629999f, 1.320000f, -0.300000f }, { 0.629999f, -0.990000f, -0.300000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.250000f, -0.250000f }, - { { 4.340000f, 7.840000f, 4.449999f }, { 0.000000f, -0.389999f, 1.129999f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.699999f, -3.170000f, 0.579999f }, { 1.240000f, 1.679999f, -0.349999f }, { 1.240000f, -1.679999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.329999f, 15.039999f, 4.670000f }, { 0.460000f, 1.620000f, -0.090000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.329999f, 12.609999f, 4.650000f }, { 0.449999f, 0.730000f, -0.090000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.539999f, 5.699999f, 2.140000f }, { 0.500000f, -0.090000f, 0.059999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.159999f, -0.740000f, 0.000000f }, { 1.029999f, 1.720000f, -0.660000f }, { 1.029999f, -1.470000f, -0.660000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.379999f, -0.340000f }, - { { 2.920000f, 6.929999f, 2.140000f }, { 0.529999f, 0.460000f, 0.059999f }, { 0.529999f, -0.620000f, 0.059999f }, { 1.370000f, -1.250000f, 0.000000f }, { 1.029999f, 2.289999f, -0.660000f }, { 1.029999f, -1.929999f, -0.660000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.379999f, -0.340000f }, - { { 2.309999f, 6.329999f, 1.289999f }, { 0.430000f, -0.280000f, -0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.070000f, -2.180000f, 0.000000f }, { 0.829999f, 1.570000f, -0.419999f }, { 0.829999f, -1.570000f, -0.419999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.230000f, -0.239999f }, - { { 2.349999f, 6.179999f, 1.789999f }, { 0.460000f, 0.140000f, -0.100000f }, { 0.460000f, -0.910000f, -0.100000f }, { -0.980000f, -2.240000f, 0.119999f }, { 0.930000f, 1.710000f, -0.349999f }, { 0.920000f, -1.700000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.300000f, -0.289999f }, - { { 4.769999f, 17.829999f, 3.849999f }, { -0.670000f, 0.600000f, 0.899999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.250000f, 6.489999f, 1.500000f }, { 0.479999f, -0.289999f, -0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.019999f, -2.200000f, 0.119999f }, { 0.829999f, 1.450000f, -0.400000f }, { 0.829999f, -1.779999f, -0.400000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.289999f }, - { { 2.779999f, 5.449999f, 1.990000f }, { 0.490000f, 0.000000f, -0.079999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.210000f, -1.909999f, -0.100000f }, { 1.139999f, 1.679999f, -0.759999f }, { 1.139999f, -1.309999f, -0.759999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.430000f, -0.430000f }, - { { 2.279999f, 4.750000f, 1.789999f }, { 0.479999f, -0.250000f, -0.119999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.059999f, -1.860000f, 0.150000f }, { 0.899999f, 1.440000f, -0.319999f }, { 0.899999f, -1.389999f, -0.319999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.050000f, -0.059999f }, - { { 2.329999f, 15.039999f, 4.659999f }, { 0.460000f, 1.620000f, -0.109999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.900000f, 6.599999f, 4.280000f }, { 0.730000f, 1.379999f, 0.300000f }, { 0.600000f, -2.460000f, 0.039999f }, { -1.299999f, -0.009999f, 0.090000f }, { 1.090000f, 2.410000f, -0.579999f }, { 0.990000f, -1.740000f, -0.579999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.469999f, -0.560000f }, - { { 2.640000f, 7.199999f, 3.750000f }, { 0.449999f, 0.209999f, -0.009999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.110000f, -1.070000f, -0.349999f }, { 0.860000f, 1.700000f, -0.550000f }, { 0.860000f, -2.130000f, -0.550000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.330000f, -0.259999f }, - { { 2.289999f, 5.010000f, 1.850000f }, { 0.449999f, -0.239999f, -0.059999f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.980000f, -1.710000f, -0.070000f }, { 0.870000f, 1.590000f, -0.620000f }, { 0.870000f, -1.169999f, -0.620000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.349999f, -0.330000f }, - { { 0.870000f, 1.409999f, 1.019999f }, { 0.000000f, 0.000000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.300000f, 0.500000f, -0.250000f }, { 0.300000f, -0.349999f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.349999f, 5.969999f, 1.519999f }, { 0.419999f, -0.119999f, -0.280000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.080000f, -1.879999f, 0.140000f }, { 0.870000f, 1.620000f, -0.400000f }, { 0.870000f, -1.490000f, -0.400000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.100000f }, - { { 2.210000f, 6.139999f, 1.629999f }, { 0.409999f, -0.289999f, -0.289999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.100000f, -2.049999f, 0.029999f }, { 0.870000f, 1.450000f, -0.400000f }, { 0.870000f, -1.649999f, -0.400000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.250000f }, - { { 2.529999f, 6.039999f, 1.649999f }, { 0.460000f, 0.180000f, -0.140000f }, { 0.460000f, -0.769999f, -0.140000f }, { -1.159999f, -1.830000f, 0.109999f }, { 0.920000f, 1.789999f, -0.349999f }, { 0.920000f, -1.779999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.289999f, -0.310000f }, - { { 2.539999f, 5.699999f, 2.140000f }, { 0.500000f, -0.090000f, 0.059999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.159999f, -0.740000f, 0.000000f }, { 1.029999f, 1.720000f, -0.660000f }, { 1.029999f, -1.470000f, -0.660000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.379999f, -0.340000f }, - { { 2.250000f, 5.219999f, 1.169999f }, { 0.469999f, -0.340000f, -0.259999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.049999f, -1.110000f, -0.050000f }, { 0.889999f, 1.220000f, -0.340000f }, { 0.889999f, -1.659999f, -0.340000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.189999f, -0.180000f }, - { { 2.569999f, 6.590000f, 1.620000f }, { 0.540000f, 0.050000f, -0.250000f }, { 0.540000f, -1.149999f, -0.259999f }, { -1.169999f, -2.299999f, 0.109999f }, { 1.039999f, 1.799999f, -0.449999f }, { 1.039999f, -1.809999f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.409999f, -0.409999f }, - { { 2.960000f, 8.050000f, 3.339999f }, { 0.540000f, 1.419999f, -0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.379999f, -3.049999f, -0.670000f }, { 0.990000f, 2.289999f, -0.899999f }, { 1.220000f, -2.289999f, -0.899999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.879999f, -0.870000f }, - { { 0.709999f, 1.899999f, 1.320000f }, { 0.000000f, -0.479999f, 0.460000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.639999f, -0.239999f }, { 0.000000f, -0.589999f, -0.189999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.720000f, 1.740000f, 1.120000f }, { 0.000000f, -0.270000f, 0.540000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.600000f, -0.259999f }, { 0.000000f, -0.569999f, -0.259999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 21.219999f, 21.190000f, 5.059999f }, { 0.419999f, 2.009999f, -0.819999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 11.159999f, 6.159999f, 2.990000f }, { 0.000000f, -0.219999f, -0.100000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 8.699999f, 9.000000f, 2.230000f }, { 0.000000f, -0.910000f, -0.439999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.190000f, 10.069999f, 3.059999f }, { 0.449999f, 1.600000f, 0.189999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.429999f, 0.379999f, -0.649999f }, { 1.230000f, 3.529999f, -0.949999f }, { 1.230000f, -4.429999f, -0.949999f }, { 1.230000f, -3.269999f, -0.949999f }, -0.860000f, -50.000000f }, - { { 3.549999f, 9.949999f, 3.420000f }, { 0.560000f, 1.340000f, 0.090000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.450000f, 0.479999f, -1.309999f }, { 1.440000f, 3.490000f, -1.389999f }, { 1.440000f, -4.079999f, -1.389999f }, { 1.440000f, -2.640000f, -1.389999f }, -1.159999f, -50.000000f }, - { { 2.599999f, 6.239999f, 1.710000f }, { 0.469999f, 0.070000f, -0.150000f }, { 0.490000f, -0.990000f, -0.129999f }, { -1.100000f, -2.450000f, -0.029999f }, { 0.910000f, 1.669999f, -0.419999f }, { 0.910000f, -1.600000f, -0.419999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.170000f, -0.170000f }, - { { 2.529999f, 6.329999f, 1.649999f }, { 0.509999f, -0.019999f, -0.180000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.179999f, -1.950000f, 0.070000f }, { 0.920000f, 1.679999f, -0.409999f }, { 0.920000f, -1.480000f, -0.409999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.310000f, -0.219999f }, - { { 2.430000f, 6.000000f, 1.570000f }, { 0.509999f, 0.070000f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.210000f, -2.190000f, -0.070000f }, { 0.939999f, 1.809999f, -0.259999f }, { 0.980000f, -1.460000f, -0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.330000f, -0.230000f }, - { { 20.309999f, 19.290000f, 6.940000f }, { 0.349999f, 5.179999f, -0.119999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 8.750000f, 14.319999f, 2.160000f }, { 0.000000f, 2.839999f, 0.090000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.699999f, 2.460000f, 1.679999f }, { 0.000000f, -0.400000f, 0.469999f }, { 0.000000f, -0.850000f, 0.600000f }, { 0.000000f, 0.129999f, 0.610000f }, { 0.000000f, 0.759999f, -0.159999f }, { 0.000000f, -0.850000f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.699999f, 2.460000f, 1.679999f }, { 0.000000f, -0.400000f, 0.469999f }, { 0.000000f, -0.850000f, 0.629999f }, { 0.000000f, 0.140000f, 0.610000f }, { 0.000000f, 0.759999f, -0.159999f }, { 0.000000f, -0.879999f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.699999f, 2.470000f, 1.679999f }, { 0.000000f, -0.400000f, 0.469999f }, { 0.000000f, -0.680000f, 0.550000f }, { 0.000000f, 0.150000f, 0.550000f }, { 0.000000f, 0.759999f, -0.159999f }, { 0.000000f, -0.850000f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.589999f, 8.840000f, 3.640000f }, { 0.490000f, 1.450000f, -0.140000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.529999f, 0.479999f, -0.990000f }, { 1.279999f, 2.950000f, -1.240000f }, { 1.330000f, -2.980000f, -1.309999f }, { 1.330000f, -1.860000f, -1.309999f }, -1.000000f, -0.230000f }, - { { 3.049999f, 6.469999f, 3.289999f }, { 0.509999f, 0.259999f, 0.340000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.389999f, -0.509999f, -0.090000f }, { 1.029999f, 2.089999f, -0.379999f }, { 1.100000f, -2.099999f, -0.379999f }, { 0.000000f, 0.000000f, 0.000000f }, 0.050000f, -50.000000f }, - { { 2.200000f, 5.400000f, 1.259999f }, { 0.469999f, -0.079999f, -0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.990000f, -1.960000f, 0.059999f }, { 0.870000f, 1.490000f, -0.400000f }, { 0.879999f, -1.500000f, -0.400000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.379999f, -0.310000f }, - { { 2.430000f, 5.719999f, 1.740000f }, { 0.409999f, -0.019999f, -0.079999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.139999f, -1.690000f, 0.140000f }, { 0.910000f, 1.610000f, -0.349999f }, { 0.910000f, -1.340000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.079999f, -0.079999f }, - { { 2.549999f, 5.550000f, 2.140000f }, { 0.500000f, -0.140000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.090000f, -2.029999f, 0.119999f }, { 0.949999f, 1.740000f, -0.610000f }, { 0.949999f, -1.539999f, -0.610000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.490000f, -0.389999f }, - { { 2.380000f, 5.630000f, 1.860000f }, { 0.490000f, -0.079999f, -0.039999f }, { 0.490000f, -1.039999f, -0.039999f }, { -1.200000f, -2.220000f, 0.200000f }, { 0.949999f, 1.450000f, -0.250000f }, { 0.949999f, -1.659999f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.019999f, -0.029999f }, - { { 1.580000f, 4.230000f, 2.680000f }, { 0.000000f, -0.319999f, 0.389999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.490000f, 0.569999f, -0.379999f }, { 0.509999f, -0.709999f, -0.419999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 1.960000f, 3.700000f, 1.669999f }, { 0.000000f, -0.460000f, 0.070000f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.009999f, 0.819999f, 0.430000f }, { 0.829999f, 1.429999f, -0.620000f }, { 0.709999f, -1.070000f, -0.300000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 8.619999f, 11.390000f, 4.179999f }, { 1.009999f, 3.000000f, 0.589999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 2.880000f, 3.690000f, -1.710000f }, { 1.759999f, -1.669999f, -1.500000f }, { 1.820000f, 1.669999f, -1.149999f }, -50.000000f, -50.000000f }, - { { 2.380000f, 5.420000f, 1.490000f }, { 0.479999f, -0.239999f, -0.119999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.019999f, -1.960000f, 0.140000f }, { 0.889999f, 1.570000f, -0.349999f }, { 0.889999f, -1.570000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.239999f, -0.239999f }, - { { 2.180000f, 6.269999f, 1.159999f }, { 0.589999f, 0.029999f, -0.280000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.039999f, -0.819999f, -0.200000f }, { 0.930000f, 1.860000f, -0.270000f }, { 0.930000f, -1.529999f, -0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.400000f, -0.330000f }, - { { 2.670000f, 5.480000f, 1.580000f }, { 0.419999f, 0.009999f, -0.150000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.200000f, -0.560000f, 0.270000f }, { 0.970000f, 1.590000f, -0.330000f }, { 0.970000f, -1.620000f, -0.330000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.370000f, -50.000000f }, - { { 2.460000f, 6.420000f, 1.299999f }, { 0.519999f, -0.219999f, -0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.070000f, -1.690000f, 0.090000f }, { 0.899999f, 1.750000f, -0.349999f }, { 0.899999f, -1.730000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.340000f, -0.370000f }, - { { 3.329999f, 18.430000f, 5.199999f }, { 0.460000f, 5.130000f, 0.529999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.269999f, 16.590000f, 4.949999f }, { 0.709999f, 5.989999f, 0.370000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.500000f, 3.869999f, 2.559999f }, { 0.000000f, 0.349999f, 0.109999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.589999f, 6.070000f, 1.500000f }, { 0.519999f, -0.059999f, -0.259999f }, { 0.550000f, -1.350000f, -0.259999f }, { -1.169999f, -2.519999f, -0.019999f }, { 1.000000f, 1.799999f, -0.469999f }, { 1.000000f, -1.899999f, -0.469999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.209999f, -0.209999f }, - { { 2.269999f, 4.949999f, 1.240000f }, { 0.479999f, -0.119999f, -0.209999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.009999f, -1.990000f, 0.150000f }, { 0.899999f, 1.500000f, -0.250000f }, { 0.899999f, -1.500000f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.300000f, -0.239999f }, - { { 2.480000f, 6.400000f, 1.700000f }, { 0.509999f, -0.150000f, -0.119999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.120000f, -1.919999f, 0.310000f }, { 0.889999f, 1.620000f, -0.370000f }, { 0.889999f, -1.580000f, -0.370000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.129999f, 0.059999f }, - { { 2.380000f, 5.730000f, 1.860000f }, { 0.449999f, 0.090000f, -0.050000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.100000f, -0.949999f, 0.000000f }, { 0.930000f, 1.580000f, -0.449999f }, { 0.930000f, -1.580000f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.389999f, -0.330000f }, - { { 2.809999f, 12.859999f, 3.890000f }, { 0.600000f, 2.509999f, 0.289999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.299999f, 2.069999f, 0.319999f }, { 1.049999f, 2.450000f, -0.699999f }, { 1.049999f, -2.049999f, -0.699999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.620000f, -50.000000f }, - { { 2.190000f, 4.809999f, 1.690000f }, { 0.330000f, -0.340000f, -0.170000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, -2.220000f, -0.319999f }, { 0.850000f, 1.419999f, -0.449999f }, { 0.850000f, -1.419999f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.529999f, -0.529999f }, - { { 2.569999f, 5.860000f, 1.669999f }, { 0.569999f, -0.159999f, -0.140000f }, { 0.509999f, -1.159999f, -0.109999f }, { 1.090000f, -2.029999f, 0.150000f }, { 0.990000f, 1.629999f, -0.340000f }, { 0.970000f, -1.919999f, -0.340000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.070000f, -0.050000f }, - { { 2.490000f, 5.840000f, 1.769999f }, { 0.519999f, 0.000000f, -0.059999f }, { 0.519999f, -1.000000f, -0.059999f }, { -1.169999f, -2.009999f, 0.119999f }, { 0.920000f, 1.610000f, -0.349999f }, { 0.920000f, -1.480000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.079999f, -0.070000f }, - { { 4.179999f, 24.420000f, 4.909999f }, { 0.649999f, 4.570000f, -0.810000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.200000f, 5.389999f, -2.430000f }, { 1.669999f, -1.500000f, -2.430000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.400000f, 5.530000f, 1.429999f }, { 0.469999f, 0.250000f, -0.150000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.080000f, -1.179999f, 0.219999f }, { 0.970000f, 1.740000f, -0.360000f }, { 0.970000f, -1.460000f, -0.360000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.129999f, -0.119999f }, - { { 2.539999f, 5.889999f, 1.539999f }, { 0.519999f, 0.050000f, -0.189999f }, { 0.519999f, -0.920000f, -0.230000f }, { -1.070000f, -2.490000f, 0.039999f }, { 0.980000f, 1.679999f, -0.419999f }, { 0.980000f, -1.870000f, -0.419999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.289999f }, - { { 2.660000f, 6.719999f, 1.769999f }, { 0.490000f, 0.109999f, -0.129999f }, { 0.490000f, -1.059999f, -0.109999f }, { -1.149999f, -2.670000f, 0.090000f }, { 0.939999f, 1.830000f, -0.419999f }, { 0.939999f, -1.769999f, -0.430000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.150000f, -0.140000f }, - { { 2.650000f, 6.719999f, 3.559999f }, { 0.620000f, 0.639999f, 0.330000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.289999f, -0.959999f, 0.490000f }, { 1.039999f, 2.259999f, -0.180000f }, { 1.039999f, -1.429999f, -0.180000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.029999f, -50.000000f }, - { { 28.739999f, 23.489999f, 7.389999f }, { 0.430000f, 9.529999f, -0.100000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.680000f, 6.170000f, 2.089999f }, { 0.540000f, 0.100000f, -0.029999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.210000f, -2.390000f, 0.119999f }, { 1.100000f, 1.679999f, -0.569999f }, { 1.100000f, -1.700000f, -0.569999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.340000f, -0.360000f }, - { { 2.000000f, 5.130000f, 1.419999f }, { 0.439999f, -0.170000f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.790000f, -1.500000f, 0.180000f }, { 0.759999f, 1.529999f, -0.330000f }, { 0.720000f, -1.539999f, -0.330000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.660000f, 6.369999f, 3.289999f }, { 0.540000f, 0.100000f, 0.639999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.389999f, 1.710000f, -0.449999f }, { 1.389999f, -1.710000f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, 0.270000f, 0.270000f }, - { { 3.660000f, 6.260000f, 3.289999f }, { 0.540000f, 0.000000f, 0.629999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.190000f, -2.569999f, 0.850000f }, { 1.389999f, 1.669999f, -0.449999f }, { 1.389999f, -1.659999f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, 0.270000f, 0.250000f }, - { { 2.230000f, 5.250000f, 1.750000f }, { 0.540000f, -0.239999f, -0.019999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.090000f, -1.940000f, 0.270000f }, { 0.889999f, 1.350000f, -0.250000f }, { 0.889999f, -1.519999f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, 0.050000f, 0.039999f }, - { { 2.279999f, 5.480000f, 1.399999f }, { 0.479999f, -0.189999f, -0.200000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.080000f, -1.710000f, 0.270000f }, { 0.939999f, 1.460000f, -0.250000f }, { 0.930000f, -1.460000f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.100000f, 0.009999f }, - { { 2.319999f, 5.400000f, 1.620000f }, { 0.479999f, 0.109999f, -0.079999f }, { 0.509999f, -0.750000f, -0.090000f }, { 1.139999f, -1.899999f, 0.129999f }, { 0.949999f, 1.549999f, -0.250000f }, { 0.949999f, -1.450000f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, 0.019999f, 0.029999f }, - { { 2.500000f, 5.800000f, 1.789999f }, { 0.519999f, 0.090000f, -0.129999f }, { 0.519999f, -0.819999f, -0.129999f }, { 1.110000f, -2.299999f, 0.109999f }, { 0.930000f, 1.710000f, -0.409999f }, { 0.910000f, -1.409999f, -0.409999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.180000f, -0.189999f }, - { { 2.259999f, 5.309999f, 1.509999f }, { 0.509999f, -0.050000f, -0.140000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.039999f, -0.699999f, 0.070000f }, { 0.899999f, 1.549999f, -0.310000f }, { 0.910000f, -1.299999f, -0.310000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.050000f, -0.019999f }, - { { 3.390000f, 18.620000f, 4.710000f }, { 0.419999f, 2.640000f, -0.340000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.870000f, 1.409999f, 1.019999f }, { 0.059999f, -0.070000f, 0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.259999f, 0.400000f, 0.029999f }, { 0.259999f, -0.400000f, 0.029999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.029999f, 4.820000f, 1.500000f }, { 0.479999f, -0.059999f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.910000f, -0.870000f, 0.029999f }, { 0.829999f, 1.389999f, -0.270000f }, { 0.829999f, -1.389999f, -0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.070000f, -0.059999f }, - { { 2.509999f, 6.460000f, 1.659999f }, { 0.540000f, 0.090000f, -0.170000f }, { 0.540000f, -1.059999f, -0.180000f }, { 1.080000f, -2.440000f, 0.019999f }, { 0.980000f, 1.710000f, -0.349999f }, { 0.980000f, -1.710000f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.250000f, -0.270000f }, - { { 2.710000f, 6.630000f, 1.580000f }, { 0.509999f, 0.250000f, -0.270000f }, { 0.509999f, -1.000000f, -0.270000f }, { 0.000000f, -2.859999f, -0.460000f }, { 1.000000f, 2.069999f, -0.479999f }, { 1.000000f, -1.480000f, -0.479999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.430000f, -0.449999f }, - { { 2.710000f, 4.610000f, 1.419999f }, { 0.000000f, -0.029999f, -0.189999f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.500000f, -0.660000f, 0.379999f }, { 0.850000f, 1.750000f, -0.500000f }, { 0.870000f, -0.910000f, -0.430000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.259999f, 18.430000f, 5.030000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.470000f, 21.069999f, 5.190000f }, { 0.000000f, 1.960000f, -1.129999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 1.570000f, 2.329999f, 1.580000f }, { 0.000000f, -0.180000f, -0.100000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.189999f, 0.019999f }, { 0.519999f, 0.569999f, -0.159999f }, { 0.550000f, -0.629999f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.170000f, -50.000000f }, - { { 1.659999f, 2.349999f, 2.019999f }, { 0.000000f, -0.620000f, 0.310000f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.379999f, -0.970000f, 0.159999f }, { 0.479999f, 0.689999f, -0.349999f }, { 0.479999f, -0.689999f, -0.289999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.930000f, 7.380000f, 3.160000f }, { 0.560000f, 2.029999f, 0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.179999f, 0.479999f, -0.479999f }, { 1.049999f, 1.769999f, -0.930000f }, { 0.959999f, -1.759999f, -0.930000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.629999f, -0.730000f }, - { { 1.620000f, 3.849999f, 2.500000f }, { 0.230000f, 0.550000f, 0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.750000f, -0.970000f, 0.280000f }, { 0.569999f, 0.800000f, -0.439999f }, { 0.569999f, -0.800000f, -0.439999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.300000f, -0.300000f }, - { { 2.490000f, 5.829999f, 1.929999f }, { 0.500000f, 0.059999f, 0.009999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, -2.779999f, -0.050000f }, { 0.920000f, 1.710000f, -0.250000f }, { 0.920000f, -1.710000f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.209999f }, - { { 2.420000f, 6.360000f, 1.850000f }, { 0.469999f, -0.159999f, -0.090000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, -3.160000f, -0.250000f }, { 0.930000f, 1.710000f, -0.250000f }, { 0.920000f, -1.710000f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.310000f, -0.270000f }, - { { 62.490001f, 61.439998f, 34.950000f }, { 1.289999f, 21.059999f, 4.119999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.150000f, 11.789999f, 2.779999f }, { 0.469999f, 3.430000f, 0.059999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.240000f, 2.910000f, -0.019999f }, { 1.250000f, 3.000000f, -1.000000f }, { 1.250000f, -3.980000f, -1.000000f }, { 1.250000f, -2.750000f, -1.000000f }, -0.860000f, -50.000000f }, - { { 2.470000f, 6.210000f, 2.559999f }, { 0.460000f, -0.159999f, 0.219999f }, { 0.430000f, -1.230000f, 0.239999f }, { 1.220000f, -2.299999f, 0.170000f }, { 0.959999f, 1.580000f, -0.439999f }, { 0.959999f, -1.580000f, -0.439999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.180000f, -0.180000f }, - { { 2.660000f, 5.769999f, 2.240000f }, { 0.540000f, -0.009999f, 0.059999f }, { 0.430000f, -0.910000f, 0.050000f }, { 1.190000f, -1.820000f, 0.239999f }, { 1.080000f, 1.779999f, -0.300000f }, { 1.080000f, -1.779999f, -0.300000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.349999f, -0.259999f }, - { { 0.699999f, 2.460000f, 1.679999f }, { 0.000000f, -0.400000f, 0.469999f }, { 0.000000f, -0.850000f, 0.600000f }, { 0.000000f, 0.129999f, 0.540000f }, { 0.000000f, 0.759999f, -0.159999f }, { 0.000000f, -0.819999f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.440000f, 7.219999f, 3.190000f }, { 0.419999f, 0.560000f, -0.039999f }, { 0.550000f, -2.490000f, -0.079999f }, { -1.059999f, 0.140000f, -0.280000f }, { 0.899999f, 1.860000f, -0.620000f }, { 0.899999f, -2.069999f, -0.620000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.449999f, -0.460000f }, - { { 1.669999f, 3.660000f, 3.210000f }, { 0.000000f, -1.009999f, 0.610000f }, { 0.000000f, 0.000000f, 0.000000f }, { -0.759999f, 0.409999f, -0.059999f }, { 0.629999f, 1.129999f, -0.219999f }, { 0.620000f, -1.120000f, -0.140000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.029999f, -50.000000f }, - { { 3.549999f, 15.909999f, 3.400000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.129999f, -2.640000f, -1.450000f }, { 1.129999f, -3.779999f, -1.450000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.440000f, 6.530000f, 2.059999f }, { 0.469999f, 0.000000f, 0.070000f }, { 0.430000f, -1.049999f, 0.050000f }, { 1.139999f, -2.299999f, 0.200000f }, { 1.009999f, 1.799999f, -0.230000f }, { 1.009999f, -1.799999f, -0.230000f }, { 0.000000f, 0.000000f, 0.000000f }, 0.019999f, 0.070000f }, - { { 0.699999f, 2.799999f, 1.960000f }, { 0.000000f, -0.419999f, 0.379999f }, { 0.000000f, -0.769999f, 0.490000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.850000f, -0.159999f }, { 0.000000f, -0.839999f, -0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.609999f, 5.760000f, 1.450000f }, { 0.519999f, -0.239999f, -0.230000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.230000f, -1.220000f, 0.100000f }, { 0.980000f, 1.480000f, -0.360000f }, { 0.980000f, -1.620000f, -0.360000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.150000f, -0.059999f }, - { { 3.079999f, 8.619999f, 7.530000f }, { 0.699999f, 2.289999f, 0.469999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.460000f, -2.160000f, 0.219999f }, { 1.289999f, 2.130000f, -0.469999f }, { 1.289999f, -2.119999f, -0.469999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.560000f, -0.560000f }, - { { 2.259999f, 5.090000f, 2.119999f }, { 0.419999f, -0.019999f, 0.050000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.980000f, -0.889999f, 0.119999f }, { 0.959999f, 1.639999f, -0.230000f }, { 0.959999f, -1.629999f, -0.230000f }, { 0.000000f, 0.000000f, 0.000000f }, 0.009999f, 0.009999f }, - { { 3.440000f, 18.399999f, 5.030000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.180000f, 13.630000f, 4.659999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.009999f, -1.440000f, -0.949999f }, { 1.009999f, -2.730000f, -0.949999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 44.450000f, 57.569999f, 18.430000f }, { 0.560000f, 12.510000f, -0.419999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 12.590000f, 13.550000f, 3.569999f }, { 0.319999f, 0.029999f, -0.070000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 0.500000f, 0.920000f, 0.300000f }, { 0.059999f, -0.070000f, 0.159999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.219999f, 0.150000f, 0.070000f }, { 0.219999f, -0.150000f, 0.070000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.849999f, 13.470000f, 2.210000f }, { 0.479999f, 0.899999f, -0.009999f }, { -0.019999f, -4.289999f, 0.469999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.410000f, 5.909999f, 1.769999f }, { 0.519999f, 0.059999f, -0.140000f }, { 0.519999f, -1.029999f, -0.109999f }, { -1.110000f, -2.160000f, 0.100000f }, { 0.920000f, 1.639999f, -0.349999f }, { 0.920000f, -1.639999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.319999f }, - { { 2.410000f, 5.909999f, 1.769999f }, { 0.519999f, 0.059999f, -0.140000f }, { 0.519999f, -1.029999f, -0.109999f }, { -1.100000f, -2.150000f, 0.100000f }, { 0.920000f, 1.639999f, -0.349999f }, { 0.920000f, -1.639999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.280000f, -0.319999f }, - { { 2.410000f, 5.789999f, 1.769999f }, { 0.519999f, 0.059999f, -0.059999f }, { 0.519999f, -1.029999f, -0.109999f }, { -1.080000f, -1.960000f, 0.159999f }, { 0.959999f, 1.639999f, -0.349999f }, { 0.959999f, -1.639999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.219999f, -0.200000f }, - { { 2.920000f, 6.159999f, 2.140000f }, { 0.500000f, -0.090000f, 0.059999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.159999f, -0.740000f, 0.000000f }, { 1.029999f, 1.720000f, -0.660000f }, { 1.029999f, -1.470000f, -0.660000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.379999f, -0.340000f }, - { { 2.400000f, 6.059999f, 1.559999f }, { 0.519999f, 0.059999f, -0.100000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.090000f, -2.029999f, 0.079999f }, { 0.959999f, 1.830000f, -0.340000f }, { 0.959999f, -1.409999f, -0.340000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.310000f, -0.310000f }, - { { 3.079999f, 6.960000f, 3.829999f }, { 0.529999f, -0.300000f, 0.419999f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.330000f, -1.690000f, 0.920000f }, { 0.930000f, 1.679999f, -0.070000f }, { 0.920000f, -1.669999f, -0.070000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.319999f, 5.539999f, 1.289999f }, { 0.479999f, -0.119999f, -0.219999f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.090000f, -1.990000f, 0.109999f }, { 0.930000f, 1.539999f, -0.400000f }, { 0.930000f, -1.529999f, -0.400000f }, { 0.000000f, 0.000000f, 0.000000f }, -0.419999f, -0.360000f }, - { { 2.640000f, 6.070000f, 1.429999f }, { 0.519999f, -0.419999f, -0.270000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.179999f, -2.190000f, -0.079999f }, { 1.019999f, 1.600000f, -0.409999f }, { 1.019999f, -1.580000f, -0.409999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.310000f, -0.259999f }, - { { 2.529999f, 6.170000f, 1.649999f }, { 0.500000f, 0.150000f, -0.140000f }, { 0.460000f, -0.769999f, -0.140000f }, { 0.000000f, -3.000000f, -0.129999f }, { 0.920000f, 1.789999f, -0.349999f }, { 0.920000f, -1.779999f, -0.349999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.289999f, -0.310000f }, - { { 2.380000f, 5.730000f, 1.860000f }, { 0.449999f, 0.090000f, -0.050000f }, { 0.000000f, 0.000000f, 0.000000f }, { -1.100000f, -0.949999f, 0.000000f }, { 0.930000f, 1.580000f, -0.449999f }, { 0.930000f, -1.580000f, -0.449999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.389999f, -0.330000f }, - { { 2.930000f, 3.380000f, 1.970000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.639999f, 1.169999f, -0.689999f }, { 0.639999f, -1.169999f, -0.689999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 3.019999f, 3.259999f, 1.600000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.639999f, 1.190000f, -0.699999f }, { 0.639999f, -1.000000f, -0.699999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 1.450000f, 4.650000f, 6.360000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.740000f, 1.240000f, -1.169999f }, { 0.740000f, -1.269999f, -1.169999f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.900000f, 6.599999f, 4.219999f }, { 0.730000f, 1.379999f, 0.300000f }, { 0.600000f, -2.460000f, 0.039999f }, { -1.299999f, 0.000000f, 0.100000f }, { 1.090000f, 2.410000f, -0.579999f }, { 0.990000f, -1.740000f, -0.579999f }, { 0.000000f, 0.000000f, 0.000000f }, -0.469999f, -0.560000f }, - { { 2.480000f, 1.429999f, 1.629999f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 1.139999f, -0.409999f, -0.140000f }, { 1.139999f, -0.720000f, -0.140000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f }, - { { 2.130000f, 3.160000f, 1.830000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.000000f, 0.000000f, 0.000000f }, { 0.930000f, 0.340000f, -0.250000f }, { 0.930000f, -0.379999f, -0.250000f }, { 0.000000f, 0.000000f, 0.000000f }, -50.000000f, -50.000000f } } }; - - model -= 400; - switch (type) - { - case VehicleModelInfo_Size: - { - out = allModelInfo[model].Size; - break; - } - case VehicleModelInfo_FrontSeat: - { - out = allModelInfo[model].FrontSeat; - break; - } - case VehicleModelInfo_RearSeat: - { - out = allModelInfo[model].RearSeat; - break; - } - case VehicleModelInfo_PetrolCap: - { - out = allModelInfo[model].PetrolCap; - break; - } - case VehicleModelInfo_WheelsFront: - { - out = allModelInfo[model].FrontWheel; - break; - } - case VehicleModelInfo_WheelsRear: - { - out = allModelInfo[model].RearWheel; - break; - } - case VehicleModelInfo_WheelsMid: - { - out = allModelInfo[model].MidWheel; - break; - } - case VehicleModelInfo_FrontBumperZ: - { - out.x = out.y = out.z = allModelInfo[model].FrontBumperZ; - break; - } - case VehicleModelInfo_RearBumperZ: - { - out.x = out.y = out.z = allModelInfo[model].RearBumperZ; - break; - } - default: - { - return false; - } - } - return true; -} - -} diff --git a/SDK/include/Server/Components/Vehicles/vehicle_seats.hpp b/SDK/include/Server/Components/Vehicles/vehicle_seats.hpp deleted file mode 100644 index 6336ef57e..000000000 --- a/SDK/include/Server/Components/Vehicles/vehicle_seats.hpp +++ /dev/null @@ -1,235 +0,0 @@ -#pragma once - -#include "vehicles.hpp" -#include - -namespace Impl -{ - -/// Returns 0xFF for invalid vehicles, and returns 0 for vehicles with only a driver. -inline uint8_t getVehiclePassengerSeats(int model) -{ - if (!isValidVehicleModel(model)) - { - return 255; - } - - static const StaticArray allSeats = { - 3, // 400 - landstal - 1, // 401 - bravura - 1, // 402 - buffalo - 1, // 403 - linerun - 3, // 404 - peren - 3, // 405 - sentinel - 0, // 406 - dumper - 1, // 407 - firetruk - 1, // 408 - trash - 3, // 409 - stretch - 1, // 410 - manana - 1, // 411 - infernus - 1, // 412 - voodoo - 3, // 413 - pony - 1, // 414 - mule - 1, // 415 - cheetah - 3, // 416 - ambulan - 1, // 417 - leviathn - 3, // 418 - moonbeam - 1, // 419 - esperant - 3, // 420 - taxi - 3, // 421 - washing - 1, // 422 - bobcat - 1, // 423 - mrwhoop - 1, // 424 - bfinject - 0, // 425 - hunter - 3, // 426 - premier - 3, // 427 - enforcer - 3, // 428 - securica - 1, // 429 - banshee - 0, // 430 - predator - 8, // 431 - bus - 0, // 432 - rhino - 1, // 433 - barracks - 1, // 434 - hotknife - 0, // 435 - artict1 - 1, // 436 - previon - 8, // 437 - coach - 3, // 438 - cabbie - 1, // 439 - stallion - 3, // 440 - rumpo - 0, // 441 - rcbandit - 1, // 442 - romero - 1, // 443 - packer - 1, // 444 - monster - 3, // 445 - admiral - 0, // 446 - squalo - 1, // 447 - seaspar - 0, // 448 - pizzaboy - 5, // 449 - tram - 0, // 450 - artict2 - 1, // 451 - turismo - 0, // 452 - speeder - 0, // 453 - reefer - 0, // 454 - tropic - 1, // 455 - flatbed - 1, // 456 - yankee - 1, // 457 - caddy - 3, // 458 - solair - 3, // 459 - topfun - 1, // 460 - skimmer - 1, // 461 - pcj600 - 1, // 462 - faggio - 1, // 463 - freeway - 1, // 464 - rcbaron - 1, // 465 - rcraider - 3, // 466 - glendale - 3, // 467 - oceanic - 1, // 468 - sanchez - 1, // 469 - sparrow - 3, // 470 - patriot - 1, // 471 - quad - 0, // 472 - coastg - 0, // 473 - dinghy - 1, // 474 - hermes - 1, // 475 - sabre - 0, // 476 - rustler - 1, // 477 - zr350 - 1, // 478 - walton - 3, // 479 - regina - 1, // 480 - comet - 0, // 481 - bmx - 3, // 482 - burrito - 2, // 483 - camper - 0, // 484 - marquis - 0, // 485 - baggage - 0, // 486 - dozer - 3, // 487 - maverick - 1, // 488 - vcnmav - 1, // 489 - rancher - 3, // 490 - fbiranch - 1, // 491 - virgo - 3, // 492 - greenwoo - 0, // 493 - jetmax - 1, // 494 - hotring - 1, // 495 - sandking - 1, // 496 - blistac - 3, // 497 - polmav - 3, // 498 - boxville - 1, // 499 - benson - 1, // 500 - mesa - 1, // 501 - rcgoblin - 1, // 502 - hotrina - 1, // 503 - hotrinb - 1, // 504 - bloodra - 1, // 505 - rnchlure - 1, // 506 - supergt - 3, // 507 - elegant - 1, // 508 - journey - 0, // 509 - bike - 0, // 510 - mtbike - 1, // 511 - beagle - 0, // 512 - cropdust - 0, // 513 - stunt - 1, // 514 - petro - 1, // 515 - rdtrain - 3, // 516 - nebula - 1, // 517 - majestic - 1, // 518 - buccanee - 0, // 519 - shamal - 0, // 520 - hydra - 1, // 521 - fcr900 - 1, // 522 - nrg500 - 1, // 523 - copbike - 1, // 524 - cement - 1, // 525 - towtruck - 1, // 526 - fortune - 1, // 527 - cadrona - 1, // 528 - fbitruck - 3, // 529 - willard - 0, // 530 - forklift - 0, // 531 - tractor - 0, // 532 - combine - 1, // 533 - feltzer - 1, // 534 - remingtn - 1, // 535 - slamvan - 1, // 536 - blade - 5, // 537 - freight - 5, // 538 - streak - 0, // 539 - vortex - 3, // 540 - vincent - 1, // 541 - bullet - 1, // 542 - clover - 1, // 543 - sadler - 1, // 544 - firela - 1, // 545 - hustler - 3, // 546 - intruder - 3, // 547 - primo - 1, // 548 - cargobob - 1, // 549 - tampa - 3, // 550 - sunrise - 3, // 551 - merit - 1, // 552 - utility - 0, // 553 - nevada - 1, // 554 - yosemite - 1, // 555 - windsor - 1, // 556 - monstera - 1, // 557 - monsterb - 1, // 558 - uranus - 1, // 559 - jester - 3, // 560 - sultan - 3, // 561 - stratum - 1, // 562 - elegy - 1, // 563 - raindanc - 0, // 564 - rctiger - 1, // 565 - flash - 3, // 566 - tahoma - 3, // 567 - savanna - 0, // 568 - bandito - 5, // 569 - freiflat - 5, // 570 - streakc - 0, // 571 - kart - 0, // 572 - mower - 1, // 573 - duneride - 0, // 574 - sweeper - 1, // 575 - broadway - 1, // 576 - tornado - 1, // 577 - at400 - 1, // 578 - dft30 - 3, // 579 - huntley - 3, // 580 - stafford - 1, // 581 - bf400 - 3, // 582 - newsvan - 0, // 583 - tug - 0, // 584 - petrotr - 3, // 585 - emperor - 1, // 586 - wayfarer - 1, // 587 - euros - 1, // 588 - hotdog - 1, // 589 - club - 5, // 590 - freibox - 0, // 591 - artict3 - 1, // 592 - androm - 1, // 593 - dodo - 1, // 594 - rccam - 0, // 595 - launch - 3, // 596 - copcarla - 3, // 597 - copcarsf - 3, // 598 - copcarvg - 1, // 599 - copcarru - 1, // 600 - picador - 1, // 601 - swatvan - 1, // 602 - alpha - 1, // 603 - phoenix - 3, // 604 - glenshit - 1, // 605 - sadlshit - 0, // 606 - bagboxa - 0, // 607 - bagboxb - 0, // 608 - tugstair - 3, // 609 - boxburg - 0, // 610 - farmtr1 - 0 // 611 - utiltr1 - }; - - return allSeats[model - 400]; -} - -} diff --git a/SDK/include/Server/Components/Vehicles/vehicles.hpp b/SDK/include/Server/Components/Vehicles/vehicles.hpp deleted file mode 100644 index 799b7a3df..000000000 --- a/SDK/include/Server/Components/Vehicles/vehicles.hpp +++ /dev/null @@ -1,477 +0,0 @@ -#pragma once - -#include -#include -#include - -struct IPlayer; - -struct VehicleSpawnData -{ - Seconds respawnDelay; - int modelID; - Vector3 position; - float zRotation; - int colour1; - int colour2; - bool siren; - int interior; -}; - -struct UnoccupiedVehicleUpdate -{ - uint8_t seat; - Vector3 position; - Vector3 velocity; -}; - -enum VehicleSCMEvent : uint32_t -{ - VehicleSCMEvent_SetPaintjob = 1, - VehicleSCMEvent_AddComponent, - VehicleSCMEvent_SetColour, - VehicleSCMEvent_EnterExitModShop -}; - -struct VehicleModelInfo -{ - Vector3 Size; - Vector3 FrontSeat; - Vector3 RearSeat; - Vector3 PetrolCap; - Vector3 FrontWheel; - Vector3 RearWheel; - Vector3 MidWheel; - float FrontBumperZ; - float RearBumperZ; -}; - -enum VehicleComponentSlot -{ - VehicleComponent_None = -1, - VehicleComponent_Spoiler = 0, - VehicleComponent_Hood = 1, - VehicleComponent_Roof = 2, - VehicleComponent_SideSkirt = 3, - VehicleComponent_Lamps = 4, - VehicleComponent_Nitro = 5, - VehicleComponent_Exhaust = 6, - VehicleComponent_Wheels = 7, - VehicleComponent_Stereo = 8, - VehicleComponent_Hydraulics = 9, - VehicleComponent_FrontBumper = 10, - VehicleComponent_RearBumper = 11, - VehicleComponent_VentRight = 12, - VehicleComponent_VentLeft = 13, - VehicleComponent_FrontBullbar = 14, - VehicleComponent_RearBullbar = 15, -}; - -enum VehicleVelocitySetType : uint8_t -{ - VehicleVelocitySet_Normal = 0, - VehicleVelocitySet_Angular -}; - -enum VehicleModelInfoType -{ - VehicleModelInfo_Size = 1, - VehicleModelInfo_FrontSeat, - VehicleModelInfo_RearSeat, - VehicleModelInfo_PetrolCap, - VehicleModelInfo_WheelsFront, - VehicleModelInfo_WheelsRear, - VehicleModelInfo_WheelsMid, - VehicleModelInfo_FrontBumperZ, - VehicleModelInfo_RearBumperZ -}; - -struct VehicleParams -{ - int8_t engine = -1; - int8_t lights = -1; - int8_t alarm = -1; - int8_t doors = -1; - int8_t bonnet = -1; - int8_t boot = -1; - int8_t objective = -1; - int8_t siren = -1; - int8_t doorDriver = -1; - int8_t doorPassenger = -1; - int8_t doorBackLeft = -1; - int8_t doorBackRight = -1; - int8_t windowDriver = -1; - int8_t windowPassenger = -1; - int8_t windowBackLeft = -1; - int8_t windowBackRight = -1; - - bool isSet() - { - return engine != -1 || lights != -1 || alarm != -1 || doors != -1 || bonnet != -1 || boot != -1 || objective != -1 || siren != -1 || doorDriver != -1 - || doorPassenger != -1 || doorBackLeft != -1 || doorBackRight != -1 || windowDriver != -1 || windowPassenger != -1 || windowBackLeft != -1 || windowBackRight != -1; - } - - void setZero() - { - engine = 0; - lights = 0; - alarm = 0; - doors = 0; - bonnet = 0; - boot = 0; - objective = 0; - siren = 0; - doorDriver = 0; - doorPassenger = 0; - doorBackLeft = 0; - doorBackRight = 0; - windowDriver = 0; - windowPassenger = 0; - windowBackLeft = 0; - windowBackRight = 0; - } -}; - -struct VehicleDriverSyncPacket -{ - int PlayerID; - uint16_t VehicleID; - uint16_t LeftRight; - uint16_t UpDown; - uint16_t Keys; - GTAQuat Rotation; - Vector3 Position; - Vector3 Velocity; - float Health; - Vector2 PlayerHealthArmour; - uint8_t Siren; - uint8_t LandingGear; - uint16_t TrailerID; - bool HasTrailer; - - union - { - uint8_t AdditionalKeyWeapon; - struct - { - uint8_t WeaponID : 6; - uint8_t AdditionalKey : 2; - }; - }; - - union - { - uint32_t HydraThrustAngle; - float TrainSpeed; - }; -}; - -struct VehiclePassengerSyncPacket -{ - int PlayerID; - int VehicleID; - - union - { - uint16_t DriveBySeatAdditionalKeyWeapon; - struct - { - uint8_t SeatID : 6; - uint8_t DriveBy : 1; - uint8_t Cuffed : 1; - uint8_t WeaponID : 6; - uint8_t AdditionalKey : 2; - }; - }; - uint16_t Keys; - - Vector2 HealthArmour; - uint16_t LeftRight; - uint16_t UpDown; - Vector3 Position; -}; - -struct VehicleUnoccupiedSyncPacket -{ - int VehicleID; - int PlayerID; - uint8_t SeatID; - Vector3 Roll; - Vector3 Rotation; - Vector3 Position; - Vector3 Velocity; - Vector3 AngularVelocity; - float Health; -}; - -struct VehicleTrailerSyncPacket -{ - int VehicleID; - int PlayerID; - Vector3 Position; - Vector4 Quat; - Vector3 Velocity; - Vector3 TurnVelocity; -}; - -/// A vehicle interface -struct IVehicle : public IExtensible, public IEntity -{ - - /// Set the inital spawn data of the vehicle - virtual void setSpawnData(const VehicleSpawnData& data) = 0; - - /// Get the initial spawn data of the vehicle - virtual const VehicleSpawnData& getSpawnData() = 0; - - /// Checks if player has the vehicle streamed in for themselves - virtual bool isStreamedInForPlayer(const IPlayer& player) const = 0; - - /// Streams in the vehicle for a specific player - virtual void streamInForPlayer(IPlayer& player) = 0; - - /// Streams out the vehicle for a specific player - virtual void streamOutForPlayer(IPlayer& player) = 0; - - /// Set the vehicle's colour - virtual void setColour(int col1, int col2) = 0; - - /// Get the vehicle's colour - virtual Pair getColour() const = 0; - - /// Set the vehicle's health - virtual void setHealth(float Health) = 0; - - /// Get the vehicle's health - virtual float getHealth() = 0; - - /// Update the vehicle from a sync packet - virtual bool updateFromDriverSync(const VehicleDriverSyncPacket& vehicleSync, IPlayer& player) = 0; - - /// Update the vehicle from a passenger sync packet - virtual bool updateFromPassengerSync(const VehiclePassengerSyncPacket& passengerSync, IPlayer& player) = 0; - - /// Update the vehicle from an unoccupied sync packet - virtual bool updateFromUnoccupied(const VehicleUnoccupiedSyncPacket& unoccupiedSync, IPlayer& player) = 0; - - /// Update the vehicle from a trailer sync packet - virtual bool updateFromTrailerSync(const VehicleTrailerSyncPacket& unoccupiedSync, IPlayer& player) = 0; - - /// Get the players which the vehicle is streamed for - virtual const FlatPtrHashSet& streamedForPlayers() const = 0; - - /// Returns the current driver of the vehicle - virtual IPlayer* getDriver() = 0; - - /// Returns the passengers of the vehicle - virtual const FlatHashSet& getPassengers() = 0; - - /// Sets the vehicle's number plate - virtual void setPlate(StringView plate) = 0; - - /// Get the vehicle's number plate - virtual const StringView getPlate() = 0; - - /// Sets the vehicle's damage status - virtual void setDamageStatus(int PanelStatus, int DoorStatus, uint8_t LightStatus, uint8_t TyreStatus, IPlayer* vehicleUpdater = nullptr) = 0; - - /// Gets the vehicle's damage status - virtual void getDamageStatus(int& PanelStatus, int& DoorStatus, int& LightStatus, int& TyreStatus) = 0; - - /// Sets the vehicle's paintjob - virtual void setPaintJob(int paintjob) = 0; - - /// Gets the vehicle's paintjob - virtual int getPaintJob() = 0; - - /// Adds a component to the vehicle. - virtual void addComponent(int component) = 0; - - /// Gets the vehicle's component in a designated slot - virtual int getComponentInSlot(int slot) = 0; - - /// Removes a vehicle's component. - virtual void removeComponent(int component) = 0; - - /// Puts the player inside this vehicle. - virtual void putPlayer(IPlayer& player, int SeatID) = 0; - - /// Set the vehicle's Z angle. - virtual void setZAngle(float angle) = 0; - - /// Gets the vehicle's Z angle. - virtual float getZAngle() = 0; - - // Set the vehicle's parameters. - virtual void setParams(const VehicleParams& params) = 0; - - // Set the vehicle's parameters for a specific player. - virtual void setParamsForPlayer(IPlayer& player, const VehicleParams& params) = 0; - - // Get the vehicle's parameters. - virtual VehicleParams const& getParams() = 0; - - /// Checks if the vehicle is dead. - virtual bool isDead() = 0; - - /// Respawns the vehicle. - virtual void respawn() = 0; - - /// Get the vehicle's respawn delay. - virtual Seconds getRespawnDelay() = 0; - - /// Set the vehicle respawn delay. - virtual void setRespawnDelay(Seconds delay) = 0; - - /// Checks if the vehicle is respawning. - virtual bool isRespawning() = 0; - - // Sets (links) the vehicle to an interior. - virtual void setInterior(int InteriorID) = 0; - - // Gets the vehicle's interior. - virtual int getInterior() = 0; - - /// Attaches a vehicle as a trailer to this vehicle. - virtual void attachTrailer(IVehicle& trailer) = 0; - - /// Detaches a vehicle from this vehicle. - virtual void detachTrailer() = 0; - - /// Checks if the current vehicle is a trailer. - virtual bool isTrailer() const = 0; - - /// Get the current vehicle's attached trailer. - virtual IVehicle* getTrailer() const = 0; - - /// Get the current vehicle's cab. - virtual IVehicle* getCab() const = 0; - - /// Fully repair the vehicle. - virtual void repair() = 0; - - /// Adds a train carriage to the vehicle (ONLY FOR TRAINS). - virtual void addCarriage(IVehicle* carriage, int pos) = 0; - virtual void updateCarriage(Vector3 pos, Vector3 veloc) = 0; - virtual const StaticArray& getCarriages() = 0; - - /// Sets the velocity of the vehicle. - virtual void setVelocity(Vector3 velocity) = 0; - - /// Gets the current velocity of the vehicle. - virtual Vector3 getVelocity() = 0; - - /// Sets the angular velocity of the vehicle. - virtual void setAngularVelocity(Vector3 velocity) = 0; - - /// Gets the current angular velocity of the vehicle. - virtual Vector3 getAngularVelocity() = 0; - - /// Gets the current model ID of the vehicle. - virtual int getModel() = 0; - - /// Gets the current landing gear state from a ID_VEHICLE_SYNC packet from the latest driver. - virtual uint8_t getLandingGearState() = 0; - - /// Get if the vehicle was occupied since last spawn. - virtual bool hasBeenOccupied() = 0; - - /// Get the last time the vehicle was occupied. - virtual const TimePoint& getLastOccupiedTime() = 0; - - /// Get the last time the vehicle was spawned. - virtual const TimePoint& getLastSpawnTime() = 0; - - /// Get if vehicle is occupied. - virtual bool isOccupied() = 0; - - /// Set vehicle siren status. - virtual void setSiren(bool status) = 0; - - /// Get vehicle siren status. - virtual uint8_t getSirenState() const = 0; - - /// Get hydra thrust angle - virtual uint32_t getHydraThrustAngle() const = 0; - - /// Get train speed - virtual float getTrainSpeed() const = 0; - - /// Get last driver's pool id - virtual int getLastDriverPoolID() const = 0; -}; - -/// A vehicle event handler -struct VehicleEventHandler -{ - virtual void onVehicleStreamIn(IVehicle& vehicle, IPlayer& player) { } - virtual void onVehicleStreamOut(IVehicle& vehicle, IPlayer& player) { } - virtual void onVehicleDeath(IVehicle& vehicle, IPlayer& player) { } - virtual void onPlayerEnterVehicle(IPlayer& player, IVehicle& vehicle, bool passenger) { } - virtual void onPlayerExitVehicle(IPlayer& player, IVehicle& vehicle) { } - virtual void onVehicleDamageStatusUpdate(IVehicle& vehicle, IPlayer& player) { } - virtual bool onVehiclePaintJob(IPlayer& player, IVehicle& vehicle, int paintJob) { return true; } - virtual bool onVehicleMod(IPlayer& player, IVehicle& vehicle, int component) { return true; } - virtual bool onVehicleRespray(IPlayer& player, IVehicle& vehicle, int colour1, int colour2) { return true; } - virtual void onEnterExitModShop(IPlayer& player, bool enterexit, int interiorID) { } - virtual void onVehicleSpawn(IVehicle& vehicle) { } - virtual bool onUnoccupiedVehicleUpdate(IVehicle& vehicle, IPlayer& player, UnoccupiedVehicleUpdate const updateData) { return true; } - virtual bool onTrailerUpdate(IPlayer& player, IVehicle& trailer) { return true; } - virtual bool onVehicleSirenStateChange(IPlayer& player, IVehicle& vehicle, uint8_t sirenState) { return true; } -}; - -/// A vehicle pool -static const UID VehicleComponent_UID = UID(0x3f1f62ee9e22ab19); -struct IVehiclesComponent : public IPoolComponent -{ - PROVIDE_UID(VehicleComponent_UID) - - /// Get the number of model instances for each model - virtual StaticArray& models() = 0; - - virtual IVehicle* create(bool isStatic, int modelID, Vector3 position, float Z = 0.0f, int colour1 = -1, int colour2 = -1, Seconds respawnDelay = Seconds(-1), bool addSiren = false) = 0; - virtual IVehicle* create(const VehicleSpawnData& data) = 0; - - virtual IEventDispatcher& getEventDispatcher() = 0; -}; - -/// Player vehicle data -static const UID SomePlayerData_UID = UID(0xa960485be6c70fb2); -struct IPlayerVehicleData : public IExtension -{ - PROVIDE_EXT_UID(SomePlayerData_UID) - - /// Get the player's vehicle - /// Returns nullptr if they aren't in a vehicle - virtual IVehicle* getVehicle() = 0; - - /// Reset player's vehicle value interally - /// *** DO NOT USE THIS IF YOU HAVE NO IDEA WHAT IT DOES - /// IT IS NOT FOR VEHICLE DESTRUCTION OR REMOVE PLAYER FROM ONE *** - virtual void resetVehicle() = 0; - - /// Get the player's seat - /// Returns -1 if they aren't in a vehicle. - virtual int getSeat() const = 0; - - /// Checks if player is in a mod shop - virtual bool isInModShop() const = 0; - - /// Check if passenger is in drive-by mode or not - virtual bool isInDriveByMode() const = 0; - - /// Check if passenger is cuffed or not - virtual bool isCuffed() const = 0; -}; - -namespace Impl -{ -inline bool isValidVehicleModel(int model) -{ - if (model < 400 || model > 611) - { - return false; - } - return true; -} -} diff --git a/SDK/include/anim.hpp b/SDK/include/anim.hpp deleted file mode 100644 index b1c469648..000000000 --- a/SDK/include/anim.hpp +++ /dev/null @@ -1,2069 +0,0 @@ -#pragma once - -#include "types.hpp" - -/// Animation names -static StringView AnimationNames[] = { - "", - "AIRPORT:THRW_BARL_THRW", - "ATTRACTORS:STEPSIT_IN", - "ATTRACTORS:STEPSIT_LOOP", - "ATTRACTORS:STEPSIT_OUT", - "BAR:BARCUSTOM_GET", - "BAR:BARCUSTOM_LOOP", - "BAR:BARCUSTOM_ORDER", - "BAR:BARMAN_IDLE", - "BAR:BARSERVE_BOTTLE", - "BAR:BARSERVE_GIVE", - "BAR:BARSERVE_GLASS", - "BAR:BARSERVE_IN", - "BAR:BARSERVE_LOOP", - "BAR:BARSERVE_ORDER", - "BAR:DNK_STNDF_LOOP", - "BAR:DNK_STNDM_LOOP", - "BASEBALL:BAT_1", - "BASEBALL:BAT_2", - "BASEBALL:BAT_3", - "BASEBALL:BAT_4", - "BASEBALL:BAT_BLOCK", - "BASEBALL:BAT_HIT_1", - "BASEBALL:BAT_HIT_2", - "BASEBALL:BAT_HIT_3", - "BASEBALL:BAT_IDLE", - "BASEBALL:BAT_M", - "BASEBALL:BAT_PART", - "BD_FIRE:BD_FIRE1", - "BD_FIRE:BD_FIRE2", - "BD_FIRE:BD_FIRE3", - "BD_FIRE:BD_GF_WAVE", - "BD_FIRE:BD_PANIC_01", - "BD_FIRE:BD_PANIC_02", - "BD_FIRE:BD_PANIC_03", - "BD_FIRE:BD_PANIC_04", - "BD_FIRE:BD_PANIC_LOOP", - "BD_FIRE:GRLFRD_KISS_03", - "BD_FIRE:M_SMKLEAN_LOOP", - "BD_FIRE:PLAYA_KISS_03", - "BD_FIRE:WASH_UP", - "BEACH:BATHER", - "BEACH:LAY_BAC_LOOP", - "BEACH:PARKSIT_M_LOOP", - "BEACH:PARKSIT_W_LOOP", - "BEACH:SITNWAIT_LOOP_W", - "BENCHPRESS:GYM_BP_CELEBRATE", - "BENCHPRESS:GYM_BP_DOWN", - "BENCHPRESS:GYM_BP_GETOFF", - "BENCHPRESS:GYM_BP_GETON", - "BENCHPRESS:GYM_BP_UP_A", - "BENCHPRESS:GYM_BP_UP_B", - "BENCHPRESS:GYM_BP_UP_SMOOTH", - "BF_INJECTION:BF_GETIN_LHS", - "BF_INJECTION:BF_GETIN_RHS", - "BF_INJECTION:BF_GETOUT_LHS", - "BF_INJECTION:BF_GETOUT_RHS", - "BIKED:BIKED_BACK", - "BIKED:BIKED_DRIVEBYFT", - "BIKED:BIKED_DRIVEBYLHS", - "BIKED:BIKED_DRIVEBYRHS", - "BIKED:BIKED_FWD", - "BIKED:BIKED_GETOFFBACK", - "BIKED:BIKED_GETOFFLHS", - "BIKED:BIKED_GETOFFRHS", - "BIKED:BIKED_HIT", - "BIKED:BIKED_JUMPONL", - "BIKED:BIKED_JUMPONR", - "BIKED:BIKED_KICK", - "BIKED:BIKED_LEFT", - "BIKED:BIKED_PASSENGER", - "BIKED:BIKED_PUSHES", - "BIKED:BIKED_RIDE", - "BIKED:BIKED_RIGHT", - "BIKED:BIKED_SHUFFLE", - "BIKED:BIKED_STILL", - "BIKEH:BIKEH_BACK", - "BIKEH:BIKEH_DRIVEBYFT", - "BIKEH:BIKEH_DRIVEBYLHS", - "BIKEH:BIKEH_DRIVEBYRHS", - "BIKEH:BIKEH_FWD", - "BIKEH:BIKEH_GETOFFBACK", - "BIKEH:BIKEH_GETOFFLHS", - "BIKEH:BIKEH_GETOFFRHS", - "BIKEH:BIKEH_HIT", - "BIKEH:BIKEH_JUMPONL", - "BIKEH:BIKEH_JUMPONR", - "BIKEH:BIKEH_KICK", - "BIKEH:BIKEH_LEFT", - "BIKEH:BIKEH_PASSENGER", - "BIKEH:BIKEH_PUSHES", - "BIKEH:BIKEH_RIDE", - "BIKEH:BIKEH_RIGHT", - "BIKEH:BIKEH_STILL", - "BIKELEAP:BK_BLNCE_IN", - "BIKELEAP:BK_BLNCE_OUT", - "BIKELEAP:BK_JMP", - "BIKELEAP:BK_RDY_IN", - "BIKELEAP:BK_RDY_OUT", - "BIKELEAP:STRUGGLE_CESAR", - "BIKELEAP:STRUGGLE_DRIVER", - "BIKELEAP:TRUCK_DRIVER", - "BIKELEAP:TRUCK_GETIN", - "BIKES:BIKES_BACK", - "BIKES:BIKES_DRIVEBYFT", - "BIKES:BIKES_DRIVEBYLHS", - "BIKES:BIKES_DRIVEBYRHS", - "BIKES:BIKES_FWD", - "BIKES:BIKES_GETOFFBACK", - "BIKES:BIKES_GETOFFLHS", - "BIKES:BIKES_GETOFFRHS", - "BIKES:BIKES_HIT", - "BIKES:BIKES_JUMPONL", - "BIKES:BIKES_JUMPONR", - "BIKES:BIKES_KICK", - "BIKES:BIKES_LEFT", - "BIKES:BIKES_PASSENGER", - "BIKES:BIKES_PUSHES", - "BIKES:BIKES_RIDE", - "BIKES:BIKES_RIGHT", - "BIKES:BIKES_SNATCH_L", - "BIKES:BIKES_SNATCH_R", - "BIKES:BIKES_STILL", - "BIKEV:BIKEV_BACK", - "BIKEV:BIKEV_DRIVEBYFT", - "BIKEV:BIKEV_DRIVEBYLHS", - "BIKEV:BIKEV_DRIVEBYRHS", - "BIKEV:BIKEV_FWD", - "BIKEV:BIKEV_GETOFFBACK", - "BIKEV:BIKEV_GETOFFLHS", - "BIKEV:BIKEV_GETOFFRHS", - "BIKEV:BIKEV_HIT", - "BIKEV:BIKEV_JUMPONL", - "BIKEV:BIKEV_JUMPONR", - "BIKEV:BIKEV_KICK", - "BIKEV:BIKEV_LEFT", - "BIKEV:BIKEV_PASSENGER", - "BIKEV:BIKEV_PUSHES", - "BIKEV:BIKEV_RIDE", - "BIKEV:BIKEV_RIGHT", - "BIKEV:BIKEV_STILL", - "BIKE_DBZ:PASS_DRIVEBY_BWD", - "BIKE_DBZ:PASS_DRIVEBY_FWD", - "BIKE_DBZ:PASS_DRIVEBY_LHS", - "BIKE_DBZ:PASS_DRIVEBY_RHS", - "BMX:BMX_BACK", - "BMX:BMX_BUNNYHOP", - "BMX:BMX_DRIVEBYFT", - "BMX:BMX_DRIVEBY_LHS", - "BMX:BMX_DRIVEBY_RHS", - "BMX:BMX_FWD", - "BMX:BMX_GETOFFBACK", - "BMX:BMX_GETOFFLHS", - "BMX:BMX_GETOFFRHS", - "BMX:BMX_JUMPONL", - "BMX:BMX_JUMPONR", - "BMX:BMX_LEFT", - "BMX:BMX_PEDAL", - "BMX:BMX_PUSHES", - "BMX:BMX_RIDE", - "BMX:BMX_RIGHT", - "BMX:BMX_SPRINT", - "BMX:BMX_STILL", - "BOMBER:BOM_PLANT", - "BOMBER:BOM_PLANT_2IDLE", - "BOMBER:BOM_PLANT_CROUCH_IN", - "BOMBER:BOM_PLANT_CROUCH_OUT", - "BOMBER:BOM_PLANT_IN", - "BOMBER:BOM_PLANT_LOOP", - "BOX:BOXHIPIN", - "BOX:BOXHIPUP", - "BOX:BOXSHDWN", - "BOX:BOXSHUP", - "BOX:BXHIPWLK", - "BOX:BXHWLKI", - "BOX:BXSHWLK", - "BOX:BXSHWLKI", - "BOX:BXWLKO", - "BOX:CATCH_BOX", - "BSKTBALL:BBALL_DEF_JUMP_SHOT", - "BSKTBALL:BBALL_DEF_LOOP", - "BSKTBALL:BBALL_DEF_STEPL", - "BSKTBALL:BBALL_DEF_STEPR", - "BSKTBALL:BBALL_DNK", - "BSKTBALL:BBALL_DNK_GLI", - "BSKTBALL:BBALL_DNK_GLI_O", - "BSKTBALL:BBALL_DNK_LNCH", - "BSKTBALL:BBALL_DNK_LNCH_O", - "BSKTBALL:BBALL_DNK_LND", - "BSKTBALL:BBALL_DNK_O", - "BSKTBALL:BBALL_IDLE", - "BSKTBALL:BBALL_IDLE2", - "BSKTBALL:BBALL_IDLE2_O", - "BSKTBALL:BBALL_IDLELOOP", - "BSKTBALL:BBALL_IDLELOOP_O", - "BSKTBALL:BBALL_IDLE_O", - "BSKTBALL:BBALL_JUMP_CANCEL", - "BSKTBALL:BBALL_JUMP_CANCEL_O", - "BSKTBALL:BBALL_JUMP_END", - "BSKTBALL:BBALL_JUMP_SHOT", - "BSKTBALL:BBALL_JUMP_SHOT_O", - "BSKTBALL:BBALL_NET_DNK_O", - "BSKTBALL:BBALL_PICKUP", - "BSKTBALL:BBALL_PICKUP_O", - "BSKTBALL:BBALL_REACT_MISS", - "BSKTBALL:BBALL_REACT_SCORE", - "BSKTBALL:BBALL_RUN", - "BSKTBALL:BBALL_RUN_O", - "BSKTBALL:BBALL_SKIDSTOP_L", - "BSKTBALL:BBALL_SKIDSTOP_L_O", - "BSKTBALL:BBALL_SKIDSTOP_R", - "BSKTBALL:BBALL_SKIDSTOP_R_O", - "BSKTBALL:BBALL_WALK", - "BSKTBALL:BBALL_WALKSTOP_L", - "BSKTBALL:BBALL_WALKSTOP_L_O", - "BSKTBALL:BBALL_WALKSTOP_R", - "BSKTBALL:BBALL_WALKSTOP_R_O", - "BSKTBALL:BBALL_WALK_O", - "BSKTBALL:BBALL_WALK_START", - "BSKTBALL:BBALL_WALK_START_O", - "BUDDY:BUDDY_CROUCHFIRE", - "BUDDY:BUDDY_CROUCHRELOAD", - "BUDDY:BUDDY_FIRE", - "BUDDY:BUDDY_FIRE_POOR", - "BUDDY:BUDDY_RELOAD", - "BUS:BUS_CLOSE", - "BUS:BUS_GETIN_LHS", - "BUS:BUS_GETIN_RHS", - "BUS:BUS_GETOUT_LHS", - "BUS:BUS_GETOUT_RHS", - "BUS:BUS_JACKED_LHS", - "BUS:BUS_OPEN", - "BUS:BUS_OPEN_RHS", - "BUS:BUS_PULLOUT_LHS", - "CAMERA:CAMCRCH_CMON", - "CAMERA:CAMCRCH_IDLELOOP", - "CAMERA:CAMCRCH_STAY", - "CAMERA:CAMCRCH_TO_CAMSTND", - "CAMERA:CAMSTND_CMON", - "CAMERA:CAMSTND_IDLELOOP", - "CAMERA:CAMSTND_LKABT", - "CAMERA:CAMSTND_TO_CAMCRCH", - "CAMERA:PICCRCH_IN", - "CAMERA:PICCRCH_OUT", - "CAMERA:PICCRCH_TAKE", - "CAMERA:PICSTND_IN", - "CAMERA:PICSTND_OUT", - "CAMERA:PICSTND_TAKE", - "CAR:FIXN_CAR_LOOP", - "CAR:FIXN_CAR_OUT", - "CAR:FLAG_DROP", - "CAR:SIT_RELAXED", - "CAR:TAP_HAND", - "CAR:TYD2CAR_BUMP", - "CAR:TYD2CAR_HIGH", - "CAR:TYD2CAR_LOW", - "CAR:TYD2CAR_MED", - "CAR:TYD2CAR_TURNL", - "CAR:TYD2CAR_TURNR", - "CARRY:CRRY_PRTIAL", - "CARRY:LIFTUP", - "CARRY:LIFTUP05", - "CARRY:LIFTUP105", - "CARRY:PUTDWN", - "CARRY:PUTDWN05", - "CARRY:PUTDWN105", - "CAR_CHAT:CARFONE_IN", - "CAR_CHAT:CARFONE_LOOPA", - "CAR_CHAT:CARFONE_LOOPA_TO_B", - "CAR_CHAT:CARFONE_LOOPB", - "CAR_CHAT:CARFONE_LOOPB_TO_A", - "CAR_CHAT:CARFONE_OUT", - "CAR_CHAT:CAR_SC1_BL", - "CAR_CHAT:CAR_SC1_BR", - "CAR_CHAT:CAR_SC1_FL", - "CAR_CHAT:CAR_SC1_FR", - "CAR_CHAT:CAR_SC2_FL", - "CAR_CHAT:CAR_SC3_BR", - "CAR_CHAT:CAR_SC3_FL", - "CAR_CHAT:CAR_SC3_FR", - "CAR_CHAT:CAR_SC4_BL", - "CAR_CHAT:CAR_SC4_BR", - "CAR_CHAT:CAR_SC4_FL", - "CAR_CHAT:CAR_SC4_FR", - "CAR_CHAT:CAR_TALKM_IN", - "CAR_CHAT:CAR_TALKM_LOOP", - "CAR_CHAT:CAR_TALKM_OUT", - "CASINO:CARDS_IN", - "CASINO:CARDS_LOOP", - "CASINO:CARDS_LOSE", - "CASINO:CARDS_OUT", - "CASINO:CARDS_PICK_01", - "CASINO:CARDS_PICK_02", - "CASINO:CARDS_RAISE", - "CASINO:CARDS_WIN", - "CASINO:DEALONE", - "CASINO:MANWINB", - "CASINO:MANWIND", - "CASINO:ROULETTE_BET", - "CASINO:ROULETTE_IN", - "CASINO:ROULETTE_LOOP", - "CASINO:ROULETTE_LOSE", - "CASINO:ROULETTE_OUT", - "CASINO:ROULETTE_WIN", - "CASINO:SLOT_BET_01", - "CASINO:SLOT_BET_02", - "CASINO:SLOT_IN", - "CASINO:SLOT_LOSE_OUT", - "CASINO:SLOT_PLYR", - "CASINO:SLOT_WAIT", - "CASINO:SLOT_WIN_OUT", - "CASINO:WOF", - "CHAINSAW:CSAW_1", - "CHAINSAW:CSAW_2", - "CHAINSAW:CSAW_3", - "CHAINSAW:CSAW_G", - "CHAINSAW:CSAW_HIT_1", - "CHAINSAW:CSAW_HIT_2", - "CHAINSAW:CSAW_HIT_3", - "CHAINSAW:CSAW_PART", - "CHAINSAW:IDLE_CSAW", - "CHAINSAW:WEAPON_CSAW", - "CHAINSAW:WEAPON_CSAWLO", - "CHOPPA:CHOPPA_BACK", - "CHOPPA:CHOPPA_BUNNYHOP", - "CHOPPA:CHOPPA_DRIVEBYFT", - "CHOPPA:CHOPPA_DRIVEBY_LHS", - "CHOPPA:CHOPPA_DRIVEBY_RHS", - "CHOPPA:CHOPPA_FWD", - "CHOPPA:CHOPPA_GETOFFBACK", - "CHOPPA:CHOPPA_GETOFFLHS", - "CHOPPA:CHOPPA_GETOFFRHS", - "CHOPPA:CHOPPA_JUMPONL", - "CHOPPA:CHOPPA_JUMPONR", - "CHOPPA:CHOPPA_LEFT", - "CHOPPA:CHOPPA_PEDAL", - "CHOPPA:CHOPPA_PUSHES", - "CHOPPA:CHOPPA_RIDE", - "CHOPPA:CHOPPA_RIGHT", - "CHOPPA:CHOPPA_SPRINT", - "CHOPPA:CHOPPA_STILL", - "CLOTHES:CLO_BUY", - "CLOTHES:CLO_IN", - "CLOTHES:CLO_OUT", - "CLOTHES:CLO_POSE_HAT", - "CLOTHES:CLO_POSE_IN", - "CLOTHES:CLO_POSE_IN_O", - "CLOTHES:CLO_POSE_LEGS", - "CLOTHES:CLO_POSE_LOOP", - "CLOTHES:CLO_POSE_OUT", - "CLOTHES:CLO_POSE_OUT_O", - "CLOTHES:CLO_POSE_SHOES", - "CLOTHES:CLO_POSE_TORSO", - "CLOTHES:CLO_POSE_WATCH", - "COACH:COACH_INL", - "COACH:COACH_INR", - "COACH:COACH_OPNL", - "COACH:COACH_OPNR", - "COACH:COACH_OUTL", - "COACH:COACH_OUTR", - "COLT45:2GUNS_CROUCHFIRE", - "COLT45:COLT45_CROUCHFIRE", - "COLT45:COLT45_CROUCHRELOAD", - "COLT45:COLT45_FIRE", - "COLT45:COLT45_FIRE_2HANDS", - "COLT45:COLT45_RELOAD", - "COLT45:SAWNOFF_RELOAD", - "COP_AMBIENT:COPBROWSE_IN", - "COP_AMBIENT:COPBROWSE_LOOP", - "COP_AMBIENT:COPBROWSE_NOD", - "COP_AMBIENT:COPBROWSE_OUT", - "COP_AMBIENT:COPBROWSE_SHAKE", - "COP_AMBIENT:COPLOOK_IN", - "COP_AMBIENT:COPLOOK_LOOP", - "COP_AMBIENT:COPLOOK_NOD", - "COP_AMBIENT:COPLOOK_OUT", - "COP_AMBIENT:COPLOOK_SHAKE", - "COP_AMBIENT:COPLOOK_THINK", - "COP_AMBIENT:COPLOOK_WATCH", - "COP_DVBYZ:COP_DVBY_B", - "COP_DVBYZ:COP_DVBY_FT", - "COP_DVBYZ:COP_DVBY_L", - "COP_DVBYZ:COP_DVBY_R", - "CRACK:BBALBAT_IDLE_01", - "CRACK:BBALBAT_IDLE_02", - "CRACK:CRCKDETH1", - "CRACK:CRCKDETH2", - "CRACK:CRCKDETH3", - "CRACK:CRCKDETH4", - "CRACK:CRCKIDLE1", - "CRACK:CRCKIDLE2", - "CRACK:CRCKIDLE3", - "CRACK:CRCKIDLE4", - "CRIB:CRIB_CONSOLE_LOOP", - "CRIB:CRIB_USE_SWITCH", - "CRIB:PED_CONSOLE_LOOP", - "CRIB:PED_CONSOLE_LOOSE", - "CRIB:PED_CONSOLE_WIN", - "DAM_JUMP:DAM_DIVE_LOOP", - "DAM_JUMP:DAM_LAND", - "DAM_JUMP:DAM_LAUNCH", - "DAM_JUMP:JUMP_ROLL", - "DAM_JUMP:SF_JUMPWALL", - "DANCING:BD_CLAP", - "DANCING:BD_CLAP1", - "DANCING:DANCE_LOOP", - "DANCING:DAN_DOWN_A", - "DANCING:DAN_LEFT_A", - "DANCING:DAN_LOOP_A", - "DANCING:DAN_RIGHT_A", - "DANCING:DAN_UP_A", - "DANCING:DNCE_M_A", - "DANCING:DNCE_M_B", - "DANCING:DNCE_M_C", - "DANCING:DNCE_M_D", - "DANCING:DNCE_M_E", - "DEALER:DEALER_DEAL", - "DEALER:DEALER_IDLE", - "DEALER:DEALER_IDLE_01", - "DEALER:DEALER_IDLE_02", - "DEALER:DEALER_IDLE_03", - "DEALER:DRUGS_BUY", - "DEALER:SHOP_PAY", - "DILDO:DILDO_1", - "DILDO:DILDO_2", - "DILDO:DILDO_3", - "DILDO:DILDO_BLOCK", - "DILDO:DILDO_G", - "DILDO:DILDO_HIT_1", - "DILDO:DILDO_HIT_2", - "DILDO:DILDO_HIT_3", - "DILDO:DILDO_IDLE", - "DODGE:COVER_DIVE_01", - "DODGE:COVER_DIVE_02", - "DODGE:CRUSHED", - "DODGE:CRUSH_JUMP", - "DOZER:DOZER_ALIGN_LHS", - "DOZER:DOZER_ALIGN_RHS", - "DOZER:DOZER_GETIN_LHS", - "DOZER:DOZER_GETIN_RHS", - "DOZER:DOZER_GETOUT_LHS", - "DOZER:DOZER_GETOUT_RHS", - "DOZER:DOZER_JACKED_LHS", - "DOZER:DOZER_JACKED_RHS", - "DOZER:DOZER_PULLOUT_LHS", - "DOZER:DOZER_PULLOUT_RHS", - "DRIVEBYS:GANG_DRIVEBYLHS", - "DRIVEBYS:GANG_DRIVEBYLHS_BWD", - "DRIVEBYS:GANG_DRIVEBYLHS_FWD", - "DRIVEBYS:GANG_DRIVEBYRHS", - "DRIVEBYS:GANG_DRIVEBYRHS_BWD", - "DRIVEBYS:GANG_DRIVEBYRHS_FWD", - "DRIVEBYS:GANG_DRIVEBYTOP_LHS", - "DRIVEBYS:GANG_DRIVEBYTOP_RHS", - "FAT:FATIDLE", - "FAT:FATIDLE_ARMED", - "FAT:FATIDLE_CSAW", - "FAT:FATIDLE_ROCKET", - "FAT:FATRUN", - "FAT:FATRUN_ARMED", - "FAT:FATRUN_CSAW", - "FAT:FATRUN_ROCKET", - "FAT:FATSPRINT", - "FAT:FATWALK", - "FAT:FATWALKSTART", - "FAT:FATWALKSTART_CSAW", - "FAT:FATWALKST_ARMED", - "FAT:FATWALKST_ROCKET", - "FAT:FATWALK_ARMED", - "FAT:FATWALK_CSAW", - "FAT:FATWALK_ROCKET", - "FAT:IDLE_TIRED", - "FIGHT_B:FIGHTB_1", - "FIGHT_B:FIGHTB_2", - "FIGHT_B:FIGHTB_3", - "FIGHT_B:FIGHTB_BLOCK", - "FIGHT_B:FIGHTB_G", - "FIGHT_B:FIGHTB_IDLE", - "FIGHT_B:FIGHTB_M", - "FIGHT_B:HITB_1", - "FIGHT_B:HITB_2", - "FIGHT_B:HITB_3", - "FIGHT_C:FIGHTC_1", - "FIGHT_C:FIGHTC_2", - "FIGHT_C:FIGHTC_3", - "FIGHT_C:FIGHTC_BLOCK", - "FIGHT_C:FIGHTC_BLOCKING", - "FIGHT_C:FIGHTC_G", - "FIGHT_C:FIGHTC_IDLE", - "FIGHT_C:FIGHTC_M", - "FIGHT_C:FIGHTC_SPAR", - "FIGHT_C:HITC_1", - "FIGHT_C:HITC_2", - "FIGHT_C:HITC_3", - "FIGHT_D:FIGHTD_1", - "FIGHT_D:FIGHTD_2", - "FIGHT_D:FIGHTD_3", - "FIGHT_D:FIGHTD_BLOCK", - "FIGHT_D:FIGHTD_G", - "FIGHT_D:FIGHTD_IDLE", - "FIGHT_D:FIGHTD_M", - "FIGHT_D:HITD_1", - "FIGHT_D:HITD_2", - "FIGHT_D:HITD_3", - "FIGHT_E:FIGHTKICK", - "FIGHT_E:FIGHTKICK_B", - "FIGHT_E:HIT_FIGHTKICK", - "FIGHT_E:HIT_FIGHTKICK_B", - "FINALE:FIN_CLIMB_IN", - "FINALE:FIN_COP1_CLIMBOUT2", - "FINALE:FIN_COP1_LOOP", - "FINALE:FIN_COP1_STOMP", - "FINALE:FIN_HANG_L", - "FINALE:FIN_HANG_LOOP", - "FINALE:FIN_HANG_R", - "FINALE:FIN_HANG_SLIP", - "FINALE:FIN_JUMP_ON", - "FINALE:FIN_LAND_CAR", - "FINALE:FIN_LAND_DIE", - "FINALE:FIN_LEGSUP", - "FINALE:FIN_LEGSUP_L", - "FINALE:FIN_LEGSUP_LOOP", - "FINALE:FIN_LEGSUP_R", - "FINALE:FIN_LET_GO", - "FINALE2:FIN_COP1_CLIMBOUT", - "FINALE2:FIN_COP1_FALL", - "FINALE2:FIN_COP1_LOOP", - "FINALE2:FIN_COP1_SHOT", - "FINALE2:FIN_COP1_SWING", - "FINALE2:FIN_COP2_CLIMBOUT", - "FINALE2:FIN_SWITCH_P", - "FINALE2:FIN_SWITCH_S", - "FLAME:FLAME_FIRE", - "FLOWERS:FLOWER_ATTACK", - "FLOWERS:FLOWER_ATTACK_M", - "FLOWERS:FLOWER_HIT", - "FOOD:EAT_BURGER", - "FOOD:EAT_CHICKEN", - "FOOD:EAT_PIZZA", - "FOOD:EAT_VOMIT_P", - "FOOD:EAT_VOMIT_SK", - "FOOD:FF_DAM_BKW", - "FOOD:FF_DAM_FWD", - "FOOD:FF_DAM_LEFT", - "FOOD:FF_DAM_RIGHT", - "FOOD:FF_DIE_BKW", - "FOOD:FF_DIE_FWD", - "FOOD:FF_DIE_LEFT", - "FOOD:FF_DIE_RIGHT", - "FOOD:FF_SIT_EAT1", - "FOOD:FF_SIT_EAT2", - "FOOD:FF_SIT_EAT3", - "FOOD:FF_SIT_IN", - "FOOD:FF_SIT_IN_L", - "FOOD:FF_SIT_IN_R", - "FOOD:FF_SIT_LOOK", - "FOOD:FF_SIT_LOOP", - "FOOD:FF_SIT_OUT_180", - "FOOD:FF_SIT_OUT_L_180", - "FOOD:FF_SIT_OUT_R_180", - "FOOD:SHP_THANK", - "FOOD:SHP_TRAY_IN", - "FOOD:SHP_TRAY_LIFT", - "FOOD:SHP_TRAY_LIFT_IN", - "FOOD:SHP_TRAY_LIFT_LOOP", - "FOOD:SHP_TRAY_LIFT_OUT", - "FOOD:SHP_TRAY_OUT", - "FOOD:SHP_TRAY_POSE", - "FOOD:SHP_TRAY_RETURN", - "FREEWEIGHTS:GYM_BARBELL", - "FREEWEIGHTS:GYM_FREE_A", - "FREEWEIGHTS:GYM_FREE_B", - "FREEWEIGHTS:GYM_FREE_CELEBRATE", - "FREEWEIGHTS:GYM_FREE_DOWN", - "FREEWEIGHTS:GYM_FREE_LOOP", - "FREEWEIGHTS:GYM_FREE_PICKUP", - "FREEWEIGHTS:GYM_FREE_PUTDOWN", - "FREEWEIGHTS:GYM_FREE_UP_SMOOTH", - "GANGS:DEALER_DEAL", - "GANGS:DEALER_IDLE", - "GANGS:DRNKBR_PRTL", - "GANGS:DRNKBR_PRTL_F", - "GANGS:DRUGS_BUY", - "GANGS:HNDSHKAA", - "GANGS:HNDSHKBA", - "GANGS:HNDSHKCA", - "GANGS:HNDSHKCB", - "GANGS:HNDSHKDA", - "GANGS:HNDSHKEA", - "GANGS:HNDSHKFA", - "GANGS:HNDSHKFA_SWT", - "GANGS:INVITE_NO", - "GANGS:INVITE_YES", - "GANGS:LEANIDLE", - "GANGS:LEANIN", - "GANGS:LEANOUT", - "GANGS:PRTIAL_GNGTLKA", - "GANGS:PRTIAL_GNGTLKB", - "GANGS:PRTIAL_GNGTLKC", - "GANGS:PRTIAL_GNGTLKD", - "GANGS:PRTIAL_GNGTLKE", - "GANGS:PRTIAL_GNGTLKF", - "GANGS:PRTIAL_GNGTLKG", - "GANGS:PRTIAL_GNGTLKH", - "GANGS:PRTIAL_HNDSHK_01", - "GANGS:PRTIAL_HNDSHK_BIZ_01", - "GANGS:SHAKE_CARA", - "GANGS:SHAKE_CARK", - "GANGS:SHAKE_CARSH", - "GANGS:SMKCIG_PRTL", - "GANGS:SMKCIG_PRTL_F", - "GHANDS:GSIGN1", - "GHANDS:GSIGN1LH", - "GHANDS:GSIGN2", - "GHANDS:GSIGN2LH", - "GHANDS:GSIGN3", - "GHANDS:GSIGN3LH", - "GHANDS:GSIGN4", - "GHANDS:GSIGN4LH", - "GHANDS:GSIGN5", - "GHANDS:GSIGN5LH", - "GHANDS:LHGSIGN1", - "GHANDS:LHGSIGN2", - "GHANDS:LHGSIGN3", - "GHANDS:LHGSIGN4", - "GHANDS:LHGSIGN5", - "GHANDS:RHGSIGN1", - "GHANDS:RHGSIGN2", - "GHANDS:RHGSIGN3", - "GHANDS:RHGSIGN4", - "GHANDS:RHGSIGN5", - "GHETTO_DB:GDB_CAR2_PLY", - "GHETTO_DB:GDB_CAR2_SMO", - "GHETTO_DB:GDB_CAR2_SWE", - "GHETTO_DB:GDB_CAR_PLY", - "GHETTO_DB:GDB_CAR_RYD", - "GHETTO_DB:GDB_CAR_SMO", - "GHETTO_DB:GDB_CAR_SWE", - "GOGGLES:GOGGLES_PUT_ON", - "GRAFFITI:GRAFFITI_CHKOUT", - "GRAFFITI:SPRAYCAN_FIRE", - "GRAVEYARD:MRNF_LOOP", - "GRAVEYARD:MRNM_LOOP", - "GRAVEYARD:PRST_LOOPA", - "GRENADE:WEAPON_START_THROW", - "GRENADE:WEAPON_THROW", - "GRENADE:WEAPON_THROWU", - "GYMNASIUM:GYMSHADOWBOX", - "GYMNASIUM:GYM_BIKE_CELEBRATE", - "GYMNASIUM:GYM_BIKE_FAST", - "GYMNASIUM:GYM_BIKE_FASTER", - "GYMNASIUM:GYM_BIKE_GETOFF", - "GYMNASIUM:GYM_BIKE_GETON", - "GYMNASIUM:GYM_BIKE_PEDAL", - "GYMNASIUM:GYM_BIKE_SLOW", - "GYMNASIUM:GYM_BIKE_STILL", - "GYMNASIUM:GYM_JOG_FALLOFF", - "GYMNASIUM:GYM_SHADOWBOX", - "GYMNASIUM:GYM_TREAD_CELEBRATE", - "GYMNASIUM:GYM_TREAD_FALLOFF", - "GYMNASIUM:GYM_TREAD_GETOFF", - "GYMNASIUM:GYM_TREAD_GETON", - "GYMNASIUM:GYM_TREAD_JOG", - "GYMNASIUM:GYM_TREAD_SPRINT", - "GYMNASIUM:GYM_TREAD_TIRED", - "GYMNASIUM:GYM_TREAD_WALK", - "GYMNASIUM:GYM_WALK_FALLOFF", - "GYMNASIUM:PEDALS_FAST", - "GYMNASIUM:PEDALS_MED", - "GYMNASIUM:PEDALS_SLOW", - "GYMNASIUM:PEDALS_STILL", - "HAIRCUTS:BRB_BEARD_01", - "HAIRCUTS:BRB_BUY", - "HAIRCUTS:BRB_CUT", - "HAIRCUTS:BRB_CUT_IN", - "HAIRCUTS:BRB_CUT_OUT", - "HAIRCUTS:BRB_HAIR_01", - "HAIRCUTS:BRB_HAIR_02", - "HAIRCUTS:BRB_IN", - "HAIRCUTS:BRB_LOOP", - "HAIRCUTS:BRB_OUT", - "HAIRCUTS:BRB_SIT_IN", - "HAIRCUTS:BRB_SIT_LOOP", - "HAIRCUTS:BRB_SIT_OUT", - "HEIST9:CAS_G2_GASKO", - "HEIST9:SWT_WLLPK_L", - "HEIST9:SWT_WLLPK_L_BACK", - "HEIST9:SWT_WLLPK_R", - "HEIST9:SWT_WLLPK_R_BACK", - "HEIST9:SWT_WLLSHOOT_IN_L", - "HEIST9:SWT_WLLSHOOT_IN_R", - "HEIST9:SWT_WLLSHOOT_OUT_L", - "HEIST9:SWT_WLLSHOOT_OUT_R", - "HEIST9:USE_SWIPECARD", - "INT_HOUSE:BED_IN_L", - "INT_HOUSE:BED_IN_R", - "INT_HOUSE:BED_LOOP_L", - "INT_HOUSE:BED_LOOP_R", - "INT_HOUSE:BED_OUT_L", - "INT_HOUSE:BED_OUT_R", - "INT_HOUSE:LOU_IN", - "INT_HOUSE:LOU_LOOP", - "INT_HOUSE:LOU_OUT", - "INT_HOUSE:WASH_UP", - "INT_OFFICE:FF_DAM_FWD", - "INT_OFFICE:OFF_SIT_2IDLE_180", - "INT_OFFICE:OFF_SIT_BORED_LOOP", - "INT_OFFICE:OFF_SIT_CRASH", - "INT_OFFICE:OFF_SIT_DRINK", - "INT_OFFICE:OFF_SIT_IDLE_LOOP", - "INT_OFFICE:OFF_SIT_IN", - "INT_OFFICE:OFF_SIT_READ", - "INT_OFFICE:OFF_SIT_TYPE_LOOP", - "INT_OFFICE:OFF_SIT_WATCH", - "INT_SHOP:SHOP_CASHIER", - "INT_SHOP:SHOP_IN", - "INT_SHOP:SHOP_LOOKA", - "INT_SHOP:SHOP_LOOKB", - "INT_SHOP:SHOP_LOOP", - "INT_SHOP:SHOP_OUT", - "INT_SHOP:SHOP_PAY", - "INT_SHOP:SHOP_SHELF", - "JST_BUISNESS:GIRL_01", - "JST_BUISNESS:GIRL_02", - "JST_BUISNESS:PLAYER_01", - "JST_BUISNESS:SMOKE_01", - "KART:KART_GETIN_LHS", - "KART:KART_GETIN_RHS", - "KART:KART_GETOUT_LHS", - "KART:KART_GETOUT_RHS", - "KISSING:BD_GF_WAVE", - "KISSING:GFWAVE2", - "KISSING:GF_CARARGUE_01", - "KISSING:GF_CARARGUE_02", - "KISSING:GF_CARSPOT", - "KISSING:GF_STREETARGUE_01", - "KISSING:GF_STREETARGUE_02", - "KISSING:GIFT_GET", - "KISSING:GIFT_GIVE", - "KISSING:GRLFRD_KISS_01", - "KISSING:GRLFRD_KISS_02", - "KISSING:GRLFRD_KISS_03", - "KISSING:PLAYA_KISS_01", - "KISSING:PLAYA_KISS_02", - "KISSING:PLAYA_KISS_03", - "KNIFE:KILL_KNIFE_PED_DAMAGE", - "KNIFE:KILL_KNIFE_PED_DIE", - "KNIFE:KILL_KNIFE_PLAYER", - "KNIFE:KILL_PARTIAL", - "KNIFE:KNIFE_1", - "KNIFE:KNIFE_2", - "KNIFE:KNIFE_3", - "KNIFE:KNIFE_4", - "KNIFE:KNIFE_BLOCK", - "KNIFE:KNIFE_G", - "KNIFE:KNIFE_HIT_1", - "KNIFE:KNIFE_HIT_2", - "KNIFE:KNIFE_HIT_3", - "KNIFE:KNIFE_IDLE", - "KNIFE:KNIFE_PART", - "KNIFE:WEAPON_KNIFEIDLE", - "LAPDAN1:LAPDAN_D", - "LAPDAN1:LAPDAN_P", - "LAPDAN2:LAPDAN_D", - "LAPDAN2:LAPDAN_P", - "LAPDAN3:LAPDAN_D", - "LAPDAN3:LAPDAN_P", - "LOWRIDER:F_SMKLEAN_LOOP", - "LOWRIDER:LRGIRL_BDBNCE", - "LOWRIDER:LRGIRL_HAIR", - "LOWRIDER:LRGIRL_HURRY", - "LOWRIDER:LRGIRL_IDLELOOP", - "LOWRIDER:LRGIRL_IDLE_TO_L0", - "LOWRIDER:LRGIRL_L0_BNCE", - "LOWRIDER:LRGIRL_L0_LOOP", - "LOWRIDER:LRGIRL_L0_TO_L1", - "LOWRIDER:LRGIRL_L12_TO_L0", - "LOWRIDER:LRGIRL_L1_BNCE", - "LOWRIDER:LRGIRL_L1_LOOP", - "LOWRIDER:LRGIRL_L1_TO_L2", - "LOWRIDER:LRGIRL_L2_BNCE", - "LOWRIDER:LRGIRL_L2_LOOP", - "LOWRIDER:LRGIRL_L2_TO_L3", - "LOWRIDER:LRGIRL_L345_TO_L1", - "LOWRIDER:LRGIRL_L3_BNCE", - "LOWRIDER:LRGIRL_L3_LOOP", - "LOWRIDER:LRGIRL_L3_TO_L4", - "LOWRIDER:LRGIRL_L4_BNCE", - "LOWRIDER:LRGIRL_L4_LOOP", - "LOWRIDER:LRGIRL_L4_TO_L5", - "LOWRIDER:LRGIRL_L5_BNCE", - "LOWRIDER:LRGIRL_L5_LOOP", - "LOWRIDER:M_SMKLEAN_LOOP", - "LOWRIDER:M_SMKSTND_LOOP", - "LOWRIDER:PRTIAL_GNGTLKB", - "LOWRIDER:PRTIAL_GNGTLKC", - "LOWRIDER:PRTIAL_GNGTLKD", - "LOWRIDER:PRTIAL_GNGTLKE", - "LOWRIDER:PRTIAL_GNGTLKF", - "LOWRIDER:PRTIAL_GNGTLKG", - "LOWRIDER:PRTIAL_GNGTLKH", - "LOWRIDER:RAP_A_LOOP", - "LOWRIDER:RAP_B_LOOP", - "LOWRIDER:RAP_C_LOOP", - "LOWRIDER:SIT_RELAXED", - "LOWRIDER:TAP_HAND", - "MD_CHASE:CARHIT_HANGON", - "MD_CHASE:CARHIT_TUMBLE", - "MD_CHASE:DONUTDROP", - "MD_CHASE:FEN_CHOPPA_L1", - "MD_CHASE:FEN_CHOPPA_L2", - "MD_CHASE:FEN_CHOPPA_L3", - "MD_CHASE:FEN_CHOPPA_R1", - "MD_CHASE:FEN_CHOPPA_R2", - "MD_CHASE:FEN_CHOPPA_R3", - "MD_CHASE:HANGON_STUN_LOOP", - "MD_CHASE:HANGON_STUN_TURN", - "MD_CHASE:MD_BIKE_2_HANG", - "MD_CHASE:MD_BIKE_JMP_BL", - "MD_CHASE:MD_BIKE_JMP_F", - "MD_CHASE:MD_BIKE_LND_BL", - "MD_CHASE:MD_BIKE_LND_DIE_BL", - "MD_CHASE:MD_BIKE_LND_DIE_F", - "MD_CHASE:MD_BIKE_LND_F", - "MD_CHASE:MD_BIKE_LND_ROLL", - "MD_CHASE:MD_BIKE_LND_ROLL_F", - "MD_CHASE:MD_BIKE_PUNCH", - "MD_CHASE:MD_BIKE_PUNCH_F", - "MD_CHASE:MD_BIKE_SHOT_F", - "MD_CHASE:MD_HANG_LND_ROLL", - "MD_CHASE:MD_HANG_LOOP", - "MD_END:END_SC1_PLY", - "MD_END:END_SC1_RYD", - "MD_END:END_SC1_SMO", - "MD_END:END_SC1_SWE", - "MD_END:END_SC2_PLY", - "MD_END:END_SC2_RYD", - "MD_END:END_SC2_SMO", - "MD_END:END_SC2_SWE", - "MEDIC:CPR", - "MISC:BITCHSLAP", - "MISC:BMX_CELEBRATE", - "MISC:BMX_COMEON", - "MISC:BMX_IDLELOOP_01", - "MISC:BMX_IDLELOOP_02", - "MISC:BMX_TALKLEFT_IN", - "MISC:BMX_TALKLEFT_LOOP", - "MISC:BMX_TALKLEFT_OUT", - "MISC:BMX_TALKRIGHT_IN", - "MISC:BMX_TALKRIGHT_LOOP", - "MISC:BMX_TALKRIGHT_OUT", - "MISC:BNG_WNDW", - "MISC:BNG_WNDW_02", - "MISC:CASE_PICKUP", - "MISC:DOOR_JET", - "MISC:GRAB_L", - "MISC:GRAB_R", - "MISC:HIKER_POSE", - "MISC:HIKER_POSE_L", - "MISC:IDLE_CHAT_02", - "MISC:KAT_THROW_K", - "MISC:KAT_THROW_O", - "MISC:KAT_THROW_P", - "MISC:PASS_RIFLE_O", - "MISC:PASS_RIFLE_PED", - "MISC:PASS_RIFLE_PLY", - "MISC:PICKUP_BOX", - "MISC:PLANE_DOOR", - "MISC:PLANE_EXIT", - "MISC:PLANE_HIJACK", - "MISC:PLUNGER_01", - "MISC:PLYRLEAN_LOOP", - "MISC:PLYR_SHKHEAD", - "MISC:RUN_DIVE", - "MISC:SCRATCHBALLS_01", - "MISC:SEAT_LR", - "MISC:SEAT_TALK_01", - "MISC:SEAT_TALK_02", - "MISC:SEAT_WATCH", - "MISC:SMALPLANE_DOOR", - "MISC:SMLPLANE_DOOR", - "MTB:MTB_BACK", - "MTB:MTB_BUNNYHOP", - "MTB:MTB_DRIVEBYFT", - "MTB:MTB_DRIVEBY_LHS", - "MTB:MTB_DRIVEBY_RHS", - "MTB:MTB_FWD", - "MTB:MTB_GETOFFBACK", - "MTB:MTB_GETOFFLHS", - "MTB:MTB_GETOFFRHS", - "MTB:MTB_JUMPONL", - "MTB:MTB_JUMPONR", - "MTB:MTB_LEFT", - "MTB:MTB_PEDAL", - "MTB:MTB_PUSHES", - "MTB:MTB_RIDE", - "MTB:MTB_RIGHT", - "MTB:MTB_SPRINT", - "MTB:MTB_STILL", - "MUSCULAR:MSCLEWALKST_ARMED", - "MUSCULAR:MSCLEWALKST_CSAW", - "MUSCULAR:MSCLE_RCKT_RUN", - "MUSCULAR:MSCLE_RCKT_WALKST", - "MUSCULAR:MSCLE_RUN_CSAW", - "MUSCULAR:MUSCLEIDLE", - "MUSCULAR:MUSCLEIDLE_ARMED", - "MUSCULAR:MUSCLEIDLE_CSAW", - "MUSCULAR:MUSCLEIDLE_ROCKET", - "MUSCULAR:MUSCLERUN", - "MUSCULAR:MUSCLERUN_ARMED", - "MUSCULAR:MUSCLESPRINT", - "MUSCULAR:MUSCLEWALK", - "MUSCULAR:MUSCLEWALKSTART", - "MUSCULAR:MUSCLEWALK_ARMED", - "MUSCULAR:MUSCLEWALK_CSAW", - "MUSCULAR:MUSCLEWALK_ROCKET", - "NEVADA:NEVADA_GETIN", - "NEVADA:NEVADA_GETOUT", - "ON_LOOKERS:LKAROUND_IN", - "ON_LOOKERS:LKAROUND_LOOP", - "ON_LOOKERS:LKAROUND_OUT", - "ON_LOOKERS:LKUP_IN", - "ON_LOOKERS:LKUP_LOOP", - "ON_LOOKERS:LKUP_OUT", - "ON_LOOKERS:LKUP_POINT", - "ON_LOOKERS:PANIC_COWER", - "ON_LOOKERS:PANIC_HIDE", - "ON_LOOKERS:PANIC_IN", - "ON_LOOKERS:PANIC_LOOP", - "ON_LOOKERS:PANIC_OUT", - "ON_LOOKERS:PANIC_POINT", - "ON_LOOKERS:PANIC_SHOUT", - "ON_LOOKERS:POINTUP_IN", - "ON_LOOKERS:POINTUP_LOOP", - "ON_LOOKERS:POINTUP_OUT", - "ON_LOOKERS:POINTUP_SHOUT", - "ON_LOOKERS:POINT_IN", - "ON_LOOKERS:POINT_LOOP", - "ON_LOOKERS:POINT_OUT", - "ON_LOOKERS:SHOUT_01", - "ON_LOOKERS:SHOUT_02", - "ON_LOOKERS:SHOUT_IN", - "ON_LOOKERS:SHOUT_LOOP", - "ON_LOOKERS:SHOUT_OUT", - "ON_LOOKERS:WAVE_IN", - "ON_LOOKERS:WAVE_LOOP", - "ON_LOOKERS:WAVE_OUT", - "OTB:BETSLP_IN", - "OTB:BETSLP_LKABT", - "OTB:BETSLP_LOOP", - "OTB:BETSLP_OUT", - "OTB:BETSLP_TNK", - "OTB:WTCHRACE_CMON", - "OTB:WTCHRACE_IN", - "OTB:WTCHRACE_LOOP", - "OTB:WTCHRACE_LOSE", - "OTB:WTCHRACE_OUT", - "OTB:WTCHRACE_WIN", - "PARACHUTE:FALL_SKYDIVE", - "PARACHUTE:FALL_SKYDIVE_ACCEL", - "PARACHUTE:FALL_SKYDIVE_DIE", - "PARACHUTE:FALL_SKYDIVE_L", - "PARACHUTE:FALL_SKYDIVE_R", - "PARACHUTE:PARA_DECEL", - "PARACHUTE:PARA_DECEL_O", - "PARACHUTE:PARA_FLOAT", - "PARACHUTE:PARA_FLOAT_O", - "PARACHUTE:PARA_LAND", - "PARACHUTE:PARA_LAND_O", - "PARACHUTE:PARA_LAND_WATER", - "PARACHUTE:PARA_LAND_WATER_O", - "PARACHUTE:PARA_OPEN", - "PARACHUTE:PARA_OPEN_O", - "PARACHUTE:PARA_RIP_LAND_O", - "PARACHUTE:PARA_RIP_LOOP_O", - "PARACHUTE:PARA_RIP_O", - "PARACHUTE:PARA_STEERL", - "PARACHUTE:PARA_STEERL_O", - "PARACHUTE:PARA_STEERR", - "PARACHUTE:PARA_STEERR_O", - "PARK:TAI_CHI_IN", - "PARK:TAI_CHI_LOOP", - "PARK:TAI_CHI_OUT", - "PAULNMAC:PISS_IN", - "PAULNMAC:PISS_LOOP", - "PAULNMAC:PISS_OUT", - "PAULNMAC:PNM_ARGUE1_A", - "PAULNMAC:PNM_ARGUE1_B", - "PAULNMAC:PNM_ARGUE2_A", - "PAULNMAC:PNM_ARGUE2_B", - "PAULNMAC:PNM_LOOP_A", - "PAULNMAC:PNM_LOOP_B", - "PAULNMAC:WANK_IN", - "PAULNMAC:WANK_LOOP", - "PAULNMAC:WANK_OUT", - "PED:ABSEIL", - "PED:ARRESTGUN", - "PED:ATM", - "PED:BIKE_ELBOWL", - "PED:BIKE_ELBOWR", - "PED:BIKE_FALLR", - "PED:BIKE_FALL_OFF", - "PED:BIKE_PICKUPL", - "PED:BIKE_PICKUPR", - "PED:BIKE_PULLUPL", - "PED:BIKE_PULLUPR", - "PED:BOMBER", - "PED:CAR_ALIGNHI_LHS", - "PED:CAR_ALIGNHI_RHS", - "PED:CAR_ALIGN_LHS", - "PED:CAR_ALIGN_RHS", - "PED:CAR_CLOSEDOORL_LHS", - "PED:CAR_CLOSEDOORL_RHS", - "PED:CAR_CLOSEDOOR_LHS", - "PED:CAR_CLOSEDOOR_RHS", - "PED:CAR_CLOSE_LHS", - "PED:CAR_CLOSE_RHS", - "PED:CAR_CRAWLOUTRHS", - "PED:CAR_DEAD_LHS", - "PED:CAR_DEAD_RHS", - "PED:CAR_DOORLOCKED_LHS", - "PED:CAR_DOORLOCKED_RHS", - "PED:CAR_FALLOUT_LHS", - "PED:CAR_FALLOUT_RHS", - "PED:CAR_GETINL_LHS", - "PED:CAR_GETINL_RHS", - "PED:CAR_GETIN_LHS", - "PED:CAR_GETIN_RHS", - "PED:CAR_GETOUTL_LHS", - "PED:CAR_GETOUTL_RHS", - "PED:CAR_GETOUT_LHS", - "PED:CAR_GETOUT_RHS", - "PED:CAR_HOOKERTALK", - "PED:CAR_JACKEDLHS", - "PED:CAR_JACKEDRHS", - "PED:CAR_JUMPIN_LHS", - "PED:CAR_LB", - "PED:CAR_LB_PRO", - "PED:CAR_LB_WEAK", - "PED:CAR_LJACKEDLHS", - "PED:CAR_LJACKEDRHS", - "PED:CAR_LSHUFFLE_RHS", - "PED:CAR_LSIT", - "PED:CAR_OPEN_LHS", - "PED:CAR_OPEN_RHS", - "PED:CAR_PULLOUTL_LHS", - "PED:CAR_PULLOUTL_RHS", - "PED:CAR_PULLOUT_LHS", - "PED:CAR_PULLOUT_RHS", - "PED:CAR_QJACKED", - "PED:CAR_ROLLDOOR", - "PED:CAR_ROLLDOORLO", - "PED:CAR_ROLLOUT_LHS", - "PED:CAR_ROLLOUT_RHS", - "PED:CAR_SHUFFLE_RHS", - "PED:CAR_SIT", - "PED:CAR_SITP", - "PED:CAR_SITPLO", - "PED:CAR_SIT_PRO", - "PED:CAR_SIT_WEAK", - "PED:CAR_TUNE_RADIO", - "PED:CLIMB_IDLE", - "PED:CLIMB_JUMP", - "PED:CLIMB_JUMP2FALL", - "PED:CLIMB_JUMP_B", - "PED:CLIMB_PULL", - "PED:CLIMB_STAND", - "PED:CLIMB_STAND_FINISH", - "PED:COWER", - "PED:CROUCH_ROLL_L", - "PED:CROUCH_ROLL_R", - "PED:DAM_ARML_FRMBK", - "PED:DAM_ARML_FRMFT", - "PED:DAM_ARML_FRMLT", - "PED:DAM_ARMR_FRMBK", - "PED:DAM_ARMR_FRMFT", - "PED:DAM_ARMR_FRMRT", - "PED:DAM_LEGL_FRMBK", - "PED:DAM_LEGL_FRMFT", - "PED:DAM_LEGL_FRMLT", - "PED:DAM_LEGR_FRMBK", - "PED:DAM_LEGR_FRMFT", - "PED:DAM_LEGR_FRMRT", - "PED:DAM_STOMACH_FRMBK", - "PED:DAM_STOMACH_FRMFT", - "PED:DAM_STOMACH_FRMLT", - "PED:DAM_STOMACH_FRMRT", - "PED:DOOR_LHINGE_O", - "PED:DOOR_RHINGE_O", - "PED:DRIVEBYL_L", - "PED:DRIVEBYL_R", - "PED:DRIVEBY_L", - "PED:DRIVEBY_R", - "PED:DRIVE_BOAT", - "PED:DRIVE_BOAT_BACK", - "PED:DRIVE_BOAT_L", - "PED:DRIVE_BOAT_R", - "PED:DRIVE_L", - "PED:DRIVE_LO_L", - "PED:DRIVE_LO_R", - "PED:DRIVE_L_PRO", - "PED:DRIVE_L_PRO_SLOW", - "PED:DRIVE_L_SLOW", - "PED:DRIVE_L_WEAK", - "PED:DRIVE_L_WEAK_SLOW", - "PED:DRIVE_R", - "PED:DRIVE_R_PRO", - "PED:DRIVE_R_PRO_SLOW", - "PED:DRIVE_R_SLOW", - "PED:DRIVE_R_WEAK", - "PED:DRIVE_R_WEAK_SLOW", - "PED:DRIVE_TRUCK", - "PED:DRIVE_TRUCK_BACK", - "PED:DRIVE_TRUCK_L", - "PED:DRIVE_TRUCK_R", - "PED:DROWN", - "PED:DUCK_COWER", - "PED:ENDCHAT_01", - "PED:ENDCHAT_02", - "PED:ENDCHAT_03", - "PED:EV_DIVE", - "PED:EV_STEP", - "PED:FACANGER", - "PED:FACGUM", - "PED:FACSURP", - "PED:FACSURPM", - "PED:FACTALK", - "PED:FACURIOS", - "PED:FALL_BACK", - "PED:FALL_COLLAPSE", - "PED:FALL_FALL", - "PED:FALL_FRONT", - "PED:FALL_GLIDE", - "PED:FALL_LAND", - "PED:FALL_SKYDIVE", - "PED:FIGHT2IDLE", - "PED:FIGHTA_1", - "PED:FIGHTA_2", - "PED:FIGHTA_3", - "PED:FIGHTA_BLOCK", - "PED:FIGHTA_G", - "PED:FIGHTA_M", - "PED:FIGHTIDLE", - "PED:FIGHTSHB", - "PED:FIGHTSHF", - "PED:FIGHTSH_BWD", - "PED:FIGHTSH_FWD", - "PED:FIGHTSH_LEFT", - "PED:FIGHTSH_RIGHT", - "PED:FLEE_LKAROUND_01", - "PED:FLOOR_HIT", - "PED:FLOOR_HIT_F", - "PED:FUCKU", - "PED:GANG_GUNSTAND", - "PED:GAS_CWR", - "PED:GETUP", - "PED:GETUP_FRONT", - "PED:GUM_EAT", - "PED:GUNCROUCHBWD", - "PED:GUNCROUCHFWD", - "PED:GUNMOVE_BWD", - "PED:GUNMOVE_FWD", - "PED:GUNMOVE_L", - "PED:GUNMOVE_R", - "PED:GUN_2_IDLE", - "PED:GUN_BUTT", - "PED:GUN_BUTT_CROUCH", - "PED:GUN_STAND", - "PED:HANDSCOWER", - "PED:HANDSUP", - "PED:HITA_1", - "PED:HITA_2", - "PED:HITA_3", - "PED:HIT_BACK", - "PED:HIT_BEHIND", - "PED:HIT_FRONT", - "PED:HIT_GUN_BUTT", - "PED:HIT_L", - "PED:HIT_R", - "PED:HIT_WALK", - "PED:HIT_WALL", - "PED:IDLESTANCE_FAT", - "PED:IDLESTANCE_OLD", - "PED:IDLE_ARMED", - "PED:IDLE_CHAT", - "PED:IDLE_CSAW", - "PED:IDLE_GANG1", - "PED:IDLE_HBHB", - "PED:IDLE_ROCKET", - "PED:IDLE_STANCE", - "PED:IDLE_TAXI", - "PED:IDLE_TIRED", - "PED:JETPACK_IDLE", - "PED:JOG_FEMALEA", - "PED:JOG_MALEA", - "PED:JUMP_GLIDE", - "PED:JUMP_LAND", - "PED:JUMP_LAUNCH", - "PED:JUMP_LAUNCH_R", - "PED:KART_DRIVE", - "PED:KART_L", - "PED:KART_LB", - "PED:KART_R", - "PED:KD_LEFT", - "PED:KD_RIGHT", - "PED:KO_SHOT_FACE", - "PED:KO_SHOT_FRONT", - "PED:KO_SHOT_STOM", - "PED:KO_SKID_BACK", - "PED:KO_SKID_FRONT", - "PED:KO_SPIN_L", - "PED:KO_SPIN_R", - "PED:PASS_SMOKE_IN_CAR", - "PED:PHONE_IN", - "PED:PHONE_OUT", - "PED:PHONE_TALK", - "PED:PLAYER_SNEAK", - "PED:PLAYER_SNEAK_WALKSTART", - "PED:ROADCROSS", - "PED:ROADCROSS_FEMALE", - "PED:ROADCROSS_GANG", - "PED:ROADCROSS_OLD", - "PED:RUN_1ARMED", - "PED:RUN_ARMED", - "PED:RUN_CIVI", - "PED:RUN_CSAW", - "PED:RUN_FAT", - "PED:RUN_FATOLD", - "PED:RUN_GANG1", - "PED:RUN_LEFT", - "PED:RUN_OLD", - "PED:RUN_PLAYER", - "PED:RUN_RIGHT", - "PED:RUN_ROCKET", - "PED:RUN_STOP", - "PED:RUN_STOPR", - "PED:RUN_WUZI", - "PED:SEAT_DOWN", - "PED:SEAT_IDLE", - "PED:SEAT_UP", - "PED:SHOT_LEFTP", - "PED:SHOT_PARTIAL", - "PED:SHOT_PARTIAL_B", - "PED:SHOT_RIGHTP", - "PED:SHOVE_PARTIAL", - "PED:SMOKE_IN_CAR", - "PED:SPRINT_CIVI", - "PED:SPRINT_PANIC", - "PED:SPRINT_WUZI", - "PED:SWAT_RUN", - "PED:SWIM_TREAD", - "PED:TAP_HAND", - "PED:TAP_HANDP", - "PED:TURN_180", - "PED:TURN_L", - "PED:TURN_R", - "PED:WALK_ARMED", - "PED:WALK_CIVI", - "PED:WALK_CSAW", - "PED:WALK_DOORPARTIAL", - "PED:WALK_DRUNK", - "PED:WALK_FAT", - "PED:WALK_FATOLD", - "PED:WALK_GANG1", - "PED:WALK_GANG2", - "PED:WALK_OLD", - "PED:WALK_PLAYER", - "PED:WALK_ROCKET", - "PED:WALK_SHUFFLE", - "PED:WALK_START", - "PED:WALK_START_ARMED", - "PED:WALK_START_CSAW", - "PED:WALK_START_ROCKET", - "PED:WALK_WUZI", - "PED:WEAPON_CROUCH", - "PED:WOMAN_IDLESTANCE", - "PED:WOMAN_RUN", - "PED:WOMAN_RUNBUSY", - "PED:WOMAN_RUNFATOLD", - "PED:WOMAN_RUNPANIC", - "PED:WOMAN_RUNSEXY", - "PED:WOMAN_WALKBUSY", - "PED:WOMAN_WALKFATOLD", - "PED:WOMAN_WALKNORM", - "PED:WOMAN_WALKOLD", - "PED:WOMAN_WALKPRO", - "PED:WOMAN_WALKSEXY", - "PED:WOMAN_WALKSHOP", - "PED:XPRESSSCRATCH", - "PLAYER_DVBYS:PLYR_DRIVEBYBWD", - "PLAYER_DVBYS:PLYR_DRIVEBYFWD", - "PLAYER_DVBYS:PLYR_DRIVEBYLHS", - "PLAYER_DVBYS:PLYR_DRIVEBYRHS", - "PLAYIDLES:SHIFT", - "PLAYIDLES:SHLDR", - "PLAYIDLES:STRETCH", - "PLAYIDLES:STRLEG", - "PLAYIDLES:TIME", - "POLICE:COPTRAF_AWAY", - "POLICE:COPTRAF_COME", - "POLICE:COPTRAF_LEFT", - "POLICE:COPTRAF_STOP", - "POLICE:COP_GETOUTCAR_LHS", - "POLICE:COP_MOVE_FWD", - "POLICE:CRM_DRGBST_01", - "POLICE:DOOR_KICK", - "POLICE:PLC_DRGBST_01", - "POLICE:PLC_DRGBST_02", - "POOL:POOL_CHALKCUE", - "POOL:POOL_IDLE_STANCE", - "POOL:POOL_LONG_SHOT", - "POOL:POOL_LONG_SHOT_O", - "POOL:POOL_LONG_START", - "POOL:POOL_LONG_START_O", - "POOL:POOL_MED_SHOT", - "POOL:POOL_MED_SHOT_O", - "POOL:POOL_MED_START", - "POOL:POOL_MED_START_O", - "POOL:POOL_PLACE_WHITE", - "POOL:POOL_SHORT_SHOT", - "POOL:POOL_SHORT_SHOT_O", - "POOL:POOL_SHORT_START", - "POOL:POOL_SHORT_START_O", - "POOL:POOL_WALK", - "POOL:POOL_WALK_START", - "POOL:POOL_XLONG_SHOT", - "POOL:POOL_XLONG_SHOT_O", - "POOL:POOL_XLONG_START", - "POOL:POOL_XLONG_START_O", - "POOR:WINWASH_START", - "POOR:WINWASH_WASH2BEG", - "PYTHON:PYTHON_CROUCHFIRE", - "PYTHON:PYTHON_CROUCHRELOAD", - "PYTHON:PYTHON_FIRE", - "PYTHON:PYTHON_FIRE_POOR", - "PYTHON:PYTHON_RELOAD", - "QUAD:QUAD_BACK", - "QUAD:QUAD_DRIVEBY_FT", - "QUAD:QUAD_DRIVEBY_LHS", - "QUAD:QUAD_DRIVEBY_RHS", - "QUAD:QUAD_FWD", - "QUAD:QUAD_GETOFF_B", - "QUAD:QUAD_GETOFF_LHS", - "QUAD:QUAD_GETOFF_RHS", - "QUAD:QUAD_GETON_LHS", - "QUAD:QUAD_GETON_RHS", - "QUAD:QUAD_HIT", - "QUAD:QUAD_KICK", - "QUAD:QUAD_LEFT", - "QUAD:QUAD_PASSENGER", - "QUAD:QUAD_REVERSE", - "QUAD:QUAD_RIDE", - "QUAD:QUAD_RIGHT", - "QUAD_DBZ:PASS_DRIVEBY_BWD", - "QUAD_DBZ:PASS_DRIVEBY_FWD", - "QUAD_DBZ:PASS_DRIVEBY_LHS", - "QUAD_DBZ:PASS_DRIVEBY_RHS", - "RAPPING:LAUGH_01", - "RAPPING:RAP_A_IN", - "RAPPING:RAP_A_LOOP", - "RAPPING:RAP_A_OUT", - "RAPPING:RAP_B_IN", - "RAPPING:RAP_B_LOOP", - "RAPPING:RAP_B_OUT", - "RAPPING:RAP_C_LOOP", - "RIFLE:RIFLE_CROUCHFIRE", - "RIFLE:RIFLE_CROUCHLOAD", - "RIFLE:RIFLE_FIRE", - "RIFLE:RIFLE_FIRE_POOR", - "RIFLE:RIFLE_LOAD", - "RIOT:RIOT_ANGRY", - "RIOT:RIOT_ANGRY_B", - "RIOT:RIOT_CHALLENGE", - "RIOT:RIOT_CHANT", - "RIOT:RIOT_FUKU", - "RIOT:RIOT_PUNCHES", - "RIOT:RIOT_SHOUT", - "ROB_BANK:CAT_SAFE_END", - "ROB_BANK:CAT_SAFE_OPEN", - "ROB_BANK:CAT_SAFE_OPEN_O", - "ROB_BANK:CAT_SAFE_ROB", - "ROB_BANK:SHP_HANDSUP_SCR", - "ROCKET:IDLE_ROCKET", - "ROCKET:ROCKETFIRE", - "ROCKET:RUN_ROCKET", - "ROCKET:WALK_ROCKET", - "ROCKET:WALK_START_ROCKET", - "RUSTLER:PLANE_ALIGN_LHS", - "RUSTLER:PLANE_CLOSE", - "RUSTLER:PLANE_GETIN", - "RUSTLER:PLANE_GETOUT", - "RUSTLER:PLANE_OPEN", - "RYDER:RYD_BECKON_01", - "RYDER:RYD_BECKON_02", - "RYDER:RYD_BECKON_03", - "RYDER:RYD_DIE_PT1", - "RYDER:RYD_DIE_PT2", - "RYDER:VAN_CRATE_L", - "RYDER:VAN_CRATE_R", - "RYDER:VAN_FALL_L", - "RYDER:VAN_FALL_R", - "RYDER:VAN_LEAN_L", - "RYDER:VAN_LEAN_R", - "RYDER:VAN_PICKUP_E", - "RYDER:VAN_PICKUP_S", - "RYDER:VAN_STAND", - "RYDER:VAN_STAND_CRATE", - "RYDER:VAN_THROW", - "SCRATCHING:SCDLDLP", - "SCRATCHING:SCDLULP", - "SCRATCHING:SCDRDLP", - "SCRATCHING:SCDRULP", - "SCRATCHING:SCLNG_L", - "SCRATCHING:SCLNG_R", - "SCRATCHING:SCMID_L", - "SCRATCHING:SCMID_R", - "SCRATCHING:SCSHRTL", - "SCRATCHING:SCSHRTR", - "SCRATCHING:SC_LTOR", - "SCRATCHING:SC_RTOL", - "SHAMAL:SHAMAL_ALIGN", - "SHAMAL:SHAMAL_GETIN_LHS", - "SHAMAL:SHAMAL_GETOUT_LHS", - "SHAMAL:SHAMAL_OPEN", - "SHOP:ROB_2IDLE", - "SHOP:ROB_LOOP", - "SHOP:ROB_LOOP_THREAT", - "SHOP:ROB_SHIFTY", - "SHOP:ROB_STICKUP_IN", - "SHOP:SHP_DUCK", - "SHOP:SHP_DUCK_AIM", - "SHOP:SHP_DUCK_FIRE", - "SHOP:SHP_GUN_AIM", - "SHOP:SHP_GUN_DUCK", - "SHOP:SHP_GUN_FIRE", - "SHOP:SHP_GUN_GRAB", - "SHOP:SHP_GUN_THREAT", - "SHOP:SHP_HANDSUP_SCR", - "SHOP:SHP_JUMP_GLIDE", - "SHOP:SHP_JUMP_LAND", - "SHOP:SHP_JUMP_LAUNCH", - "SHOP:SHP_ROB_GIVECASH", - "SHOP:SHP_ROB_HANDSUP", - "SHOP:SHP_ROB_REACT", - "SHOP:SHP_SERVE_END", - "SHOP:SHP_SERVE_IDLE", - "SHOP:SHP_SERVE_LOOP", - "SHOP:SHP_SERVE_START", - "SHOP:SMOKE_RYD", - "SHOTGUN:SHOTGUN_CROUCHFIRE", - "SHOTGUN:SHOTGUN_FIRE", - "SHOTGUN:SHOTGUN_FIRE_POOR", - "SILENCED:CROUCHRELOAD", - "SILENCED:SILENCECROUCHFIRE", - "SILENCED:SILENCE_FIRE", - "SILENCED:SILENCE_RELOAD", - "SKATE:SKATE_IDLE", - "SKATE:SKATE_RUN", - "SKATE:SKATE_SPRINT", - "SMOKING:F_SMKLEAN_LOOP", - "SMOKING:M_SMKLEAN_LOOP", - "SMOKING:M_SMKSTND_LOOP", - "SMOKING:M_SMK_DRAG", - "SMOKING:M_SMK_IN", - "SMOKING:M_SMK_LOOP", - "SMOKING:M_SMK_OUT", - "SMOKING:M_SMK_TAP", - "SNIPER:WEAPON_SNIPER", - "SPRAYCAN:SPRAYCAN_FIRE", - "SPRAYCAN:SPRAYCAN_FULL", - "STRIP:PLY_CASH", - "STRIP:PUN_CASH", - "STRIP:PUN_HOLLER", - "STRIP:PUN_LOOP", - "STRIP:STRIP_A", - "STRIP:STRIP_B", - "STRIP:STRIP_C", - "STRIP:STRIP_D", - "STRIP:STRIP_E", - "STRIP:STRIP_F", - "STRIP:STRIP_G", - "STRIP:STR_A2B", - "STRIP:STR_B2A", - "STRIP:STR_B2C", - "STRIP:STR_C1", - "STRIP:STR_C2", - "STRIP:STR_C2B", - "STRIP:STR_LOOP_A", - "STRIP:STR_LOOP_B", - "STRIP:STR_LOOP_C", - "SUNBATHE:BATHERDOWN", - "SUNBATHE:BATHERUP", - "SUNBATHE:LAY_BAC_IN", - "SUNBATHE:LAY_BAC_OUT", - "SUNBATHE:PARKSIT_M_IDLEA", - "SUNBATHE:PARKSIT_M_IDLEB", - "SUNBATHE:PARKSIT_M_IDLEC", - "SUNBATHE:PARKSIT_M_IN", - "SUNBATHE:PARKSIT_M_OUT", - "SUNBATHE:PARKSIT_W_IDLEA", - "SUNBATHE:PARKSIT_W_IDLEB", - "SUNBATHE:PARKSIT_W_IDLEC", - "SUNBATHE:PARKSIT_W_IN", - "SUNBATHE:PARKSIT_W_OUT", - "SUNBATHE:SBATHE_F_LIEB2SIT", - "SUNBATHE:SBATHE_F_OUT", - "SUNBATHE:SITNWAIT_IN_W", - "SUNBATHE:SITNWAIT_OUT_W", - "SWAT:GNSTWALL_INJURD", - "SWAT:JMP_WALL1M_180", - "SWAT:RAIL_FALL", - "SWAT:RAIL_FALL_CRAWL", - "SWAT:SWT_BREACH_01", - "SWAT:SWT_BREACH_02", - "SWAT:SWT_BREACH_03", - "SWAT:SWT_GO", - "SWAT:SWT_LKT", - "SWAT:SWT_STY", - "SWAT:SWT_VENT_01", - "SWAT:SWT_VENT_02", - "SWAT:SWT_VNT_SHT_DIE", - "SWAT:SWT_VNT_SHT_IN", - "SWAT:SWT_VNT_SHT_LOOP", - "SWAT:SWT_WLLPK_L", - "SWAT:SWT_WLLPK_L_BACK", - "SWAT:SWT_WLLPK_R", - "SWAT:SWT_WLLPK_R_BACK", - "SWAT:SWT_WLLSHOOT_IN_L", - "SWAT:SWT_WLLSHOOT_IN_R", - "SWAT:SWT_WLLSHOOT_OUT_L", - "SWAT:SWT_WLLSHOOT_OUT_R", - "SWEET:HO_ASS_SLAPPED", - "SWEET:LAFIN_PLAYER", - "SWEET:LAFIN_SWEET", - "SWEET:PLYR_HNDSHLDR_01", - "SWEET:SWEET_ASS_SLAP", - "SWEET:SWEET_HNDSHLDR_01", - "SWEET:SWEET_INJUREDLOOP", - "SWIM:SWIM_BREAST", - "SWIM:SWIM_CRAWL", - "SWIM:SWIM_DIVE_UNDER", - "SWIM:SWIM_GLIDE", - "SWIM:SWIM_JUMPOUT", - "SWIM:SWIM_TREAD", - "SWIM:SWIM_UNDER", - "SWORD:SWORD_1", - "SWORD:SWORD_2", - "SWORD:SWORD_3", - "SWORD:SWORD_4", - "SWORD:SWORD_BLOCK", - "SWORD:SWORD_HIT_1", - "SWORD:SWORD_HIT_2", - "SWORD:SWORD_HIT_3", - "SWORD:SWORD_IDLE", - "SWORD:SWORD_PART", - "TANK:TANK_ALIGN_LHS", - "TANK:TANK_CLOSE_LHS", - "TANK:TANK_DOORLOCKED", - "TANK:TANK_GETIN_LHS", - "TANK:TANK_GETOUT_LHS", - "TANK:TANK_OPEN_LHS", - "TATTOOS:TAT_ARML_IN_O", - "TATTOOS:TAT_ARML_IN_P", - "TATTOOS:TAT_ARML_IN_T", - "TATTOOS:TAT_ARML_OUT_O", - "TATTOOS:TAT_ARML_OUT_P", - "TATTOOS:TAT_ARML_OUT_T", - "TATTOOS:TAT_ARML_POSE_O", - "TATTOOS:TAT_ARML_POSE_P", - "TATTOOS:TAT_ARML_POSE_T", - "TATTOOS:TAT_ARMR_IN_O", - "TATTOOS:TAT_ARMR_IN_P", - "TATTOOS:TAT_ARMR_IN_T", - "TATTOOS:TAT_ARMR_OUT_O", - "TATTOOS:TAT_ARMR_OUT_P", - "TATTOOS:TAT_ARMR_OUT_T", - "TATTOOS:TAT_ARMR_POSE_O", - "TATTOOS:TAT_ARMR_POSE_P", - "TATTOOS:TAT_ARMR_POSE_T", - "TATTOOS:TAT_BACK_IN_O", - "TATTOOS:TAT_BACK_IN_P", - "TATTOOS:TAT_BACK_IN_T", - "TATTOOS:TAT_BACK_OUT_O", - "TATTOOS:TAT_BACK_OUT_P", - "TATTOOS:TAT_BACK_OUT_T", - "TATTOOS:TAT_BACK_POSE_O", - "TATTOOS:TAT_BACK_POSE_P", - "TATTOOS:TAT_BACK_POSE_T", - "TATTOOS:TAT_BACK_SIT_IN_P", - "TATTOOS:TAT_BACK_SIT_LOOP_P", - "TATTOOS:TAT_BACK_SIT_OUT_P", - "TATTOOS:TAT_BEL_IN_O", - "TATTOOS:TAT_BEL_IN_T", - "TATTOOS:TAT_BEL_OUT_O", - "TATTOOS:TAT_BEL_OUT_T", - "TATTOOS:TAT_BEL_POSE_O", - "TATTOOS:TAT_BEL_POSE_T", - "TATTOOS:TAT_CHE_IN_O", - "TATTOOS:TAT_CHE_IN_P", - "TATTOOS:TAT_CHE_IN_T", - "TATTOOS:TAT_CHE_OUT_O", - "TATTOOS:TAT_CHE_OUT_P", - "TATTOOS:TAT_CHE_OUT_T", - "TATTOOS:TAT_CHE_POSE_O", - "TATTOOS:TAT_CHE_POSE_P", - "TATTOOS:TAT_CHE_POSE_T", - "TATTOOS:TAT_DROP_O", - "TATTOOS:TAT_IDLE_LOOP_O", - "TATTOOS:TAT_IDLE_LOOP_T", - "TATTOOS:TAT_SIT_IN_O", - "TATTOOS:TAT_SIT_IN_P", - "TATTOOS:TAT_SIT_IN_T", - "TATTOOS:TAT_SIT_LOOP_O", - "TATTOOS:TAT_SIT_LOOP_P", - "TATTOOS:TAT_SIT_LOOP_T", - "TATTOOS:TAT_SIT_OUT_O", - "TATTOOS:TAT_SIT_OUT_P", - "TATTOOS:TAT_SIT_OUT_T", - "TEC:TEC_CROUCHFIRE", - "TEC:TEC_CROUCHRELOAD", - "TEC:TEC_FIRE", - "TEC:TEC_RELOAD", - "TRAIN:TRAN_GTUP", - "TRAIN:TRAN_HNG", - "TRAIN:TRAN_OUCH", - "TRAIN:TRAN_STMB", - "TRUCK:TRUCK_ALIGN_LHS", - "TRUCK:TRUCK_ALIGN_RHS", - "TRUCK:TRUCK_CLOSEDOOR_LHS", - "TRUCK:TRUCK_CLOSEDOOR_RHS", - "TRUCK:TRUCK_CLOSE_LHS", - "TRUCK:TRUCK_CLOSE_RHS", - "TRUCK:TRUCK_GETIN_LHS", - "TRUCK:TRUCK_GETIN_RHS", - "TRUCK:TRUCK_GETOUT_LHS", - "TRUCK:TRUCK_GETOUT_RHS", - "TRUCK:TRUCK_JACKEDLHS", - "TRUCK:TRUCK_JACKEDRHS", - "TRUCK:TRUCK_OPEN_LHS", - "TRUCK:TRUCK_OPEN_RHS", - "TRUCK:TRUCK_PULLOUT_LHS", - "TRUCK:TRUCK_PULLOUT_RHS", - "TRUCK:TRUCK_SHUFFLE", - "UZI:UZI_CROUCHFIRE", - "UZI:UZI_CROUCHRELOAD", - "UZI:UZI_FIRE", - "UZI:UZI_FIRE_POOR", - "UZI:UZI_RELOAD", - "VAN:VAN_CLOSE_BACK_LHS", - "VAN:VAN_CLOSE_BACK_RHS", - "VAN:VAN_GETIN_BACK_LHS", - "VAN:VAN_GETIN_BACK_RHS", - "VAN:VAN_GETOUT_BACK_LHS", - "VAN:VAN_GETOUT_BACK_RHS", - "VAN:VAN_OPEN_BACK_LHS", - "VAN:VAN_OPEN_BACK_RHS", - "VENDING:VEND_DRINK2_P", - "VENDING:VEND_DRINK_P", - "VENDING:VEND_EAT1_P", - "VENDING:VEND_EAT_P", - "VENDING:VEND_USE", - "VENDING:VEND_USE_PT2", - "VORTEX:CAR_JUMPIN_LHS", - "VORTEX:CAR_JUMPIN_RHS", - "VORTEX:VORTEX_GETOUT_LHS", - "VORTEX:VORTEX_GETOUT_RHS", - "WAYFARER:WF_BACK", - "WAYFARER:WF_DRIVEBYFT", - "WAYFARER:WF_DRIVEBYLHS", - "WAYFARER:WF_DRIVEBYRHS", - "WAYFARER:WF_FWD", - "WAYFARER:WF_GETOFFBACK", - "WAYFARER:WF_GETOFFLHS", - "WAYFARER:WF_GETOFFRHS", - "WAYFARER:WF_HIT", - "WAYFARER:WF_JUMPONL", - "WAYFARER:WF_JUMPONR", - "WAYFARER:WF_KICK", - "WAYFARER:WF_LEFT", - "WAYFARER:WF_PASSENGER", - "WAYFARER:WF_PUSHES", - "WAYFARER:WF_RIDE", - "WAYFARER:WF_RIGHT", - "WAYFARER:WF_STILL", - "WEAPONS:SHP_1H_LIFT", - "WEAPONS:SHP_1H_LIFT_END", - "WEAPONS:SHP_1H_RET", - "WEAPONS:SHP_1H_RET_S", - "WEAPONS:SHP_2H_LIFT", - "WEAPONS:SHP_2H_LIFT_END", - "WEAPONS:SHP_2H_RET", - "WEAPONS:SHP_2H_RET_S", - "WEAPONS:SHP_AR_LIFT", - "WEAPONS:SHP_AR_LIFT_END", - "WEAPONS:SHP_AR_RET", - "WEAPONS:SHP_AR_RET_S", - "WEAPONS:SHP_G_LIFT_IN", - "WEAPONS:SHP_G_LIFT_OUT", - "WEAPONS:SHP_TRAY_IN", - "WEAPONS:SHP_TRAY_OUT", - "WEAPONS:SHP_TRAY_POSE", - "WUZI:CS_DEAD_GUY", - "WUZI:CS_PLYR_PT1", - "WUZI:CS_PLYR_PT2", - "WUZI:CS_WUZI_PT1", - "WUZI:CS_WUZI_PT2", - "WUZI:WALKSTART_IDLE_01", - "WUZI:WUZI_FOLLOW", - "WUZI:WUZI_GREET_PLYR", - "WUZI:WUZI_GREET_WUZI", - "WUZI:WUZI_GRND_CHK", - "WUZI:WUZI_STAND_LOOP", - "WUZI:WUZI_WALK", - "WOP:DANCE_G1", - "WOP:DANCE_G2", - "WOP:DANCE_G3", - "WOP:DANCE_G4", - "WOP:DANCE_G5", - "WOP:DANCE_G6", - "WOP:DANCE_G7", - "WOP:DANCE_G8", - "WOP:DANCE_G9", - "WOP:DANCE_G10", - "WOP:DANCE_G11", - "WOP:DANCE_G12", - "WOP:DANCE_G13", - "WOP:DANCE_G14", - "WOP:DANCE_G15", - "WOP:DANCE_G16", - "WOP:DANCE_B1", - "WOP:DANCE_B2", - "WOP:DANCE_B3", - "WOP:DANCE_B4", - "WOP:DANCE_B5", - "WOP:DANCE_B6", - "WOP:DANCE_B7", - "WOP:DANCE_B8", - "WOP:DANCE_B9", - "WOP:DANCE_B10", - "WOP:DANCE_B11", - "WOP:DANCE_B12", - "WOP:DANCE_B13", - "WOP:DANCE_B14", - "WOP:DANCE_B15", - "WOP:DANCE_B16", - "WOP:DANCE_LOOP", - "GFUNK:DANCE_G1", - "GFUNK:DANCE_G2", - "GFUNK:DANCE_G3", - "GFUNK:DANCE_G4", - "GFUNK:DANCE_G5", - "GFUNK:DANCE_G6", - "GFUNK:DANCE_G7", - "GFUNK:DANCE_G8", - "GFUNK:DANCE_G9", - "GFUNK:DANCE_G10", - "GFUNK:DANCE_G11", - "GFUNK:DANCE_G12", - "GFUNK:DANCE_G13", - "GFUNK:DANCE_G14", - "GFUNK:DANCE_G15", - "GFUNK:DANCE_G16", - "GFUNK:DANCE_B1", - "GFUNK:DANCE_B2", - "GFUNK:DANCE_B3", - "GFUNK:DANCE_B4", - "GFUNK:DANCE_B5", - "GFUNK:DANCE_B6", - "GFUNK:DANCE_B7", - "GFUNK:DANCE_B8", - "GFUNK:DANCE_B9", - "GFUNK:DANCE_B10", - "GFUNK:DANCE_B11", - "GFUNK:DANCE_B12", - "GFUNK:DANCE_B13", - "GFUNK:DANCE_B14", - "GFUNK:DANCE_B15", - "GFUNK:DANCE_B16", - "GFUNK:DANCE_LOOP", - "RUNNINGMAN:DANCE_G1", - "RUNNINGMAN:DANCE_G2", - "RUNNINGMAN:DANCE_G3", - "RUNNINGMAN:DANCE_G4", - "RUNNINGMAN:DANCE_G5", - "RUNNINGMAN:DANCE_G6", - "RUNNINGMAN:DANCE_G7", - "RUNNINGMAN:DANCE_G8", - "RUNNINGMAN:DANCE_G9", - "RUNNINGMAN:DANCE_G10", - "RUNNINGMAN:DANCE_G11", - "RUNNINGMAN:DANCE_G12", - "RUNNINGMAN:DANCE_G13", - "RUNNINGMAN:DANCE_G14", - "RUNNINGMAN:DANCE_G15", - "RUNNINGMAN:DANCE_G16", - "RUNNINGMAN:DANCE_B1", - "RUNNINGMAN:DANCE_B2", - "RUNNINGMAN:DANCE_B3", - "RUNNINGMAN:DANCE_B4", - "RUNNINGMAN:DANCE_B5", - "RUNNINGMAN:DANCE_B6", - "RUNNINGMAN:DANCE_B7", - "RUNNINGMAN:DANCE_B8", - "RUNNINGMAN:DANCE_B9", - "RUNNINGMAN:DANCE_B10", - "RUNNINGMAN:DANCE_B11", - "RUNNINGMAN:DANCE_B12", - "RUNNINGMAN:DANCE_B13", - "RUNNINGMAN:DANCE_B14", - "RUNNINGMAN:DANCE_B15", - "RUNNINGMAN:DANCE_B16", - "RUNNINGMAN:DANCE_LOOP", - "SAMP:FISHINGIDLE", - // TODO: Add The "SEX", "SNM", and "BLOWJOBZ" animations, optionally based on version. -}; - -static StringView AnimLibs[] = { - "AIRPORT", - "ATTRACTORS", - "BAR", - "BASEBALL", - "BD_FIRE", - "BEACH", - "BENCHPRESS", - "BF_INJECTION", - "BIKE_DBZ", - "BIKED", - "BIKEH", - "BIKELEAP", - "BIKES", - "BIKEV", - "BMX", - "BOMBER", - "BOX", - "BSKTBALL", - "BUDDY", - "BUS", - "CAMERA", - "CAR", - "CAR_CHAT", - "CARRY", - "CASINO", - "CHAINSAW", - "CHOPPA", - "CLOTHES", - "COACH", - "COLT45", - "COP_AMBIENT", - "COP_DVBYZ", - "CRACK", - "CRIB", - "DAM_JUMP", - "DANCING", - "DEALER", - "DILDO", - "DODGE", - "DOZER", - "DRIVEBYS", - "FAT", - "FIGHT_B", - "FIGHT_C", - "FIGHT_D", - "FIGHT_E", - "FINALE", - "FINALE2", - "FLAME", - "FLOWERS", - "FOOD", - "FREEWEIGHTS", - "GANGS", - "GFUNK", - "GHANDS", - "GHETTO_DB", - "GOGGLES", - "GRAFFITI", - "GRAVEYARD", - "GRENADE", - "GYMNASIUM", - "HAIRCUTS", - "HEIST9", - "INT_HOUSE", - "INT_OFFICE", - "INT_SHOP", - "JST_BUISNESS", - "KART", - "KISSING", - "KNIFE", - "LAPDAN1", - "LAPDAN2", - "LAPDAN3", - "LOWRIDER", - "MD_CHASE", - "MD_END", - "MEDIC", - "MISC", - "MTB", - "MUSCULAR", - "NEVADA", - "ON_LOOKERS", - "OTB", - "PARACHUTE", - "PARK", - "PAULNMAC", - "PED", - "PLAYER_DVBYS", - "PLAYIDLES", - "POLICE", - "POOL", - "POOR", - "PYTHON", - "QUAD", - "QUAD_DBZ", - "RAPPING", - "RIFLE", - "RIOT", - "ROB_BANK", - "ROCKET", - "RUNNINGMAN", - "RUSTLER", - "RYDER", - "SAMP", - "SCRATCHING", - "SHAMAL", - "SHOP", - "SHOTGUN", - "SILENCED", - "SKATE", - "SMOKING", - "SNIPER", - "SPRAYCAN", - "STRIP", - "SUNBATHE", - "SWAT", - "SWEET", - "SWIM", - "SWORD", - "TANK", - "TATTOOS", - "TEC", - "TRAIN", - "TRUCK", - "UZI", - "VAN", - "VENDING", - "VORTEX", - "WAYFARER", - "WEAPONS", - "WUZI", - "WOP" -}; - -/// Quick animation validity lookup -static struct AnimationLookup -{ - FlatHashSet valid; - - AnimationLookup() - { - for (int i = 1 /* skip animation 0 since it's invalid */; i < GLM_COUNTOF(AnimationNames); ++i) - { - valid.emplace(Impl::String(AnimationNames[i])); - } - } -} AnimationNamesLookup; - -/// Quick animation validity lookup -static struct AnimationLibraryLookup -{ - FlatHashSet valid; - - AnimationLibraryLookup() - { - for (int i = 0; i < GLM_COUNTOF(AnimLibs); ++i) - { - valid.emplace(Impl::String(AnimLibs[i])); - } - } -} AnimationLibraryLookup; - -inline Pair splitAnimationNames(int ID) -{ - if (ID <= 0 || ID >= GLM_COUNTOF(AnimationNames)) - { - return { "", "" }; - } - - StringView full = AnimationNames[ID]; - unsigned int idx = full.find(':'); - if (idx == -1) - { - return { "", "" }; - } - - return { full.substr(0, idx), full.substr(idx + 1) }; -} - -inline bool animationNameValid(StringView lib, StringView name) -{ - Impl::String fullName(lib); - fullName += ':' + Impl::String(name); - std::transform(fullName.begin(), fullName.end(), fullName.begin(), [](unsigned char c) - { - return std::toupper(c); - }); - return AnimationNamesLookup.valid.find(fullName) != AnimationNamesLookup.valid.end(); -} - -inline bool animationLibraryValid(StringView lib, bool v1_0 = true) -{ - Impl::String fullName(lib); - std::transform(fullName.begin(), fullName.end(), fullName.begin(), [](unsigned char c) - { - return std::toupper(c); - }); - if (AnimationLibraryLookup.valid.find(fullName) != AnimationLibraryLookup.valid.end()) - { - return true; - } - if (v1_0) - { - // Check three more libraries, removed in version 1.1 - return fullName == "BLOWJOBZ" || fullName == "SEX" || fullName == "SNM"; - } - return false; -} - -/* Interfaces, to be passed around */ - -/// Holds data to pass when applying an animation to a player -struct AnimationData -{ - float delta; ///< The speed to play the animation - bool loop; ///< If set to 1, the animation will loop. If set to 0, the animation will play once - bool lockX; ///< If set to 0, the player is returned to their old X coordinate once the animation is complete (for animations that move the player such as walking). 1 will not return them to their old position - bool lockY; ///< Same as above but for the Y axis. Should be kept the same as the previous parameter - bool freeze; ///< Setting this to 1 will freeze the player at the end of the animation. 0 will not - uint32_t time; ///< Timer in milliseconds. For a never-ending loop it should be 0 - HybridString<16> lib; ///< The animation library of the animation to apply - HybridString<24> name; ///< The name of the animation to apply - - AnimationData() - : delta(4.1f) - , loop(false) - , lockX(false) - , lockY(false) - , freeze(false) - , time(0) - { - } - - /// Constructor - AnimationData(float delta, bool loop, bool lockX, bool lockY, bool freeze, uint32_t time, StringView lib, StringView name) - : delta(delta) - , loop(loop) - , lockX(lockX) - , lockY(lockY) - , freeze(freeze) - , time(time) - , lib(lib) - , name(name) - { - } -}; diff --git a/SDK/include/component.hpp b/SDK/include/component.hpp deleted file mode 100644 index bcf1a4c9b..000000000 --- a/SDK/include/component.hpp +++ /dev/null @@ -1,259 +0,0 @@ -#pragma once - -#include "types.hpp" - -#ifndef BUILD_NUMBER -#define BUILD_NUMBER 0 -#endif - -#define OMP_VERSION_SUPPORTED 1 - -/// Should always be used in classes inheriting IExtension -#define PROVIDE_EXT_UID(uuid) \ - static constexpr UID ExtensionIID = uuid; \ - UID getExtensionID() override { return ExtensionIID; } - -/// A class which should be inherited by extensions returned by IExtensible -struct IExtension -{ - /// Get the extension's UID - virtual UID getExtensionID() = 0; - - /// Delete the extension. - /// If the extension is added dynamically with addExtension and the autoDeleteExt flag was set, - /// this will be called on destruction of the IExtensible interface or on removeExtension. - virtual void freeExtension() { } - - virtual void reset() = 0; -}; - -/// A class which should be inherited by classes which want to be extensible without breaking the ABI -struct IExtensible -{ - /// Try to get an extension by its UID - /// @return A pointer to the extension or nullptr if it's not supported - virtual IExtension* getExtension(UID id) { return nullptr; } - - /// Query an extension by its type - /// Don't call directly, use global queryExtension() instead - /// @typeparam ExtensionT The extension type, must derive from IExtension - template - ExtensionT* _queryExtension() - { - static_assert(std::is_base_of::value, "queryExtension parameter must inherit from IExtension"); - - auto it = miscExtensions.find(ExtensionT::ExtensionIID); - if (it != miscExtensions.end()) - { - return static_cast(it->second.first); - } - - IExtension* ext = getExtension(ExtensionT::ExtensionIID); - if (ext) - { - return static_cast(ext); - } - return nullptr; - } - - /// Add an extension dynamically - /// @param ext The extension to add - /// @param autoDeleteExt Whether the extension should be automatically deleted (its freeExtension method called) on the extensible's destruction - /// @return True if added successfully, false otherwise (the ID is already inserted) - virtual bool addExtension(IExtension* ext, bool autoDeleteExt) - { - return miscExtensions.emplace(robin_hood::pair>(ext->getExtensionID(), std::make_pair(ext, autoDeleteExt))).second; - } - - /// Remove a dynamically added extension - /// If the extension was added with the autoDeleteExt flag on this also calls its freeExtension method - /// @param ext The extension to remove - /// @return True if removed successfully, false otherwise (ID not found) - virtual bool removeExtension(IExtension* ext) - { - auto it = miscExtensions.find(ext->getExtensionID()); - if (it == miscExtensions.end()) - { - return false; - } - if (it->second.second) - { - it->second.first->freeExtension(); - } - miscExtensions.erase(it); - return true; - } - - /// Remove a dynamically added extension - /// If the extension was added with the autoDeleteExt flag on this also calls its freeExtension method - /// @param ext The extension to remove - /// @return True if removed successfully, false otherwise (ID not found) - virtual bool removeExtension(UID id) - { - auto it = miscExtensions.find(id); - if (it == miscExtensions.end()) - { - return false; - } - if (it->second.second) - { - it->second.first->freeExtension(); - } - miscExtensions.erase(it); - return true; - } - - virtual ~IExtensible() - { - freeExtensions(); - } - -protected: - FlatHashMap> miscExtensions; - - void freeExtensions() - { - for (auto it = miscExtensions.begin(); it != miscExtensions.end(); ++it) - { - if (it->second.second) - { - it->second.first->freeExtension(); - } - } - } - - void resetExtensions() - { - for (auto it = miscExtensions.begin(); it != miscExtensions.end(); ++it) - { - if (it->second.second) - { - it->second.first->reset(); - } - } - } -}; - -/// Query an extension by its type -/// @typeparam ExtensionT The extension type, must derive from IExtension -template -ExtensionT* queryExtension(IExtensible* extensible) -{ - return extensible->_queryExtension(); -} - -/// Query an extension by its type -/// @typeparam ExtensionT The extension type, must derive from IExtension -template -ExtensionT* queryExtension(const IExtensible* extensible) -{ - return extensible->_queryExtension(); -} - -/// Query an extension by its type -/// @typeparam ExtensionT The extension type, must derive from IExtension -template -ExtensionT* queryExtension(IExtensible& extensible) -{ - return extensible._queryExtension(); -} - -/// Query an extension by its type -/// @typeparam ExtensionT The extension type, must derive from IExtension -template -ExtensionT* queryExtension(const IExtensible& extensible) -{ - return extensible._queryExtension(); -} - -/// Should always be used in classes inheriting IUIDProvider -#define PROVIDE_UID(uuid) \ - static constexpr UID IID = uuid; \ - UID getUID() override { return uuid; } - -/// An interface providing UIDs -struct IUIDProvider -{ - virtual UID getUID() = 0; -}; - -enum ComponentType -{ - Other, - Network, - Pool, -}; - -struct ICore; -struct IComponentList; -struct ILogger; -struct IEarlyConfig; - -/// A component interface -struct IComponent : public IExtensible, public IUIDProvider -{ - /// The idea is for the SDK to be totally forward compatible, so code built at any time will - /// always work, thanks to ABI compatibility. This method is an emergency trap door, just in - /// case that's ever not the problem. Check which major version this component was built for, - /// if it isn't the current major version, fail to load it. Always just returns a constant, - /// recompiling will often be enough to upgrade. `virtual` and `final` to be the vtable, but it - /// can't be overridden because it is a constant. - virtual int supportedVersion() const final - { - return OMP_VERSION_SUPPORTED; - } - - /// Get the component's name - virtual StringView componentName() const = 0; - - /// Get the component's type - virtual ComponentType componentType() const { return ComponentType::Other; } - - /// Get the component's version - virtual SemanticVersion componentVersion() const = 0; - - /// Called for every component to load it - /// Should be used for caching the core interface, registering player/core event handlers - virtual void onLoad(ICore* c) = 0; - - /// Called when all components have been loaded - /// Should be used for querying other components, registering their event handlers - /// Should NOT be used for interacting with other components or firing events - /// @param components Tcomponentgins list to query - virtual void onInit(IComponentList* components) { } - - /// Called when all components have been initialised - /// Should be used for interacting with other components, firing events, or any more complex logic - virtual void onReady() { } - - /// Called before the components are about to be freed - /// Should be used for disconnecting - virtual void onFree(IComponent* component) { } - - /// Fill a configuration object with custom configuration - /// @param defaults Whether to only provide default values. True when generating the config file - virtual void provideConfiguration(ILogger& logger, IEarlyConfig& config, bool defaults) { } - - /// Frees the component data - virtual void free() = 0; - - /// Reset the component data (on GMX) - virtual void reset() = 0; -}; - -struct IComponentList : public IExtensible -{ - /// Query a component by its ID - /// @param id The UID of the component - /// @return A pointer to the component or nullptr if not available - virtual IComponent* queryComponent(UID id) = 0; - - /// Query a component by its type - /// @typeparam ComponentT The component type, must derive from IComponent - template - ComponentT* queryComponent() - { - static_assert(std::is_base_of::value, "queryComponent parameter must inherit from IComponent"); - return static_cast(queryComponent(ComponentT::IID)); - } -}; diff --git a/SDK/include/core.hpp b/SDK/include/core.hpp deleted file mode 100644 index 212d3c7db..000000000 --- a/SDK/include/core.hpp +++ /dev/null @@ -1,393 +0,0 @@ -#pragma once - -#include "component.hpp" -#include "events.hpp" -#include "network.hpp" -#include "player.hpp" -#include "types.hpp" -#include "values.hpp" - -enum HTTPRequestType -{ - HTTPRequestType_Get = 1, - HTTPRequestType_Post, - HTTPRequestType_Head -}; - -struct HTTPResponseHandler -{ - virtual void onHTTPResponse(int status, StringView body) = 0; -}; - -/// An event handler for core events -struct CoreEventHandler -{ - virtual void onTick(Microseconds elapsed, TimePoint now) = 0; -}; - -/// Types of data can be set in core during runtime -enum class SettableCoreDataType -{ - ServerName, - ModeText, - MapName, - Language, - URL, - Password, - AdminPassword, -}; - -enum ConfigOptionType -{ - ConfigOptionType_None = -1, - ConfigOptionType_Int = 0, - ConfigOptionType_String = 1, - ConfigOptionType_Float = 2, - ConfigOptionType_Strings = 3, - ConfigOptionType_Bool = 4, -}; - -/// A config option enumerator -struct OptionEnumeratorCallback -{ - /// Called for each option that's available in the config - /// @return true to continue enumerating, false to stop - virtual bool proc(StringView name, ConfigOptionType type) = 0; -}; - -struct IConfig : public IExtensible -{ - /// Get a variable as a string - virtual const StringView getString(StringView key) const = 0; - - /// Get a variable as an int - virtual int* getInt(StringView key) = 0; - - /// Get a variable as a float - virtual float* getFloat(StringView key) = 0; - - /// Get a list of strings - virtual size_t getStrings(StringView key, Span output) const = 0; - - /// Get the count of a list of strings - /// Useful for pre-allocating the container that will store the getStrings() result - virtual size_t getStringsCount(StringView key) const = 0; - - /// Get the type of the option - virtual ConfigOptionType getType(StringView key) const = 0; - - /// Get the number of bans - virtual size_t getBansCount() const = 0; - - /// Get a list of banned addresses - virtual const BanEntry& getBan(size_t index) const = 0; - - /// Add a ban - virtual void addBan(const BanEntry& entry) = 0; - - /// Remove a ban - virtual void removeBan(size_t index) = 0; - - /// Remove a ban - virtual void removeBan(const BanEntry& entry) = 0; - - /// Write bans to file - virtual void writeBans() = 0; - - /// Reload bans - virtual void reloadBans() = 0; - - /// Clear bans - virtual void clearBans() = 0; - - /// Check if ban entry is banned - virtual bool isBanned(const BanEntry& entry) const = 0; - - /// Get an option name from an alias if available - /// @return A pair of bool which is true if the alias is deprecated and a string with the real config name - virtual Pair getNameFromAlias(StringView alias) const = 0; - - /// Enumerate the options in the config - virtual void enumOptions(OptionEnumeratorCallback& callback) const = 0; - - /// Get a variable as a bool - virtual bool* getBool(StringView key) = 0; -}; - -/// Used for filling config parameters by Config components -struct IEarlyConfig : public IConfig -{ - /// Set or create a string in the config - virtual void setString(StringView key, StringView value) = 0; - - /// Set or create an int in the config - virtual void setInt(StringView key, int value) = 0; - - /// Set or create a float in the config - virtual void setFloat(StringView key, float value) = 0; - - /// Set or create a list of strings in the config - virtual void setStrings(StringView key, Span value) = 0; - - /// Add an alias to another option in the config - /// @param alias The alias - /// @param key The real name - /// @param deprecated Whether the alias is deprecated - virtual void addAlias(StringView alias, StringView key, bool deprecated = false) = 0; - - /// Set or create a bool in the config - virtual void setBool(StringView key, bool value) = 0; -}; - -enum LogLevel -{ - Debug, - Message, - Warning, - Error -}; - -/// A basic logger interface -struct ILogger -{ - /// Print a new line to console - __ATTRIBUTE__((__format__(__printf__, 2, 3))) - virtual void printLn(const char* fmt, ...) = 0; - - /// Print a new line to console (receives va_list instead) - __ATTRIBUTE__((__format__(__printf__, 2, 0))) - virtual void vprintLn(const char* fmt, va_list args) = 0; - - /// Print a new line to console of a specified log type - __ATTRIBUTE__((__format__(__printf__, 3, 4))) - virtual void logLn(LogLevel level, const char* fmt, ...) = 0; - - /// Print a new line to console of a specified log type (receives va_list instead) - __ATTRIBUTE__((__format__(__printf__, 3, 0))) - virtual void vlogLn(LogLevel level, const char* fmt, va_list args) = 0; - - /// Print a new line to console in UTF-8 encoding - __ATTRIBUTE__((__format__(__printf__, 2, 3))) - virtual void printLnU8(const char* fmt, ...) = 0; - - /// Print a new line to console in UTF-8 encoding (receives va_list instead) - __ATTRIBUTE__((__format__(__printf__, 2, 0))) - virtual void vprintLnU8(const char* fmt, va_list args) = 0; - - /// Print a new line to console of a specified log type in UTF-8 encoding - __ATTRIBUTE__((__format__(__printf__, 3, 4))) - virtual void logLnU8(LogLevel level, const char* fmt, ...) = 0; - - /// Print a new line to console of a specified log type in UTF-8 encoding (receives va_list instead) - __ATTRIBUTE__((__format__(__printf__, 3, 0))) - virtual void vlogLnU8(LogLevel level, const char* fmt, va_list args) = 0; -}; - -/// The core interface -struct ICore : public IExtensible, public ILogger -{ - /// Get the SDK version - virtual SemanticVersion getVersion() const = 0; - - /// Get the version of the NetworkBitStream class the core was built with - virtual int getNetworkBitStreamVersion() const = 0; - - /// Get the player pool - virtual IPlayerPool& getPlayers() = 0; - - /// Get the core event dispatcher - virtual IEventDispatcher& getEventDispatcher() = 0; - - virtual IConfig& getConfig() = 0; - - /// Get a list of available networks - virtual const FlatPtrHashSet& getNetworks() = 0; - - /// Get tick count - virtual unsigned getTickCount() const = 0; - - /// Set server gravity - virtual void setGravity(float gravity) = 0; - - /// Get server gravity - virtual float getGravity() const = 0; - - /// Set server weather - virtual void setWeather(int weather) = 0; - - /// Set server world time - virtual void setWorldTime(Hours time) = 0; - - /// Toggle server stunt bonus - virtual void useStuntBonuses(bool enable) = 0; - - /// Set string data during runtime - virtual void setData(SettableCoreDataType type, StringView data) = 0; - - /// Set sleep value for each main thread update cycle - virtual void setThreadSleep(Microseconds value) = 0; - - /// Toggle dynamic ticks instead of static duration sleep - virtual void useDynTicks(const bool enable) = 0; - - /// Clear all entites that vanish on GM exit. - virtual void resetAll() = 0; - - /// Create all entites that appear on GM start. - virtual void reloadAll() = 0; - - /// Get weapon's name as a string - virtual StringView getWeaponName(PlayerWeapon weapon) = 0; - - /// Attempt to connect a new bot to the server - /// @param name The bot name (player name) - /// @param script The bot script to execute - virtual void connectBot(StringView name, StringView script) = 0; - - /// Launch an HTTP request and read the response - /// @param handler The handler that will handle the response - /// @param type The request type - /// @param url The URL - /// @param[opt] data The POST data - virtual void requestHTTP(HTTPResponseHandler* handler, HTTPRequestType type, StringView url, StringView data = StringView()) = 0; - - /// Get the ticks per second - virtual unsigned tickRate() const = 0; - - /// Hash a password with SHA-256, for backwards compatibility - virtual bool sha256(StringView password, StringView salt, StaticArray& output) const = 0; - - virtual StringView getVersionHash() const = 0; - - /// Add a per-RPC event handler for each network for the packet's network ID - template - inline void addPerRPCInEventHandler(SingleNetworkInEventHandler* handler, event_order_t priority = EventPriority_Default) - { - const FlatPtrHashSet& networks = getNetworks(); - for (INetwork* network : networks) - { - if (PktID != INVALID_PACKET_ID) - { - network->getPerRPCInEventDispatcher().addEventHandler(handler, PktID, priority); - } - } - } - - /// Add a per-PACKET event handler for each network for the packet's network ID - template - inline void addPerPacketInEventHandler(SingleNetworkInEventHandler* handler, event_order_t priority = EventPriority_Default) - { - const FlatPtrHashSet& networks = getNetworks(); - for (INetwork* network : networks) - { - if (PktID != INVALID_PACKET_ID) - { - network->getPerPacketInEventDispatcher().addEventHandler(handler, PktID, priority); - } - } - } - - /// Remove a per-RPC event handler for each network for the packet's network ID - template - inline void removePerRPCInEventHandler(SingleNetworkInEventHandler* handler) - { - const FlatPtrHashSet& networks = getNetworks(); - for (INetwork* network : networks) - { - if (PktID != INVALID_PACKET_ID) - { - network->getPerRPCInEventDispatcher().removeEventHandler(handler, PktID); - } - } - } - - /// Remove a per-PACKET event handler for each network for the packet's network ID - template - inline void removePerPacketInEventHandler(SingleNetworkInEventHandler* handler) - { - const FlatPtrHashSet& networks = getNetworks(); - for (INetwork* network : networks) - { - if (PktID != INVALID_PACKET_ID) - { - network->getPerPacketInEventDispatcher().removeEventHandler(handler, PktID); - } - } - } - - /// Add a network event handler to all available networks' dispatchers - inline void addNetworkEventHandler(NetworkEventHandler* handler, event_order_t priority = EventPriority_Default) - { - const FlatPtrHashSet& networks = getNetworks(); - for (INetwork* network : networks) - { - network->getEventDispatcher().addEventHandler(handler, priority); - } - } - - /// Remove a network event handler from all available networks' dispatchers - inline void removeNetworkEventHandler(NetworkEventHandler* handler) - { - const FlatPtrHashSet& networks = getNetworks(); - for (INetwork* network : networks) - { - network->getEventDispatcher().removeEventHandler(handler); - } - } - - /// Update network and query parameter cache - inline void updateNetworks() - { - const FlatPtrHashSet& networks = getNetworks(); - for (INetwork* network : networks) - { - network->update(); - } - } - - /// Launch an HTTP request (IPV4) and read the response - /// @param handler The handler that will handle the response - /// @param type The request type - /// @param url The URL - /// @param[opt] data The POST data - virtual void requestHTTP4(HTTPResponseHandler* handler, HTTPRequestType type, StringView url, StringView data = StringView()) = 0; -}; - -/// Helper class to get streamer config properties -struct StreamConfigHelper -{ - float getDistanceSqr() const - { - const float dist = *distance; - return dist * dist; - } - int getRate() const { return *rate; } - - StreamConfigHelper() - : distance(nullptr) - , rate(nullptr) - , last() - { - } - - StreamConfigHelper(IConfig& config) - : distance(config.getFloat("network.stream_radius")) - , rate(config.getInt("network.stream_rate")) - { - } - - bool shouldStream(int pid, TimePoint now) - { - if (now - last[pid] > Milliseconds(*rate)) - { - last[pid] = now; - return true; - } - return false; - } - -private: - float* distance; - int* rate; - StaticArray last; -}; diff --git a/SDK/include/entity.hpp b/SDK/include/entity.hpp deleted file mode 100644 index 87a6d107c..000000000 --- a/SDK/include/entity.hpp +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -#include "component.hpp" -#include "events.hpp" -#include "gtaquat.hpp" -#include "types.hpp" -#include - -/// An interface for ID providers -struct IIDProvider -{ - virtual int getID() const = 0; -}; - -/// A base entity interface -struct IEntity : public IIDProvider -{ - /// Get the entity's position - virtual Vector3 getPosition() const = 0; - - /// Set the entity's position - virtual void setPosition(Vector3 position) = 0; - - /// Get the entity's rotation - virtual GTAQuat getRotation() const = 0; - - /// Set the entity's rotation - virtual void setRotation(GTAQuat rotation) = 0; - - /// Get the entity's virtual world - virtual int getVirtualWorld() const = 0; - - /// Set the entity's virtual world - virtual void setVirtualWorld(int vw) = 0; -}; diff --git a/SDK/include/events.hpp b/SDK/include/events.hpp deleted file mode 100644 index 96763c99c..000000000 --- a/SDK/include/events.hpp +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once - -#include "types.hpp" -#include -#include -#include -#include - -/* Interfaces, to be passed around */ - -typedef int8_t event_order_t; - -enum EventPriority : event_order_t -{ - EventPriority_Highest = std::numeric_limits::min(), - EventPriority_FairlyHigh = EventPriority_Highest / 2, - EventPriority_Default = 0, - EventPriority_Lowest = std::numeric_limits::max(), - EventPriority_FairlyLow = EventPriority_Lowest / 2 -}; - -/// An event dispatcher -template -struct IEventDispatcher -{ - virtual bool addEventHandler(EventHandlerType* handler, event_order_t priority = EventPriority_Default) = 0; - virtual bool removeEventHandler(EventHandlerType* handler) = 0; - virtual bool hasEventHandler(EventHandlerType* handler, event_order_t& priority) = 0; - virtual size_t count() const = 0; -}; - -/// An indexed event dispatcher which executes events based on an index -template -struct IIndexedEventDispatcher -{ - virtual size_t count() const = 0; - virtual size_t count(size_t index) const = 0; - virtual bool addEventHandler(EventHandlerType* handler, size_t index, event_order_t priority = EventPriority_Default) = 0; - virtual bool removeEventHandler(EventHandlerType* handler, size_t index) = 0; - virtual bool hasEventHandler(EventHandlerType* handler, size_t index, event_order_t& priority) = 0; -}; diff --git a/SDK/include/gtaquat.hpp b/SDK/include/gtaquat.hpp deleted file mode 100644 index d06f793c2..000000000 --- a/SDK/include/gtaquat.hpp +++ /dev/null @@ -1,87 +0,0 @@ -#pragma once - -#include "types.hpp" -#include -#include - -// WARNING: Do not use glm::quat or glm::vec4 for quaternions instead of this class! -// The game uses a weird implementation of Euler angles and/or quaternions than almost everything you'd find. -// Special thanks to IllidanS4 and his i_quat include for the formulas used in this class. -// See this issue for more information: https://github.com/openmultiplayer/old.open.mp/issues/143 -// See this link for an explanation of the formulas: https://math.stackexchange.com/questions/1477926/quaternion-to-euler-with-some-properties - -class GTAQuat -{ -private: - static constexpr float EPSILON = 0.00000202655792236328125f; - -public: - GTAQuat() - : q(1.0f, 0.0f, 0.0f, 0.0f) - { - } - - GTAQuat(float w, float x, float y, float z) - : q(w, x, y, z) - { - } - - GTAQuat(float x, float y, float z) - : GTAQuat(Vector3(x, y, z)) - { - } - - GTAQuat(Vector3 degrees) - { - Vector3 radians = glm::radians(degrees); - Vector3 c = cos(radians * -0.5f); - Vector3 s = sin(radians * -0.5f); - - q.w = c.x * c.y * c.z + s.x * s.y * s.z; - q.x = c.x * s.y * s.z + s.x * c.y * c.z; - q.y = c.x * s.y * c.z - s.x * c.y * s.z; - q.z = c.x * c.y * s.z - s.x * s.y * c.z; - } - - Vector3 ToEuler() const - { - float temp = 2 * q.y * q.z - 2 * q.x * q.w; - float rx, ry, rz; - - if (temp >= 1.0f - EPSILON) - { - rx = 90.0f; - ry = -glm::degrees(atan2(glm::clamp(q.y, -1.0f, 1.0f), glm::clamp(q.w, -1.0f, 1.0f))); - rz = -glm::degrees(atan2(glm::clamp(q.z, -1.0f, 1.0f), glm::clamp(q.w, -1.0f, 1.0f))); - } - else if (-temp >= 1.0f - EPSILON) - { - rx = -90.0f; - ry = -glm::degrees(atan2(glm::clamp(q.y, -1.0f, 1.0f), glm::clamp(q.w, -1.0f, 1.0f))); - rz = -glm::degrees(atan2(glm::clamp(q.z, -1.0f, 1.0f), glm::clamp(q.w, -1.0f, 1.0f))); - } - else - { - rx = glm::degrees(asin(glm::clamp(temp, -1.0f, 1.0f))); - ry = -glm::degrees(atan2(glm::clamp(q.x * q.z + q.y * q.w, -1.0f, 1.0f), glm::clamp(0.5f - q.x * q.x - q.y * q.y, -1.0f, 1.0f))); - rz = -glm::degrees(atan2(glm::clamp(q.x * q.y + q.z * q.w, -1.0f, 1.0f), glm::clamp(0.5f - q.x * q.x - q.z * q.z, -1.0f, 1.0f))); - } - - // Keep each component in the [0, 360) interval - return mod(Vector3(rx, ry, rz), 360.0f); - } - - GTAQuat operator*(const GTAQuat& other) const - { - glm::quat res = q * other.q; - return GTAQuat(res.w, res.x, res.y, res.z); - } - - GTAQuat& operator*=(const GTAQuat& other) - { - q *= other.q; - return *this; - } - - glm::quat q; -}; diff --git a/SDK/include/legacy_id_mapper.hpp b/SDK/include/legacy_id_mapper.hpp deleted file mode 100644 index 8834362e5..000000000 --- a/SDK/include/legacy_id_mapper.hpp +++ /dev/null @@ -1,131 +0,0 @@ -// This class maps one set of IDs to another set. For example the gang zones internal pool is -// infinite, but the external Pawn API has two separate finite pools - a global pool and a per- -// player pool (technically that's `MAX_PLAYERS + 1` pools, not two). The SDK can simply create as -// many gang zones as desired and assign them ever increasing IDs. - -/// `X` (`MAX`) is the highest valid legacy ID PLUS ONE. -/// `N` (`MIN`) is the lowest valid legacy ID. -/// `I` (`INVALID`) is the invalid legacy ID returned in errors. -/// `F` (`FAIL`) is the invalid new ID returned in errors. -template -struct ILegacyIDMapper -{ - static const int MIN; - static const int MAX; - static const int INVALID; - static const int NOT_FOUND; - - /// Request a new legacy ID. - virtual int reserve() = 0; - - /// Store the given new ID in a legacy ID. - virtual void set(int legacy, int real) = 0; - - /// Release a previously used legacy ID and return the new ID it referenced. - virtual void release(int legacy) = 0; - - /// Get the legacy ID for the given new ID, or `INVALID`. - virtual int toLegacy(int real) const = 0; - - /// Get the new ID for the given legacy ID, or `NOT_FOUND`. - virtual int fromLegacy(int legacy) const = 0; -}; - -template -const int ILegacyIDMapper::MIN = N; - -template -const int ILegacyIDMapper::MAX = X; - -template -const int ILegacyIDMapper::INVALID = I; - -template -const int ILegacyIDMapper::NOT_FOUND = F; - -// TODO: Use a faster `toLegacy` lookup system. Maybe binary search or similar. -template -class FiniteLegacyIDMapper final : public ILegacyIDMapper -{ -public: - static const int MIN; - static const int MAX; - static const int INVALID; - static const int NOT_FOUND; - -private: - StaticArray ids_; - -public: - FiniteLegacyIDMapper() - : ids_() - { - ids_.fill(NOT_FOUND); - } - - /// Request a new legacy ID. - virtual int reserve() override - { - for (size_t legacy = 0; legacy != MAX - MIN; ++legacy) - { - if (ids_[legacy] == NOT_FOUND) - { - return legacy + MIN; - } - } - return INVALID; - } - - /// Store the given new ID in a legacy ID. - virtual void set(int legacy, int real) override - { - if (legacy >= MIN && legacy < MAX) - { - ids_[legacy - MIN] = real; - } - } - - /// Release a previously used legacy ID. - virtual void release(int legacy) override - { - if (legacy >= MIN && legacy < MAX) - { - ids_[legacy - MIN] = NOT_FOUND; - } - } - - /// Get the legacy ID for the given new ID, or `INVALID`. - virtual int toLegacy(int real) const override - { - for (size_t legacy = 0; legacy != MAX - MIN; ++legacy) - { - if (ids_[legacy] == real) - { - return legacy + MIN; - } - } - return INVALID; - } - - /// Get the new ID for the given legacy ID, or `NOT_FOUND`. - virtual int fromLegacy(int legacy) const override - { - if (legacy < MIN || legacy >= MAX) - { - return NOT_FOUND; - } - return ids_[legacy - MIN]; - } -}; - -template -const int FiniteLegacyIDMapper::MIN = N; - -template -const int FiniteLegacyIDMapper::MAX = X; - -template -const int FiniteLegacyIDMapper::INVALID = I; - -template -const int FiniteLegacyIDMapper::NOT_FOUND = F; diff --git a/SDK/include/network.hpp b/SDK/include/network.hpp deleted file mode 100644 index 42583cee5..000000000 --- a/SDK/include/network.hpp +++ /dev/null @@ -1,386 +0,0 @@ -#pragma once - -#include "component.hpp" -#include "events.hpp" -#include "gtaquat.hpp" -#include "types.hpp" -#include "values.hpp" -#include -#include -#include -#include - -#if OMP_BUILD_PLATFORM == OMP_WINDOWS -#include -#include -#include -#pragma comment(lib, "ws2_32.lib") -#elif OMP_BUILD_PLATFORM == OMP_UNIX -#include -#endif - -constexpr int INVALID_PACKET_ID = -1; - -struct IPlayer; -struct PeerNetworkData; - -enum PeerDisconnectReason -{ - PeerDisconnectReason_Timeout, - PeerDisconnectReason_Quit, - PeerDisconnectReason_Kicked, -}; - -enum OrderingChannel -{ - OrderingChannel_Internal, - OrderingChannel_SyncPacket, - OrderingChannel_SyncRPC, - OrderingChannel_Unordered, - OrderingChannel_Reliable, - OrderingChannel_DownloadRequest -}; - -/// The network types -enum ENetworkType -{ - ENetworkType_RakNetLegacy, - ENetworkType_ENet, - - ENetworkType_End -}; - -/// Stream reset types -enum ENetworkBitStreamReset -{ - BSResetRead = (1 << 0), ///< Reset read pointer - BSResetWrite = (1 << 1), ///< Reset write pointer - BSReset = BSResetRead | BSResetWrite ///< Reset both -}; - -/* Interfaces, to be passed around */ - -enum NewConnectionResult -{ - NewConnectionResult_Ignore, ///< Ignore the result - NewConnectionResult_VersionMismatch, - NewConnectionResult_BadName, - NewConnectionResult_BadMod, - NewConnectionResult_NoPlayerSlot, - NewConnectionResult_Success -}; - -enum class ClientVersion : uint8_t -{ - ClientVersion_SAMP_037, - ClientVersion_SAMP_03DL, - ClientVersion_openmp -}; - -struct PeerRequestParams -{ - ClientVersion version; - StringView versionName; - bool bot; - StringView name; - StringView serial; - bool isUsingOfficialClient; -}; - -struct NetworkStats -{ - unsigned connectionStartTime; - unsigned messageSendBuffer; - unsigned messagesSent; - unsigned totalBytesSent; - unsigned acknowlegementsSent; - unsigned acknowlegementsPending; - unsigned messagesOnResendQueue; - unsigned messageResends; - unsigned messagesTotalBytesResent; - float packetloss; - unsigned messagesReceived; - unsigned messagesReceivedPerSecond; - unsigned bytesReceived; - unsigned acknowlegementsReceived; - unsigned duplicateAcknowlegementsReceived; - double bitsPerSecond; - double bpsSent; - double bpsReceived; - bool isActive; // only for player network statistics - int connectMode; // only for player network statistics - unsigned connectionElapsedTime; -}; - -/// An event handler for network events -struct NetworkEventHandler -{ - /// Low-level network connect event, called after IPlayerPool::requestPlayer succeeds but before onIncomingConnection & onPlayerConnect - virtual void onPeerConnect(IPlayer& peer) { } - /// Low-level network disconnect event, called before onPlayerDisconnect - /// Only disconnect reasons supported are PeerDisconnectReason_Timeout and PeerDisconnectReason_Quit - /// any other reason should be handled by onPlayerDisconnect - virtual void onPeerDisconnect(IPlayer& peer, PeerDisconnectReason reason) { } -}; - -// Needs NetCode -class NetworkBitStream; - -/// An event handler for incoming network I/O events -struct NetworkInEventHandler -{ - virtual bool onReceivePacket(IPlayer& peer, int id, NetworkBitStream& bs) { return true; } - virtual bool onReceiveRPC(IPlayer& peer, int id, NetworkBitStream& bs) { return true; } -}; - -/// An event handler for incoming I/O events bound to a specific RPC/packet ID -struct SingleNetworkInEventHandler -{ - virtual bool onReceive(IPlayer& peer, NetworkBitStream& bs) { return true; } -}; - -/// An event handler for outgoing network I/O events -struct NetworkOutEventHandler -{ - virtual bool onSendPacket(IPlayer* peer, int id, NetworkBitStream& bs) { return true; } - virtual bool onSendRPC(IPlayer* peer, int id, NetworkBitStream& bs) { return true; } -}; - -/// An event handler for outgoing I/O events bound to a specific RPC/packet ID -struct SingleNetworkOutEventHandler -{ - virtual bool onSend(IPlayer* peer, NetworkBitStream& bs) { return true; } -}; - -/// A peer address with support for IPv4 and IPv6 -struct PeerAddress -{ - using AddressString = HybridString<46>; - - bool ipv6; ///< True if IPv6 is used, false otherwise - union - { - uint32_t v4; ///< The IPv4 address - union - { - uint16_t segments[8]; ///< The IPv6 address segments - uint8_t bytes[16]; ///< The IPv6 address bytes - } v6; - }; - - bool operator<(const PeerAddress& other) const - { - return ipv6 < other.ipv6 && v4 < other.v4 && v6.segments[2] < other.v6.segments[2] && v6.segments[3] < other.v6.segments[3] && v6.segments[4] < other.v6.segments[4] && v6.segments[5] < other.v6.segments[5] && v6.segments[6] < other.v6.segments[6] && v6.segments[7] < other.v6.segments[7]; - } - - bool operator==(const PeerAddress& other) const - { - return ipv6 == other.ipv6 && v4 == other.v4 && v6.segments[2] == other.v6.segments[2] && v6.segments[3] == other.v6.segments[3] && v6.segments[4] == other.v6.segments[4] && v6.segments[5] == other.v6.segments[5] && v6.segments[6] == other.v6.segments[6] && v6.segments[7] == other.v6.segments[7]; - } - - /// Get an address from string - /// @param[in,out] out The address to fill - needs its ipv6 set to know which type of address to get - static bool FromString(PeerAddress& out, StringView string) - { - if (out.ipv6) - { - in6_addr output; - if (inet_pton(AF_INET6, string.data(), &output)) - { - for (int i = 0; i < 16; ++i) - { - out.v6.bytes[i] = output.s6_addr[i]; - } - return true; - } - } - else - { - in_addr output; - if (inet_pton(AF_INET, string.data(), &output)) - { - out.v4 = output.s_addr; - return true; - } - } - - return false; - } - - /// Get a string from an address - static bool ToString(const PeerAddress& in, AddressString& address) - { - if (in.ipv6) - { - in6_addr addr; - for (int i = 0; i < 16; ++i) - { - addr.s6_addr[i] = in.v6.bytes[i]; - } - char output[INET6_ADDRSTRLEN] {}; - bool res = inet_ntop(AF_INET6, &addr, output, INET6_ADDRSTRLEN) != nullptr; - if (res) - { - address = AddressString(output); - } - return res; - } - else - { - in_addr addr; - addr.s_addr = in.v4; - char output[INET_ADDRSTRLEN] {}; - bool res = inet_ntop(AF_INET, &addr, output, INET_ADDRSTRLEN) != nullptr; - if (res) - { - address = AddressString(output); - } - return res; - } - } -}; - -struct BanEntry -{ -public: - PeerAddress::AddressString address; ///< The banned address - WorldTimePoint time; ///< The time when the ban was issued - HybridString name; ///< The banned player's name - HybridString<32> reason; ///< The ban reason - - BanEntry(StringView address, WorldTimePoint time = WorldTime::now()) - : address(address) - , time(time) - { - } - - BanEntry(StringView address, StringView name, StringView reason, WorldTimePoint time = WorldTime::now()) - : address(address) - , time(time) - , name(name) - , reason(reason) - { - } - - bool operator<(const BanEntry& other) const - { - return address.cmp(other.address) < 0; - } - - bool operator==(const BanEntry& other) const - { - return address == other.address; - } -}; - -/// A network interface for various network-related functions -struct INetwork : public IExtensible -{ - /// Get the network type of the network - /// @return The network type of the network - virtual ENetworkType getNetworkType() const = 0; - - /// Get the dispatcher which dispatches network events - virtual IEventDispatcher& getEventDispatcher() = 0; - - /// Get the dispatcher which dispatches incoming network events - virtual IEventDispatcher& getInEventDispatcher() = 0; - - /// Get the dispatcher which dispatches incoming network events bound to a specific RPC ID - virtual IIndexedEventDispatcher& getPerRPCInEventDispatcher() = 0; - - /// Get the dispatcher which dispatches incoming network events bound to a specific packet ID - virtual IIndexedEventDispatcher& getPerPacketInEventDispatcher() = 0; - - /// Get the dispatcher which dispatches incoming network events - virtual IEventDispatcher& getOutEventDispatcher() = 0; - - /// Get the dispatcher which dispatches incoming network events bound to a specific RPC ID - virtual IIndexedEventDispatcher& getPerRPCOutEventDispatcher() = 0; - - /// Get the dispatcher which dispatches incoming network events bound to a specific packet ID - virtual IIndexedEventDispatcher& getPerPacketOutEventDispatcher() = 0; - - /// Attempt to send a packet to a network peer - /// @param peer The network peer to send the packet to - /// @param data The data span with the length in BITS - /// @param dispatchEvents If calling sendPacket should dispatch send events or not - virtual bool sendPacket(IPlayer& peer, Span data, int channel, bool dispatchEvents = true) = 0; - - /// Attempt to broadcast a packet to everyone on this network - /// @param data The data span with the length in BITS - /// @param exceptPeer send packet to everyone except this peer - /// @param dispatchEvents dispatch packet related events - virtual bool broadcastPacket(Span data, int channel, const IPlayer* exceptPeer = nullptr, bool dispatchEvents = true) = 0; - - /// Attempt to send an RPC to a network peer - /// @param peer The network peer to send the RPC to - /// @param id The RPC ID for the current network - /// @param data The data span with the length in BITS - /// @param dispatchEvents If calling sendRPC should dispatch send events or not - virtual bool sendRPC(IPlayer& peer, int id, Span data, int channel, bool dispatchEvents = true) = 0; - - /// Attempt to broadcast an RPC to everyone on this network - /// @param id The RPC ID for the current network - /// @param data The data span with the length in BITS - /// @param exceptPeer send RPC to everyone except this peer - /// @param dispatchEvents dispatch RPC related events - virtual bool broadcastRPC(int id, Span data, int channel, const IPlayer* exceptPeer = nullptr, bool dispatchEvents = true) = 0; - - /// Get netowrk statistics - virtual NetworkStats getStatistics(IPlayer* player = nullptr) = 0; - - /// Get the last ping for a peer on this network or 0 if the peer isn't on this network - virtual unsigned getPing(const IPlayer& peer) = 0; - - /// Disconnect the peer from the network - virtual void disconnect(const IPlayer& peer) = 0; - - /// Ban a peer from the network - virtual void ban(const BanEntry& entry, Milliseconds expire = Milliseconds(0)) = 0; - - /// Unban a peer from the network - virtual void unban(const BanEntry& entry) = 0; - - /// Update server parameters - virtual void update() = 0; -}; - -/// A component interface which allows for writing a network component -struct INetworkComponent : public IComponent -{ - /// Return Network component type - ComponentType componentType() const override { return ComponentType::Network; } - - /// Return the network provided by the component - virtual INetwork* getNetwork() = 0; -}; - -static const UID NetworkQueryExtension_UID = UID(0xfd46e147ea474971); -struct INetworkQueryExtension : public IExtension -{ - PROVIDE_EXT_UID(NetworkQueryExtension_UID); - - /// Add a rule to the network rules or change it's value - virtual bool addRule(StringView rule, StringView value) = 0; - - /// Remove a rule from the network rules - virtual bool removeRule(StringView rule) = 0; - - /// Check if a rule is valid - virtual bool isValidRule(StringView rule) = 0; -}; - -/// Peer network data -struct PeerNetworkData -{ - /// Peer network ID - struct NetworkID - { - PeerAddress address; ///< The peer's address - unsigned short port; ///< The peer's port - }; - - INetwork* network; ///< The network associated with the peer - NetworkID networkID; ///< The peer's network ID -}; diff --git a/SDK/include/player.hpp b/SDK/include/player.hpp deleted file mode 100644 index 9bb0fd67b..000000000 --- a/SDK/include/player.hpp +++ /dev/null @@ -1,1082 +0,0 @@ -#pragma once - -#include "anim.hpp" -#include "entity.hpp" -#include "network.hpp" -#include "pool.hpp" -#include "types.hpp" -#include "values.hpp" -#include -#include -#include -#include -struct IVehicle; -struct IObject; -struct IPlayerObject; -struct IActor; - -enum PlayerFightingStyle -{ - PlayerFightingStyle_Normal = 4, - PlayerFightingStyle_Boxing = 5, - PlayerFightingStyle_KungFu = 6, - PlayerFightingStyle_KneeHead = 7, - PlayerFightingStyle_GrabKick = 15, - PlayerFightingStyle_Elbow = 16 -}; - -enum PlayerState -{ - PlayerState_None = 0, - PlayerState_OnFoot = 1, - PlayerState_Driver = 2, - PlayerState_Passenger = 3, - PlayerState_ExitVehicle = 4, - PlayerState_EnterVehicleDriver = 5, - PlayerState_EnterVehiclePassenger = 6, - PlayerState_Wasted = 7, - PlayerState_Spawned = 8, - PlayerState_Spectating = 9 -}; - -enum PlayerWeaponSkill -{ - PlayerWeaponSkill_Pistol, - PlayerWeaponSkill_SilencedPistol, - PlayerWeaponSkill_DesertEagle, - PlayerWeaponSkill_Shotgun, - PlayerWeaponSkill_SawnOff, - PlayerWeaponSkill_SPAS12, - PlayerWeaponSkill_Uzi, - PlayerWeaponSkill_MP5, - PlayerWeaponSkill_AK47, - PlayerWeaponSkill_M4, - PlayerWeaponSkill_Sniper -}; - -enum PlayerSpecialAction -{ - SpecialAction_None, - SpecialAction_Duck, - SpecialAction_Jetpack, - SpecialAction_EnterVehicle, - SpecialAction_ExitVehicle, - SpecialAction_Dance1, - SpecialAction_Dance2, - SpecialAction_Dance3, - SpecialAction_Dance4, - SpecialAction_HandsUp = 10, - SpecialAction_Cellphone, - SpecialAction_Sitting, - SpecialAction_StopCellphone, - SpecialAction_Beer = 20, - Specialaction_Smoke, - SpecialAction_Wine, - SpecialAction_Sprunk, - SpecialAction_Cuffed, - SpecialAction_Carry, - SpecialAction_Pissing = 68 -}; - -enum PlayerAnimationSyncType -{ - PlayerAnimationSyncType_NoSync, - PlayerAnimationSyncType_Sync, - PlayerAnimationSyncType_SyncOthers -}; - -enum PlayerBulletHitType : uint8_t -{ - PlayerBulletHitType_None, - PlayerBulletHitType_Player = 1, - PlayerBulletHitType_Vehicle = 2, - PlayerBulletHitType_Object = 3, - PlayerBulletHitType_PlayerObject = 4, -}; - -enum BodyPart -{ - BodyPart_Torso = 3, - BodyPart_Groin, - BodyPart_LeftArm, - BodyPart_RightArm, - BodyPart_LeftLeg, - BodyPart_RightLeg, - BodyPart_Head -}; - -enum MapIconStyle -{ - MapIconStyle_Local, - MapIconStyle_Global, - MapIconStyle_LocalCheckpoint, - MapIconStyle_GlobalCheckpoint -}; - -enum PlayerClickSource -{ - PlayerClickSource_Scoreboard -}; - -enum PlayerSpectateMode -{ - PlayerSpectateMode_Normal = 1, - PlayerSpectateMode_Fixed, - PlayerSpectateMode_Side -}; - -enum PlayerCameraCutType -{ - PlayerCameraCutType_Cut, - PlayerCameraCutType_Move -}; - -enum PlayerMarkerMode -{ - PlayerMarkerMode_Off, - PlayerMarkerMode_Global, - PlayerMarkerMode_Streamed -}; - -enum LagCompMode -{ - LagCompMode_Disabled = 0, - LagCompMode_PositionOnly = 2, - LagCompMode_Enabled = 1 -}; - -enum PlayerWeapon -{ - PlayerWeapon_Fist, - PlayerWeapon_BrassKnuckle, - PlayerWeapon_GolfClub, - PlayerWeapon_NiteStick, - PlayerWeapon_Knife, - PlayerWeapon_Bat, - PlayerWeapon_Shovel, - PlayerWeapon_PoolStick, - PlayerWeapon_Katana, - PlayerWeapon_Chainsaw, - PlayerWeapon_Dildo, - PlayerWeapon_Dildo2, - PlayerWeapon_Vibrator, - PlayerWeapon_Vibrator2, - PlayerWeapon_Flower, - PlayerWeapon_Cane, - PlayerWeapon_Grenade, - PlayerWeapon_Teargas, - PlayerWeapon_Moltov, - PlayerWeapon_Colt45 = 22, - PlayerWeapon_Silenced, - PlayerWeapon_Deagle, - PlayerWeapon_Shotgun, - PlayerWeapon_Sawedoff, - PlayerWeapon_Shotgspa, - PlayerWeapon_UZI, - PlayerWeapon_MP5, - PlayerWeapon_AK47, - PlayerWeapon_M4, - PlayerWeapon_TEC9, - PlayerWeapon_Rifle, - PlayerWeapon_Sniper, - PlayerWeapon_RocketLauncher, - PlayerWeapon_HeatSeeker, - PlayerWeapon_FlameThrower, - PlayerWeapon_Minigun, - PlayerWeapon_Satchel, - PlayerWeapon_Bomb, - PlayerWeapon_SprayCan, - PlayerWeapon_FireExtinguisher, - PlayerWeapon_Camera, - PlayerWeapon_Night_Vis_Goggles, - PlayerWeapon_Thermal_Goggles, - PlayerWeapon_Parachute, - PlayerWeapon_Vehicle = 49, - PlayerWeapon_Heliblades, - PlayerWeapon_Explosion, - PlayerWeapon_Drown = 53, - PlayerWeapon_Collision, - PlayerWeapon_End -}; - -static const StringView PlayerWeaponNames[] = { - "Fist", - "Brass Knuckles", - "Golf Club", - "Nite Stick", - "Knife", - "Baseball Bat", - "Shovel", - "Pool Cue", - "Katana", - "Chainsaw", - "Dildo", - "Dildo", - "Vibrator", - "Vibrator", - "Flowers", - "Cane", - "Grenade", - "Teargas", - "Molotov Cocktail", // 18 - "Invalid", - "Invalid", - "Invalid", - "Colt 45", // 22 - "Silenced Pistol", - "Desert Eagle", - "Shotgun", - "Sawn-off Shotgun", - "Combat Shotgun", - "UZI", - "MP5", - "AK47", - "M4", - "TEC9", - "Rifle", - "Sniper Rifle", - "Rocket Launcher", - "Heat Seaker", - "Flamethrower", - "Minigun", - "Satchel Explosives", - "Bomb", - "Spray Can", - "Fire Extinguisher", - "Camera", - "Night Vision Goggles", - "Thermal Goggles", - "Parachute", // 46 - "Invalid", - "Invalid", - "Vehicle", // 49 - "Helicopter Blades", // 50 - "Explosion", // 51 - "Invalid", - "Drowned", // 53 - "Splat" -}; - -static const StringView BodyPartString[] = { - "invalid", - "invalid", - "invalid", - "torso", - "groin", - "left arm", - "right arm", - "left leg", - "right leg", - "head" -}; - -struct PlayerKeyData -{ - // todo fill with union - uint32_t keys; - int16_t upDown; - int16_t leftRight; -}; - -struct PlayerAnimationData -{ - uint16_t ID; - uint16_t flags; - - inline Pair name() const - { - return splitAnimationNames(ID); - } -}; - -struct PlayerSurfingData -{ - enum class Type - { - None, - Vehicle, - Object, - PlayerObject - } type; - int ID; - Vector3 offset; -}; - -/// Holds weapon slot data -struct WeaponSlotData -{ - uint8_t id; - uint32_t ammo; - - WeaponSlotData() - : id(0) - , ammo(0) - { - } - - WeaponSlotData(uint8_t id) - : id(id) - , ammo(0) - { - } - - WeaponSlotData(uint8_t id, uint32_t ammo) - : id(id) - , ammo(ammo) - { - } - - int8_t slot() - { - static const int8_t slots[] = { - 0, // 0 - Fist - 0, // 1 - Brass Knuckles - 1, // 2 - Golf Club - 1, // 3 - Nite Stick - 1, // 4 - Knife - 1, // 5 - Baseball Bat - 1, // 6 - Shovel - 1, // 7 - Pool Cue - 1, // 8 - Katana - 1, // 9 - Chainsaw - 10, // 10 - Dildo - 10, // 11 - Dildo - 10, // 12 - Vibrator - 10, // 13 - Vibrator - 10, // 14 - Flowers - 10, // 15 - Cane - 8, // 16 - Grenade - 8, // 17 - Teargas - 8, // 18 - Molotov Cocktail - INVALID_WEAPON_SLOT, // - INVALID_WEAPON_SLOT, // - INVALID_WEAPON_SLOT, // - 2, // 22 - Colt 45 - 2, // 23 - Silenced Pistol - 2, // 24 - Desert Eagle - 3, // 25 - Shotgun - 3, // 26 - Sawn-off Shotgun - 3, // 27 - Combat Shotgun - 4, // 28 - UZI - 4, // 29 - MP5 - 5, // 30 - AK47 - 5, // 31 - M4 - 4, // 32 - TEC9 - 6, // 33 - Rifle - 6, // 34 - Sniper Rifle - 7, // 35 - Rocket Launcher - 7, // 36 - Heat Seaker - 7, // 37 - Flamethrower - 7, // 38 - Minigun - 8, // 39 - Satchel Explosives - 12, // 40 - Bomb - 9, // 41 - Spray Can - 9, // 42 - Fire Extinguisher - 9, // 43 - Camera - 11, // 44 - Night Vision Goggles - 11, // 45 - Thermal Goggles - 11 // 46 - Parachute - }; - if (id >= GLM_COUNTOF(slots)) - { - return INVALID_WEAPON_SLOT; - } - return slots[id]; - } - - bool shootable() - { - return (id >= 22 && id <= 34) || id == 38; - } -}; - -/// An array of weapon slots -typedef StaticArray WeaponSlots; - -enum PlayerWeaponState : int8_t -{ - PlayerWeaponState_Unknown = -1, - PlayerWeaponState_NoBullets, - PlayerWeaponState_LastBullet, - PlayerWeaponState_MoreBullets, - PlayerWeaponState_Reloading -}; - -struct PlayerAimData -{ - Vector3 camFrontVector; - Vector3 camPos; - float aimZ; - float camZoom; - float aspectRatio; - PlayerWeaponState weaponState; - uint8_t camMode; -}; - -struct PlayerBulletData -{ - Vector3 origin; - Vector3 hitPos; - Vector3 offset; - uint8_t weapon; - PlayerBulletHitType hitType; - uint16_t hitID; -}; - -struct PlayerSpectateData -{ - enum ESpectateType - { - None, - Vehicle, - Player - }; - - bool spectating; - int spectateID; - ESpectateType type; -}; - -struct IPlayerPool; -struct IPlayer; - -/// The player's name status returned when updating their name -enum EPlayerNameStatus -{ - Updated, ///< The name has successfully been updated - Taken, ///< The name is already taken by another player - Invalid ///< The name is invalid -}; - -/// A player interface -struct IPlayer : public IExtensible, public IEntity -{ - /// Kick the player - virtual void kick() = 0; - - /// Ban the player - virtual void ban(StringView reason = StringView()) = 0; - - /// Get whether the player is a bot (NPC) - virtual bool isBot() const = 0; - - virtual const PeerNetworkData& getNetworkData() const = 0; - - /// Get the peer's ping from their network - unsigned getPing() const - { - return getNetworkData().network->getPing(*this); - } - - /// Attempt to send a packet to the network peer - /// @param bs The bit stream with data to send - bool sendPacket(Span data, int channel, bool dispatchEvents = true) - { - return getNetworkData().network->sendPacket(*this, data, channel, dispatchEvents); - } - - /// Attempt to send an RPC to the network peer - /// @param id The RPC ID for the current network - /// @param bs The bit stream with data to send - bool sendRPC(int id, Span data, int channel, bool dispatchEvents = true) - { - return getNetworkData().network->sendRPC(*this, id, data, channel, dispatchEvents); - } - - /// Attempt to broadcast an RPC derived from NetworkPacketBase to the player's streamed peers - /// @param packet The packet to send - virtual void broadcastRPCToStreamed(int id, Span data, int channel, bool skipFrom = false) const = 0; - - /// Attempt to broadcast a packet derived from NetworkPacketBase to the player's streamed peers - /// @param packet The packet to send - virtual void broadcastPacketToStreamed(Span data, int channel, bool skipFrom = true) const = 0; - - /// Broadcast sync packet - virtual void broadcastSyncPacket(Span data, int channel) const = 0; - - /// Immediately spawn the player - virtual void spawn() = 0; - - /// Get the player's client version - virtual ClientVersion getClientVersion() const = 0; - - /// Get player's client verison name - virtual StringView getClientVersionName() const = 0; - - /// Set the player's position with the proper Z coordinate for the map - virtual void setPositionFindZ(Vector3 pos) = 0; - - /// Set the player's camera position - virtual void setCameraPosition(Vector3 pos) = 0; - - /// Get the player's camera position - virtual Vector3 getCameraPosition() = 0; - - /// Set the direction a player's camera looks at - virtual void setCameraLookAt(Vector3 pos, int cutType) = 0; - - /// Get the direction a player's camera looks at - virtual Vector3 getCameraLookAt() = 0; - - /// Sets the camera to a place behind the player - virtual void setCameraBehind() = 0; - - /// Interpolate camera position - virtual void interpolateCameraPosition(Vector3 from, Vector3 to, int time, PlayerCameraCutType cutType) = 0; - - /// Interpolate camera look at - virtual void interpolateCameraLookAt(Vector3 from, Vector3 to, int time, PlayerCameraCutType cutType) = 0; - - /// Attach player's camera to an object - virtual void attachCameraToObject(IObject& object) = 0; - - /// Attach player's camera to a player object - virtual void attachCameraToObject(IPlayerObject& object) = 0; - - /// Set the player's name - /// @return The player's new name status - virtual EPlayerNameStatus setName(StringView name) = 0; - - /// Get the player's name - virtual StringView getName() const = 0; - - /// Get the player's serial (gpci) - virtual StringView getSerial() const = 0; - - /// Give a weapon to the player - virtual void giveWeapon(WeaponSlotData weapon) = 0; - - /// Removes player weapon - virtual void removeWeapon(uint8_t weapon) = 0; - - /// Set the player's ammo for a weapon - virtual void setWeaponAmmo(WeaponSlotData data) = 0; - - /// Get player's weapons - virtual const WeaponSlots& getWeapons() const = 0; - - /// Get single weapon - virtual WeaponSlotData getWeaponSlot(int slot) = 0; - - /// Reset the player's weapons - virtual void resetWeapons() = 0; - - /// Set the player's currently armed weapon - virtual void setArmedWeapon(uint32_t weapon) = 0; - - /// Get the player's currently armed weapon - virtual uint32_t getArmedWeapon() const = 0; - - /// Get the player's currently armed weapon ammo - virtual uint32_t getArmedWeaponAmmo() const = 0; - - /// Set the player's shop name - virtual void setShopName(StringView name) = 0; - - /// Get the player's shop name - virtual StringView getShopName() const = 0; - - /// Set the player's drunk level - virtual void setDrunkLevel(int level) = 0; - - /// Get the player's drunk level - virtual int getDrunkLevel() const = 0; - - /// Set the player's colour - virtual void setColour(Colour colour) = 0; - - /// Get the player's colour - virtual const Colour& getColour() const = 0; - - /// Set another player's colour for this player - virtual void setOtherColour(IPlayer& other, Colour colour) = 0; - - /// Get another player's colour for this player - virtual bool getOtherColour(IPlayer& other, Colour& colour) const = 0; - - /// Set whether the player is controllable - virtual void setControllable(bool controllable) = 0; - - /// Get whether the player is controllable - virtual bool getControllable() const = 0; - - /// Set whether the player is spectating - virtual void setSpectating(bool spectating) = 0; - - /// Set the player's wanted level - virtual void setWantedLevel(unsigned level) = 0; - - /// Get the player's wanted level - virtual unsigned getWantedLevel() const = 0; - - /// Play a sound for the player at a position - /// @param sound The sound ID - /// @param pos The position to play at - virtual void playSound(uint32_t sound, Vector3 pos) = 0; - - /// Get the sound that was last played - virtual uint32_t lastPlayedSound() const = 0; - - /// Play an audio stream for the player - /// @param url The HTTP URL of the stream - /// @param[opt] usePos Whether to play in a radius at a specific position - /// @param pos The position to play at - /// @param distance The distance to play at - virtual void playAudio(StringView url, bool usePos = false, Vector3 pos = Vector3(0.f), float distance = 0.f) = 0; - - virtual bool playerCrimeReport(IPlayer& suspect, int crime) = 0; - - /// Stop playing audio stream for the player - virtual void stopAudio() = 0; - - /// Get the player's last played audio URL - virtual StringView lastPlayedAudio() const = 0; - - // Create an explosion - virtual void createExplosion(Vector3 vec, int type, float radius) = 0; - - // Send Death message - virtual void sendDeathMessage(IPlayer& player, IPlayer* killer, int weapon) = 0; - - /// Send empty death message - virtual void sendEmptyDeathMessage() = 0; - - /// Remove default map objects with a model in a radius at a specific position - /// @param model The object model to remove - /// @param pos The position to remove at - /// @param radius The radius to remove around - virtual void removeDefaultObjects(unsigned model, Vector3 pos, float radius) = 0; - - /// Force class selection for the player - virtual void forceClassSelection() = 0; - - /// Set the player's money - virtual void setMoney(int money) = 0; - - /// Give money to the player - virtual void giveMoney(int money) = 0; - - /// Reset the player's money to 0 - virtual void resetMoney() = 0; - - /// Get the player's money - virtual int getMoney() = 0; - - /// Set a map icon for the player - virtual void setMapIcon(int id, Vector3 pos, int type, Colour colour, MapIconStyle style) = 0; - - /// Unset a map icon for the player - virtual void unsetMapIcon(int id) = 0; - - /// Toggle stunt bonus for the player - virtual void useStuntBonuses(bool enable) = 0; - - /// Toggle another player's name tag for the player - virtual void toggleOtherNameTag(IPlayer& other, bool toggle) = 0; - - /// Set the player's game time - /// @param hr The hours from 0 to 23 - /// @param min The minutes from 0 to 59 - virtual void setTime(Hours hr, Minutes min) = 0; - - /// Get the player's game time - virtual Pair getTime() const = 0; - - /// Toggle the player's clock visibility - virtual void useClock(bool enable) = 0; - - /// Get whether the clock is visible for the player - virtual bool hasClock() const = 0; - - /// Toggle widescreen for player - virtual void useWidescreen(bool enable) = 0; - - /// Get widescreen status from player - virtual bool hasWidescreen() const = 0; - - /// Set the transform applied to player rotation - virtual void setTransform(GTAQuat tm) = 0; - - /// Set the player's health - virtual void setHealth(float health) = 0; - - /// Get the player's health - virtual float getHealth() const = 0; - - /// Set the player's score - virtual void setScore(int score) = 0; - - /// Get the player's score - virtual int getScore() const = 0; - - /// Set the player's armour - virtual void setArmour(float armour) = 0; - - /// Get the player's armour - virtual float getArmour() const = 0; - - /// Set the player's gravity - virtual void setGravity(float gravity) = 0; - - /// Get player's gravity - virtual float getGravity() const = 0; - - /// Set the player's world time - virtual void setWorldTime(Hours time) = 0; - - /// Apply an animation to the player - /// @param animation The animation to apply - /// @param syncType How to sync the animation - virtual void applyAnimation(const AnimationData& animation, PlayerAnimationSyncType syncType) = 0; - - /// Clear the player's animation - /// @param syncType How to sync the animation - virtual void clearAnimations(PlayerAnimationSyncType syncType) = 0; - - /// Get the player's animation data - virtual PlayerAnimationData getAnimationData() const = 0; - - /// Get the player's surf data - virtual PlayerSurfingData getSurfingData() const = 0; - - /// Stream in the player for another player - /// @param other The player to stream in - virtual void streamInForPlayer(IPlayer& other) = 0; - - /// Check if a player is streamed in for the current player - virtual bool isStreamedInForPlayer(const IPlayer& other) const = 0; - - /// Stream out a player for the current player - /// @param other The player to stream out - virtual void streamOutForPlayer(IPlayer& other) = 0; - - /// Get the players which are streamed in for this player - virtual const FlatPtrHashSet& streamedForPlayers() const = 0; - - /// Get the player's state - virtual PlayerState getState() const = 0; - - /// Set the player's team - virtual void setTeam(int team) = 0; - - /// Get the player's team - virtual int getTeam() const = 0; - - /// Set the player's skin - virtual void setSkin(int skin, bool send = true) = 0; - - /// Get the player's skin - virtual int getSkin() const = 0; - - virtual void setChatBubble(StringView text, const Colour& colour, float drawDist, Milliseconds expire) = 0; - - /// Send a message to the player - virtual void sendClientMessage(const Colour& colour, StringView message) = 0; - - /// Send a standardly formatted chat message from another player - virtual void sendChatMessage(IPlayer& sender, StringView message) = 0; - - /// Send a command to server (Player) - virtual void sendCommand(StringView message) = 0; - - /// Send a game text message to the player - virtual void sendGameText(StringView message, Milliseconds time, int style) = 0; - - /// Hide a game text message from the player - virtual void hideGameText(int style) = 0; - - /// Check if the player can currently see this game text. - virtual bool hasGameText(int style) = 0; - - /// Get the data for this gametext, if they have one. - virtual bool getGameText(int style, StringView& message, Milliseconds& time, Milliseconds& remaining) = 0; - - /// Set the player's weather - virtual void setWeather(int weatherID) = 0; - - /// Get the player's weather - virtual int getWeather() const = 0; - - /// Set world bounds - virtual void setWorldBounds(Vector4 coords) = 0; - - /// Get world bounds - virtual Vector4 getWorldBounds() const = 0; - - /// Set the player's fighting style - /// @note See https://open.mp/docs/scripting/resources/fightingstyles - virtual void setFightingStyle(PlayerFightingStyle style) = 0; - - /// Get the player's fighting style - /// @note See https://open.mp/docs/scripting/resources/fightingstyles - virtual PlayerFightingStyle getFightingStyle() const = 0; - - /// Set the player's skill level - /// @note See https://open.mp/docs/scripting/resources/weaponskills - /// @param skill The skill type - /// @param level The skill level - virtual void setSkillLevel(PlayerWeaponSkill skill, int level) = 0; - - /// Set the player's special action - virtual void setAction(PlayerSpecialAction action) = 0; - - /// Get the player's special action - virtual PlayerSpecialAction getAction() const = 0; - - /// Set the player's velocity - virtual void setVelocity(Vector3 velocity) = 0; - - /// Get the player's velocity - virtual Vector3 getVelocity() const = 0; - - /// Set the player's interior - virtual void setInterior(unsigned interior) = 0; - - /// Get the player's interior - virtual unsigned getInterior() const = 0; - - /// Get the player's key data - virtual const PlayerKeyData& getKeyData() const = 0; - - /// Get the player's skill levels - /// @note See https://open.mp/docs/scripting/resources/weaponskills - virtual const StaticArray& getSkillLevels() const = 0; - - /// Get the player's aim data - virtual const PlayerAimData& getAimData() const = 0; - - /// Get the player's bullet data - virtual const PlayerBulletData& getBulletData() const = 0; - - /// Toggle the camera targeting functions for the player - virtual void useCameraTargeting(bool enable) = 0; - - /// Get whether the player has camera targeting functions enabled - virtual bool hasCameraTargeting() const = 0; - - /// Remove the player from their vehicle - virtual void removeFromVehicle(bool force) = 0; - - /// Get the player the player is looking at or nullptr if none - virtual IPlayer* getCameraTargetPlayer() = 0; - - /// Get the vehicle the player is looking at or nullptr if none - virtual IVehicle* getCameraTargetVehicle() = 0; - - /// Get the object the player is looking at or nullptr if none - virtual IObject* getCameraTargetObject() = 0; - - /// Get the actor the player is looking at or nullptr if none - virtual IActor* getCameraTargetActor() = 0; - - /// Get the player the player is targeting or nullptr if none - virtual IPlayer* getTargetPlayer() = 0; - - /// Get the actor the player is targeting or nullptr if none - virtual IActor* getTargetActor() = 0; - - /// Disable remote vehicle collision detection for this player. - virtual void setRemoteVehicleCollisions(bool collide) = 0; - - /// Make player spectate another player - virtual void spectatePlayer(IPlayer& target, PlayerSpectateMode mode) = 0; - - /// Make player spectate a vehicle - virtual void spectateVehicle(IVehicle& target, PlayerSpectateMode mode) = 0; - - /// Get spectate data - virtual const PlayerSpectateData& getSpectateData() const = 0; - - /// Send client check (asks for certain data depending on type of action) - virtual void sendClientCheck(int actionType, int address, int offset, int count) = 0; - - /// Toggle player's collision for other players - virtual void toggleGhostMode(bool toggle) = 0; - - /// Get player's collision status (ghost mode) - virtual bool isGhostModeEnabled() const = 0; - - /// Get default objects removed (basically just how many times removeDefaultObject is called) - virtual int getDefaultObjectsRemoved() const = 0; - - /// Get if player is kicked or not (about to be disconnected) - virtual bool getKickStatus() const = 0; - - /// Clear player tasks - virtual void clearTasks(PlayerAnimationSyncType syncType) = 0; - - /// Allow player to use weapons - virtual void allowWeapons(bool allow) = 0; - - /// Check if player is allowed to use weapons - virtual bool areWeaponsAllowed() const = 0; - - /// Teleport the player when they click the map - virtual void allowTeleport(bool allow) = 0; - - /// Does the player teleport when they click the map - virtual bool isTeleportAllowed() const = 0; - - /// Check if player is using an official client or not - virtual bool isUsingOfficialClient() const = 0; -}; - -/// Player spawn event handlers -struct PlayerSpawnEventHandler -{ - virtual bool onPlayerRequestSpawn(IPlayer& player) { return true; } - virtual void onPlayerSpawn(IPlayer& player) { } -}; - -/// Player connection event handlers -struct PlayerConnectEventHandler -{ - virtual void onIncomingConnection(IPlayer& player, StringView ipAddress, unsigned short port) { } - virtual void onPlayerConnect(IPlayer& player) { } - virtual void onPlayerDisconnect(IPlayer& player, PeerDisconnectReason reason) { } - virtual void onPlayerClientInit(IPlayer& player) { } -}; - -/// Player streaming event handlers -struct PlayerStreamEventHandler -{ - virtual void onPlayerStreamIn(IPlayer& player, IPlayer& forPlayer) { } - virtual void onPlayerStreamOut(IPlayer& player, IPlayer& forPlayer) { } -}; - -/// Player text and commands event handlers -struct PlayerTextEventHandler -{ - virtual bool onPlayerText(IPlayer& player, StringView message) { return true; } - virtual bool onPlayerCommandText(IPlayer& player, StringView message) { return false; } -}; - -/// Player shooting event handlers -struct PlayerShotEventHandler -{ - virtual bool onPlayerShotMissed(IPlayer& player, const PlayerBulletData& bulletData) { return true; } - virtual bool onPlayerShotPlayer(IPlayer& player, IPlayer& target, const PlayerBulletData& bulletData) { return true; } - virtual bool onPlayerShotVehicle(IPlayer& player, IVehicle& target, const PlayerBulletData& bulletData) { return true; } - virtual bool onPlayerShotObject(IPlayer& player, IObject& target, const PlayerBulletData& bulletData) { return true; } - virtual bool onPlayerShotPlayerObject(IPlayer& player, IPlayerObject& target, const PlayerBulletData& bulletData) { return true; } -}; - -/// Player data change event handlers -struct PlayerChangeEventHandler -{ - virtual void onPlayerScoreChange(IPlayer& player, int score) { } - virtual void onPlayerNameChange(IPlayer& player, StringView oldName) { } - virtual void onPlayerInteriorChange(IPlayer& player, unsigned newInterior, unsigned oldInterior) { } - virtual void onPlayerStateChange(IPlayer& player, PlayerState newState, PlayerState oldState) { } - virtual void onPlayerKeyStateChange(IPlayer& player, uint32_t newKeys, uint32_t oldKeys) { } -}; - -/// APlayer death and damage event handlers -struct PlayerDamageEventHandler -{ - virtual void onPlayerDeath(IPlayer& player, IPlayer* killer, int reason) { } - virtual void onPlayerTakeDamage(IPlayer& player, IPlayer* from, float amount, unsigned weapon, BodyPart part) { } - virtual void onPlayerGiveDamage(IPlayer& player, IPlayer& to, float amount, unsigned weapon, BodyPart part) { } -}; - -/// Player clicking event handlers -struct PlayerClickEventHandler -{ - virtual void onPlayerClickMap(IPlayer& player, Vector3 pos) { } - virtual void onPlayerClickPlayer(IPlayer& player, IPlayer& clicked, PlayerClickSource source) { } -}; - -/// Player client check response event handler -struct PlayerCheckEventHandler -{ - virtual void onClientCheckResponse(IPlayer& player, int actionType, int address, int results) { } -}; - -/// Player update event handler -struct PlayerUpdateEventHandler -{ - virtual bool onPlayerUpdate(IPlayer& player, TimePoint now) { return true; } -}; - -/// A player pool interface -struct IPlayerPool : public IExtensible, public IReadOnlyPool -{ - /// Get a set of all the available players and bots (anything in the pool) - virtual const FlatPtrHashSet& entries() = 0; - - /// Get a set of all the available players only - virtual const FlatPtrHashSet& players() = 0; - - /// Get a set of all the available bots only - virtual const FlatPtrHashSet& bots() = 0; - - /// Returns a dispatcher to the main player event dispatcher. - virtual IEventDispatcher& getPlayerSpawnDispatcher() = 0; - virtual IEventDispatcher& getPlayerConnectDispatcher() = 0; - virtual IEventDispatcher& getPlayerStreamDispatcher() = 0; - virtual IEventDispatcher& getPlayerTextDispatcher() = 0; - virtual IEventDispatcher& getPlayerShotDispatcher() = 0; - virtual IEventDispatcher& getPlayerChangeDispatcher() = 0; - virtual IEventDispatcher& getPlayerDamageDispatcher() = 0; - virtual IEventDispatcher& getPlayerClickDispatcher() = 0; - virtual IEventDispatcher& getPlayerCheckDispatcher() = 0; - - /// Returns a dispatcher to the PlayerUpdateEvent. - virtual IEventDispatcher& getPlayerUpdateDispatcher() = 0; - - // Returns a dispatcher to the player pool event dispatcher. - virtual IEventDispatcher>& getPoolEventDispatcher() = 0; - - /// Returns whether a name is taken by any player excluding one player - /// @param skip The player to exclude from the check - virtual bool isNameTaken(StringView name, const IPlayer* skip) = 0; - - /// sendClientMessage for all players - virtual void sendClientMessageToAll(const Colour& colour, StringView message) = 0; - - /// sendChatMessage for all players - virtual void sendChatMessageToAll(IPlayer& from, StringView message) = 0; - - /// sendGameText for all players - virtual void sendGameTextToAll(StringView message, Milliseconds time, int style) = 0; - - /// hideGameText for all players - virtual void hideGameTextForAll(int style) = 0; - - /// sendDeathMessage for all players - virtual void sendDeathMessageToAll(IPlayer* killer, IPlayer& killee, int weapon) = 0; - - /// Send an empty death message to all players - virtual void sendEmptyDeathMessageToAll() = 0; - - /// createExplosion for all players - virtual void createExplosionForAll(Vector3 vec, int type, float radius) = 0; - - /// Request a new player with the given network parameters - virtual Pair requestPlayer(const PeerNetworkData& netData, const PeerRequestParams& params) = 0; - - /// Attempt to broadcast an packet derived from NetworkPacketBase to all peers - /// @param data The data span with the length in BITS - /// @param skipFrom send packet to everyone except this player - /// @param dispatchEvents dispatch packet related events - virtual void broadcastPacket(Span data, int channel, const IPlayer* skipFrom = nullptr, bool dispatchEvents = true) = 0; - - /// Attempt to broadcast an RPC derived from NetworkPacketBase to all peers - /// @param id The RPC ID for the current network - /// @param data The data span with the length in BITS - /// @param skipFrom send RPC to everyone except this peer - /// @param dispatchEvents dispatch RPC related events - virtual void broadcastRPC(int id, Span data, int channel, const IPlayer* skipFrom = nullptr, bool dispatchEvents = true) = 0; - - /// Check if player name is valid. - virtual bool isNameValid(StringView name) const = 0; - - /// Allow or disallow the use of specific character in player names. - virtual void allowNickNameCharacter(char character, bool allow) = 0; - - /// Check if a specific character is allowed to be used in player names. - virtual bool isNickNameCharacterAllowed(char character) const = 0; - - /// Get the colour assigned to a player ID when it first connects. - virtual Colour getDefaultColour(int pid) const = 0; -}; diff --git a/SDK/include/pool.hpp b/SDK/include/pool.hpp deleted file mode 100644 index e77e5364b..000000000 --- a/SDK/include/pool.hpp +++ /dev/null @@ -1,164 +0,0 @@ -#pragma once - -#include "entity.hpp" -#include "types.hpp" -#include -#include -#include -#include -#include - -/* Iterators, to be passed around */ - -/// A pool iterator which locks/unlocks marked pools -template -class MarkedPoolIterator -{ -public: - using iterator_category = typename FlatPtrHashSet::const_iterator::iterator_category; - using difference_type = typename FlatPtrHashSet::const_iterator::difference_type; - using value_type = typename FlatPtrHashSet::const_iterator::value_type; - using pointer = typename FlatPtrHashSet::const_iterator::pointer; - using reference = typename FlatPtrHashSet::const_iterator::reference; - -private: - StoragePool& pool; ///< The pool to lock/unlock - int lockedID; ///< Cached entry ID that was locked, -1 if entry isn't locked - const FlatPtrHashSet& entries; ///< Pool entries list - typename FlatPtrHashSet::const_iterator iter; ///< Current iterator of pool entries list - - /// Lock the pool and cache the entry ID - inline void lock() - { - assert(lockedID == -1); - if (iter != entries.end()) - { - lockedID = (*iter)->getID(); - pool.lock(lockedID); - } - } - - /// If pool is locked, unlock it and clear the entry ID cache - inline void unlock() - { - if (lockedID != -1) - { - pool.unlock(lockedID); - lockedID = -1; - } - } - -public: - /// Constructor, locks the pool if possible - inline MarkedPoolIterator(StoragePool& pool, const FlatPtrHashSet& entries, typename FlatPtrHashSet::const_iterator iter) - : pool(pool) - , lockedID(-1) - , entries(entries) - , iter(iter) - { - lock(); - } - - /// Destructor, unlocks the pool if locked - inline ~MarkedPoolIterator() - { - unlock(); - } - - /// Pass-through - inline reference operator*() const { return *iter; } - /// Pass-through - inline pointer operator->() { return iter.operator->(); } - - /// Forwards iterator - /// Code order is important - first increase the iterator and then unlock the pool, otherwise the iterator is invalid - inline MarkedPoolIterator& operator++() - { - ++iter; - unlock(); - lock(); - return *this; - } - - /// Pass-through - inline friend bool operator==(const MarkedPoolIterator& a, const MarkedPoolIterator& b) - { - return a.iter == b.iter; - }; - /// Pass-through - inline friend bool operator!=(const MarkedPoolIterator& a, const MarkedPoolIterator& b) - { - return a.iter != b.iter; - }; -}; - -/* Interfaces, to be passed around */ - -template -struct IReadOnlyPool -{ - /// Get the object at an index - virtual T* get(int index) = 0; - - /// Get the bounds of the pool - a pair of (lowest idx, highest idx) - virtual Pair bounds() const = 0; -}; - -template -struct PoolEventHandler -{ - /// Called right after a new entry was constructed - virtual void onPoolEntryCreated(T& entry) { } - /// Called just before an entry is destructed - virtual void onPoolEntryDestroyed(T& entry) { } -}; - -/// A statically sized pool interface -template -struct IPool : IReadOnlyPool -{ - /// The iterator type - using Iterator = MarkedPoolIterator>; - - /// Release the object at an index - virtual void release(int index) = 0; - - /// Lock an entry at index to postpone release until unlocked - virtual void lock(int index) = 0; - - /// Unlock an entry at index and release it if needed - virtual bool unlock(int index) = 0; - - /// Get the event dispatcher of the pool - virtual IEventDispatcher>& getPoolEventDispatcher() = 0; - - /// Return the begin iterator - inline Iterator begin() - { - return Iterator(*this, entries(), entries().begin()); - } - - /// Return the end iterator - inline Iterator end() - { - return Iterator(*this, entries(), entries().end()); - } - - /// Return the pool's entry count - inline size_t count() - { - return entries().size(); - } - -protected: - /// Get a set of all the available objects - virtual const FlatPtrHashSet& entries() = 0; -}; - -/// A component interface which allows for writing a pool component -template -struct IPoolComponent : public IComponent, public IPool -{ - /// Return Pool component type - ComponentType componentType() const override { return ComponentType::Pool; } -}; diff --git a/SDK/include/sdk.hpp b/SDK/include/sdk.hpp deleted file mode 100644 index a049ebca7..000000000 --- a/SDK/include/sdk.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "core.hpp" - -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) -#define SDK_EXPORT __declspec(dllexport) -#else -#define SDK_EXPORT __attribute__((visibility("default"))) -#endif - -/// The component's entry point function -/// To be used like so: COMPONENT_ENTRY_POINT(ICore* core) { ... } -typedef IComponent*(__CDECL* ComponentEntryPoint_t)(); -#define COMPONENT_ENTRY_POINT extern "C" SDK_EXPORT IComponent* __CDECL ComponentEntryPoint diff --git a/SDK/include/types.hpp b/SDK/include/types.hpp deleted file mode 100644 index c340e6ce8..000000000 --- a/SDK/include/types.hpp +++ /dev/null @@ -1,594 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define OMP_WINDOWS 0 -#define OMP_UNIX 1 - -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) -#define OMP_BUILD_PLATFORM OMP_WINDOWS -#else -#define OMP_BUILD_PLATFORM OMP_UNIX -#endif - -#ifdef __arm__ -#define __ATTRIBUTE__(x) __attribute__(x) -#define __CDECL -#else -#if defined(_MSC_VER) && !defined(__clang__) -#define __ATTRIBUTE__(x) -#define __CDECL __cdecl -#else -#define __ATTRIBUTE__(x) __attribute__(x) -#define __CDECL __attribute__((__cdecl__)) -#endif -#endif - -/* Fix Ubuntu 18.04 build - possibly remove when EOL depending on which - * other distributions we might want to support (18.04 uses glibc 2.27) - * (see: https://sourceware.org/bugzilla/show_bug.cgi?id=19239%22) - */ -#ifdef major -#undef major -#endif -#ifdef minor -#undef minor -#endif - -typedef glm::vec2 Vector2; -typedef glm::vec3 Vector3; -typedef glm::vec4 Vector4; -typedef uint64_t UID; -typedef std::chrono::steady_clock Time; -typedef std::chrono::steady_clock::time_point TimePoint; -typedef std::chrono::system_clock WorldTime; -typedef std::chrono::system_clock::time_point WorldTimePoint; -typedef std::chrono::nanoseconds Nanoseconds; -typedef std::chrono::microseconds Microseconds; -typedef std::chrono::milliseconds Milliseconds; -typedef std::chrono::seconds Seconds; -typedef std::chrono::minutes Minutes; -typedef std::chrono::hours Hours; -typedef std::chrono::duration RealSeconds; -using std::chrono::duration_cast; - -/// Don't pass these around the SDK -namespace Impl -{ -using String = std::string; - -template -using StaticBitset = std::bitset; - -template -using DynamicArray = std::vector; -} - -template -using Span = nonstd::span; - -using StringView = nonstd::string_view; - -template -using FlatHashSet = robin_hood::unordered_flat_set; - -template -using FlatHashMap = robin_hood::unordered_flat_map; - -template -using FlatPtrHashSet = FlatHashSet; - -template -using FlatPtrHashMap = FlatHashMap; - -template -using StaticArray = std::array; - -template -using Pair = std::pair; - -struct NoCopy -{ - NoCopy() = default; - - NoCopy(const NoCopy& other) = delete; - NoCopy(NoCopy&& other) = delete; - - NoCopy& operator=(const NoCopy& other) = delete; - NoCopy& operator=(NoCopy&& other) = delete; -}; - -struct Colour -{ - union - { - struct - { - uint8_t r, g, b, a; - }; - }; - - Colour() = default; - - Colour(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 0xFF) - : r(r) - , g(g) - , b(b) - , a(a) - { - } - - uint32_t RGBA() const - { - return ((r << 24) & 0xFF000000) | ((g << 16) & 0x00FF0000) | ((b << 8) & 0x0000FF00) | (a & 0x000000FF); - } - - uint32_t ARGB() const - { - return ((a << 24) & 0xFF000000) | ((r << 16) & 0x00FF0000) | ((g << 8) & 0x0000FF00) | (b & 0x000000FF); - } - - uint32_t ABGR() const - { - return ((a << 24) & 0xFF000000) | ((b << 16) & 0x00FF0000) | ((g << 8) & 0x0000FF00) | (r & 0x000000FF); - } - - static Colour FromRGBA(uint32_t from) - { - Colour c; - c.r = (from & 0xFF000000) >> 24; - c.g = (from & 0x00FF0000) >> 16; - c.b = (from & 0x0000FF00) >> 8; - c.a = (from & 0x000000FF); - return c; - } - - static Colour FromARGB(uint32_t from) - { - Colour c; - c.a = (from & 0xFF000000) >> 24; - c.r = (from & 0x00FF0000) >> 16; - c.g = (from & 0x0000FF00) >> 8; - c.b = (from & 0x000000FF); - return c; - } - - static Colour White() - { - return Colour::FromRGBA(0xFFFFFFFF); - } - - static Colour Black() - { - return Colour::FromRGBA(0x000000FF); - } - - static Colour None() - { - return Colour::FromRGBA(0); - } - - static Colour Yellow() - { - return Colour::FromRGBA(0xFFFF00FF); - } - - static Colour Cyan() - { - return Colour::FromRGBA(0x00FFFFFF); - } -}; - -/// SemVer -struct SemanticVersion -{ - uint8_t major; ///< MAJOR version when you make incompatible API changes - uint8_t minor; ///< MINOR version when you add functionality in a backwards compatible manner - uint8_t patch; ///< PATCH version when you make backwards compatible bug fixes - uint16_t prerel; ///< PRE-RELEASE version - - SemanticVersion(uint8_t major, uint8_t minor, uint8_t patch, uint16_t prerel = 0) - : major(major) - , minor(minor) - , patch(patch) - , prerel(prerel) - { - } - - int compare(const SemanticVersion& other, bool cmpPreRel) const - { - if (major != other.major) - { - return major - other.major; - } - - if (minor != other.minor) - { - return minor - other.minor; - } - - if (patch != other.patch) - { - return patch - other.patch; - } - - if (cmpPreRel && prerel != other.prerel) - { - return prerel - other.prerel; - } - - return 0; - } - - bool operator==(const SemanticVersion& other) const - { - return compare(other, false) == 0; - } - - bool operator!=(const SemanticVersion& other) const - { - return !(*this == other); - } - - bool operator>(const SemanticVersion& other) const - { - return compare(other, false) > 0; - } - - bool operator<(const SemanticVersion& other) const - { - return compare(other, false) < 0; - } - - bool operator>=(const SemanticVersion& other) const - { - return compare(other, false) >= 0; - } - - bool operator<=(const SemanticVersion& other) const - { - return compare(other, false) <= 0; - } -}; - -/// An ABI-stable, C-compatible string on the stack -template -struct StaticString -{ - /// The actual usable size - this accounts for the trailing 0 - constexpr static size_t UsableStaticSize = Size - 1; - - /// Empty string constructor - StaticString() - : len(0) - { - storage[0] = 0; - } - - /// StringView copy constructor - StaticString(StringView string) - { - len = std::min(string.size(), UsableStaticSize); - memcpy(storage.data(), string.data(), len); - storage[len] = 0; - } - - /// StringView copy assignment - StaticString& operator=(StringView string) - { - len = std::min(string.size(), UsableStaticSize); - memcpy(storage.data(), string.data(), len); - storage[len] = 0; - - return *this; - } - - /// Get the data - constexpr StaticArray& data() - { - return storage; - } - - /// Get the data - constexpr const StaticArray& data() const - { - return storage; - } - - /// Get the string's length - constexpr size_t length() const - { - return len; - } - - constexpr bool empty() const - { - return length() == 0; - } - - /// Clear the string - void clear() - { - storage[0] = 0; - len = 0; - } - - /// Compare the string to another string - int cmp(const StaticString& other) const - { - return strcmp(data().data(), other.data().data()); - } - - /// Return whether the string is equal to another string - bool operator==(const StaticString& other) const - { - if (length() != other.length()) - { - return false; - } - return !strncmp(data().data(), other.data().data(), length()); - } - - constexpr char& operator[](size_t index) - { - assert(index < length()); - return data()[index]; - } - - constexpr const char& operator[](size_t index) const - { - assert(index < length()); - return data()[index]; - } - - /// Cast to StringView - operator StringView() const - { - return StringView(data().data(), length()); - } - -private: - size_t len; - StaticArray storage; -}; - -namespace Impl -{ -struct HybridStringDynamicStorage -{ - char* ptr; ///< The dynamic storage - void(__CDECL* free)(void*); ///< The free function to use for deallocating the dynamic storage -}; -}; - -/// An ABI-stable, C-compatible string that allows for specifying a static allocation of a size before falling back to dynamic allocation -template -struct HybridString -{ - /// The actual usable size - this accounts for the trailing 0 - constexpr static size_t UsableStaticSize = Size - 1; - - /// Empty string constructor - HybridString() - : lenDynamic(0) - { - staticStorage[0] = 0; - } - - /// StringView copy constructor - HybridString(StringView string) - { - initCopy(string.data(), string.length()); - } - - /// StringView copy assignment - HybridString& operator=(StringView string) - { - clear(); - initCopy(string.data(), string.length()); - - return *this; - } - - /// Copy constructor - HybridString(const HybridString& other) - { - initCopy(other.data(), other.length()); - } - - /// Copy assignment - HybridString& operator=(const HybridString& other) - { - clear(); - initCopy(other.data(), other.length()); - - return *this; - } - - /// Move constructor - HybridString(HybridString&& other) - { - initMove(other.data(), other.length(), other.dynamicStorage.free); - other.lenDynamic = 0; - } - - /// Move assignment - HybridString& operator=(HybridString&& other) - { - clear(); - initMove(other.data(), other.length(), other.dynamicStorage.free); - other.lenDynamic = 0; - - return *this; - } - - /// Destructor - ~HybridString() - { - clear(); - } - - /// Reserve a given length for outside filling - void reserve(size_t len) - { - clear(); - initReserve(len); - } - - /// Get the data - constexpr char* data() - { - return dynamic() ? dynamicStorage.ptr : staticStorage; - } - - /// Get the data - constexpr const char* data() const - { - return dynamic() ? dynamicStorage.ptr : staticStorage; - } - - /// Get whether the string is dynamically allocated - constexpr bool dynamic() const - { - return lenDynamic & 1; - } - - /// Get the string's length - constexpr size_t length() const - { - return lenDynamic >> 1; - } - - constexpr bool empty() const - { - return length() == 0; - } - - /// Clear the string and free any dynamic memory - void clear() - { - if (dynamic()) - { - dynamicStorage.free(dynamicStorage.ptr); - } - staticStorage[0] = 0; - lenDynamic = 0; - } - - /// Compare the string to another string - int cmp(const HybridString& other) const - { - return strcmp(data(), other.data()); - } - - /// Return whether the string is equal to another string - bool operator==(const HybridString& other) const - { - if (length() != other.length()) - { - return false; - } - return !strncmp(data(), other.data(), length()); - } - - constexpr char& operator[](size_t index) - { - assert(index < length()); - return data()[index]; - } - - constexpr const char& operator[](size_t index) const - { - assert(index < length()); - return data()[index]; - } - - /// Cast to StringView - operator StringView() const - { - return StringView(data(), length()); - } - -private: - /// Copy data - void initCopy(const char* data, size_t len) - { - const bool isDynamic = len > UsableStaticSize; - lenDynamic = (len << 1) | int(isDynamic); - char* ptr; - if (isDynamic) - { - dynamicStorage.ptr = reinterpret_cast(malloc(sizeof(char) * (len + 1))); - dynamicStorage.free = &free; - ptr = dynamicStorage.ptr; - } - else - { - ptr = staticStorage; - } - memcpy(ptr, data, len); - ptr[len] = 0; - } - - /// Move data - void initMove(char* data, size_t len, void(__CDECL* freeFn)(void*)) - { - const bool isDynamic = len > UsableStaticSize; - lenDynamic = (len << 1) | int(isDynamic); - if (isDynamic) - { - dynamicStorage.ptr = data; - dynamicStorage.free = freeFn; - } - else - { - memcpy(staticStorage, data, len); - staticStorage[len] = 0; - } - } - - /// Reserve data - void initReserve(size_t len) - { - const bool isDynamic = len > UsableStaticSize; - lenDynamic = (len << 1) | int(isDynamic); - if (isDynamic) - { - dynamicStorage.ptr = reinterpret_cast(malloc(sizeof(char) * (len + 1))); - dynamicStorage.free = &free; - dynamicStorage.ptr[0] = 0; - } - data()[len] = 0; - } - - size_t lenDynamic; ///< First bit is 1 if dynamic and 0 if static; the rest are the length - union - { - Impl::HybridStringDynamicStorage dynamicStorage; ///< Used when first bit of lenDynamic is 1 - char staticStorage[Size]; ///< Used when first bit of lenDynamic is 0 - }; -}; - -using OptimisedString = HybridString; - -/// Macro for quick printing of a StringView or HybridString to %.s -#define PRINT_VIEW(view) int(view.length()), view.data() - -template -inline constexpr auto CEILDIV(T n, U d) -> decltype(n / d) -{ - return (n) ? ((n - (T)1) / d + (decltype(n / d))1) : (decltype(n / d))0; -} diff --git a/SDK/include/utils.hpp b/SDK/include/utils.hpp deleted file mode 100644 index d19acab55..000000000 --- a/SDK/include/utils.hpp +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once -#include "player.hpp" - -#define STRINGIFY(s) _STRINGIFY(s) -#define _STRINGIFY(s) #s - -inline StringView trim(StringView view) -{ - char const* const whitespace = " \t\n\r\f\v"; - const size_t start = view.find_first_not_of(whitespace); - if (start == StringView::npos) - { - return ""; - } - const size_t end = view.find_last_not_of(whitespace); - return view.substr(start, end - start + 1); -} - -inline bool IsWeaponForTakenDamageValid(int weapon) -{ - auto slot = WeaponSlotData(weapon).slot(); - if (slot == INVALID_WEAPON_SLOT) - { - // 52 is a valid damage reason, though not a valid death reason. It is given by the police boat gun. - // - // https://github.com/openmultiplayer/open.mp/issues/600#issuecomment-1377236916 - // - if (weapon < 49 || weapon > 54) - { - return false; - } - } - return true; -} diff --git a/SDK/include/values.hpp b/SDK/include/values.hpp deleted file mode 100644 index f48a9ba52..000000000 --- a/SDK/include/values.hpp +++ /dev/null @@ -1,98 +0,0 @@ -#pragma once - -#include "types.hpp" - -constexpr int MAX_SEATS = 4; -constexpr int PLAYER_POOL_SIZE = 1000; -constexpr int VEHICLE_POOL_SIZE = 2000; -constexpr int CLASS_POOL_SIZE = 320; -constexpr int OBJECT_POOL_SIZE = 2000; -constexpr int OBJECT_POOL_SIZE_037 = 1000; -constexpr int MAX_WEAPON_SLOTS = 13; -constexpr int MAX_VEHICLE_MODELS = 611 - 400 + 1; -constexpr int MAX_WEAPON_ID = 46; -constexpr int NUM_SKILL_LEVELS = 11; -constexpr int8_t INVALID_WEAPON_SLOT = -1; -constexpr int MIN_PLAYER_NAME = 3; -constexpr int MAX_PLAYER_NAME = 24; -constexpr int MAX_ANIMATIONS = 1813; -constexpr int MAX_SKILL_LEVEL = 999; -constexpr int INVALID_VEHICLE_ID = 0xFFFF; -constexpr int INVALID_OBJECT_ID = 0xFFFF; -constexpr int INVALID_PLAYER_ID = 0xFFFF; -constexpr int INVALID_ACTOR_ID = 0xFFFF; -constexpr float STREAM_DISTANCE = 200.f; -constexpr int MAX_ATTACHED_OBJECT_SLOTS = 10; -constexpr int MAX_OBJECT_MATERIAL_SLOTS = 16; -constexpr int TEXT_LABEL_POOL_SIZE = 1024; -constexpr int INVALID_TEXT_LABEL_ID = 0xFFFF; -constexpr int PICKUP_POOL_SIZE = 4096; -constexpr int GLOBAL_TEXTDRAW_POOL_SIZE = 2048; -constexpr int PLAYER_TEXTDRAW_POOL_SIZE = 256; -constexpr int MAX_VEHICLE_COMPONENTS = 194; -constexpr int INVALID_COMPONENT_ID = 0; -constexpr int MAX_VEHICLE_COMPONENT_SLOT = 16; -constexpr int MAX_VEHICLE_COMPONENT_SLOT_IN_RPC = 14; -constexpr int MAX_TEXT_LABELS = 1024; -constexpr int MAX_GLOBAL_TEXTDRAWS = 2048; -constexpr int MAX_PLAYER_TEXTDRAWS = 256; -constexpr int INVALID_TEXTDRAW = 0xFFFF; -constexpr int ACTOR_POOL_SIZE = 1000; -constexpr int MENU_POOL_SIZE = 128; -constexpr int MAX_MENU_ITEMS = 12; -constexpr int MAX_MENU_TEXT_LENGTH = 32; -constexpr int INVALID_MENU_ID = 0xFF; -constexpr int INVALID_DIALOG_ID = -1; -constexpr int MAX_DIALOG = 32768; -constexpr int INVALID_GANG_ZONE_ID = -1; -constexpr int INVALID_PICKUP_ID = -1; -constexpr int INVALID_OBJECT_MODEL_ID = -1; -constexpr int INVALID_MENU_ITEM_ID = -1; -constexpr int GANG_ZONE_POOL_SIZE = 1024; -constexpr int MAX_STREAMED_PLAYERS = 200; -constexpr int MAX_STREAMED_ACTORS = 50; -constexpr int MAX_STREAMED_VEHICLES = 700; -constexpr int TEAM_NONE = 255; -constexpr int SEAT_NONE = -1; -constexpr float MAX_WORLD_BOUNDS = 20000.0f; -constexpr float MIN_WORLD_BOUNDS = -20000.0f; -constexpr int MAX_TEXTDRAW_STR_LENGTH = 800; -constexpr int MAX_VEHICLE_CARRIAGES = 3; -constexpr int MAX_GAMETEXT_STYLES = 16; -constexpr int MIN_CUSTOM_SKIN_ID = 20001; -constexpr int MAX_CUSTOM_SKIN_ID = 30000; -constexpr int MIN_CUSTOM_OBJECT_ID = -30000; -constexpr int MAX_CUSTOM_OBJECT_ID = -1000; - -enum Key -{ - ACTION = 1, - CROUCH = 2, - FIRE = 4, - SPRINT = 8, - SECONDARY_ATTACK = 16, - JUMP = 32, - LOOK_RIGHT = 64, - HANDBRAKE = 128, - AIM = HANDBRAKE, - LOOK_LEFT = 256, - LOOK_BEHIND = 320, - SUBMISSION = 512, - WALK = 1024, - ANALOG_UP = 2048, - ANALOG_DOWN = 4096, - ANALOG_LEFT = 8192, - ANALOG_RIGHT = 16384, - - YES = 65536, - NO = 131072, - CTRL_BACK = 262144, - - UP = -128, - DOWN = 128, - LEFT = -128, - RIGHT = 128, -}; - -constexpr uint16_t INVALID_MODEL_ID = 65535u; -constexpr int32_t QUESTION_MARK_MODEL_ID = 18631; \ No newline at end of file diff --git a/SDK/lib/glm b/SDK/lib/glm deleted file mode 160000 index bf71a8349..000000000 --- a/SDK/lib/glm +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bf71a834948186f4097caa076cd2663c69a10e1e diff --git a/SDK/lib/robin-hood-hashing b/SDK/lib/robin-hood-hashing deleted file mode 160000 index 9145f963d..000000000 --- a/SDK/lib/robin-hood-hashing +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9145f963d80d6a02f0f96a47758050a89184a3ed diff --git a/SDK/lib/span-lite b/SDK/lib/span-lite deleted file mode 160000 index cbb9c3c51..000000000 --- a/SDK/lib/span-lite +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cbb9c3c5162a0d7018c7b3e053153a04d4fbbbb9 diff --git a/SDK/lib/string-view-lite b/SDK/lib/string-view-lite deleted file mode 160000 index a47222b98..000000000 --- a/SDK/lib/string-view-lite +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a47222b9855dd6e6d1eac38acaa495822e2caa69 diff --git a/Shared/Network b/Shared/Network new file mode 160000 index 000000000..dc3eac9d5 --- /dev/null +++ b/Shared/Network @@ -0,0 +1 @@ +Subproject commit dc3eac9d5dc30f96edcf4e7e64f33d8c241d49ff diff --git a/Shared/Network/CMakeLists.txt b/Shared/Network/CMakeLists.txt deleted file mode 100644 index 281884519..000000000 --- a/Shared/Network/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -project(OMP-Network LANGUAGES CXX DESCRIPTION "Non-stable network classes to use alongside the SDK" VERSION 2) - -add_library(OMP-Network STATIC) - -target_link_libraries(OMP-Network PUBLIC OMP-SDK) - -target_include_directories(OMP-Network PUBLIC .) - -file(GLOB_RECURSE network_source_list "*.cpp" "*.hpp") - -set_property(TARGET OMP-Network PROPERTY SOURCES ${network_source_list}) -set_property(TARGET OMP-Network PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/Shared/Network/Encoding/huffman_tree.cpp b/Shared/Network/Encoding/huffman_tree.cpp deleted file mode 100644 index 1c2b323e0..000000000 --- a/Shared/Network/Encoding/huffman_tree.cpp +++ /dev/null @@ -1,265 +0,0 @@ -/// \file -/// -/// This file is part of RakNet Copyright 2003 Kevin Jenkins. -/// -/// Usage of RakNet is subject to the appropriate license agreement. -/// Creative Commons Licensees are subject to the -/// license found at -/// http://creativecommons.org/licenses/by-nc/2.5/ -/// Single application licensees are subject to the license found at -/// http://www.rakkarsoft.com/SingleApplicationLicense.html -/// Custom license users are subject to the terms therein. -/// GPL license users are subject to the GNU General Public -/// License as published by the Free -/// Software Foundation; either version 2 of the License, or (at your -/// option) any later version. - -#include "huffman_tree.hpp" -#include "bitstream.hpp" -#include "types.hpp" -#include -#include -#include - -using namespace Encoding; - -DataStructures::HuffmanEncodingTree::HuffmanEncodingTree() -{ - root = nullptr; -} - -DataStructures::HuffmanEncodingTree::~HuffmanEncodingTree() -{ - FreeMemory(); -} - -void DataStructures::HuffmanEncodingTree::FreeMemory(void) -{ - if (root == nullptr) - return; - - // Use an in-order traversal to delete the tree - std::queue nodeQueue; - - HuffmanEncodingTreeNode* node; - - nodeQueue.push(root); - - while (nodeQueue.size() > 0) { - node = nodeQueue.front(); - nodeQueue.pop(); - - if (node->left) - nodeQueue.push(node->left); - - if (node->right) - nodeQueue.push(node->right); - - delete node; - } - - // Delete the encoding table - for (int i = 0; i < 256; i++) - delete[] encodingTable[i].encoding; - - root = nullptr; -} - -////#include - -// Given a frequency table of 256 elements, all with a frequency of 1 or more, generate the tree -void DataStructures::HuffmanEncodingTree::GenerateFromFrequencyTable(unsigned int frequencyTable[256]) -{ - int counter; - HuffmanEncodingTreeNode* node; - HuffmanEncodingTreeNode* leafList[256]; // Keep a copy of the pointers to all the leaves so we can generate the encryption table bottom-up, which is easier - // 1. Make 256 trees each with a weight equal to the frequency of the corresponding character - std::list huffmanEncodingTreeNodeList; - - FreeMemory(); - - for (counter = 0; counter < 256; counter++) { - node = new HuffmanEncodingTreeNode; - node->left = nullptr; - node->right = nullptr; - node->value = (unsigned char)counter; - node->weight = frequencyTable[counter]; - - if (node->weight == 0) - node->weight = 1; // 0 weights are illegal - - leafList[counter] = node; // Used later to generate the encryption table - - InsertNodeIntoSortedList(node, huffmanEncodingTreeNodeList); // Insert and maintain sort order. - } - - // 2. While there is more than one tree, take the two smallest trees and merge them so that the two trees are the left and right - // children of a new node, where the new node has the weight the sum of the weight of the left and right child nodes. - while (1) { - HuffmanEncodingTreeNode *lesser, *greater; - lesser = huffmanEncodingTreeNodeList.front(); - huffmanEncodingTreeNodeList.pop_front(); - greater = huffmanEncodingTreeNodeList.front(); - huffmanEncodingTreeNodeList.pop_front(); - node = new HuffmanEncodingTreeNode; - node->left = lesser; - node->right = greater; - node->weight = lesser->weight + greater->weight; - lesser->parent = node; // This is done to make generating the encryption table easier - greater->parent = node; // This is done to make generating the encryption table easier - - if (huffmanEncodingTreeNodeList.size() == 0) { - // 3. Assign the one remaining node in the list to the root node. - root = node; - root->parent = nullptr; - break; - } - - // Put the new node back into the list at the correct spot to maintain the sort. Linear search time - InsertNodeIntoSortedList(node, huffmanEncodingTreeNodeList); - } - - bool tempPath[256]; // Maximum path length is 256 - unsigned short tempPathLength; - HuffmanEncodingTreeNode* currentNode; - NetworkBitStream bitStream; - - // Generate the encryption table. From before, we have an array of pointers to all the leaves which contain pointers to their parents. - // This can be done more efficiently but this isn't bad and it's way easier to program and debug - - for (counter = 0; counter < 256; counter++) { - // Already done at the end of the loop and before it! - tempPathLength = 0; - - // Set the current node at the leaf - currentNode = leafList[counter]; - - do { - if (currentNode->parent->left == currentNode) // We're storing the paths in reverse order.since we are going from the leaf to the root - tempPath[tempPathLength++] = false; - else - tempPath[tempPathLength++] = true; - - currentNode = currentNode->parent; - } - - while (currentNode != root); - - // Write to the bitstream in the reverse order that we stored the path, which gives us the correct order from the root to the leaf - while (tempPathLength-- > 0) { - bitStream.writeBIT(tempPath[tempPathLength]); - } - - // Read data from the bitstream, which is written to the encoding table in bits and bitlength. Note this function allocates the encodingTable[counter].encoding pointer - encodingTable[counter].bitLength = (unsigned char)bitStream.CopyData(&encodingTable[counter].encoding); - - // Reset the bitstream for the next iteration - bitStream.reset(); - } -} - -// Pass an array of bytes to array and a preallocated BitStream to receive the output -void DataStructures::HuffmanEncodingTree::EncodeArray(unsigned char* input, unsigned sizeInBytes, NetworkBitStream* output) -{ - unsigned counter; - - // For each input byte, Write out the corresponding series of 1's and 0's that give the encoded representation - for (counter = 0; counter < sizeInBytes; counter++) { - output->WriteBits(encodingTable[input[counter]].encoding, encodingTable[input[counter]].bitLength, false); // Data is left aligned - } - - // Byte align the output so the unassigned remaining bits don't equate to some actual value - if (output->GetNumberOfBitsUsed() % 8 != 0) { - // Find an input that is longer than the remaining bits. Write out part of it to pad the output to be byte aligned. - unsigned char remainingBits = (unsigned char)(8 - (output->GetNumberOfBitsUsed() % 8)); - - for (counter = 0; counter < 256; counter++) - if (encodingTable[counter].bitLength > remainingBits) { - output->WriteBits(encodingTable[counter].encoding, remainingBits, false); // Data is left aligned - break; - } - - assert(counter != 256); // Given 256 elements, we should always be able to find an input that would be >= 7 bits - } -} - -unsigned DataStructures::HuffmanEncodingTree::DecodeArray(NetworkBitStream* input, unsigned& sizeInBits, unsigned maxCharsToWrite, unsigned char* output, bool skip) -{ - HuffmanEncodingTreeNode* currentNode; - - unsigned outputWriteIndex; - outputWriteIndex = 0; - currentNode = root; - - // For each bit, go left if it is a 0 and right if it is a 1. When we reach a leaf, that gives us the desired value and we restart from the root - - while (sizeInBits) { - if (outputWriteIndex == maxCharsToWrite) { - if (skip) { - input->IgnoreBits(sizeInBits); - sizeInBits = 0; - } - - return maxCharsToWrite; - } - - if (input->ReadBit() == false) // left! - currentNode = currentNode->left; - else - currentNode = currentNode->right; - - if (currentNode->left == nullptr && currentNode->right == nullptr) // Leaf - { - output[outputWriteIndex] = currentNode->value; - - outputWriteIndex++; - - currentNode = root; - } - - --sizeInBits; - } - - return outputWriteIndex; -} - -// Pass an array of encoded bytes to array and a preallocated BitStream to receive the output -void DataStructures::HuffmanEncodingTree::DecodeArray(unsigned char* input, unsigned sizeInBits, NetworkBitStream* output) -{ - HuffmanEncodingTreeNode* currentNode; - - if (sizeInBits <= 0) - return; - - NetworkBitStream bitStream(input, bitsToBytes(sizeInBits), false); - - currentNode = root; - - // For each bit, go left if it is a 0 and right if it is a 1. When we reach a leaf, that gives us the desired value and we restart from the root - for (unsigned counter = 0; counter < sizeInBits; counter++) { - if (bitStream.ReadBit() == false) // left! - currentNode = currentNode->left; - else - currentNode = currentNode->right; - - if (currentNode->left == 0 && currentNode->right == 0) // Leaf - { - output->WriteBits(&(currentNode->value), sizeof(char) * 8, true); // Use DoWriteBits instead of Write(char) because we want to avoid TYPE_CHECKING - currentNode = root; - } - } -} - -// Insertion sort. Slow but easy to write in this case -void DataStructures::HuffmanEncodingTree::InsertNodeIntoSortedList(HuffmanEncodingTreeNode* node, std::list& huffmanEncodingTreeNodeList) const -{ - for (auto it = huffmanEncodingTreeNodeList.begin(); it != huffmanEncodingTreeNodeList.end(); ++it) { - if ((*it)->weight >= node->weight) { - huffmanEncodingTreeNodeList.insert(it, node); - return; - } - } - - // Didn't find a spot in the middle - add to the end - huffmanEncodingTreeNodeList.push_back(node); -} diff --git a/Shared/Network/Encoding/huffman_tree.hpp b/Shared/Network/Encoding/huffman_tree.hpp deleted file mode 100644 index a891062af..000000000 --- a/Shared/Network/Encoding/huffman_tree.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/// \file -/// \brief \b [Internal] Generates a huffman encoding tree, used for string and global compression. -/// -/// This file is part of RakNet Copyright 2003 Kevin Jenkins. -/// -/// Usage of RakNet is subject to the appropriate license agreement. -/// Creative Commons Licensees are subject to the -/// license found at -/// http://creativecommons.org/licenses/by-nc/2.5/ -/// Single application licensees are subject to the license found at -/// http://www.rakkarsoft.com/SingleApplicationLicense.html -/// Custom license users are subject to the terms therein. -/// GPL license users are subject to the GNU General Public -/// License as published by the Free -/// Software Foundation; either version 2 of the License, or (at your -/// option) any later version. - -#pragma once - -#include "bitstream.hpp" -#include "huffman_tree_node.hpp" -#include - -namespace Encoding { -namespace DataStructures { - /// This generates special cases of the huffman encoding tree using 8 bit keys with the additional condition that unused combinations of 8 bits are treated as a frequency of 1 - class HuffmanEncodingTree { - - public: - HuffmanEncodingTree(); - ~HuffmanEncodingTree(); - - /// Pass an array of bytes to array and a preallocated BitStream to receive the output - /// \param [in] input Array of bytes to encode - /// \param [in] sizeInBytes size of \a input - /// \param [out] output The bitstream to write to - void EncodeArray(unsigned char* input, unsigned sizeInBytes, NetworkBitStream* output); - - // Decodes an array encoded by EncodeArray() - unsigned DecodeArray(NetworkBitStream* input, unsigned& sizeInBits, unsigned maxCharsToWrite, unsigned char* output, bool skip = true); - void DecodeArray(unsigned char* input, unsigned sizeInBits, NetworkBitStream* output); - - /// Given a frequency table of 256 elements, all with a frequency of 1 or more, generate the tree - void GenerateFromFrequencyTable(unsigned int frequencyTable[256]); - - /// Free the memory used by the tree - void FreeMemory(void); - - private: - /// The root node of the tree - - HuffmanEncodingTreeNode* root; - - /// Used to hold bit encoding for one character - - struct CharacterEncoding { - unsigned char* encoding; - unsigned short bitLength; - }; - - CharacterEncoding encodingTable[256]; - - void InsertNodeIntoSortedList(HuffmanEncodingTreeNode* node, std::list& huffmanEncodingTreeNodeList) const; - }; -} -} diff --git a/Shared/Network/Encoding/huffman_tree_node.hpp b/Shared/Network/Encoding/huffman_tree_node.hpp deleted file mode 100644 index 8fc86e6ff..000000000 --- a/Shared/Network/Encoding/huffman_tree_node.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/// \file -/// \brief \b [Internal] A single node in the Huffman Encoding Tree. -/// -/// This file is part of RakNet Copyright 2003 Kevin Jenkins. -/// -/// Usage of RakNet is subject to the appropriate license agreement. -/// Creative Commons Licensees are subject to the -/// license found at -/// http://creativecommons.org/licenses/by-nc/2.5/ -/// Single application licensees are subject to the license found at -/// http://www.rakkarsoft.com/SingleApplicationLicense.html -/// Custom license users are subject to the terms therein. -/// GPL license users are subject to the GNU General Public -/// License as published by the Free -/// Software Foundation; either version 2 of the License, or (at your -/// option) any later version. - -#pragma once - -namespace Encoding { -namespace DataStructures { - struct HuffmanEncodingTreeNode { - unsigned char value; - unsigned weight; - HuffmanEncodingTreeNode* left; - HuffmanEncodingTreeNode* right; - HuffmanEncodingTreeNode* parent; - }; -} -} diff --git a/Shared/Network/Encoding/str_compress.cpp b/Shared/Network/Encoding/str_compress.cpp deleted file mode 100644 index 685c14a2d..000000000 --- a/Shared/Network/Encoding/str_compress.cpp +++ /dev/null @@ -1,361 +0,0 @@ -/// \file -/// -/// This file is part of RakNet Copyright 2003 Kevin Jenkins. -/// -/// Usage of RakNet is subject to the appropriate license agreement. -/// Creative Commons Licensees are subject to the -/// license found at -/// http://creativecommons.org/licenses/by-nc/2.5/ -/// Single application licensees are subject to the license found at -/// http://www.rakkarsoft.com/SingleApplicationLicense.html -/// Custom license users are subject to the terms therein. -/// GPL license users are subject to the GNU General Public -/// License as published by the Free -/// Software Foundation; either version 2 of the License, or (at your -/// option) any later version. - -#include "str_compress.hpp" -#include "bitstream.hpp" -#include "huffman_tree.hpp" -#include -#include -#include - -using namespace Encoding; - -StringCompressor* StringCompressor::instance = nullptr; - -StringCompressor* StringCompressor::Instance(void) -{ - if (instance == nullptr) { - instance = new StringCompressor(); - } - return instance; -} - -namespace Encoding { - -unsigned int englishCharacterFrequencies[256] = { - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 722, - 0, - 0, - 2, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 11084, - 58, - 63, - 1, - 0, - 31, - 0, - 317, - 64, - 64, - 44, - 0, - 695, - 62, - 980, - 266, - 69, - 67, - 56, - 7, - 73, - 3, - 14, - 2, - 69, - 1, - 167, - 9, - 1, - 2, - 25, - 94, - 0, - 195, - 139, - 34, - 96, - 48, - 103, - 56, - 125, - 653, - 21, - 5, - 23, - 64, - 85, - 44, - 34, - 7, - 92, - 76, - 147, - 12, - 14, - 57, - 15, - 39, - 15, - 1, - 1, - 1, - 2, - 3, - 0, - 3611, - 845, - 1077, - 1884, - 5870, - 841, - 1057, - 2501, - 3212, - 164, - 531, - 2019, - 1330, - 3056, - 4037, - 848, - 47, - 2586, - 2919, - 4771, - 1707, - 535, - 1106, - 152, - 1243, - 100, - 0, - 2, - 0, - 10, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 -}; -} - -StringCompressor::StringCompressor() -{ - // Make a default tree immediately, since this is used for RPC possibly from multiple threads at the same time - huffmanEncodingTree.GenerateFromFrequencyTable(englishCharacterFrequencies); -} - -void StringCompressor::EncodeString(const char* input, int maxCharsToWrite, NetworkBitStream* output) -{ - if (input == 0) { - output->WriteCompressed((unsigned short)0); - return; - } - - NetworkBitStream encodedBitStream; - - unsigned short stringBitLength; - - int charsToWrite; - - if (maxCharsToWrite <= 0 || (int)strlen(input) < maxCharsToWrite) - charsToWrite = (int)strlen(input); - else - charsToWrite = maxCharsToWrite - 1; - - huffmanEncodingTree.EncodeArray((unsigned char*)input, charsToWrite, &encodedBitStream); - - stringBitLength = (unsigned short)encodedBitStream.GetNumberOfBitsUsed(); - - output->WriteCompressed(stringBitLength); - - output->WriteBits(encodedBitStream.GetData(), stringBitLength); -} - -bool StringCompressor::DecodeString(char* output, int maxCharsToWrite, NetworkBitStream* input, unsigned& stringBitLength, bool skip) -{ - //unsigned short stringBitLength; - int bytesInStream; - - output[0] = 0; - - if (stringBitLength == 0) { - short shortBitLength; - - if (input->ReadCompressed(shortBitLength) == false) - return false; - - stringBitLength = shortBitLength; - } - - if (input->GetNumberOfUnreadBits() < stringBitLength) - return false; - - bytesInStream = huffmanEncodingTree.DecodeArray(input, stringBitLength, maxCharsToWrite - 1, (unsigned char*)output, skip); - - output[bytesInStream] = 0; - - return true; -} - -bool StringCompressor::DecodeString(char* output, int maxCharsToWrite, NetworkBitStream* input) -{ - unsigned stringBitLength = 0; - return DecodeString(output, maxCharsToWrite, input, stringBitLength, true); -} diff --git a/Shared/Network/Encoding/str_compress.hpp b/Shared/Network/Encoding/str_compress.hpp deleted file mode 100644 index d961cc86d..000000000 --- a/Shared/Network/Encoding/str_compress.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/// \file -/// \brief \b Compresses/Decompresses ASCII strings and writes/reads them to BitStream class instances. You can use this to easily serialize and deserialize your own strings. -/// -/// This file is part of RakNet Copyright 2003 Kevin Jenkins. -/// -/// Usage of RakNet is subject to the appropriate license agreement. -/// Creative Commons Licensees are subject to the -/// license found at -/// http://creativecommons.org/licenses/by-nc/2.5/ -/// Single application licensees are subject to the license found at -/// http://www.rakkarsoft.com/SingleApplicationLicense.html -/// Custom license users are subject to the terms therein. -/// GPL license users are subject to the GNU General Public -/// License as published by the Free -/// Software Foundation; either version 2 of the License, or (at your -/// option) any later version. - -#pragma once - -#include "bitstream.hpp" -#include "huffman_tree.hpp" - -/// Forward declaration -namespace Encoding { - -/// \brief Writes and reads strings to and from bitstreams. -/// -/// Only works with ASCII strings. The default compression is for English. -/// You can call GenerateTreeFromStrings to compress and decompress other languages efficiently as well. -class StringCompressor { -public: - /// static function because only static functions can access static members - /// The RakPeer constructor adds a reference to this class, so don't call this until an instance of RakPeer exists, or unless you call AddReference yourself. - /// \return the unique instance of the StringCompressor - static StringCompressor* Instance(void); - - /// Writes input to output, compressed. Takes care of the null terminator for you. - /// \param[in] input Pointer to an ASCII string - /// \param[in] maxCharsToWrite The max number of bytes to write of \a input. Use 0 to mean no limit. - /// \param[out] output The bitstream to write the compressed string to - /// \param[in] languageID Which language to use - void EncodeString(const char* input, int maxCharsToWrite, NetworkBitStream* output); - - /// Writes input to output, uncompressed. Takes care of the null terminator for you. - /// \param[out] output A block of bytes to receive the output - /// \param[in] maxCharsToWrite Size, in bytes, of \a output . A NULL terminator will always be appended to the output string. If the maxCharsToWrite is not large enough, the string will be truncated. - /// \param[in] input The bitstream containing the compressed string - bool DecodeString(char* output, int maxCharsToWrite, NetworkBitStream* input); - - /// Writes input to output, uncompressed. Takes care of the null terminator for you. Can be resumed by tracking stringBitLength. - /// \param[out] output A block of bytes to receive the output - /// \param[in] maxCharsToWrite Size, in bytes, of \a output . A NULL terminator will always be appended to the output string. If the maxCharsToWrite is not large enough, the string will be truncated. - /// \param[in] input The bitstream containing the compressed string - /// \param[in] stringBitLength How many bits were not previously decoded - /// \param[in] skip If there is too much data to fit in the output, drop the remainder - bool DecodeString(char* output, int maxCharsToWrite, NetworkBitStream* input, unsigned& stringBitLength, bool skip); - -private: - /// Private Constructor - StringCompressor(); - - /// Pointer to the huffman encoding trees. - DataStructures::HuffmanEncodingTree huffmanEncodingTree; - - /// Singleton instance - static StringCompressor* instance; -}; -} - -/// Define to more easily reference the string compressor instance. -/// The RakPeer constructor adds a reference to this class, so don't call this until an instance of RakPeer exists, or unless you call AddReference yourself. -#define stringCompressor Encoding::StringCompressor::Instance() diff --git a/Shared/Network/LICENSE.md b/Shared/Network/LICENSE.md deleted file mode 100644 index 5cd7fe7ab..000000000 --- a/Shared/Network/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 open.mp - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/Shared/Network/README.md b/Shared/Network/README.md deleted file mode 100644 index 35a9e4f3f..000000000 --- a/Shared/Network/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# open.mp Network - -## Requires [open.mp SDK](https://github.com/openmultiplayer/open.mp-sdk) - -## Sources - -```bash -# With HTTPS: -git clone https://github.com/openmultiplayer/open.mp-network -# With SSH: -git clone git@github.com:openmultiplayer/open.mp-network -``` diff --git a/Shared/Network/bitstream.cpp b/Shared/Network/bitstream.cpp deleted file mode 100644 index ff191dd87..000000000 --- a/Shared/Network/bitstream.cpp +++ /dev/null @@ -1,672 +0,0 @@ -/// \file -/// -/// This file is part of RakNet Copyright 2003 Kevin Jenkins. -/// -/// Usage of RakNet is subject to the appropriate license agreement. -/// Creative Commons Licensees are subject to the -/// license found at -/// http://creativecommons.org/licenses/by-nc/2.5/ -/// Single application licensees are subject to the license found at -/// http://www.rakkarsoft.com/SingleApplicationLicense.html -/// Custom license users are subject to the terms therein. -/// GPL license users are subject to the GNU General Public -/// License as published by the Free -/// Software Foundation; either version 2 of the License, or (at your -/// option) any later version. - -#include "bitstream.hpp" -#include "Encoding/str_compress.hpp" -#include -#include -#include -#include -#include -#include -#if defined(_WIN32) -#include // htonl -#else -#include -#endif - -NetworkBitStream::NetworkBitStream() -{ - numberOfBitsUsed = 0; - //numberOfBitsAllocated = 32 * 8; - numberOfBitsAllocated = StackAllocationSize * 8; - readOffset = 0; - //data = ( unsigned char* ) malloc( 32 ); - data = (unsigned char*)stackData; - - // RakAssert( data ); - - //memset(data, 0, 32); - copyData = true; -} - -NetworkBitStream::NetworkBitStream(int initialBytesToAllocate) -{ - numberOfBitsUsed = 0; - readOffset = 0; - if (initialBytesToAllocate <= StackAllocationSize) { - data = (unsigned char*)stackData; - numberOfBitsAllocated = StackAllocationSize * 8; - } else { - data = (unsigned char*)malloc(initialBytesToAllocate); - numberOfBitsAllocated = initialBytesToAllocate << 3; - } - - assert(data); - - // memset(data, 0, initialBytesToAllocate); - copyData = true; -} - -NetworkBitStream::NetworkBitStream(unsigned char* _data, unsigned int lengthInBytes, bool _copyData) -{ - numberOfBitsUsed = lengthInBytes << 3; - readOffset = 0; - copyData = _copyData; - numberOfBitsAllocated = lengthInBytes << 3; - - if (copyData) { - if (lengthInBytes > 0) { - if (lengthInBytes < StackAllocationSize) { - data = (unsigned char*)stackData; - numberOfBitsAllocated = StackAllocationSize << 3; - } else { - data = (unsigned char*)malloc(lengthInBytes); - } - - assert(data); - - memcpy(data, _data, lengthInBytes); - } else - data = 0; - } else - data = (unsigned char*)_data; -} - -// Use this if you pass a pointer copy to the constructor (_copyData==false) and want to overallocate to prevent reallocation -void NetworkBitStream::SetNumberOfBitsAllocated(const unsigned int lengthInBits) -{ - - assert(lengthInBits >= (unsigned int)numberOfBitsAllocated); - - numberOfBitsAllocated = lengthInBits; -} - -NetworkBitStream::~NetworkBitStream() -{ - if (copyData && numberOfBitsAllocated > StackAllocationSize << 3) - free(data); // Use realloc and free so we are more efficient than delete and new for resizing -} - -void NetworkBitStream::reset(void) -{ - // Note: Do NOT reallocate memory because NetworkBitStream is used - // in places to serialize/deserialize a buffer. Reallocation - // is a dangerous operation (may result in leaks). - - if (numberOfBitsUsed > 0) { - // memset(data, 0, bitsToBytes(numberOfBitsUsed)); - } - - // Don't free memory here for speed efficiency - //free(data); // Use realloc and free so we are more efficient than delete and new for resizing - numberOfBitsUsed = 0; - - //numberOfBitsAllocated=8; - readOffset = 0; - - //data=(unsigned char*)malloc(1); - // if (numberOfBitsAllocated>0) - // memset(data, 0, bitsToBytes(numberOfBitsAllocated)); -} - -// Write an array or casted stream -void NetworkBitStream::Write(const char* input, const int numberOfBytes) -{ - if (numberOfBytes == 0) - return; - - // Optimization: - if ((numberOfBitsUsed & 7) == 0) { - AddBitsAndReallocate(bytesToBits(numberOfBytes)); - memcpy(data + bitsToBytes(numberOfBitsUsed), input, numberOfBytes); - numberOfBitsUsed += bytesToBits(numberOfBytes); - } else { - WriteBits((unsigned char*)input, numberOfBytes * 8, true); - } -} -void NetworkBitStream::Write(NetworkBitStream* bitStream) -{ - Write(bitStream, bitStream->GetNumberOfBitsUsed()); -} -void NetworkBitStream::Write(NetworkBitStream* bitStream, int numberOfBits) -{ - if (numberOfBits > bitStream->GetNumberOfUnreadBits()) - return; - - AddBitsAndReallocate(numberOfBits); - int numberOfBitsMod8; - - while (numberOfBits-- > 0) { - numberOfBitsMod8 = numberOfBitsUsed & 7; - if (numberOfBitsMod8 == 0) { - // New byte - if (bitStream->data[bitStream->readOffset >> 3] & (0x80 >> (bitStream->readOffset % 8))) { - // Write 1 - data[numberOfBitsUsed >> 3] = 0x80; - } else { - // Write 0 - data[numberOfBitsUsed >> 3] = 0; - } - ++bitStream->readOffset; - } else { - // Existing byte - if (bitStream->data[bitStream->readOffset >> 3] & (0x80 >> (bitStream->readOffset % 8))) - data[numberOfBitsUsed >> 3] |= 0x80 >> (numberOfBitsMod8); // Set the bit to 1 - // else 0, do nothing - ++bitStream->readOffset; - } - - numberOfBitsUsed++; - } -} - -// Read an array or casted stream -bool NetworkBitStream::Read(char* output, const int numberOfBytes) -{ - // Optimization: - if ((readOffset & 7) == 0) { - if (GetNumberOfUnreadBits() < (numberOfBytes << 3)) - return false; - - // Write the data - memcpy(output, data + (readOffset >> 3), numberOfBytes); - - readOffset += numberOfBytes << 3; - return true; - } else { - return ReadBits((unsigned char*)output, numberOfBytes * 8); - } -} - -// Sets the read pointer back to the beginning of your data. -void NetworkBitStream::resetReadPointer(void) -{ - readOffset = 0; -} - -// Sets the write pointer back to the beginning of your data. -void NetworkBitStream::resetWritePointer(void) -{ - numberOfBitsUsed = 0; -} - -// Write a 0 -void NetworkBitStream::Write0(void) -{ - AddBitsAndReallocate(1); - - // New bytes need to be zeroed - if ((numberOfBitsUsed & 7) == 0) - data[numberOfBitsUsed >> 3] = 0; - - numberOfBitsUsed++; -} - -// Write a 1 -void NetworkBitStream::Write1(void) -{ - AddBitsAndReallocate(1); - - int numberOfBitsMod8 = numberOfBitsUsed & 7; - - if (numberOfBitsMod8 == 0) - data[numberOfBitsUsed >> 3] = 0x80; - else - data[numberOfBitsUsed >> 3] |= 0x80 >> (numberOfBitsMod8); // Set the bit to 1 - - numberOfBitsUsed++; -} - -// Returns true if the next data read is a 1, false if it is a 0 -bool NetworkBitStream::ReadBit(void) -{ - if (GetNumberOfUnreadBits() == 0) { - return false; - } - - bool res = (bool)(data[readOffset >> 3] & (0x80 >> (readOffset & 7))); - ++readOffset; - return res; -} - -// Align the bitstream to the byte boundary and then write the specified number of bits. -// This is faster than DoWriteBits but wastes the bits to do the alignment and requires you to call -// SetReadToByteAlignment at the corresponding read position -void NetworkBitStream::WriteAlignedBytes(const unsigned char* input, - const int numberOfBytesToWrite) -{ - - assert(numberOfBytesToWrite > 0); - - AlignWriteToByteBoundary(); - Write((const char*)input, numberOfBytesToWrite); -} - -// Read bits, starting at the next aligned bits. Note that the modulus 8 starting offset of the -// sequence must be the same as was used with DoWriteBits. This will be a problem with packet coalescence -// unless you byte align the coalesced packets. -bool NetworkBitStream::ReadAlignedBytes(unsigned char* output, const int numberOfBytesToRead) -{ - - assert(numberOfBytesToRead > 0); - - if (numberOfBytesToRead <= 0) - return false; - - // Byte align - AlignReadToByteBoundary(); - - if (GetNumberOfUnreadBits() < (numberOfBytesToRead << 3)) - return false; - - // Write the data - memcpy(output, data + (readOffset >> 3), numberOfBytesToRead); - - readOffset += numberOfBytesToRead << 3; - - return true; -} - -// Align the next write and/or read to a byte boundary. This can be used to 'waste' bits to byte align for efficiency reasons -void NetworkBitStream::AlignWriteToByteBoundary(void) -{ - if (numberOfBitsUsed) - numberOfBitsUsed += 8 - (((numberOfBitsUsed - 1) & 7) + 1); -} - -// Align the next write and/or read to a byte boundary. This can be used to 'waste' bits to byte align for efficiency reasons -void NetworkBitStream::AlignReadToByteBoundary(void) -{ - if (readOffset) - readOffset += 8 - (((readOffset - 1) & 7) + 1); -} - -// Write numberToWrite bits from the input source -void NetworkBitStream::WriteBits(const unsigned char* input, int numberOfBitsToWrite, const bool rightAlignedBits) -{ - if (numberOfBitsToWrite <= 0) - return; - - AddBitsAndReallocate(numberOfBitsToWrite); - int offset = 0; - unsigned char dataByte; - int numberOfBitsUsedMod8; - - numberOfBitsUsedMod8 = numberOfBitsUsed & 7; - - // Faster to put the while at the top surprisingly enough - while (numberOfBitsToWrite > 0) - //do - { - dataByte = *(input + offset); - - if (numberOfBitsToWrite < 8 && rightAlignedBits) // rightAlignedBits means in the case of a partial byte, the bits are aligned from the right (bit 0) rather than the left (as in the normal internal representation) - dataByte <<= 8 - numberOfBitsToWrite; // shift left to get the bits on the left, as in our internal representation - - // Writing to a new byte each time - if (numberOfBitsUsedMod8 == 0) - *(data + (numberOfBitsUsed >> 3)) = dataByte; - else { - // Copy over the new data. - *(data + (numberOfBitsUsed >> 3)) |= dataByte >> (numberOfBitsUsedMod8); // First half - - if (8 - (numberOfBitsUsedMod8) < 8 && 8 - (numberOfBitsUsedMod8) < numberOfBitsToWrite) // If we didn't write it all out in the first half (8 - (numberOfBitsUsed%8) is the number we wrote in the first half) - { - *(data + (numberOfBitsUsed >> 3) + 1) = (unsigned char)(dataByte << (8 - (numberOfBitsUsedMod8))); // Second half (overlaps byte boundary) - } - } - - if (numberOfBitsToWrite >= 8) - numberOfBitsUsed += 8; - else - numberOfBitsUsed += numberOfBitsToWrite; - - numberOfBitsToWrite -= 8; - - offset++; - } - // } while(numberOfBitsToWrite>0); -} - -// Set the stream to some initial data. For internal use -void NetworkBitStream::SetData(unsigned char* input) -{ - data = input; - copyData = false; -} - -// Assume the input source points to a native type, compress and write it -void NetworkBitStream::WriteCompressed(const unsigned char* input, - const int size, const bool unsignedData) -{ - int currentByte = (size >> 3) - 1; // PCs - - unsigned char byteMatch; - - if (unsignedData) { - byteMatch = 0; - } - - else { - byteMatch = 0xFF; - } - - // Write upper bytes with a single 1 - // From high byte to low byte, if high byte is a byteMatch then write a 1 bit. Otherwise write a 0 bit and then write the remaining bytes - while (currentByte > 0) { - if (input[currentByte] == byteMatch) // If high byte is byteMatch (0 of 0xff) then it would have the same value shifted - { - bool b = true; - Write(b); - } else { - // Write the remainder of the data after writing 0 - bool b = false; - Write(b); - - WriteBits(input, (currentByte + 1) << 3, true); - // currentByte--; - - return; - } - - currentByte--; - } - - // If the upper half of the last byte is a 0 (positive) or 16 (negative) then write a 1 and the remaining 4 bits. Otherwise write a 0 and the 8 bites. - if ((unsignedData && ((*(input + currentByte)) & 0xF0) == 0x00) || (unsignedData == false && ((*(input + currentByte)) & 0xF0) == 0xF0)) { - bool b = true; - Write(b); - WriteBits(input + currentByte, 4, true); - } - - else { - bool b = false; - Write(b); - WriteBits(input + currentByte, 8, true); - } -} - -// Read numberOfBitsToRead bits to the output source -// alignBitsToRight should be set to true to convert internal bitstream data to userdata -// It should be false if you used DoWriteBits with rightAlignedBits false -bool NetworkBitStream::ReadBits(unsigned char* output, int numberOfBitsToRead, const bool alignBitsToRight) -{ - - assert(numberOfBitsToRead > 0); - - if (numberOfBitsToRead <= 0) - return false; - - if (GetNumberOfUnreadBits() < numberOfBitsToRead) - return false; - - int readOffsetMod8; - - int offset = 0; - - memset(output, 0, bitsToBytes(numberOfBitsToRead)); - - readOffsetMod8 = readOffset & 7; - - // do - // Faster to put the while at the top surprisingly enough - while (numberOfBitsToRead > 0) { - *(output + offset) |= *(data + (readOffset >> 3)) << (readOffsetMod8); // First half - - if (readOffsetMod8 > 0 && numberOfBitsToRead > 8 - (readOffsetMod8)) // If we have a second half, we didn't read enough bytes in the first half - *(output + offset) |= *(data + (readOffset >> 3) + 1) >> (8 - (readOffsetMod8)); // Second half (overlaps byte boundary) - - numberOfBitsToRead -= 8; - - if (numberOfBitsToRead < 0) // Reading a partial byte for the last byte, shift right so the data is aligned on the right - { - - if (alignBitsToRight) - *(output + offset) >>= -numberOfBitsToRead; - - readOffset += 8 + numberOfBitsToRead; - } else - readOffset += 8; - - offset++; - } - - //} while(numberOfBitsToRead>0); - - return true; -} - -// Assume the input source points to a compressed native type. Decompress and read it -bool NetworkBitStream::ReadCompressed(unsigned char* output, - const int size, const bool unsignedData) -{ - int currentByte = (size >> 3) - 1; - - unsigned char byteMatch, halfByteMatch; - - if (unsignedData) { - byteMatch = 0; - halfByteMatch = 0; - } - - else { - byteMatch = 0xFF; - halfByteMatch = 0xF0; - } - - // Upper bytes are specified with a single 1 if they match byteMatch - // From high byte to low byte, if high byte is a byteMatch then write a 1 bit. Otherwise write a 0 bit and then write the remaining bytes - while (currentByte > 0) { - // If we read a 1 then the data is byteMatch. - - bool b; - - if (Read(b) == false) - return false; - - if (b) // Check that bit - { - output[currentByte] = byteMatch; - currentByte--; - } else { - // Read the rest of the bytes - - if (ReadBits(output, (currentByte + 1) << 3) == false) - return false; - - return true; - } - } - - // All but the first bytes are byteMatch. If the upper half of the last byte is a 0 (positive) or 16 (negative) then what we read will be a 1 and the remaining 4 bits. - // Otherwise we read a 0 and the 8 bytes - //RakAssert(readOffset+1 <=numberOfBitsUsed); // If this assert is hit the stream wasn't long enough to read from - if (readOffset + 1 > numberOfBitsUsed) - return false; - - bool b; - - if (Read(b) == false) - return false; - - if (b) // Check that bit - { - - if (ReadBits(output + currentByte, 4) == false) - return false; - - output[currentByte] |= halfByteMatch; // We have to set the high 4 bits since these are set to 0 by ReadBits - } else { - if (ReadBits(output + currentByte, 8) == false) - return false; - } - - return true; -} - -// Reallocates (if necessary) in preparation of writing numberOfBitsToWrite -void NetworkBitStream::AddBitsAndReallocate(const int numberOfBitsToWrite) -{ - if (numberOfBitsToWrite <= 0) - return; - - int newNumberOfBitsAllocated = numberOfBitsToWrite + numberOfBitsUsed; - - if (numberOfBitsToWrite + numberOfBitsUsed > 0 && ((numberOfBitsAllocated - 1) >> 3) < ((newNumberOfBitsAllocated - 1) >> 3)) // If we need to allocate 1 or more new bytes - { - // Less memory efficient but saves on news and deletes - newNumberOfBitsAllocated = (numberOfBitsToWrite + numberOfBitsUsed) * 2; - // int newByteOffset = bitsToBytes( numberOfBitsAllocated ); - // Use realloc and free so we are more efficient than delete and new for resizing - int amountToAllocate = bitsToBytes(newNumberOfBitsAllocated); - if (data == (unsigned char*)stackData) { - - // If this assert hits then we need to specify true for the third parameter in the constructor - // It needs to reallocate to hold all the data and can't do it unless we allocated to begin with - assert(copyData == true); - - if (amountToAllocate > StackAllocationSize) { - data = (unsigned char*)malloc(amountToAllocate); - - // need to copy the stack data over to our new memory area too - memcpy((void*)data, (void*)stackData, bitsToBytes(numberOfBitsAllocated)); - } - } else { - if (copyData == true) { - data = (unsigned char*)realloc(data, amountToAllocate); - assert(data); - } else { - copyData = true; - unsigned char* new_data = amountToAllocate < StackAllocationSize ? (unsigned char*)stackData : (unsigned char*)malloc(amountToAllocate); - assert(new_data); - memcpy((void*)new_data, (void*)data, bitsToBytes(numberOfBitsAllocated)); - numberOfBitsAllocated = new_data == stackData ? bytesToBits(StackAllocationSize) : amountToAllocate; - data = new_data; - } - } - } - - if (newNumberOfBitsAllocated > numberOfBitsAllocated) - numberOfBitsAllocated = newNumberOfBitsAllocated; -} - -// Should hit if reads didn't match writes -void NetworkBitStream::AssertStreamEmpty(void) -{ - assert(readOffset == numberOfBitsUsed); -} - -void NetworkBitStream::PrintBits(void) const -{ - if (numberOfBitsUsed <= 0) { - printf("No bits\n"); - return; - } - - for (int counter = 0; counter < bitsToBytes(numberOfBitsUsed); counter++) { - int stop; - - if (counter == (numberOfBitsUsed - 1) >> 3) - stop = 8 - (((numberOfBitsUsed - 1) & 7) + 1); - else - stop = 0; - - for (int counter2 = 7; counter2 >= stop; counter2--) { - if ((data[counter] >> counter2) & 1) - putchar('1'); - else - putchar('0'); - } - - putchar(' '); - } - - putchar('\n'); -} - -// Exposes the data for you to look at, like PrintBits does. -// Data will point to the stream. Returns the length in bits of the stream. -int NetworkBitStream::CopyData(unsigned char** _data) const -{ - - assert(numberOfBitsUsed > 0); - - *_data = new unsigned char[bitsToBytes(numberOfBitsUsed)]; - memcpy(*_data, data, sizeof(unsigned char) * (bitsToBytes(numberOfBitsUsed))); - return numberOfBitsUsed; -} - -// Ignore data we don't intend to read -void NetworkBitStream::IgnoreBits(const int numberOfBits) -{ - readOffset += numberOfBits; -} - -// Move the write pointer to a position on the array. Dangerous if you don't know what you are doing! -void NetworkBitStream::SetWriteOffset(const int offset) -{ - numberOfBitsUsed = offset; -} - -/* -int NetworkBitStream::GetWriteOffset( void ) const -{ - return numberOfBitsUsed; -} - -// Returns the length in bits of the stream -int NetworkBitStream::GetNumberOfBitsUsed( void ) const -{ - return GetWriteOffset(); -} - -// Returns the length in bytes of the stream -int NetworkBitStream::GetNumberOfBytesUsed( void ) const -{ - return bitsToBytes( numberOfBitsUsed ); -} - -// Returns the number of bits into the stream that we have read -int NetworkBitStream::GetReadOffset( void ) const -{ - return readOffset; -} - - -// Sets the read bit index -void NetworkBitStream::SetReadOffset( int newReadOffset ) -{ - readOffset=newReadOffset; -} - -// Returns the number of bits left in the stream that haven't been read -int NetworkBitStream::GetNumberOfUnreadBits( void ) const -{ - return numberOfBitsUsed - readOffset; -} -// Exposes the internal data -unsigned char* NetworkBitStream::GetData( void ) const -{ - return data; -} - -*/ - -void NetworkBitStream::WriteCompressedStr(StringView data) -{ - stringCompressor->EncodeString(data.data(), data.length() + 1, this); -} diff --git a/Shared/Network/bitstream.hpp b/Shared/Network/bitstream.hpp deleted file mode 100644 index e16b8e8c2..000000000 --- a/Shared/Network/bitstream.hpp +++ /dev/null @@ -1,1430 +0,0 @@ -/// \file -/// \brief This class allows you to write and read native types as a string of bits. NetworkBitStream is used extensively throughout RakNet and is designed to be used by users as well. -/// -/// This file is part of RakNet Copyright 2003 Kevin Jenkins. -/// -/// Usage of RakNet is subject to the appropriate license agreement. -/// Creative Commons Licensees are subject to the -/// license found at -/// http://creativecommons.org/licenses/by-nc/2.5/ -/// Single application licensees are subject to the license found at -/// http://www.rakkarsoft.com/SingleApplicationLicense.html -/// Custom license users are subject to the terms therein. -/// GPL license users are subject to the GNU General Public -/// License as published by the Free -/// Software Foundation; either version 2 of the License, or (at your -/// option) any later version. - -#pragma once - -#include "gtaquat.hpp" -#include "types.hpp" -#include -#include - -constexpr int bitsToBytes(int bits) -{ - return (((bits) + 7) >> 3); -} - -constexpr int bytesToBits(int bytes) -{ - return ((bytes) << 3); -} - -class NetworkBitStream { - /// Arbitrary size, just picking something likely to be larger than most packets - constexpr static const size_t StackAllocationSize = 256; - constexpr static const float CompressedVecMagnitudeEpsilon = 0.00001f; - -public: - /// The version of the NetworkBitStream class; increased when breaking changes are introduced - constexpr static const int Version = 3; - - /// Default Constructor - NetworkBitStream(); - - /// Create the bitstream, with some number of bytes to immediately allocate. - /// There is no benefit to calling this, unless you know exactly how many bytes you need and it is greater than NETWORK_BITSTREAM_STACK_ALLOCATION_SIZE. - /// In that case all it does is save you one or more realloc calls. - /// \param[in] initialBytesToAllocate the number of bytes to pre-allocate. - NetworkBitStream(int initialBytesToAllocate); - - /// Initialize the NetworkBitStream, immediately setting the data it contains to a predefined pointer. - /// Set \a _copyData to true if you want to make an internal copy of the data you are passing. Set it to false to just save a pointer to the data. - /// You shouldn't call Write functions with \a _copyData as false, as this will write to unallocated memory - /// 99% of the time you will use this function to cast Packet::data to a bitstream for reading, in which case you should write something as follows: - /// \code - /// RakNet::NetworkBitStream bs(packet->data, packet->length, false); - /// \endcode - /// \param[in] _data An array of bytes. - /// \param[in] lengthInBytes Size of the \a _data. - /// \param[in] _copyData true or false to make a copy of \a _data or not. - NetworkBitStream(unsigned char* _data, unsigned int lengthInBytes, bool _copyData); - - /// Destructor - ~NetworkBitStream(); - - /// Resets the bitstream for reuse. - void reset(void); - - /// Sets the read pointer back to the beginning of your data. - void resetReadPointer(void); - - /// Sets the write pointer back to the beginning of your data. - void resetWritePointer(void); - -public: - inline void writeBIT(bool data); - - template , T>> - inline void writeUINT8(T data) - { - Write(uint8_t(data)); - } - - template , T>> - inline void writeUINT16(T data) - { - Write(uint16_t(data)); - } - - template , T>> - inline void writeUINT32(T data) - { - Write(uint32_t(data)); - } - - template , T>> - inline void writeUINT64(T data) - { - Write(uint64_t(data)); - } - - template , T>> - inline void writeINT8(T data) - { - Write(int8_t(data)); - } - - template , T>> - inline void writeINT16(T data) - { - Write(int16_t(data)); - } - - template , T>> - inline void writeINT32(T data) - { - Write(int32_t(data)); - } - - template , T>> - inline void writeINT64(T data) - { - Write(int64_t(data)); - } - - inline void writeDOUBLE(double data) - { - Write(data); - } - - inline void writeFLOAT(float data) - { - Write(data); - } - - inline void writeVEC2(Vector2 data) - { - Write(data); - } - - inline void writeVEC3(Vector3 data) - { - Write(data); - } - - inline void writeVEC4(Vector4 data) - { - Write(data); - } - - inline void writeDynStr8(StringView data) - { - Write(static_cast(data.length())); - Write(data.data(), data.length()); - } - - inline void writeDynStr16(StringView data) - { - Write(static_cast(data.length())); - Write(data.data(), data.length()); - } - - inline void writeDynStr32(StringView data) - { - Write(static_cast(data.length())); - Write(data.data(), data.length()); - } - - template , T>> - inline void writeArray(Span data) - { - Write(reinterpret_cast(data.data()), data.size() * sizeof(T)); - } - - template , T>> - inline void writeArray(StaticArray data) - { - Write(reinterpret_cast(data.data()), data.size() * sizeof(T)); - } - - inline void writeCompressedPercentPair(Vector2 data) - { - const uint8_t ha = (data.x >= 100 ? 0x0F : (uint8_t)CEILDIV((int)data.x, 7)) << 4 | (data.y >= 100 ? 0x0F : (uint8_t)CEILDIV((int)data.y, 7)); - Write(ha); - } - - inline void writeCompressedVEC3(Vector3 data); - - inline void writeGTAQuat(GTAQuat data) - { - WriteNormQuat(data.q.w, data.q.x, data.q.y, data.q.z); - } - - void WriteCompressedStr(StringView data); - - inline bool readBIT(bool& data); - - template , T>> - inline bool readUINT8(T& data) - { - uint8_t tmp; - const bool res = Read(tmp); - data = tmp; - return res; - } - - template , T>> - inline bool readUINT16(T& data) - { - uint16_t tmp; - const bool res = Read(tmp); - data = tmp; - return res; - } - - template , T>> - inline bool readUINT32(T& data) - { - uint32_t tmp; - const bool res = Read(tmp); - data = tmp; - return res; - } - - template , T>> - inline bool readUINT64(T& data) - { - uint64_t tmp; - const bool res = Read(tmp); - data = tmp; - return res; - } - - template , T>> - inline bool readINT8(T& data) - { - int8_t tmp; - const bool res = Read(tmp); - data = tmp; - return res; - } - - template , T>> - inline bool readINT16(T& data) - { - int16_t tmp; - const bool res = Read(tmp); - data = tmp; - return res; - } - - template , T>> - inline bool readINT32(T& data) - { - int32_t tmp; - const bool res = Read(tmp); - data = tmp; - return res; - } - - template , T>> - inline bool readINT64(T& data) - { - int64_t tmp; - const bool res = Read(tmp); - data = tmp; - return res; - } - - [[nodiscard]] inline bool readDOUBLE(double& data) - { - const bool res = Read(data); - return res && std::isfinite(data); - } - - [[nodiscard]] inline bool readFLOAT(float& data) - { - const bool res = Read(data); - return res && std::isfinite(data); - } - - [[nodiscard]] inline bool readVEC2(Vector2& data) - { - const bool res = Read(data); - return res && std::isfinite(data.x) && std::isfinite(data.y); - } - - [[nodiscard]] inline bool readVEC3(Vector3& data) - { - const bool res = Read(data); - return res && std::isfinite(data.x) && std::isfinite(data.y) && std::isfinite(data.z); - } - - [[nodiscard]] inline bool readPosVEC3(Vector3& data) - { - const bool res = Read(data); - return res && std::isfinite(data.x) && std::isfinite(data.y) && std::isfinite(data.z) && data.x < 20000.0f && data.x > -20000.0f && data.y < 20000.0f && data.y > -20000.0f && data.z < 200000.0f && data.z > -1000.0f; - } - - [[nodiscard]] inline bool readVelVEC3(Vector3& data) - { - const bool res = Read(data); - return res && std::isfinite(data.x) && std::isfinite(data.y) && std::isfinite(data.z) && glm::dot(data, data) <= 100.0f * 100.0f; - } - - [[nodiscard]] inline bool readVEC4(Vector4& data) - { - const bool res = Read(data); - return res && std::isfinite(data.x) && std::isfinite(data.y) && std::isfinite(data.z) && std::isfinite(data.w); - } - - template - inline bool readDynStr8(HybridString& data) - { - return readDynamicStr(data); - } - - template - inline bool readDynStr16(HybridString& data) - { - return readDynamicStr(data); - } - - template - inline bool readDynStr32(HybridString& data) - { - return readDynamicStr(data); - } - - template , T>> - inline bool readArray(Span data) - { - if (data.size() * sizeof(T) > unsigned(bitsToBytes(GetNumberOfUnreadBits()))) { - return false; - } - - return Read(reinterpret_cast(data.data()), data.size() * sizeof(T)); - } - - inline bool readCompressedPercentPair(Vector2& data) - { - uint8_t - health, - armour; - if (!Read(health)) { - return false; - } - if (!Read(armour)) { - return false; - } - data = Vector2(health, armour); - return true; - } - - [[nodiscard]] inline bool readGTAQuat(GTAQuat& data) - { - auto res = Read(data.q); - return res && std::isfinite(data.q.x) && std::isfinite(data.q.y) && std::isfinite(data.q.z) && std::isfinite(data.q.w); - } - - template - bool readDynamicStr(HybridString& data) - { - LenType len; - if (!Read(len)) { - return false; - } - if (len > unsigned(bitsToBytes(GetNumberOfUnreadBits()))) { - return false; - } - data.reserve(len); - return Read(data.data(), len); - } - - /// Write numberToWrite bits from the input source Right aligned - /// data means in the case of a partial byte, the bits are aligned - /// from the right (bit 0) rather than the left (as in the normal - /// internal representation) You would set this to true when - /// writing user data, and false when copying bitstream data, such - /// as writing one bitstream to another - /// \param[in] input The data - /// \param[in] numberOfBitsToWrite The number of bits to write - /// \param[in] rightAlignedBits if true data will be right aligned - void WriteBits(const unsigned char* input, int numberOfBitsToWrite, const bool rightAlignedBits = true); - - /// Write any integral type to a bitstream. Undefine __BITSTREAM_NATIVE_END if you need endian swapping. - /// If you are not using __BITSTREAM_NATIVE_END the opposite is true for types larger than 1 byte - /// For floating point, this is lossy, using 2 bytes for a float and 4 for a double. The range must be between -1 and +1. - /// For non-floating point, this is lossless, but only has benefit if you use less than half the range of the type - /// \param[in] var The value to write - template - void WriteCompressed(templateType var); - - /// Read \a numberOfBitsToRead bits to the output source - /// alignBitsToRight should be set to true to convert internal - /// bitstream data to userdata. It should be false if you used - /// DoWriteBits with rightAlignedBits false - /// \param[in] output The resulting bits array - /// \param[in] numberOfBitsToRead The number of bits to read - /// \param[in] alignBitsToRight if true bits will be right aligned. - /// \return true if there is enough bits to read - bool ReadBits(unsigned char* output, int numberOfBitsToRead, const bool alignBitsToRight = true); - - /// Reads 1 bit and returns true if that bit is 1 and false if it is 0 - bool ReadBit(void); - - /// Read any integral type from a bitstream. Undefine __BITSTREAM_NATIVE_END if you need endian swapping. - /// For floating point, this is lossy, using 2 bytes for a float and 4 for a double. The range must be between -1 and +1. - /// For non-floating point, this is lossless, but only has benefit if you use less than half the range of the type - /// If you are not using __BITSTREAM_NATIVE_END the opposite is true for types larger than 1 byte - /// \param[in] var The value to read - template - bool ReadCompressed(templateType& var); - - /// This is good to call when you are done with the stream to make - /// sure you didn't leave any data left over void - void AssertStreamEmpty(void); - - /// printf the bits in the stream. Great for debugging. - void PrintBits(void) const; - - /// Ignore data we don't intend to read - /// \param[in] numberOfBits The number of bits to ignore - void IgnoreBits(const int numberOfBits); - - /// Move the write pointer to a position on the array. - /// \param[in] offset the offset from the start of the array. - /// \attention - /// Dangerous if you don't know what you are doing! - /// For efficiency reasons you can only write mid-stream if your data is byte aligned. - void SetWriteOffset(const int offset); - - /// Returns the length in bits of the stream - inline int GetNumberOfBitsUsed(void) const { return GetWriteOffset(); } - inline int GetWriteOffset(void) const { return numberOfBitsUsed; } - - /// Returns the length in bytes of the stream - inline int GetNumberOfBytesUsed(void) const { return bitsToBytes(numberOfBitsUsed); } - - /// Returns the number of bits into the stream that we have read - inline int GetReadOffset(void) const { return readOffset; } - - // Sets the read bit index - inline void SetReadOffset(int newReadOffset) { readOffset = newReadOffset; } - - /// Returns the number of bits left in the stream that haven't been read - inline int GetNumberOfUnreadBits(void) const { return readOffset > numberOfBitsUsed ? 0 : numberOfBitsUsed - readOffset; } - - /// Makes a copy of the internal data for you \a _data will point to - /// the stream. Returns the length in bits of the stream. Partial - /// bytes are left aligned - /// \param[out] _data The allocated copy of GetData() - int CopyData(unsigned char** _data) const; - - /// Set the stream to some initial data. - /// \internal - void SetData(unsigned char* input); - - /// Gets the data that NetworkBitStream is writing to / reading from - /// Partial bytes are left aligned. - /// \return A pointer to the internal state - inline unsigned char* GetData(void) const { return data; } - -private: - /// Write a 0 - void Write0(void); - - /// Write a 1 - void Write1(void); - - /// Bidirectional serialize/deserialize any integral type to/from a bitstream. Undefine __BITSTREAM_NATIVE_END if you need endian swapping. - /// \param[in] writeToBitstream true to write from your data to this bitstream. False to read from this bitstream and write to your data - /// \param[in] var The value to write - /// \return true if \a writeToBitstream is true. true if \a writeToBitstream is false and the read was successful. false if \a writeToBitstream is false and the read was not successful. - template - bool Serialize(bool writeToBitstream, templateType& var); - - /// Bidirectional serialize/deserialize any integral type to/from a bitstream. If the current value is different from the last value - /// the current value will be written. Otherwise, a single bit will be written - /// \param[in] writeToBitstream true to write from your data to this bitstream. False to read from this bitstream and write to your data - /// \param[in] currentValue The current value to write - /// \param[in] lastValue The last value to compare against. Only used if \a writeToBitstream is true. - /// \return true if \a writeToBitstream is true. true if \a writeToBitstream is false and the read was successful. false if \a writeToBitstream is false and the read was not successful. - template - bool SerializeDelta(bool writeToBitstream, templateType& currentValue, templateType lastValue); - - /// Bidirectional version of SerializeDelta when you don't know what the last value is, or there is no last value. - /// \param[in] writeToBitstream true to write from your data to this bitstream. False to read from this bitstream and write to your data - /// \param[in] currentValue The current value to write - /// \return true if \a writeToBitstream is true. true if \a writeToBitstream is false and the read was successful. false if \a writeToBitstream is false and the read was not successful. - template - bool SerializeDelta(bool writeToBitstream, templateType& currentValue); - - /// Bidirectional serialize/deserialize any integral type to/from a bitstream. Undefine __BITSTREAM_NATIVE_END if you need endian swapping. - /// If you are not using __BITSTREAM_NATIVE_END the opposite is true for types larger than 1 byte - /// For floating point, this is lossy, using 2 bytes for a float and 4 for a double. The range must be between -1 and +1. - /// For non-floating point, this is lossless, but only has benefit if you use less than half the range of the type - /// \param[in] writeToBitstream true to write from your data to this bitstream. False to read from this bitstream and write to your data - /// \param[in] var The value to write - /// \return true if \a writeToBitstream is true. true if \a writeToBitstream is false and the read was successful. false if \a writeToBitstream is false and the read was not successful. - template - bool SerializeCompressed(bool writeToBitstream, templateType& var); - - /// Bidirectional serialize/deserialize any integral type to/from a bitstream. If the current value is different from the last value - /// the current value will be written. Otherwise, a single bit will be written - /// For floating point, this is lossy, using 2 bytes for a float and 4 for a double. The range must be between -1 and +1. - /// For non-floating point, this is lossless, but only has benefit if you use less than half the range of the type - /// If you are not using __BITSTREAM_NATIVE_END the opposite is true for types larger than 1 byte - /// \param[in] writeToBitstream true to write from your data to this bitstream. False to read from this bitstream and write to your data - /// \param[in] currentValue The current value to write - /// \param[in] lastValue The last value to compare against. Only used if \a writeToBitstream is true. - /// \return true if \a writeToBitstream is true. true if \a writeToBitstream is false and the read was successful. false if \a writeToBitstream is false and the read was not successful. - template - bool SerializeCompressedDelta(bool writeToBitstream, templateType& currentValue, templateType lastValue); - - /// Save as SerializeCompressedDelta(templateType ¤tValue, templateType lastValue) when we have an unknown second parameter - template - bool SerializeCompressedDelta(bool writeToBitstream, templateType& currentValue); - - /// Bidirectional serialize/deserialize an array or casted stream or raw data. This does NOT do endian swapping. - /// \param[in] writeToBitstream true to write from your data to this bitstream. False to read from this bitstream and write to your data - /// \param[in] input a byte buffer - /// \param[in] numberOfBytes the size of \a input in bytes - /// \return true if \a writeToBitstream is true. true if \a writeToBitstream is false and the read was successful. false if \a writeToBitstream is false and the read was not successful. - bool Serialize(bool writeToBitstream, char* input, const int numberOfBytes); - - /// Bidirectional serialize/deserialize a normalized 3D vector, using (at most) 4 bytes + 3 bits instead of 12-24 bytes. Will further compress y or z axis aligned vectors. - /// Accurate to 1/32767.5. - /// \param[in] writeToBitstream true to write from your data to this bitstream. False to read from this bitstream and write to your data - /// \param[in] x x - /// \param[in] y y - /// \param[in] z z - /// \return true if \a writeToBitstream is true. true if \a writeToBitstream is false and the read was successful. false if \a writeToBitstream is false and the read was not successful. - template // templateType for this function must be a float or double - bool SerializeNormVector(bool writeToBitstream, templateType& x, templateType& y, templateType& z); - - /// Bidirectional serialize/deserialize a vector, using 10 bytes instead of 12. - /// Loses accuracy to about 3/10ths and only saves 2 bytes, so only use if accuracy is not important. - /// \param[in] writeToBitstream true to write from your data to this bitstream. False to read from this bitstream and write to your data - /// \param[in] x x - /// \param[in] y y - /// \param[in] z z - /// \return true if \a writeToBitstream is true. true if \a writeToBitstream is false and the read was successful. false if \a writeToBitstream is false and the read was not successful. - template // templateType for this function must be a float or double - bool SerializeVector(bool writeToBitstream, templateType& x, templateType& y, templateType& z); - - /// Bidirectional serialize/deserialize a normalized quaternion in 6 bytes + 4 bits instead of 16 bytes. Slightly lossy. - /// \param[in] writeToBitstream true to write from your data to this bitstream. False to read from this bitstream and write to your data - /// \param[in] w w - /// \param[in] x x - /// \param[in] y y - /// \param[in] z z - /// \return true if \a writeToBitstream is true. true if \a writeToBitstream is false and the read was successful. false if \a writeToBitstream is false and the read was not successful. - template // templateType for this function must be a float or double - bool SerializeNormQuat(bool writeToBitstream, templateType& w, templateType& x, templateType& y, templateType& z); - - /// Bidirectional serialize/deserialize an orthogonal matrix by creating a quaternion, and writing 3 components of the quaternion in 2 bytes each - /// for 6 bytes instead of 36 - /// Lossy, although the result is renormalized - template // templateType for this function must be a float or double - bool SerializeOrthMatrix( - bool writeToBitstream, - templateType& m00, templateType& m01, templateType& m02, - templateType& m10, templateType& m11, templateType& m12, - templateType& m20, templateType& m21, templateType& m22); - - /// Bidirectional serialize/deserialize numberToSerialize bits to/from the input. Right aligned - /// data means in the case of a partial byte, the bits are aligned - /// from the right (bit 0) rather than the left (as in the normal - /// internal representation) You would set this to true when - /// writing user data, and false when copying bitstream data, such - /// as writing one bitstream to another - /// \param[in] writeToBitstream true to write from your data to this bitstream. False to read from this bitstream and write to your data - /// \param[in] input The data - /// \param[in] numberOfBitsToSerialize The number of bits to write - /// \param[in] rightAlignedBits if true data will be right aligned - /// \return true if \a writeToBitstream is true. true if \a writeToBitstream is false and the read was successful. false if \a writeToBitstream is false and the read was not successful. - bool SerializeBits(bool writeToBitstream, unsigned char* input, int numberOfBitsToSerialize, const bool rightAlignedBits = true); - - /// Write any integral type to a bitstream. Undefine __BITSTREAM_NATIVE_END if you need endian swapping. - /// \param[in] var The value to write - template - void Write(templateType var); - - /// Write any integral type to a bitstream. If the current value is different from the last value - /// the current value will be written. Otherwise, a single bit will be written - /// \param[in] currentValue The current value to write - /// \param[in] lastValue The last value to compare against - template - void WriteDelta(templateType currentValue, templateType lastValue); - - /// WriteDelta when you don't know what the last value is, or there is no last value. - /// \param[in] currentValue The current value to write - template - void WriteDelta(templateType currentValue); - - /// Write any integral type to a bitstream. If the current value is different from the last value - /// the current value will be written. Otherwise, a single bit will be written - /// For floating point, this is lossy, using 2 bytes for a float and 4 for a double. The range must be between -1 and +1. - /// For non-floating point, this is lossless, but only has benefit if you use less than half the range of the type - /// If you are not using __BITSTREAM_NATIVE_END the opposite is true for types larger than 1 byte - /// \param[in] currentValue The current value to write - /// \param[in] lastValue The last value to compare against - template - void WriteCompressedDelta(templateType currentValue, templateType lastValue); - - /// Save as WriteCompressedDelta(templateType currentValue, templateType lastValue) when we have an unknown second parameter - template - void WriteCompressedDelta(templateType currentValue); - - /// Read any integral type from a bitstream. Define __BITSTREAM_NATIVE_END if you need endian swapping. - /// \param[in] var The value to read - template - bool Read(templateType& var); - - /// Read any integral type from a bitstream. If the written value differed from the value compared against in the write function, - /// var will be updated. Otherwise it will retain the current value. - /// ReadDelta is only valid from a previous call to WriteDelta - /// \param[in] var The value to read - template - bool ReadDelta(templateType& var); - - /// Read any integral type from a bitstream. If the written value differed from the value compared against in the write function, - /// var will be updated. Otherwise it will retain the current value. - /// the current value will be updated. - /// For floating point, this is lossy, using 2 bytes for a float and 4 for a double. The range must be between -1 and +1. - /// For non-floating point, this is lossless, but only has benefit if you use less than half the range of the type - /// If you are not using __BITSTREAM_NATIVE_END the opposite is true for types larger than 1 byte - /// ReadCompressedDelta is only valid from a previous call to WriteDelta - /// \param[in] var The value to read - template - bool ReadCompressedDelta(templateType& var); - - /// Write an array or casted stream or raw data. This does NOT do endian swapping. - /// \param[in] input a byte buffer - /// \param[in] numberOfBytes the size of \a input in bytes - void Write(const char* input, const int numberOfBytes); - - /// Write one bitstream to another - /// \param[in] numberOfBits bits to write - /// \param bitStream the bitstream to copy from - void Write(NetworkBitStream* bitStream, int numberOfBits); - void Write(NetworkBitStream* bitStream); - - /// Read a normalized 3D vector, using (at most) 4 bytes + 3 bits instead of 12-24 bytes. Will further compress y or z axis aligned vectors. - /// Accurate to 1/32767.5. - /// \param[in] x x - /// \param[in] y y - /// \param[in] z z - template // templateType for this function must be a float or double - void WriteNormVector(templateType x, templateType y, templateType z); - - /// Write a vector, using 10 bytes instead of 12. - /// Loses accuracy to about 3/10ths and only saves 2 bytes, so only use if accuracy is not important. - /// \param[in] x x - /// \param[in] y y - /// \param[in] z z - template // templateType for this function must be a float or double - void WriteVector(templateType x, templateType y, templateType z); - - /// Write a normalized quaternion in 6 bytes + 4 bits instead of 16 bytes. Slightly lossy. - /// \param[in] w w - /// \param[in] x x - /// \param[in] y y - /// \param[in] z z - template // templateType for this function must be a float or double - void WriteNormQuat(templateType w, templateType x, templateType y, templateType z); - - /// Write an orthogonal matrix by creating a quaternion, and writing 3 components of the quaternion in 2 bytes each - /// for 6 bytes instead of 36 - /// Lossy, although the result is renormalized - template // templateType for this function must be a float or double - void WriteOrthMatrix( - templateType m00, templateType m01, templateType m02, - templateType m10, templateType m11, templateType m12, - templateType m20, templateType m21, templateType m22); - - /// Read an array or casted stream of byte. The array - /// is raw data. There is no automatic endian conversion with this function - /// \param[in] output The result byte array. It should be larger than @em numberOfBytes. - /// \param[in] numberOfBytes The number of byte to read - /// \return true on success false if there is some missing bytes. - bool Read(char* output, const int numberOfBytes); - - /// Read a normalized 3D vector, using (at most) 4 bytes + 3 bits instead of 12-24 bytes. Will further compress y or z axis aligned vectors. - /// Accurate to 1/32767.5. - /// \param[in] x x - /// \param[in] y y - /// \param[in] z z - template // templateType for this function must be a float or double - bool ReadNormVector(templateType& x, templateType& y, templateType& z); - - /// Read 3 floats or doubles, using 10 bytes, where those float or doubles comprise a vector - /// Loses accuracy to about 3/10ths and only saves 2 bytes, so only use if accuracy is not important. - /// \param[in] x x - /// \param[in] y y - /// \param[in] z z - template // templateType for this function must be a float or double - bool ReadVector(templateType& x, templateType& y, templateType& z); - - /// Read a normalized quaternion in 6 bytes + 4 bits instead of 16 bytes. - /// \param[in] w w - /// \param[in] x x - /// \param[in] y y - /// \param[in] z z - template // templateType for this function must be a float or double - bool ReadNormQuat(templateType& w, templateType& x, templateType& y, templateType& z); - - /// Read an orthogonal matrix from a quaternion, reading 3 components of the quaternion in 2 bytes each and extrapolatig the 4th. - /// for 6 bytes instead of 36 - /// Lossy, although the result is renormalized - template // templateType for this function must be a float or double - bool ReadOrthMatrix( - templateType& m00, templateType& m01, templateType& m02, - templateType& m10, templateType& m11, templateType& m12, - templateType& m20, templateType& m21, templateType& m22); - - /// Align the bitstream to the byte boundary and then write the - /// specified number of bits. This is faster than DoWriteBits but - /// wastes the bits to do the alignment and requires you to call - /// ReadAlignedBits at the corresponding read position. - /// \param[in] input The data - /// \param[in] numberOfBytesToWrite The size of data. - void WriteAlignedBytes(const unsigned char* input, const int numberOfBytesToWrite); - - /// Read bits, starting at the next aligned bits. Note that the - /// modulus 8 starting offset of the sequence must be the same as - /// was used with DoWriteBits. This will be a problem with packet - /// coalescence unless you byte align the coalesced packets. - /// \param[in] output The byte array larger than @em numberOfBytesToRead - /// \param[in] numberOfBytesToRead The number of byte to read from the internal state - /// \return true if there is enough byte. - bool ReadAlignedBytes(unsigned char* output, const int numberOfBytesToRead); - - /// Align the next write and/or read to a byte boundary. This can - /// be used to 'waste' bits to byte align for efficiency reasons It - /// can also be used to force coalesced bitstreams to start on byte - /// boundaries so so WriteAlignedBits and ReadAlignedBits both - /// calculate the same offset when aligning. - void AlignWriteToByteBoundary(void); - - /// Align the next write and/or read to a byte boundary. This can - /// be used to 'waste' bits to byte align for efficiency reasons It - /// can also be used to force coalesced bitstreams to start on byte - /// boundaries so so WriteAlignedBits and ReadAlignedBits both - /// calculate the same offset when aligning. - void AlignReadToByteBoundary(void); - - /// Use this if you pass a pointer copy to the constructor - /// *(_copyData==false) and want to overallocate to prevent - /// *reallocation - void SetNumberOfBitsAllocated(const unsigned int lengthInBits); - - /// Reallocates (if necessary) in preparation of writing numberOfBitsToWrite - void AddBitsAndReallocate(const int numberOfBitsToWrite); - -private: - /// Assume the input source points to a native type, compress and write it. - void WriteCompressed(const unsigned char* input, const int size, const bool unsignedData); - - /// Assume the input source points to a compressed native type. Decompress and read it. - bool ReadCompressed(unsigned char* output, const int size, const bool unsignedData); - - int numberOfBitsUsed; - - int numberOfBitsAllocated; - - int readOffset; - - unsigned char* data; - - /// true if the internal buffer is copy of the data passed to the constructor - bool copyData; - - /// BitStreams that use less than StackAllocationSize use the stack, rather than the heap to store data. It switches over if StackAllocationSize is exceeded - unsigned char stackData[StackAllocationSize]; -}; - -/// Write a bool to a bitstream -/// \param[in] var The value to write -template <> -inline void NetworkBitStream::Write(bool var) -{ - if (var) - Write1(); - else - Write0(); -} - -template -inline bool NetworkBitStream::Serialize(bool writeToBitstream, templateType& var) -{ - if (writeToBitstream) - Write(var); - else - return Read(var); - return true; -} - -template -inline bool NetworkBitStream::SerializeDelta(bool writeToBitstream, templateType& currentValue, templateType lastValue) -{ - if (writeToBitstream) - WriteDelta(currentValue, lastValue); - else - return ReadDelta(currentValue); - return true; -} - -template -inline bool NetworkBitStream::SerializeDelta(bool writeToBitstream, templateType& currentValue) -{ - if (writeToBitstream) - WriteDelta(currentValue); - else - return ReadDelta(currentValue); - return true; -} - -template -inline bool NetworkBitStream::SerializeCompressed(bool writeToBitstream, templateType& var) -{ - if (writeToBitstream) - WriteCompressed(var); - else - return ReadCompressed(var); - return true; -} - -template -inline bool NetworkBitStream::SerializeCompressedDelta(bool writeToBitstream, templateType& currentValue, templateType lastValue) -{ - if (writeToBitstream) - WriteCompressedDelta(currentValue, lastValue); - else - return ReadCompressedDelta(currentValue); - return true; -} - -template -inline bool NetworkBitStream::SerializeCompressedDelta(bool writeToBitstream, templateType& currentValue) -{ - if (writeToBitstream) - WriteCompressedDelta(currentValue); - else - return ReadCompressedDelta(currentValue); - return true; -} - -inline bool NetworkBitStream::Serialize(bool writeToBitstream, char* input, const int numberOfBytes) -{ - if (writeToBitstream) - Write(input, numberOfBytes); - else - return Read(input, numberOfBytes); - return true; -} - -template -inline bool NetworkBitStream::SerializeNormVector(bool writeToBitstream, templateType& x, templateType& y, templateType& z) -{ - if (writeToBitstream) - WriteNormVector(x, y, z); - else - return ReadNormVector(x, y, z); - return true; -} - -template -inline bool NetworkBitStream::SerializeVector(bool writeToBitstream, templateType& x, templateType& y, templateType& z) -{ - if (writeToBitstream) - WriteVector(x, y, z); - else - return ReadVector(x, y, z); - return true; -} - -template -inline bool NetworkBitStream::SerializeNormQuat(bool writeToBitstream, templateType& w, templateType& x, templateType& y, templateType& z) -{ - if (writeToBitstream) - WriteNormQuat(w, x, y, z); - else - return ReadNormQuat(w, x, y, z); - return true; -} - -template -inline bool NetworkBitStream::SerializeOrthMatrix( - bool writeToBitstream, - templateType& m00, templateType& m01, templateType& m02, - templateType& m10, templateType& m11, templateType& m12, - templateType& m20, templateType& m21, templateType& m22) -{ - if (writeToBitstream) - WriteOrthMatrix(m00, m01, m02, m10, m11, m12, m20, m21, m22); - else - return ReadOrthMatrix(m00, m01, m02, m10, m11, m12, m20, m21, m22); - return true; -} - -inline bool NetworkBitStream::SerializeBits(bool writeToBitstream, unsigned char* input, int numberOfBitsToSerialize, const bool rightAlignedBits) -{ - if (writeToBitstream) - WriteBits(input, numberOfBitsToSerialize, rightAlignedBits); - else - return ReadBits(input, numberOfBitsToSerialize, rightAlignedBits); - return true; -} - -template -inline void NetworkBitStream::Write(templateType var) -{ - WriteBits((unsigned char*)&var, sizeof(templateType) * 8, true); -} - -/// Write any integral type to a bitstream. If the current value is different from the last value -/// the current value will be written. Otherwise, a single bit will be written -/// \param[in] currentValue The current value to write -/// \param[in] lastValue The last value to compare against -template -inline void NetworkBitStream::WriteDelta(templateType currentValue, templateType lastValue) -{ - if (currentValue == lastValue) { - Write(false); - } else { - Write(true); - Write(currentValue); - } -} - -/// Write a bool delta. Same thing as just calling Write -/// \param[in] currentValue The current value to write -/// \param[in] lastValue The last value to compare against -template <> -inline void NetworkBitStream::WriteDelta(bool currentValue, bool lastValue) -{ - Write(currentValue); -} - -/// WriteDelta when you don't know what the last value is, or there is no last value. -/// \param[in] currentValue The current value to write -template -inline void NetworkBitStream::WriteDelta(templateType currentValue) -{ - Write(true); - Write(currentValue); -} - -/// Write any integral type to a bitstream. Undefine __BITSTREAM_NATIVE_END if you need endian swapping. -/// For floating point, this is lossy, using 2 bytes for a float and 4 for a double. The range must be between -1 and +1. -/// For non-floating point, this is lossless, but only has benefit if you use less than half the range of the type -/// If you are not using __BITSTREAM_NATIVE_END the opposite is true for types larger than 1 byte -/// \param[in] var The value to write -template -inline void NetworkBitStream::WriteCompressed(templateType var) -{ - WriteCompressed((unsigned char*)&var, sizeof(templateType) * 8, true); -} - -template <> -inline void NetworkBitStream::WriteCompressed(bool var) -{ - Write(var); -} - -/// For values between -1 and 1 -template <> -inline void NetworkBitStream::WriteCompressed(float var) -{ - // RakAssert(var > -1.01f && var < 1.01f); - if (var < -1.0f) - var = -1.0f; - if (var > 1.0f) - var = 1.0f; - Write((unsigned short)((var + 1.0f) * 32767.5f)); -} - -/// For values between -1 and 1 -template <> -inline void NetworkBitStream::WriteCompressed(double var) -{ - assert(var > -1.01 && var < 1.01); - if (var < -1.0f) - var = -1.0f; - if (var > 1.0f) - var = 1.0f; - - assert(sizeof(unsigned long) == 4); - - Write((unsigned long)((var + 1.0) * 2147483648.0)); -} - -/// Write any integral type to a bitstream. If the current value is different from the last value -/// the current value will be written. Otherwise, a single bit will be written -/// For floating point, this is lossy, using 2 bytes for a float and 4 for a double. The range must be between -1 and +1. -/// For non-floating point, this is lossless, but only has benefit if you use less than half the range of the type -/// If you are not using __BITSTREAM_NATIVE_END the opposite is true for types larger than 1 byte -/// \param[in] currentValue The current value to write -/// \param[in] lastValue The last value to compare against -template -inline void NetworkBitStream::WriteCompressedDelta(templateType currentValue, templateType lastValue) -{ - if (currentValue == lastValue) { - Write(false); - } else { - Write(true); - WriteCompressed(currentValue); - } -} - -/// Write a bool delta. Same thing as just calling Write -/// \param[in] currentValue The current value to write -/// \param[in] lastValue The last value to compare against -template <> -inline void NetworkBitStream::WriteCompressedDelta(bool currentValue, bool lastValue) -{ - Write(currentValue); -} - -/// Save as WriteCompressedDelta(templateType currentValue, templateType lastValue) when we have an unknown second parameter -template -inline void NetworkBitStream::WriteCompressedDelta(templateType currentValue) -{ - Write(true); - WriteCompressed(currentValue); -} - -/// Save as WriteCompressedDelta(bool currentValue, templateType lastValue) when we have an unknown second bool -template <> -inline void NetworkBitStream::WriteCompressedDelta(bool currentValue) -{ - Write(currentValue); -} - -/// Read any integral type from a bitstream. Define __BITSTREAM_NATIVE_END if you need endian swapping. -/// \param[in] var The value to read -template -inline bool NetworkBitStream::Read(templateType& var) -{ - return ReadBits((unsigned char*)&var, sizeof(templateType) * 8, true); -} - -/// Read a bool from a bitstream -/// \param[in] var The value to read -template <> -inline bool NetworkBitStream::Read(bool& var) -{ - if (GetNumberOfUnreadBits() == 0) - return false; - - if (data[readOffset >> 3] & (0x80 >> (readOffset % 8))) // Is it faster to just write it out here? - var = true; - else - var = false; - - ++readOffset; - - return true; -} - -/// Read any integral type from a bitstream. If the written value differed from the value compared against in the write function, -/// var will be updated. Otherwise it will retain the current value. -/// ReadDelta is only valid from a previous call to WriteDelta -/// \param[in] var The value to read -template -inline bool NetworkBitStream::ReadDelta(templateType& var) -{ - bool dataWritten; - bool success; - success = Read(dataWritten); - if (dataWritten) - success = Read(var); - return success; -} - -/// Read a bool from a bitstream -/// \param[in] var The value to read -template <> -inline bool NetworkBitStream::ReadDelta(bool& var) -{ - return Read(var); -} - -/// Read any integral type from a bitstream. Undefine __BITSTREAM_NATIVE_END if you need endian swapping. -/// For floating point, this is lossy, using 2 bytes for a float and 4 for a double. The range must be between -1 and +1. -/// For non-floating point, this is lossless, but only has benefit if you use less than half the range of the type -/// If you are not using __BITSTREAM_NATIVE_END the opposite is true for types larger than 1 byte -/// \param[in] var The value to read -template -inline bool NetworkBitStream::ReadCompressed(templateType& var) -{ - return ReadCompressed((unsigned char*)&var, sizeof(templateType) * 8, true); -} - -template <> -inline bool NetworkBitStream::ReadCompressed(bool& var) -{ - return Read(var); -} - -/// For values between -1 and 1 -template <> -inline bool NetworkBitStream::ReadCompressed(float& var) -{ - unsigned short compressedFloat; - if (Read(compressedFloat)) { - var = ((float)compressedFloat / 32767.5f - 1.0f); - return true; - } - return false; -} - -/// For values between -1 and 1 -template <> -inline bool NetworkBitStream::ReadCompressed(double& var) -{ - unsigned long compressedFloat; - if (Read(compressedFloat)) { - var = ((double)compressedFloat / 2147483648.0 - 1.0); - return true; - } - return false; -} - -/// Read any integral type from a bitstream. If the written value differed from the value compared against in the write function, -/// var will be updated. Otherwise it will retain the current value. -/// the current value will be updated. -/// For floating point, this is lossy, using 2 bytes for a float and 4 for a double. The range must be between -1 and +1. -/// For non-floating point, this is lossless, but only has benefit if you use less than half the range of the type -/// If you are not using __BITSTREAM_NATIVE_END the opposite is true for types larger than 1 byte -/// ReadCompressedDelta is only valid from a previous call to WriteDelta -/// \param[in] var The value to read -template -inline bool NetworkBitStream::ReadCompressedDelta(templateType& var) -{ - bool dataWritten; - bool success; - success = Read(dataWritten); - if (dataWritten) - success = ReadCompressed(var); - return success; -} - -/// Read a bool from a bitstream -/// \param[in] var The value to read -template <> -inline bool NetworkBitStream::ReadCompressedDelta(bool& var) -{ - return Read(var); -} - -template // templateType for this function must be a float or double -void NetworkBitStream::WriteNormVector(templateType x, templateType y, templateType z) -{ - - RakAssert(x <= 1.01 && y <= 1.01 && z <= 1.01 && x >= -1.01 && y >= -1.01 && z >= -1.01); - - if (x > 1.0) - x = 1.0; - if (y > 1.0) - y = 1.0; - if (z > 1.0) - z = 1.0; - if (x < -1.0) - x = -1.0; - if (y < -1.0) - y = -1.0; - if (z < -1.0) - z = -1.0; - - Write((bool)(x < 0.0)); - if (y == 0.0) - Write(true); - else { - Write(false); - WriteCompressed((float)y); - // Write((unsigned short)((y+1.0f)*32767.5f)); - } - if (z == 0.0) - Write(true); - else { - Write(false); - WriteCompressed((float)z); - // Write((unsigned short)((z+1.0f)*32767.5f)); - } -} - -template // templateType for this function must be a float or double -void NetworkBitStream::WriteVector(templateType x, templateType y, templateType z) -{ - templateType magnitude = sqrt(x * x + y * y + z * z); - Write((float)magnitude); - if (magnitude > 0.0) { - WriteCompressed((float)(x / magnitude)); - WriteCompressed((float)(y / magnitude)); - WriteCompressed((float)(z / magnitude)); - // Write((unsigned short)((x/magnitude+1.0f)*32767.5f)); - // Write((unsigned short)((y/magnitude+1.0f)*32767.5f)); - // Write((unsigned short)((z/magnitude+1.0f)*32767.5f)); - } -} - -template // templateType for this function must be a float or double -void NetworkBitStream::WriteNormQuat(templateType w, templateType x, templateType y, templateType z) -{ - Write((bool)(w < 0.0)); - Write((bool)(x < 0.0)); - Write((bool)(y < 0.0)); - Write((bool)(z < 0.0)); - Write((unsigned short)(fabs(x) * 65535.0)); - Write((unsigned short)(fabs(y) * 65535.0)); - Write((unsigned short)(fabs(z) * 65535.0)); - // Leave out w and calculate it on the target -} - -template // templateType for this function must be a float or double -void NetworkBitStream::WriteOrthMatrix( - templateType m00, templateType m01, templateType m02, - templateType m10, templateType m11, templateType m12, - templateType m20, templateType m21, templateType m22) -{ - double qw; - double qx; - double qy; - double qz; - - // Convert matrix to quat - // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/ - float sum; - sum = 1 + m00 + m11 + m22; - if (sum < 0.0f) - sum = 0.0f; - qw = sqrt(sum) / 2; - sum = 1 + m00 - m11 - m22; - if (sum < 0.0f) - sum = 0.0f; - qx = sqrt(sum) / 2; - sum = 1 - m00 + m11 - m22; - if (sum < 0.0f) - sum = 0.0f; - qy = sqrt(sum) / 2; - sum = 1 - m00 - m11 + m22; - if (sum < 0.0f) - sum = 0.0f; - qz = sqrt(sum) / 2; - if (qw < 0.0) - qw = 0.0; - if (qx < 0.0) - qx = 0.0; - if (qy < 0.0) - qy = 0.0; - if (qz < 0.0) - qz = 0.0; - qx = _copysign(qx, m21 - m12); - qy = _copysign(qy, m02 - m20); - qz = _copysign(qz, m10 - m01); - - WriteNormQuat(qw, qx, qy, qz); -} - -template // templateType for this function must be a float or double -bool NetworkBitStream::ReadNormVector(templateType& x, templateType& y, templateType& z) -{ - // unsigned short sy, sz; - bool yZero, zZero; - bool xNeg; - float cy, cz; - - Read(xNeg); - - Read(yZero); - if (yZero) - y = 0.0; - else { - ReadCompressed(cy); - y = cy; - // Read(sy); - // y=((float)sy / 32767.5f - 1.0f); - } - - if (!Read(zZero)) - return false; - - if (zZero) - z = 0.0; - else { - // if (!Read(sz)) - // return false; - - // z=((float)sz / 32767.5f - 1.0f); - if (!ReadCompressed(cz)) - return false; - z = cz; - } - - x = (templateType)(sqrtf((templateType)1.0 - y * y - z * z)); - if (xNeg) - x = -x; - return true; -} - -template // templateType for this function must be a float or double -bool NetworkBitStream::ReadVector(templateType& x, templateType& y, templateType& z) -{ - float magnitude; - // unsigned short sx,sy,sz; - if (!Read(magnitude)) - return false; - if (magnitude != 0.0) { - // Read(sx); - // Read(sy); - // if (!Read(sz)) - // return false; - // x=((float)sx / 32767.5f - 1.0f) * magnitude; - // y=((float)sy / 32767.5f - 1.0f) * magnitude; - // z=((float)sz / 32767.5f - 1.0f) * magnitude; - float cx, cy, cz; - ReadCompressed(cx); - ReadCompressed(cy); - if (!ReadCompressed(cz)) - return false; - x = cx; - y = cy; - z = cz; - x *= magnitude; - y *= magnitude; - z *= magnitude; - } else { - x = 0.0; - y = 0.0; - z = 0.0; - } - return true; -} - -template // templateType for this function must be a float or double -bool NetworkBitStream::ReadNormQuat(templateType& w, templateType& x, templateType& y, templateType& z) -{ - bool cwNeg, cxNeg, cyNeg, czNeg; - unsigned short cx, cy, cz; - Read(cwNeg); - Read(cxNeg); - Read(cyNeg); - Read(czNeg); - Read(cx); - Read(cy); - if (!Read(cz)) - return false; - - // Calculate w from x,y,z - x = (templateType)(cx / 65535.0); - y = (templateType)(cy / 65535.0); - z = (templateType)(cz / 65535.0); - if (cxNeg) - x = -x; - if (cyNeg) - y = -y; - if (czNeg) - z = -z; - float difference = 1.0f - x * x - y * y - z * z; - if (difference < 0.0f) - difference = 0.0f; - w = (templateType)(sqrt(difference)); - if (cwNeg) - w = -w; - return true; -} - -template // templateType for this function must be a float or double -bool NetworkBitStream::ReadOrthMatrix( - templateType& m00, templateType& m01, templateType& m02, - templateType& m10, templateType& m11, templateType& m12, - templateType& m20, templateType& m21, templateType& m22) -{ - float qw, qx, qy, qz; - if (!ReadNormQuat(qw, qx, qy, qz)) - return false; - - // Quat to orthogonal rotation matrix - // http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToMatrix/index.htm - double sqw = (double)qw * (double)qw; - double sqx = (double)qx * (double)qx; - double sqy = (double)qy * (double)qy; - double sqz = (double)qz * (double)qz; - m00 = (templateType)(sqx - sqy - sqz + sqw); // since sqw + sqx + sqy + sqz =1 - m11 = (templateType)(-sqx + sqy - sqz + sqw); - m22 = (templateType)(-sqx - sqy + sqz + sqw); - - double tmp1 = (double)qx * (double)qy; - double tmp2 = (double)qz * (double)qw; - m10 = (templateType)(2.0 * (tmp1 + tmp2)); - m01 = (templateType)(2.0 * (tmp1 - tmp2)); - - tmp1 = (double)qx * (double)qz; - tmp2 = (double)qy * (double)qw; - m20 = (templateType)(2.0 * (tmp1 - tmp2)); - m02 = (templateType)(2.0 * (tmp1 + tmp2)); - tmp1 = (double)qy * (double)qz; - tmp2 = (double)qx * (double)qw; - m21 = (templateType)(2.0 * (tmp1 + tmp2)); - m12 = (templateType)(2.0 * (tmp1 - tmp2)); - - return true; -} - -inline void NetworkBitStream::writeCompressedVEC3(Vector3 data) -{ - float magnitude = glm::length(data); - Write(magnitude); - if (magnitude > CompressedVecMagnitudeEpsilon) { - data /= magnitude; - WriteCompressed(data.x); - WriteCompressed(data.y); - WriteCompressed(data.z); - } -} - -inline void NetworkBitStream::writeBIT(bool data) -{ - Write(data); -} - -inline bool NetworkBitStream::readBIT(bool& data) -{ - return Read(data); -} diff --git a/Shared/Network/packet.hpp b/Shared/Network/packet.hpp deleted file mode 100644 index ef601ee03..000000000 --- a/Shared/Network/packet.hpp +++ /dev/null @@ -1,124 +0,0 @@ -#pragma once - -#include "bitstream.hpp" -#include -#include -#include - -enum class NetworkPacketType { - Packet, - RPC, -}; - -/// Class used for declaring netcode packets -/// Provides an array of packet IDs -/// @typeparam PacketIDs A list of packet IDs for each network in the ENetworkType enum -template -struct NetworkPacketBase { - static constexpr const int PacketID = PktID; - static constexpr const NetworkPacketType PacketType = PktType; - static constexpr const int PacketChannel = PktChannel; - - constexpr static void addEventHandler(ICore& core, SingleNetworkInEventHandler* handler, event_order_t priority = EventPriority_Default) - { - if (PacketType == NetworkPacketType::RPC) { - core.addPerRPCInEventHandler(handler, priority); - } else if (PacketType == NetworkPacketType::Packet) { - core.addPerPacketInEventHandler(handler, priority); - } - } - - constexpr static void removeEventHandler(ICore& core, SingleNetworkInEventHandler* handler, event_order_t priority = EventPriority_Default) - { - if (PacketType == NetworkPacketType::RPC) { - core.removePerRPCInEventHandler(handler); - } else if (PacketType == NetworkPacketType::Packet) { - core.removePerPacketInEventHandler(handler); - } - } -}; - -std::false_type is_network_packet_impl(...); -template -std::true_type is_network_packet_impl(NetworkPacketBase const volatile&); -/// Get whether a class derives from NetworkPacketBase -/// @typeparam T The class to check -template -using is_network_packet = decltype(is_network_packet_impl(std::declval())); - -struct PacketHelper { - /// Attempt to send a packet derived from NetworkPacketBase to the peer - /// @param packet The packet to send - /// @param peer The peer to send the packet to - template ::value>> - static bool send(const Packet& packet, IPlayer& peer) - { - NetworkBitStream bs; - packet.write(bs); - if constexpr (Packet::PacketType == NetworkPacketType::RPC) { - return peer.sendRPC(Packet::PacketID, Span(bs.GetData(), bs.GetNumberOfBitsUsed()), Packet::PacketChannel); - } else if constexpr (Packet::PacketType == NetworkPacketType::Packet) { - return peer.sendPacket(Span(bs.GetData(), bs.GetNumberOfBitsUsed()), Packet::PacketChannel); - } - } - - /// Attempt to send a packet derived from NetworkPacketBase to the list of peers - /// @param packet The packet to send - /// @param players The list of peers to send the packet to - /// @param skipFrom The player to skip in the list of peers - template ::value>> - static void broadcastToSome(const Packet& packet, const FlatPtrHashSet& players, const IPlayer* skipFrom = nullptr) - { - NetworkBitStream bs; - packet.write(bs); - for (IPlayer* peer : players) { - if (peer != skipFrom) { - if constexpr (Packet::PacketType == NetworkPacketType::RPC) { - peer->sendRPC(Packet::PacketID, Span(bs.GetData(), bs.GetNumberOfBitsUsed()), Packet::PacketChannel); - } else if constexpr (Packet::PacketType == NetworkPacketType::Packet) { - peer->sendPacket(Span(bs.GetData(), bs.GetNumberOfBitsUsed()), Packet::PacketChannel); - } - } - } - } - - /// Attempt to send a packet derived from NetworkPacketBase to the players that a player is streamed for - /// @param packet The packet to send - /// @param player The player whose streamed players to send to - /// @param skipFrom Whether to skip the player when sending the packet - template ::value>> - static void broadcastToStreamed(const Packet& packet, IPlayer& player, bool skipFrom = false) - { - NetworkBitStream bs; - packet.write(bs); - if constexpr (Packet::PacketType == NetworkPacketType::RPC) { - return player.broadcastRPCToStreamed(Packet::PacketID, Span(bs.GetData(), bs.GetNumberOfBitsUsed()), Packet::PacketChannel, skipFrom); - } else if constexpr (Packet::PacketType == NetworkPacketType::Packet) { - return player.broadcastPacketToStreamed(Span(bs.GetData(), bs.GetNumberOfBitsUsed()), Packet::PacketChannel, skipFrom); - } - } - - /// Broadcast a sync packet - template ::value>> - static void broadcastSyncPacket(const Packet& packet, IPlayer& player) - { - static_assert(Packet::PacketType == NetworkPacketType::Packet, "broadcastSyncPacket can only be used with NetworkPacketType::Packet"); - NetworkBitStream bs; - packet.write(bs); - return player.broadcastSyncPacket(Span(bs.GetData(), bs.GetNumberOfBitsUsed()), Packet::PacketChannel); - } - - /// Attempt to send a packet derived from NetworkPacketBase to all players in the player pool - /// @param packet The packet to send - /// @param players The player pool - /// @param skipFrom The player to skip in the list of peers - template ::value, Packet>> - static void broadcast(const Packet& packet, IPlayerPool& players, const IPlayer* skipFrom = nullptr) - { - NetworkBitStream bs; - packet.write(bs); - if constexpr (Packet::PacketType == NetworkPacketType::RPC) { - players.broadcastRPC(Packet::PacketID, Span(bs.GetData(), bs.GetNumberOfBitsUsed()), Packet::PacketChannel, skipFrom); - } - } -};