-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
90 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...src/main/java/au/com/grieve/geyser/reversion/editions/bedrock/GeyserReversionSession.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* EduSupport - Minecraft Protocol Support for MultiVersion in Geyser | ||
* Copyright (C) 2020 GeyserReversion Developers | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package au.com.grieve.geyser.reversion.editions.bedrock; | ||
|
||
import au.com.grieve.reversion.editions.bedrock.BedrockReversionServer; | ||
import au.com.grieve.reversion.editions.bedrock.BedrockReversionSession; | ||
import com.nukkitx.network.raknet.RakNetSession; | ||
import com.nukkitx.protocol.bedrock.BedrockPacket; | ||
import com.nukkitx.protocol.bedrock.wrapper.BedrockWrapperSerializer; | ||
import io.netty.buffer.ByteBuf; | ||
import io.netty.buffer.ByteBufAllocator; | ||
import io.netty.channel.EventLoop; | ||
import org.geysermc.connector.network.BedrockProtocol; | ||
|
||
public class GeyserReversionSession extends BedrockReversionSession { | ||
public GeyserReversionSession(BedrockReversionServer server, RakNetSession connection, EventLoop eventLoop, BedrockWrapperSerializer serializer) { | ||
super(server, connection, eventLoop, serializer); | ||
} | ||
|
||
@Override | ||
public boolean toServer(BedrockPacket packet) { | ||
// Isolate Reversion protocol from Geyser Protocol in case there are overlapping differences | ||
ByteBuf buffer = ByteBufAllocator.DEFAULT.ioBuffer(); | ||
|
||
getPacketCodec().tryEncode(buffer, packet); | ||
BedrockPacket convertedPacket = BedrockProtocol.DEFAULT_BEDROCK_CODEC.tryDecode(buffer, packet.getPacketId()); | ||
|
||
return super.toServer(convertedPacket); | ||
} | ||
|
||
@Override | ||
public void sendPacket(BedrockPacket packet) { | ||
// Isolate Reversion protocol from Geyser Protocol in case there are overlapping differences | ||
ByteBuf buffer = ByteBufAllocator.DEFAULT.ioBuffer(); | ||
|
||
BedrockProtocol.DEFAULT_BEDROCK_CODEC.tryEncode(buffer, packet); | ||
BedrockPacket convertedPacket = getPacketCodec().tryDecode(buffer, packet.getPacketId()); | ||
|
||
super.sendPacket(convertedPacket); | ||
} | ||
|
||
|
||
} |
52 changes: 0 additions & 52 deletions
52
...ain/java/au/com/grieve/geyser/reversion/translators/geyser/v408/Register_Geyser_v408.java
This file was deleted.
Oops, something went wrong.
83 changes: 0 additions & 83 deletions
83
...rieve/geyser/reversion/translators/geyser/v408/handlers/StartGameHandler_Geyser_v408.java
This file was deleted.
Oops, something went wrong.