Skip to content

Commit

Permalink
Fix Player::getLanguageCode()
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrBox committed Dec 2, 2022
1 parent 21ab7f3 commit a5eaf62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions LiteLoader/src/llapi/mc/PlayerAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ string Player::getLanguageCode() {
if (isSimulatedPlayer()) {
return I18n::getCurrentLanguage()->getFullLanguageCode();
}
// std::cout << Global<ServerNetworkHandler> << " " << getNetworkIdentifier() << &Global<ServerNetworkHandler>->fetchConnectionRequest(*getNetworkIdentifier()) << "\n";
auto map = Global<ServerNetworkHandler>->fetchConnectionRequest(*getNetworkIdentifier()).mRawToken.get()->mDataInfo.value_.map_;
for (auto& iter : *map) {
string s(iter.first.c_str());
Expand Down
5 changes: 3 additions & 2 deletions LiteLoader/src/llapi/utils/GlobalService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ TInstanceHook(void, "?allowIncomingConnections@ServerNetworkHandler@@QEAAXAEBV?$
static bool initd = false;
if (!initd) {
initd = true;
auto v3 = (ServerNetworkHandler*)((char*)this + 16);
Global<ServerNetworkHandler> = v3;
// auto v3 = (ServerNetworkHandler*)((char*)this + 16);
// +16 cause fetchConnectionRequest returns nullptr
Global<ServerNetworkHandler> = this;
}
original(this, a1, a2);
}
Expand Down

0 comments on commit a5eaf62

Please sign in to comment.