Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Code/client/Games/Misc/SubtitleManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void TP_MAKE_THISCALL(HookShowSubtitle, SubtitleManager, TESObjectREFR* apSpeake
//spdlog::debug("Subtitle for actor {:X} (bool {}):\n\t{}", apSpeaker ? apSpeaker->formID : 0, aIsInDialogue, apSubtitleText);

Actor* pActor = Cast<Actor>(apSpeaker);
if (pActor && pActor->GetExtension()->IsLocal() && !pActor->GetExtension()->IsPlayer())
if (apSubtitleText && pActor && pActor->GetExtension()->IsLocal() && !pActor->GetExtension()->IsPlayer())
#if TP_SKYRIM64
World::Get().GetRunner().Trigger(SubtitleEvent(apSpeaker->formID, apSubtitleText));
#elif TP_FALLOUT4
Expand Down
6 changes: 3 additions & 3 deletions Code/client/Games/Skyrim/BSAnimationGraphManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct BSAnimationGraphManager
volatile LONG refCount;
void* pad_ptrs[6];
BSTSmallArray<BShkbAnimationGraph> animationGraphs; // 40 - 20
void* pad_ptrs2[8];
void* pad_ptrs2[9];
BSRecursiveLock lock; // 98 - 4C
void* unkPtrAfterLock; // A0 - 58

Expand All @@ -38,8 +38,8 @@ struct BSAnimationGraphManager

#if TP_PLATFORM_64
static_assert(offsetof(BSAnimationGraphManager, animationGraphs) == 0x40);
static_assert(offsetof(BSAnimationGraphManager, lock) == 0x98);
static_assert(offsetof(BSAnimationGraphManager, animationGraphIndex) == 0xA8);
static_assert(offsetof(BSAnimationGraphManager, lock) == 0xA0);
static_assert(offsetof(BSAnimationGraphManager, animationGraphIndex) == 0xB0);
#else
static_assert(offsetof(BSAnimationGraphManager, animationGraphs) == 0x20);
static_assert(offsetof(BSAnimationGraphManager, lock) == 0x4C);
Expand Down
52 changes: 30 additions & 22 deletions Code/client/Games/Skyrim/Forms/TESObjectCELL.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ struct TESObjectCELL : TESForm
Vector<TESObjectREFR*> GetRefsByFormTypes(const Vector<FormType>& aFormTypes) const noexcept;
void GetCOCPlacementInfo(NiPoint3* aOutPos, NiPoint3* aOutRot, bool aAllowCellLoad) noexcept;

uint8_t pad20[0x40 - 0x20];
uint8_t cellFlags[5];
uint8_t pad45[0x88 - 0x45];
bool IsValid() const
{
return cellFlags[4] == 7;
}

struct ReferenceData
{
Expand All @@ -29,7 +30,8 @@ struct TESObjectCELL : TESForm
}
};

uint32_t unk0;
uint64_t unk0;
uint32_t unk8;
uint32_t capacity;
uint32_t available;
uint32_t unkC;
Expand All @@ -41,35 +43,41 @@ struct TESObjectCELL : TESForm
{
return capacity - available;
}


};


ReferenceData refData;
uint8_t unkB0[0x118 - 0xB0];
BSRecursiveLock lock;

TESWorldSpace* worldspace;
static_assert(sizeof(ReferenceData) == 0x30);

struct LoadedCellData
{
uint8_t pad0[0x160];
BGSEncounterZone* encounterZone;
};

static_assert(offsetof(LoadedCellData, encounterZone) == 0x160);

uint8_t pad20[0x40 - 0x20];
uint8_t cellFlags[5];
bool autoWaterLoaded;
bool cellDetached;
uint8_t pad47;
ExtraDataList extraData;
uint64_t cellData;
void* pCellLand;
float waterHeight;
void* pNavMeshes;
ReferenceData refData;
void* pUnkB8;
GameArray<TESObjectREFR*> objectList;
GameArray<void*> unkD8;
GameArray<void*> unkF0;
GameArray<void*> unk108;
BSRecursiveLock lock;
TESWorldSpace* worldspace;
LoadedCellData* loadedCellData;


bool IsValid() const
{
return cellFlags[4] == 7;
}
void* pLightingTemplate;
uint64_t unk140;
};

static_assert(offsetof(TESObjectCELL, cellFlags) == 0x40);
static_assert(offsetof(TESObjectCELL, refData) == 0x88);
static_assert(offsetof(TESObjectCELL, worldspace) == 0x120);
static_assert(offsetof(TESObjectCELL, loadedCellData) == 0x128);
static_assert(offsetof(TESObjectCELL, worldspace) == 0x128);
static_assert(offsetof(TESObjectCELL, loadedCellData) == 0x130);
static_assert(sizeof(TESObjectCELL) == 0x148);
3 changes: 3 additions & 0 deletions Code/client/Games/Skyrim/Magic/MagicTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <Structs/Skyrim/AnimationGraphDescriptor_VampireLordBehavior.h>

#include <Events/AddTargetEvent.h>
#include <Events/HitEvent.h>

#include <Games/Overrides.h>

Expand Down Expand Up @@ -116,6 +117,8 @@ bool TP_MAKE_THISCALL(HookAddTarget, MagicTarget, MagicTarget::AddTargetData& ar
}
else if (pCasterExtension->IsRemotePlayer())
{
// Send out a HitEvent because TakeDamage is never triggered.
World::Get().GetRunner().Trigger(HitEvent(arData.pCaster->formID, pTargetActor->formID));
return false;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Code/skyrim_ui/src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"CONNECT": {
"INFO": {
"SERVER_ADDRESS": "Verbinden dich mit einem Server über dessen vollständige Adresse. Verwende das Format <strong>addresse:port</strong>. Standardwert für den Port ist <strong>10578</strong>.",
"HELGEN": "Stelle KEINE Verbindung zu einem Server her, wenn du dich noch in der Helgen-Intro-Sequenz befinden. Vergewissere dich, dass du bereits aus Helgen entkommen bist."
"HELGEN": "Stelle KEINE Verbindung zu einem Server her, wenn du dich noch in der Helgen-Intro-Sequenz befindest. Vergewissere dich, dass du bereits aus Helgen entkommen bist."
},
"ADDRESS": "Adresse",
"PASSWORD": "Passwort",
Expand Down Expand Up @@ -127,7 +127,7 @@
},
"GROUP": {
"LEVEL_UP": "{{name}} hat Level {{level}} erreicht.",
"ALREADY_IN_GROUP": "Du bist bereits in einer Gruppe. Um einer anderen Gruppe beizutreten, musst du deine zuerst aktuelle Gruppe verlassen.",
"ALREADY_IN_GROUP": "Du bist bereits in einer Gruppe. Um einer anderen Gruppe beizutreten, musst du zuerst deine aktuelle Gruppe verlassen.",
"KICK_NO_PARTY_LEADER": "Wenn du nicht der Gruppenleiter bist, kannst du keine anderen Gruppenmitglieder rauswerfen.",
"MAKE_LEADER_NO_PARTY_LEADER": "Wenn du nicht der Gruppenleiter bist, kannst du niemand anderen zum Gruppenleiter machen."
},
Expand Down
66 changes: 25 additions & 41 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,44 @@
ARG arch=x86_64
FROM tiltedphoques/multiarch-builder:latest as builder

FROM tiltedphoques/builder:${arch} AS builder
ARG REPO=https://github.com/tiltedphoques/TiltedEvolution.git
ARG BRANCH=master

ARG arch
WORKDIR /home/builder

WORKDIR /home/server
ENV XMAKE_ROOT=y

RUN git clone --recursive -b ${BRANCH} ${REPO} ./str && \
cd str && xmake config -m release -y && xmake -y && xmake install -o package -y

RUN apt update && \
apt install cmake -y

RUN apt install -y sudo
# Building for x86_64
FROM builder as amd64builder

# switch to ruki user
RUN groupadd -r ruki && useradd -r -g ruki ruki
RUN mkdir /home/ruki
RUN chown -R ruki:ruki /home
RUN echo "root:0000" | chpasswd
RUN echo "ruki:0000" | chpasswd
RUN echo "ruki ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER ruki
RUN cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30 /home/builder/libstdc++.so.6 2>/dev/null || :

# install xmake
RUN cd /tmp/ && git clone --depth=1 "https://github.com/xmake-io/xmake.git" --recursive xmake && cd xmake && ./scripts/get.sh __local__
RUN rm -rf /tmp/xmake

COPY ./modules ./modules
COPY ./Libraries ./Libraries
COPY xmake.lua xmake.lua
COPY ./.git ./.git
COPY ./Code ./Code
# Building for arm64/v8
FROM builder as arm64builder

RUN ~/.local/bin/xmake f -y -vD
RUN ~/.local/bin/xmake -j`nproc` -vD
RUN cp /usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.30 /home/builder/libstdc++.so.6 2>/dev/null || :

RUN objcopy --only-keep-debug /home/server/build/linux/${arch}/release/SkyrimTogetherServer /home/server/build/linux/${arch}/release/SkyrimTogetherServer.debug
RUN objcopy --only-keep-debug /home/server/build/linux/${arch}/release/libSTServer.so /home/server/build/linux/${arch}/release/libSTServer.debug

RUN ~/.local/bin/xmake install -o package
# Intermediate image that has the library specific to our $TARGETARCH
FROM ${TARGETARCH}builder as intermediate
# If a user has built without buildx, attempt to save them
RUN if [ "${TARGETARCH}" = "" ]; then export LIBFILE="/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30"; if [ ! -e ${LIBFILE} ]; then export LIBFILE=/usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.30; fi ; cp ${LIBFILE} /home/builder/libstdc++.so.6; fi

FROM ubuntu:20.04 AS skyrim

ARG arch
# Build actual server image
FROM ubuntu:22.04

RUN apt update && apt install libssl1.1
COPY --from=intermediate /home/builder/str/package/lib/libSTServer.so /home/server/libSTServer.so
COPY --from=intermediate /home/builder/str/package/bin/crashpad_handler /home/server/crashpad_handler
COPY --from=intermediate /home/builder/str/package/bin/SkyrimTogetherServer /home/server/SkyrimTogetherServer

# We copy it twice since we can't really tell the arch from Dockerfile :(
COPY --from=builder /usr/local/lib64/libstdc++.so.6.0.30 /lib/x86_64-linux-gnu/libstdc++.so.6
COPY --from=builder /usr/local/lib64/libstdc++.so.6.0.30 /lib/aarch64-linux-gnu/libstdc++.so.6
COPY --from=intermediate /home/builder/libstdc++.so.6 /home/server/libstdc++.so.6

# Now copy the actual bins
COPY --from=builder /home/server/package/lib/libSTServer.so /home/server/libSTServer.so
COPY --from=builder /home/server/package/bin/SkyrimTogetherServer /home/server/SkyrimTogetherServer
COPY --from=builder /home/server/package/bin/crashpad_handler /home/server/crashpad_handler
COPY --from=builder /home/server/build/linux/${arch}/release/libSTServer.debug /home/server/libSTServer.debug
COPY --from=builder /home/server/build/linux/${arch}/release/SkyrimTogetherServer.debug /home/server/SkyrimTogetherServer.debug
WORKDIR /home/server
ENTRYPOINT ["./SkyrimTogetherServer"]

EXPOSE 10578/udp
EXPOSE 10578/udp
37 changes: 19 additions & 18 deletions Dockerfile.builder
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
FROM ubuntu:20.04 AS builder
FROM ubuntu:22.04

RUN apt update && \
apt install software-properties-common -y && \
add-apt-repository universe -y && \
apt update && \
apt install libssl-dev curl p7zip-full p7zip-rar zip unzip zlib1g-dev wget -y && \
curl -fsSL https://xmake.io/shget.text > getxmake.sh && chmod +x getxmake.sh && ./getxmake.sh && \
wget ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-12.1.0/gcc-12.1.0.tar.xz && \
tar xf gcc-12.1.0.tar.xz && \
rm -f gcc-12.1.0.tar.xz && \
cd gcc-12.1.0 && \
contrib/download_prerequisites && \
mkdir -p obj && \
cd obj && \
../configure --enable-languages=c,c++ --disable-multilib && \
make -j 4 && \
WORKDIR /home/builder

RUN apt update && apt install \
cmake \
unzip \
git \
gcc-12 \
g++-12 \
build-essential \
ca-certificates \
curl \
--no-install-recommends -y && \
git clone --recursive https://github.com/xmake-io/xmake.git ./xmake && \
cd xmake && \
make build && \
make install && \
cd ../.. && \
rm -rf gcc-12.1.0
cd .. && rm -rf xmake/ && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 110 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12 && \
rm -rf /var/lib/apt/lists/*
22 changes: 13 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
version: '3'
version: "3"

services:
skyrim_server:
build:
context: .
skyrim-together:
image: tiltedphoques/st-reborn-server:latest
container_name: skyrim-together
volumes:
- ./build/config:/home/server/config
- ./build/logs:/home/server/logs
- ./build/Data:/home/server/Data
- /home/user/skyrim-together:/home/server/config
- /home/user/skyrim-together/Data:/home/server/Data
- /home/user/skyrim-together/logs:/home/server/logs
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
ports:
- 10578:10578/udp

- 10578:10578/udp
restart: unless-stopped
stdin_open: true
tty: true
14 changes: 14 additions & 0 deletions docker-multiarch-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#set up buildx builder
docker buildx create --name str-multiarch --use

#clean up qemu for some reason
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

#build the builder for both x86_64 and arm64 platforms
docker buildx build --platform linux/amd64,linux/arm64 -f Dockerfile.builder -t tiltedphoques/multiarch-builder:latest --push .

#build the server for both x86_64 and arm64 platforms
docker buildx build --platform linux/amd64,linux/arm64 -f Dockerfile -t tiltedphoques/st-reborn-server:latest --push .

#remove buildx builder
docker buildx rm str-multiarch