只剩mce::Color的问题了,BDS内部没有mce

This commit is contained in:
Qiuzhizhe 2022-09-30 14:36:04 +08:00
parent 3a4787b312
commit 6ae301d624
No known key found for this signature in database
GPG Key ID: 4EF4BF5521540263
5 changed files with 15 additions and 15 deletions

View File

@ -25,7 +25,7 @@ namespace RakNet {
struct SystemAddress {
char filler[17 * 8]; // uncertain?
MCAPI void ToString_New(bool, char, char*) const;
MCAPI void ToString_New(bool,char *,char) const;
};
struct RakNetGUID {
uint64_t unk;

View File

@ -4,13 +4,17 @@
#include "../Global.h"
#define BEFORE_EXTRA
#include "MC/ReadOnlyBinaryStream.hpp"
#undef BEFORE_EXTRA
class VarIntDataInput {
#define AFTER_EXTRA
ReadOnlyBinaryStream *mStream;
public:
VarIntDataInput(ReadOnlyBinaryStream *stream){
mStream = stream;
};
#undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_VARINTDATAINPUT
public:
@ -21,8 +25,8 @@ public:
public:
/*0*/ virtual ~VarIntDataInput();
/*1*/ virtual void __unk_vfn_1();
/*2*/ virtual void __unk_vfn_2();
// /*1*/ virtual void __unk_vfn_1();
/*2*/ virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>> readLongString(void);
/*3*/ virtual float readFloat();
/*4*/ virtual double readDouble();
/*5*/ virtual char readByte();

View File

@ -118,7 +118,7 @@ Color ColorFromConsoleCode(std::string const& console) {
auto codeIter = decorationToColorCodeMap.find(decoration);
if (codeIter != decorationToColorCodeMap.end())
return *ColorFromColorCode(codeIter->second);
return mce::Color::NIL;
return Color::NIL;
}
if (decoration == 38 && c == ';') {
unsigned char unk;

View File

@ -3,6 +3,6 @@
string NetworkIdentifier::getIP() {
string rv;
Global<RakNet::RakPeer>->getAdr(*this).ToString_New(true, ':', rv.data());
Global<RakNet::RakPeer>->getAdr(*this).ToString_New(true, rv.data(), ':');
return rv.substr(0, rv.find('|'));
}

View File

@ -1,6 +1,8 @@
#include <MC/ReadOnlyBinaryStream.hpp>
#include <MC/CompoundTag.hpp>
#include <MC/NbtIo.hpp>
#include <MC/IDataInput.hpp>
#include <MC/VarIntDataInput.hpp>
std::string const& ReadOnlyBinaryStream::getData() const {
return *pBuf;
@ -26,20 +28,14 @@ void ReadOnlyBinaryStream::setReadPointer(std::size_t size) {
readPointer = len;
}
struct IDataInput{
void* pVT;
ReadOnlyBinaryStream* pReadOnlyBinaryStream;
};
std::unique_ptr<class CompoundTag> ReadOnlyBinaryStream::getCompoundTag() {
// auto tag = CompoundTag::create();
// class CompoundTag& (*rv)(class CompoundTag&, class ReadOnlyBinaryStream&);
// *((void**)&rv) = dlsym("?read@?$serialize@VCompoundTag@@@@SA?AVCompoundTag@@AEAVReadOnlyBinaryStream@@@Z");
// (*rv)(*tag, *this);
IDataInput pVTVarIntDataInput;
pVTVarIntDataInput.pVT = dlsym("??_7VarIntDataInput@@6B@");
pVTVarIntDataInput.pReadOnlyBinaryStream = this;
return std::move(NbtIo::read(pVTVarIntDataInput));
VarIntDataInput pVTVarIntDataInput= VarIntDataInput(this);
return std::move(NbtIo::read((IDataInput&)pVTVarIntDataInput));
}