-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from HttpMarco/dev
Release of 1.0.8-SNAPSHOT
- Loading branch information
Showing
30 changed files
with
300 additions
and
128 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
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
52 changes: 52 additions & 0 deletions
52
...in/java/dev/httpmarco/polocloud/api/events/service/AbstractCloudServicePropertyEvent.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,52 @@ | ||
/* | ||
* Copyright 2024 Mirco Lindenau | HttpMarco | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package dev.httpmarco.polocloud.api.events.service; | ||
|
||
import dev.httpmarco.osgan.networking.packet.Packet; | ||
import dev.httpmarco.osgan.networking.packet.PacketBuffer; | ||
import dev.httpmarco.polocloud.api.events.property.PropertyEvent; | ||
import dev.httpmarco.polocloud.api.packets.ComponentPacketHelper; | ||
import dev.httpmarco.polocloud.api.properties.Property; | ||
import dev.httpmarco.polocloud.api.services.CloudService; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.experimental.Accessors; | ||
|
||
@Getter | ||
@Accessors(fluent = true) | ||
@AllArgsConstructor | ||
public abstract class AbstractCloudServicePropertyEvent extends Packet implements ServiceEvent, PropertyEvent { | ||
|
||
private CloudService cloudService; | ||
private Property<?> property; | ||
private Object value; | ||
|
||
@Override | ||
public void read(PacketBuffer packetBuffer) { | ||
this.cloudService = ComponentPacketHelper.readService(packetBuffer); | ||
|
||
var propertyData = ComponentPacketHelper.readProperty(packetBuffer); | ||
this.property = propertyData.getKey(); | ||
this.value = propertyData.getValue(); | ||
} | ||
|
||
@Override | ||
public void write(PacketBuffer packetBuffer) { | ||
ComponentPacketHelper.writeService(cloudService, packetBuffer); | ||
ComponentPacketHelper.writeProperty(property, value, packetBuffer); | ||
} | ||
} |
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
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
41 changes: 41 additions & 0 deletions
41
api/src/main/java/dev/httpmarco/polocloud/api/packets/general/OperationDoublePacket.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,41 @@ | ||
/* | ||
* Copyright 2024 Mirco Lindenau | HttpMarco | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package dev.httpmarco.polocloud.api.packets.general; | ||
|
||
import dev.httpmarco.osgan.networking.packet.Packet; | ||
import dev.httpmarco.osgan.networking.packet.PacketBuffer; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.experimental.Accessors; | ||
|
||
@Getter | ||
@Accessors(fluent = true) | ||
@AllArgsConstructor | ||
public final class OperationDoublePacket extends Packet { | ||
|
||
private Double response; | ||
|
||
@Override | ||
public void read(PacketBuffer packetBuffer) { | ||
this.response = packetBuffer.readDouble(); | ||
} | ||
|
||
@Override | ||
public void write(PacketBuffer packetBuffer) { | ||
packetBuffer.writeDouble(this.response); | ||
} | ||
} |
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
Oops, something went wrong.