Skip to content

Commit

Permalink
Push last changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Nov 17, 2023
1 parent e71d182 commit 7d90469
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
import io.grpc.stub.StreamObserver;
import lombok.RequiredArgsConstructor;
import net.pistonmaster.serverwrecker.ServerWreckerBootstrap;
import net.pistonmaster.serverwrecker.ServerWreckerServer;
import net.pistonmaster.serverwrecker.grpc.generated.*;
import net.pistonmaster.serverwrecker.settings.lib.SettingsManager;

import javax.inject.Inject;
import java.util.ArrayList;
import java.util.Collection;

@RequiredArgsConstructor(onConstructor_ = @Inject)
public class ConfigServiceImpl extends ConfigServiceGrpc.ConfigServiceImplBase {
private final SettingsManager settingsManager;
private final ServerWreckerServer serverWreckerServer;

@Override
public void getUIClientData(ClientDataRequest request, StreamObserver<UIClientDataResponse> responseObserver) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT, Re
}
})
.addService(injector.getSingleton(LogServiceImpl.class))
.addService(injector.getSingleton(ConfigServiceImpl.class))
.addService(injector.getSingleton(CommandServiceImpl.class))
.addService(injector.getSingleton(AttackServiceImpl.class))
.intercept(new JwtServerInterceptor(jwtKey))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* ServerWrecker
*
* Copyright (C) 2023 ServerWrecker
*
* 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/gpl-3.0.html>.
*/
package net.pistonmaster.serverwrecker.gui.navigation;

import net.pistonmaster.serverwrecker.grpc.generated.ClientPluginSettingsPage;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* ServerWrecker
*
* Copyright (C) 2023 ServerWrecker
*
* 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/gpl-3.0.html>.
*/
package net.pistonmaster.serverwrecker.settings.lib;

public interface Property {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* ServerWrecker
*
* Copyright (C) 2023 ServerWrecker
*
* 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/gpl-3.0.html>.
*/
package net.pistonmaster.serverwrecker.settings.lib;

import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ public JsonElement serialize(Object src, Type typeOfSrc, JsonSerializationContex
var settingClass = classMap.inverse().get(src.getClass());
Objects.requireNonNull(settingClass, "Setting name for " + src.getClass().getSimpleName() + " is null!");

jsonObject.addProperty("settingType", settingClass);
jsonObject.addProperty("settingsId", settingClass);
return jsonObject;
}

@Override
public Object deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
var jsonObject = json.getAsJsonObject();
var settingType = jsonObject.get("settingType").getAsString();
var settingType = jsonObject.get("settingId").getAsString();
var clazz = classMap.get(settingType);
Objects.requireNonNull(clazz, "Class for " + settingType + " is null!");

Expand Down

0 comments on commit 7d90469

Please sign in to comment.