Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libraries/networking-common/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setUpLibrary(project)
2 changes: 2 additions & 0 deletions libraries/networking-common/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version = 0.1.0
archives_base_name = networking-common
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
setUpModule(project,
'entrypoints-mc13w16a-04192037-mc1.14.4',
'lifecycle-events-mc19w04a-mc1.14.4'
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
environment = *
min_mc_version = 1.13-pre4
max_mc_version = 1.14.4
mc_version_range = >=1.13-rc.4 <=1.14.4

minecraft_version = 1.14.4
feather_build = 1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import net.ornithemc.osl.core.api.util.function.IOConsumer;

public final class PacketByteBufs {
public final class PacketBuffers {

public static PacketByteBuf make() {
return make(Unpooled.buffer());
Expand All @@ -19,8 +19,8 @@ public static PacketByteBuf make(byte[] bytes) {
return make(Unpooled.wrappedBuffer(bytes));
}

public static PacketByteBuf make(ByteBuf buf) {
return new PacketByteBuf(buf);
public static PacketByteBuf make(ByteBuf buffer) {
return new PacketByteBuf(buffer);
}

public static PacketByteBuf make(IOConsumer<PacketByteBuf> writer) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
setUpModule(project,
'entrypoints-mc13w16a-04192037-mc1.14.4',
'lifecycle-events-mc13w36a-09051446-mc1.13'
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
environment = *
min_mc_version = 13w41a
max_mc_version = 1.13-pre2
mc_version_range = >=1.7-alpha.13.41.a <=1.13-rc.2

minecraft_version = 1.13-pre2
feather_build = 1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import net.ornithemc.osl.core.api.util.function.IOConsumer;

public final class PacketByteBufs {
public final class PacketBuffers {

public static PacketByteBuf make() {
return make(Unpooled.buffer());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
setUpModule(project,
'entrypoints-mcin-20091223-1459-mc1.5.2',
'lifecycle-events-mcb1.4-1507-mcb1.7.3'
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
environment = client
min_mc_version = a1.0.16
max_mc_version = a1.2.6
mc_version_range = >=1.0.0-alpha.0.16 <=1.0.0-alpha.2.6

minecraft_version = a1.2.6
feather_build = 1
raven_build = 2
sparrow_build = 2
nests_build = 6
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
setUpModule(project,
'entrypoints-mcin-20091223-1459-mc1.5.2',
'lifecycle-events-mc12w21a-mc1.6.4'
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
environment = *
min_mc_version = b1.0
max_mc_version = 13w39b
mc_version_range = >=1.0.0-beta.0 <=1.7-alpha.13.39.b

minecraft_version = 1.5.2
feather_build = 1
nests_build = 5
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
setUpModule(project,
'entrypoints-mcin-20091223-1459-mc1.5.2',
'lifecycle-events-mcserver-a0.2.0-mcserver-a0.2.8'
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
environment = server
min_mc_version = server-a0.1.0
max_mc_version = server-a0.2.8
mc_version_range = >=1.0.0-alpha.1.0 <=1.0.0-alpha.2.8

minecraft_version = server-a0.2.8
feather_build = 1
raven_build = 1
sparrow_build = 1
nests_build = 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"required": true,
"minVersion": "0.8",
"package": "net.ornithemc.osl.networking.impl.mixin",
"compatibilityLevel": "JAVA_8",
"mixins": [
"common.PacketAccessor"
],
"client": [
],
"server": [
"server.ServerLoginNetworkHandlerMixin",
"server.ServerPlayNetworkHandlerMixin"
],
"injectors": {
"defaultRequire": 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package net.ornithemc.osl.networking.impl;

public class Constants {

/**
* The packet id for custom payloads, matches that
* of Vanilla custom payloads in 11w49a and above.
*/
public static final int CUSTOM_PAYLOAD_PACKET_ID = 250;
/**
* The string used to modify the Vanilla handshake.
* It needs to be an invalid Minecraft username.
*/
public static final String OSL_HANDSHAKE_KEY = "\0OrnitheMC";

public static final int DEFAULT_MAX_STRING_LENGTH = 32767;

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions libraries/networking-common/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"schemaVersion": 1,
"id": "osl-networking-common",
"version": "${version}",
"name": "Networking Common",
"description": "Common elements of the OSL Networking API.",
"authors": [
"OrnitheMC",
"Space Walker"
],
"contact": {
"homepage": "https://ornithemc.net/",
"issues": "https://github.com/OrnitheMC/ornithe-standard-libraries/issues",
"sources": "https://github.com/OrnitheMC/ornithe-standard-libraries"
},
"license": "Apache-2.0",
"icon": "assets/ornithe-standard-libraries/networking-common/icon.png",
"environment": "${environment}",
"entrypoints": {
},
"mixins": [
],
"depends": {
"fabricloader": ">=0.16.0",
"minecraft": "${mc_version_range}",
"osl-core": ">=0.4.0",
"osl-entrypoints": ">=0.2.0",
"osl-lifecycle-events": ">=0.4.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
setUpModule(project,
'entrypoints-mc13w16a-04192037-mc1.14.4',
'lifecycle-events-mc18w30a-mc18w50a'
'lifecycle-events-mc18w30a-mc18w50a',
'networking-common-mc1.13-pre4-mc1.14.4'
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import net.ornithemc.osl.core.api.util.function.IOConsumer;
import net.ornithemc.osl.networking.api.CustomPayload;
import net.ornithemc.osl.networking.api.PacketByteBufs;
import net.ornithemc.osl.networking.api.PacketBuffers;
import net.ornithemc.osl.networking.api.client.ClientPlayNetworking.ByteBufListener;
import net.ornithemc.osl.networking.api.client.ClientPlayNetworking.PayloadListener;
import net.ornithemc.osl.networking.impl.NetworkListener;
Expand Down Expand Up @@ -158,7 +158,7 @@ private static Packet<?> makePacket(Identifier channel, CustomPayload payload) {

private static Packet<?> makePacket(Identifier channel, IOConsumer<PacketByteBuf> writer) {
try {
return new CustomPayloadC2SPacket(channel, PacketByteBufs.make(writer));
return new CustomPayloadC2SPacket(channel, PacketBuffers.make(writer));
} catch (IOException e) {
LOGGER.warn("error writing custom payload to channel \'" + channel + "\'", e);
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import net.ornithemc.osl.core.api.util.function.IOConsumer;
import net.ornithemc.osl.networking.api.CustomPayload;
import net.ornithemc.osl.networking.api.PacketByteBufs;
import net.ornithemc.osl.networking.api.PacketBuffers;
import net.ornithemc.osl.networking.api.server.ServerPlayNetworking.ByteBufListener;
import net.ornithemc.osl.networking.api.server.ServerPlayNetworking.PayloadListener;
import net.ornithemc.osl.networking.impl.NetworkListener;
Expand Down Expand Up @@ -253,7 +253,7 @@ private static Packet<?> makePacket(Identifier channel, CustomPayload payload) {

private static Packet<?> makePacket(Identifier channel, IOConsumer<PacketByteBuf> writer) {
try {
return new CustomPayloadS2CPacket(channel, PacketByteBufs.make(writer));
return new CustomPayloadS2CPacket(channel, PacketBuffers.make(writer));
} catch (IOException e) {
LOGGER.warn("error writing custom payload to channel \'" + channel + "\'", e);
return null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
setUpModule(project,
'entrypoints-mcin-20091223-1459-mc1.5.2',
'lifecycle-events-mc12w01a-mc12w17a'
'lifecycle-events-mc12w01a-mc12w17a',
'networking-common-mcb1.0-mc13w39b'
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
setUpModule(project,
'entrypoints-mcin-20091223-1459-mc1.5.2',
'lifecycle-events-mc12w01a-mc12w17a'
'lifecycle-events-mc12w01a-mc12w17a',
'networking-common-mcb1.0-mc13w39b'
)

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
setUpModule(project,
'entrypoints-mcin-20091223-1459-mc1.5.2',
'lifecycle-events-mc12w18a-mc12w19a'
'lifecycle-events-mc12w18a-mc12w19a',
'networking-common-mcb1.0-mc13w39b'
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
setUpModule(project,
'entrypoints-mcin-20091223-1459-mc1.5.2',
'lifecycle-events-mc12w21a-mc1.6.4'
'lifecycle-events-mc12w21a-mc1.6.4',
'networking-common-mcb1.0-mc13w39b'
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ min_mc_version = 12w21a
max_mc_version = 13w39b
mc_version_range = >=1.3.1-alpha.12.21.a <=1.7-alpha.13.39.b

minecraft_version = 13w39b
minecraft_version = 1.5.2
feather_build = 1
nests_build = 2
nests_build = 5
Loading
Loading