erikvv / minecraft-query-cpp Goto Github PK
View Code? Open in Web Editor NEWQuery Minecraft servers in C++
Query Minecraft servers in C++
Hi,
cool & useful Code,
but some Compile Warnings on GCC via Linux with parameter -WALL
../MCQuery.cpp: In member function ‘void mcQuery::challengeReceiver(const boost::system::error_code&, size_t)’:
../MCQuery.cpp:96:68: warning: missing braces around initializer for ‘std::array<unsigned char, 5ul>::value_type [5] {aka unsigned char [5]}’ [-Wmissing-braces]
../MCQuery.cpp: In member function ‘void mcQuery::dataReceiver(const boost::system::error_code&, size_t)’:
../MCQuery.cpp:128:68: warning: missing braces around initializer for ‘std::array<unsigned char, 5ul>::value_type [5] {aka unsigned char [5]}’ [-Wmissing-braces]
../MCQuery.cpp: In member function ‘void mcQuerySimple::receiver(const boost::system::error_code&, size_t)’:
../MCQuery.cpp:291:44: warning: missing braces around initializer for ‘std::array<unsigned char, 2ul>::value_type [2] {aka unsigned char [2]}’ [-Wmissing-braces]
../MCQuery.cpp:296:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
There are just some braces missing, so here are the lines & the code which are fixed:
Line 96:
const array<uchar,5> expected = {{ 0x09, 0x01, 0x02, 0x03, 0x04 }};
Line 128:
const array<uchar,5> expected = {{ 0x00, 0x01, 0x02, 0x03, 0x04 }};
Line 291:
array<uchar,2> expected = {{ 0xFF, 0x00 }};
Also on Line 296, the compiler doesn't like the comparison between unsigned and signed. So:
for( unsigned int i=0; i<recvBuffer.size()/2; i++) {
Best regards, Sapd
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.