-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring to asynchronous. #2385
base: brigadier-dev
Are you sure you want to change the base?
Conversation
Plan to move the protocol library to a separate repository. |
@BruceChenQAQ Are you planning on finishing this? PS: |
PS: public async Task<bool> SendBrandInfo(string brandInfo)
{
return await Task.FromResult(false); //Only supported since MC 1.7
}
Maybe private async Task ReadNextTeamData()
{
await ReadNextString(); //Internal Name
byte mode = await ReadNextByte();
if (mode == 0 || mode == 2)
{
await ReadNextString(); //Display Name
await ReadNextString(); //Prefix
await ReadNextString(); //Suffix
await ReadData(1); //Friendly Fire
}
if (mode == 0 || mode == 3 || mode == 4)
{
short count = await ReadNextShort();
for (int i = 0; i < count; i++)
{
await ReadNextString(); //Players
}
}
} |
I may not have much time to finish this recently, but I can post the previously completed part. Note that this contains only part of the framework structure and part of the packet parsing, it is not finished and cannot be compiled yet. My intention is to be compatible with different types of protocols in the library and to allow multiple instances of clients to be created at the same time (no matter what protocol type or version they are) and for them to run without affecting each other. (Of course in MCC only one instance may be running at a time) To do this I need to carefully find for each packet the version in which it has changed (including naming changes) and distinguish it in the protocol library. Here's a couple of pieces of code that are close to completion, so maybe you can get a general idea of what I'm thinking:
|
That is quite a lot of work you've done, I like it, it is very similar to what I've proposed in one of the issues, using events and custom classes for parsing packets. |
Maybe if you can, push the code to your repo, I'll add packets that we already have implemented. |
@BruceChenQAQ Any updates on this? |
(Unfinished)