-
Notifications
You must be signed in to change notification settings - Fork 3
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 #101 from Foxikle/fix/redis-reliablility
Fix redis reliablility
- Loading branch information
Showing
13 changed files
with
190 additions
and
86 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
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
28 changes: 28 additions & 0 deletions
28
src/main/java/net/cytonic/cytosis/data/obj/CytonicServer.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,28 @@ | ||
package net.cytonic.cytosis.data.obj; | ||
|
||
/** | ||
* A class that holds data about a Cytosis server | ||
*/ | ||
@SuppressWarnings("unused") | ||
public record CytonicServer(String ip, String id, int port) { | ||
|
||
/** | ||
* Converts a serialized string into a CytonicServer | ||
* | ||
* @param serialized The serialized string | ||
* @return the server object | ||
*/ | ||
public static CytonicServer deserialize(String serialized) { | ||
String[] parts = serialized.split("\\|"); | ||
return new CytonicServer(parts[0], parts[1], Integer.parseInt(parts[2])); | ||
} | ||
|
||
/** | ||
* Serializes the server into a string | ||
* | ||
* @return the serialized string | ||
*/ | ||
public String serialize() { | ||
return String.format("%s|%s|%d", ip, id, port); | ||
} | ||
} |
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
Oops, something went wrong.