مرتضی
| means or
That's programming or, and it's actually ||
Danya🔥
What's gonna happen?
Pavel
What's gonna happen?
Won't compile?
Chinthaka
I have a problem with a .DLL file. A small one. Does anyone know? I ask
Chinthaka
What problem do you have with it?
I don't speak English very well. It would be better if you could show a picture and ask. This is blocked Shall I personally send to Sir?
Rose
Another one bites the dust...! Banned Chinthaka. Reason: offtop and pming
...
Well, to be able to help people usually need to understand the problem. E.g. if someone asks something like "I tried to build a house, but I couldn't, can you help me". Building a house (or application) is a complex process, many steps could go wrong, people generally don't like to waste the time on explaining something just to get an answer "Yes, I know that, but my problem is not there". For example I can't read your mind, I can't guess what problem you have, I don't have all the context that you've already built in your mind around this problem, and you provided very little information about it, but I can try to guess. So, from what I understood, you got some source code, but it didn't work as intended (I assume it compiled?), so you want to learn how other programmers would approach such a situation with someone elses code? Usually such projects have some discord servers or other ways for communication between developers who work with them. So as a first step I would recommend to find a community around the library you found, or some generic community of people who develop bots for Minecraft, if such exists. And of course any sources of documentation, Minecraft community is usually good at documenting things, so there's a good chance there are some pieces of documentation/articles/posts about writing bots. And if that doesn't work, you can try to invest time investigating and debugging the code, but this is not something one can describe in a short message.
/* Packets.h This is a list of minecraft packets*/ #ifndef _Packets_H #define _Packets_H #include <winsock2.h> #include <stdio.h> #include <string.h> char *handshake=" ' 45 ; 1 2 7 . 0 . 0 . 1 : 2 5 5 6 5"; char *login=" Name "; #endif
...
Well, to be able to help people usually need to understand the problem. E.g. if someone asks something like "I tried to build a house, but I couldn't, can you help me". Building a house (or application) is a complex process, many steps could go wrong, people generally don't like to waste the time on explaining something just to get an answer "Yes, I know that, but my problem is not there". For example I can't read your mind, I can't guess what problem you have, I don't have all the context that you've already built in your mind around this problem, and you provided very little information about it, but I can try to guess. So, from what I understood, you got some source code, but it didn't work as intended (I assume it compiled?), so you want to learn how other programmers would approach such a situation with someone elses code? Usually such projects have some discord servers or other ways for communication between developers who work with them. So as a first step I would recommend to find a community around the library you found, or some generic community of people who develop bots for Minecraft, if such exists. And of course any sources of documentation, Minecraft community is usually good at documenting things, so there's a good chance there are some pieces of documentation/articles/posts about writing bots. And if that doesn't work, you can try to invest time investigating and debugging the code, but this is not something one can describe in a short message.
in this code, the handshake data is sent to the server first, and then the login's data, but the server disconnects in response, I couldn't find out why
...
i was going to throw the code earlier, but it was long, so I just threw the packages
Pavel
in this code, the handshake data is sent to the server first, and then the login's data, but the server disconnects in response, I couldn't find out why
It can be that this code was written for some older version of the server for example, and they changed some protocols. Also if even a handshake doesn't happen, it may be that there are some issues with the connection (either the ip/port is wrong, or the server is inaccessible from your network). Does the server have API docs that you can check? Can you check what you send during the handshake, and what server returns as a response (if anything)?
Pavel
i didn't use the api on the server, and if I'm not mistaken, the login part is similar or the same for almost all versions
Well, I know too little about minecraft servers, but I would guess there can be some documentation to help to debug it step by step. Also (assuming you're connecting to a Java server) there may be some weird encoding issues between how C++ and Java encode strings (but I guess then the library that you use should have taken care of it)
Pavel
there is a part called packet ID, I don't understand how to send it
Packet ID is just an identifier of the packet type you want to send. My guess is that you need to pack it into bytes (there's a code example on that wiki page with writeVarInt) From what I see in the handshake packet you already need to send the protocol version by the way, make sure that version matches the one on the server.
...
#paste
Rose
#paste
To share code or error tracebacks, use an online pasting service like: - https://hastebin.com - https://pastebin.com - https://dpaste.org - https://wandbox.org - https://godbolt.org
Richard Luo 🐱
I am trying to read a json file as described here. It seems it only accepts public members and requires a default constructor. How do I make boost use a user defined constructor to initialize private field?
Pavel
so it looks like this : ProtocolVersion, serverip, port, 2
Yeah, just note that the result may not look like a readable string, since you pack it as a binary stream basically
El Pepe
Hello guys, i going to learn C++ İn my plan learncpp.com and book like Lipman or PPP İs this a good way?
Pavel
could you please send me a sample code? frankly, this has helped me a lot
I don't have a computer now, but I can send an example of how numbers can be packed into bytes with C++ (not the most readable one though, because of templates) https://github.com/gameraccoon/tank-game/blob/main/src/Base/Types/UnsafeSerialization.h Note that you would need to care for endianness (byte order) yourself since I guess the server can expect different endianness and in this example it uses only one of them
Richard Luo 🐱
will you please sent your code?
https://godbolt.org/z/GG1oK3vbj
Richard Luo 🐱
like this
Richard Luo 🐱
it seems I need to define a default no args constructor to make this work
Chat Boss
it seems I need to define a default no args constructor to make this work
ㅤ... sent a code, it has been re-uploaded as a file
Richard Luo 🐱
... I am sorry but what do you mean? I am trying to let boost to auto convert json to C++ type for me
David
Hi everyone, I've been learning std::thread recently and it's great. But there is a question: does std::thread support synchronous updating of application interface data? Because different interface libraries, multi-threaded update methods are not the same. For example, I use c + + builder, he itself bring the VCL TThread.Synchronize synchronization. So if I can use the c + + 11 c + + 14 c + + 17 thread synchronization, instead of a TThread.Synchronize?
David
c++ builder already supports c++ 17.
Rose
Another one bites the dust...! Banned nibu. Reason: pming
David
I believe TThread does much more than std::thread does, so you can't just replace one with the other, you may need to implement the missing parts yourself. There are multiple approaches to synchronization, depending on how you want to pass the data around.
Yes, you have a point. I also feel that the thread standardization of C++ has not done compatibility processing for UI Main Thread. As a result, I wrote the following c++ builder code:
David
std::thread cppthread_UISyncDemo = std::thread([&](){ TThread::Synchronize(NULL, [&](){ this->Memo1->Lines->Add(L"Hello World use VCL UI TThread::Synchronize") ; }) ; }) ;
David
Use TThread::Synchronize inside std::thread to update the interface synchronously. But this mixed writing method is really strange.
Pavel
Yes, you have a point. I also feel that the thread standardization of C++ has not done compatibility processing for UI Main Thread. As a result, I wrote the following c++ builder code:
Well there's no concept of "UI thread" or even "UI" in C++ as it operates more low level concepts, and things like these are defined and implemented by the application code (if needed)
Danial
is there any embedded system group also in telegram?!
poetry
what is UI thread ?
poetry
GUI?
Yash
hey guys just wanted to ask if i wanna learn about minecraft systems creating add-ons mods so c++ helps w other frameworks or need java core learned too?? creating plugins too for server's api stuff etc ykwim
Yash
what is UI thread ?
UI Thread could be called a primary thread responsible for UI on android applications and its interactions from users
Yash
GUI?
Graphical User Interface (GUI) user interface in graphical form or graphics the buttons interactive arrows bars etc
Ludovic 'Archivist'
what is UI thread ?
Some systems require that rendering and interactions with input systems are handled in a dedicated operating system thread. Some systems just recommend it is done that way to avoid synchronization issues between systems that are not thread-safe
Ludovic 'Archivist'
For example, iirc, OpenGL 3 required that a single thread does all the communication with the GPU
poetry
😚
Ya deway
Hello guys someone know Arduino? I have C++ errors between two library
Ya deway
https://forum.arduino.cc/t/mouse-h-and-mousecontroller-h-dont-compile-together/1245970
Ya deway
looks like some include containing Mouse is missing
There is a name collision between librarys they says
Ighor
There is a name collision between librarys they says
you may put them to different namespaces
Ya deway
you may put them to different namespaces
I really don't know how to do it, it's as if the mouse.h library depends on hid.h and the code is quite complicated. I also program on Arduino so setup() and loop()
Ighor
I really don't know how to do it, it's as if the mouse.h library depends on hid.h and the code is quite complicated. I also program on Arduino so setup() and loop()
// Create a wrapper header file for the library // my_lib_wrapper.h namespace MyLib { #include "my_lib.h" }
purple rose
Hello everyone
klimi
Hello everyone
read the rules
大宝剑
Hello everyone
how can i help you rose
Daniyal Nadeem
Hello everyone 👋
klimi
Hello everyone 👋
read the rules
Daniyal Nadeem
Mehran
Hi everyone
Mehran
Is there anyone from European countries?
Rose
Is there anyone from European countries?
User Mehran has 1/2 warnings; be careful! Reason: offtop
klimi
#meta
Rose
#meta
Don't ask meta questions. In other words, don't ask to ask. Questions like "Does anyone know XYZ?", "Has anyone used XYZ?" or "Can someone help me?" are all considered meta questions because they don't specify what your actual problem is. These questions give the impression that you want people to approach you and offer their help as if they don't have any other work to do. Now doesn't that expectation make you look like an idiot? If you have a question ask it directly. You are more likely to get a response that way.
Mehran
Sorry.ok
Mehran
just about code and programming?
klimi
it's in the rules
Anubhav
Hello sir I am new coder this side plz help me and tells how to start
Rose
Hello sir I am new coder this side plz help me and tells how to start
Please check out this channel - @Resources for information on learning sources for C and C++ (books and videos) and Frequently Asked Questions.
Anubhav
Ok