mirror of
https://github.com/Leahnaya/UBFunkeysServer.git
synced 2026-04-17 06:05:59 -05:00
Fix Save/Loading Profiles
This commit is contained in:
parent
45de7b5baa
commit
777fcd8ffb
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -35,3 +35,6 @@ build/
|
|||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Funkey Profiles ###
|
||||
profiles/**/*
|
||||
|
|
@ -64,6 +64,7 @@ public class ArkOneSender {
|
|||
public void SendToUser(UUID clientId, String message) {
|
||||
for (Connection conn : server.getConnections()) {
|
||||
if (conn.getClientIdentifier() == clientId) {
|
||||
System.out.println("Found");
|
||||
try {
|
||||
// Append a 0x00 to the end of the response
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public class GalaxyPlugin {
|
|||
String saveID = rootSave.getAttribute("sid");
|
||||
subElement.setAttribute("v", saveID);
|
||||
}
|
||||
resp.appendChild(subElement);
|
||||
rootElement.appendChild(subElement);
|
||||
|
||||
// Build response
|
||||
return ArkOneParser.RemoveXMLTag(resp);
|
||||
|
|
@ -82,7 +82,6 @@ public class GalaxyPlugin {
|
|||
|
||||
public String SaveProfile(Element element, Connection connection) {
|
||||
// Set the number of chunks left to save
|
||||
//TODO: VERIFY THIS ATTRIBUTE NAME
|
||||
connection.setChunksLeft(Integer.valueOf(element.getAttribute("c")));
|
||||
|
||||
// Clear save data
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ public class FileServiceImpl implements FileService {
|
|||
|
||||
@Override
|
||||
public void save(MultipartFile file, String subDir) {
|
||||
System.out.println("here");
|
||||
try {
|
||||
Files.createDirectories(fileStorageLocation.resolve(subDir));
|
||||
Files.copy(file.getInputStream(), fileStorageLocation.resolve(subDir).resolve(file.getOriginalFilename()), StandardCopyOption.REPLACE_EXISTING);
|
||||
} catch(Exception e) {
|
||||
throw new RuntimeException("Could not store the file. Error: " + e.getMessage());
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user