Old client (2012) work
This commit is contained in:
parent
334e098dba
commit
31a02be28a
@ -2,7 +2,12 @@ package com.alterdekim.game.controller;
|
||||
|
||||
import com.alterdekim.game.config.ServerConfig;
|
||||
import com.alterdekim.game.controller.result.async.*;
|
||||
import com.alterdekim.game.controller.result.async.old.ResourcesResult;
|
||||
import com.alterdekim.game.controller.result.async.old.ServerActionCDataOld;
|
||||
import com.alterdekim.game.controller.result.async.old.ServerActionMRTS;
|
||||
import com.alterdekim.game.controller.result.async.old.ServerActionResultOld;
|
||||
import com.alterdekim.game.entity.User;
|
||||
import com.alterdekim.game.repository.MagicAbilityRepository;
|
||||
import com.alterdekim.game.security.AuthenticationUtil;
|
||||
import com.alterdekim.game.service.*;
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
@ -53,9 +58,24 @@ public class AsyncController {
|
||||
@Autowired
|
||||
private ServerConfig serverConfig;
|
||||
|
||||
@Autowired
|
||||
private MRService mrService;
|
||||
|
||||
@Autowired
|
||||
private TRService trService;
|
||||
|
||||
@Autowired
|
||||
private ROService roService;
|
||||
|
||||
@Autowired
|
||||
private OnlineStatusService onlineStatusService;
|
||||
|
||||
@Autowired
|
||||
private MAService maService;
|
||||
|
||||
@Autowired
|
||||
private MRTService mrtService;
|
||||
|
||||
@PostMapping("/async/Ping")
|
||||
@ResponseBody
|
||||
public ResponseEntity<String> ping() {
|
||||
@ -68,66 +88,146 @@ public class AsyncController {
|
||||
@ResponseBody
|
||||
public ResponseEntity<String> serverAction() {
|
||||
try {
|
||||
User user = AuthenticationUtil.authProfile(userService).get();
|
||||
|
||||
XmlMapper xmlMapper = new XmlMapper();
|
||||
xmlMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE);
|
||||
xmlMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
|
||||
ServerActionResult serverActionResult = new ServerActionResult();
|
||||
serverActionResult.setSnStatus(new SnStatus(false));
|
||||
serverActionResult.setUsername(new UserName(user.getUsername()));
|
||||
serverActionResult.setFlags(new Flags(true, 13));
|
||||
serverActionResult.setRequests(new Grants(0));
|
||||
serverActionResult.setGrants(new Grants(0));
|
||||
List<ConfigItem> items = new ArrayList<>();
|
||||
items.add(new ConfigItem(1, ServerActionConfigType.IsPreloaderEnabled, "1", "bool")); // play with it
|
||||
items.add(new ConfigItem(2, ServerActionConfigType.SynchronizeAvatarRotation, "1", "bool"));
|
||||
items.add(new ConfigItem(3, ServerActionConfigType.InitialVolumeValue, "30", "number"));
|
||||
items.add(new ConfigItem(4, ServerActionConfigType.IsStartupHomeLocation, "0", "bool"));
|
||||
items.add(new ConfigItem(5, ServerActionConfigType.AccessRoleFlags, "0", "number"));
|
||||
items.add(new ConfigItem(6, ServerActionConfigType.IsInternational, "0", "bool")); // play with it
|
||||
items.add(new ConfigItem(7, ServerActionConfigType.TypeWeapon, "1", "number"));
|
||||
items.add(new ConfigItem(8, ServerActionConfigType.StatisticsSendInterval, "300", "number"));
|
||||
items.add(new ConfigItem(9, ServerActionConfigType.SwfVersion, "", "string"));
|
||||
items.add(new ConfigItem(10, ServerActionConfigType.LanguageId, "1", "number")); // play with it
|
||||
items.add(new ConfigItem(11, ServerActionConfigType.SnId, "1", "number"));
|
||||
items.add(new ConfigItem(12, ServerActionConfigType.AutoServerSelectionAllowed, "0", "bool"));
|
||||
List<ServerItem> s_items = new ArrayList<>();
|
||||
s_items.add(new ServerItem(1, 202, 5, "rtmp://"+serverConfig.getPublicDomain()+":"+serverConfig.getGameServerPort()+"/shararam", 0, 1, 5, 5.1));
|
||||
|
||||
serverActionResult.setPhone(new PhoneMessages(phoneMessageService.getAllByReceiverId(user.getId())));
|
||||
serverActionResult.setMiniquest(miniquestService.getAllMiniquests());
|
||||
serverActionResult.setPostcard(new PostcardMessages(postcardService.getAllPostcardsOfUser(user.getId())));
|
||||
serverActionResult.setPreloader(preloaderService.getSelected());
|
||||
serverActionResult.setPromotion(promotionService.getSelected());
|
||||
serverActionResult.setPromotionBanners(promotionBannerService.getSelected());
|
||||
|
||||
|
||||
List<Tutorial> tutorials = new ArrayList<>();
|
||||
tutorials.add(new Tutorial(-1, 1));
|
||||
tutorials.add(new Tutorial(1, 1));
|
||||
tutorials.add(new Tutorial(2, 1));
|
||||
tutorials.add(new Tutorial(3, 1));
|
||||
tutorials.add(new Tutorial(4, 1));
|
||||
tutorials.add(new Tutorial(5, 1));
|
||||
serverActionResult.setTutorial(tutorials);
|
||||
|
||||
List<ServerActionCData> cdatas = new ArrayList<>();
|
||||
cdatas.add(new ServerActionConfig(items));
|
||||
cdatas.add(new ServerActionSystem(1, "cache/resources.swf")); // swf/cache/rus/resources[19].swf
|
||||
if( !user.getIsBanned() ) {
|
||||
cdatas.add(new ServerActionUser(user.getId(), AuthenticationUtil.getToken(user), AuthenticationUtil.getToken(user), 2, null, null));
|
||||
cdatas.add(new ServerActionServers(s_items));
|
||||
} else {
|
||||
cdatas.add(new ServerActionUser(user.getId(), null, null, 0, LocalDateTime.now(), 162L));
|
||||
if( !serverConfig.getOldMode() ) {
|
||||
return newMode();
|
||||
}
|
||||
serverActionResult.setCdata(cdatas);
|
||||
return ResponseEntity.ok()
|
||||
.contentType(MediaType.APPLICATION_XML)
|
||||
.body(xmlMapper.writeValueAsString(serverActionResult));
|
||||
return oldMode();
|
||||
} catch (JsonProcessingException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
|
||||
private ResponseEntity<String> oldMode() throws JsonProcessingException {
|
||||
User user = AuthenticationUtil.authProfile(userService).get();
|
||||
|
||||
XmlMapper xmlMapper = new XmlMapper();
|
||||
xmlMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE);
|
||||
xmlMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
|
||||
ServerActionResultOld serverActionResult = new ServerActionResultOld();
|
||||
serverActionResult.setMagicAbilities(maService.getAll());
|
||||
serverActionResult.setSnStatus(new SnStatus(false));
|
||||
serverActionResult.setUsername(new UserName(user.getUsername()));
|
||||
serverActionResult.setFlags(new Flags(true, 13));
|
||||
serverActionResult.setRequests(new Grants(0));
|
||||
serverActionResult.setGrants(new Grants(0));
|
||||
List<ConfigItem> items = new ArrayList<>();
|
||||
items.add(new ConfigItem(1, ServerActionConfigType.IsPreloaderEnabled, "1", "bool")); // play with it
|
||||
items.add(new ConfigItem(2, ServerActionConfigType.SynchronizeAvatarRotation, "1", "bool"));
|
||||
items.add(new ConfigItem(3, ServerActionConfigType.InitialVolumeValue, "30", "number"));
|
||||
items.add(new ConfigItem(4, ServerActionConfigType.IsStartupHomeLocation, "0", "bool"));
|
||||
items.add(new ConfigItem(5, ServerActionConfigType.AccessRoleFlags, "0", "number"));
|
||||
items.add(new ConfigItem(6, ServerActionConfigType.IsInternational, "0", "bool")); // play with it
|
||||
items.add(new ConfigItem(7, ServerActionConfigType.TypeWeapon, "1", "number"));
|
||||
items.add(new ConfigItem(8, ServerActionConfigType.StatisticsSendInterval, "300", "number"));
|
||||
items.add(new ConfigItem(9, ServerActionConfigType.SwfVersion, "", "string"));
|
||||
items.add(new ConfigItem(10, ServerActionConfigType.LanguageId, "1", "number")); // play with it
|
||||
items.add(new ConfigItem(11, ServerActionConfigType.SnId, "1", "number"));
|
||||
items.add(new ConfigItem(12, ServerActionConfigType.AutoServerSelectionAllowed, "0", "bool"));
|
||||
List<ServerItem> s_items = new ArrayList<>();
|
||||
s_items.add(new ServerItem(1, 202, 5, "rtmp://"+serverConfig.getPublicDomain()+":"+serverConfig.getGameServerPort()+"/shararam", 0, 1, 5, 5.1));
|
||||
|
||||
serverActionResult.setPhone(new PhoneMessages(phoneMessageService.getAllByReceiverId(user.getId())));
|
||||
serverActionResult.setMiniquest(miniquestService.getAllMiniquests());
|
||||
serverActionResult.setPostcard(new PostcardMessages(postcardService.getAllPostcardsOfUser(user.getId())));
|
||||
serverActionResult.setPreloader(preloaderService.getSelected());
|
||||
serverActionResult.setPromotion(promotionService.getSelected());
|
||||
serverActionResult.setPromotionBanners(promotionBannerService.getSelected());
|
||||
|
||||
|
||||
List<Tutorial> tutorials = new ArrayList<>();
|
||||
tutorials.add(new Tutorial(-1, 1));
|
||||
tutorials.add(new Tutorial(1, 1));
|
||||
tutorials.add(new Tutorial(2, 1));
|
||||
tutorials.add(new Tutorial(3, 1));
|
||||
tutorials.add(new Tutorial(4, 1));
|
||||
tutorials.add(new Tutorial(5, 1));
|
||||
serverActionResult.setTutorial(tutorials);
|
||||
|
||||
|
||||
serverActionResult.setResources(new ResourcesResult(mrService.getAll(), trService.getAll(), roService.getAll()));
|
||||
|
||||
var config = new ServerActionConfig(items);
|
||||
var system = new ServerActionSystem(1, "cache/resources.swf"); // swf/cache/rus/resources[19].swf
|
||||
ServerActionUser userdata = null;
|
||||
ServerActionServers servers = null;
|
||||
if( !user.getIsBanned() ) {
|
||||
userdata = new ServerActionUser(user.getId(), AuthenticationUtil.getToken(user), AuthenticationUtil.getToken(user), 2, null, null);
|
||||
servers = new ServerActionServers(s_items);
|
||||
} else {
|
||||
userdata = new ServerActionUser(user.getId(), null, null, 0, LocalDateTime.now(), 162L);
|
||||
}
|
||||
List<ServerActionCData> cdatas = new ArrayList<>();
|
||||
cdatas.add(userdata);
|
||||
cdatas.add(config);
|
||||
cdatas.add(system);
|
||||
cdatas.add(servers);
|
||||
cdatas.add(new ServerActionMRTS(mrtService.getAll()));
|
||||
//serverActionResult.setCdata(new ServerActionCDataOld(userdata, config, system, servers, mrtService.getAll()));
|
||||
log.info("serverActionResult: {}", serverActionResult);
|
||||
serverActionResult.setCdata(cdatas);
|
||||
return ResponseEntity.ok()
|
||||
.contentType(MediaType.APPLICATION_XML)
|
||||
.body(xmlMapper.writeValueAsString(serverActionResult));
|
||||
}
|
||||
|
||||
private ResponseEntity<String> newMode() throws JsonProcessingException {
|
||||
User user = AuthenticationUtil.authProfile(userService).get();
|
||||
|
||||
XmlMapper xmlMapper = new XmlMapper();
|
||||
xmlMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE);
|
||||
xmlMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
|
||||
ServerActionResult serverActionResult = new ServerActionResult();
|
||||
serverActionResult.setSnStatus(new SnStatus(false));
|
||||
serverActionResult.setUsername(new UserName(user.getUsername()));
|
||||
serverActionResult.setFlags(new Flags(true, 13));
|
||||
serverActionResult.setRequests(new Grants(0));
|
||||
serverActionResult.setGrants(new Grants(0));
|
||||
List<ConfigItem> items = new ArrayList<>();
|
||||
items.add(new ConfigItem(1, ServerActionConfigType.IsPreloaderEnabled, "1", "bool")); // play with it
|
||||
items.add(new ConfigItem(2, ServerActionConfigType.SynchronizeAvatarRotation, "1", "bool"));
|
||||
items.add(new ConfigItem(3, ServerActionConfigType.InitialVolumeValue, "30", "number"));
|
||||
items.add(new ConfigItem(4, ServerActionConfigType.IsStartupHomeLocation, "0", "bool"));
|
||||
items.add(new ConfigItem(5, ServerActionConfigType.AccessRoleFlags, "0", "number"));
|
||||
items.add(new ConfigItem(6, ServerActionConfigType.IsInternational, "0", "bool")); // play with it
|
||||
items.add(new ConfigItem(7, ServerActionConfigType.TypeWeapon, "1", "number"));
|
||||
items.add(new ConfigItem(8, ServerActionConfigType.StatisticsSendInterval, "300", "number"));
|
||||
items.add(new ConfigItem(9, ServerActionConfigType.SwfVersion, "", "string"));
|
||||
items.add(new ConfigItem(10, ServerActionConfigType.LanguageId, "1", "number")); // play with it
|
||||
items.add(new ConfigItem(11, ServerActionConfigType.SnId, "1", "number"));
|
||||
items.add(new ConfigItem(12, ServerActionConfigType.AutoServerSelectionAllowed, "0", "bool"));
|
||||
List<ServerItem> s_items = new ArrayList<>();
|
||||
s_items.add(new ServerItem(1, 202, 5, "rtmp://"+serverConfig.getPublicDomain()+":"+serverConfig.getGameServerPort()+"/shararam", 0, 1, 5, 5.1));
|
||||
|
||||
serverActionResult.setPhone(new PhoneMessages(phoneMessageService.getAllByReceiverId(user.getId())));
|
||||
serverActionResult.setMiniquest(miniquestService.getAllMiniquests());
|
||||
serverActionResult.setPostcard(new PostcardMessages(postcardService.getAllPostcardsOfUser(user.getId())));
|
||||
serverActionResult.setPreloader(preloaderService.getSelected());
|
||||
serverActionResult.setPromotion(promotionService.getSelected());
|
||||
serverActionResult.setPromotionBanners(promotionBannerService.getSelected());
|
||||
|
||||
|
||||
List<Tutorial> tutorials = new ArrayList<>();
|
||||
tutorials.add(new Tutorial(-1, 1));
|
||||
tutorials.add(new Tutorial(1, 1));
|
||||
tutorials.add(new Tutorial(2, 1));
|
||||
tutorials.add(new Tutorial(3, 1));
|
||||
tutorials.add(new Tutorial(4, 1));
|
||||
tutorials.add(new Tutorial(5, 1));
|
||||
serverActionResult.setTutorial(tutorials);
|
||||
|
||||
List<ServerActionCData> cdatas = new ArrayList<>();
|
||||
cdatas.add(new ServerActionConfig(items));
|
||||
cdatas.add(new ServerActionSystem(1, "cache/resources.swf")); // swf/cache/rus/resources[19].swf
|
||||
if( !user.getIsBanned() ) {
|
||||
cdatas.add(new ServerActionUser(user.getId(), AuthenticationUtil.getToken(user), AuthenticationUtil.getToken(user), 2, null, null));
|
||||
cdatas.add(new ServerActionServers(s_items));
|
||||
} else {
|
||||
cdatas.add(new ServerActionUser(user.getId(), null, null, 0, LocalDateTime.now(), 162L));
|
||||
}
|
||||
serverActionResult.setCdata(cdatas);
|
||||
return ResponseEntity.ok()
|
||||
.contentType(MediaType.APPLICATION_XML)
|
||||
.body(xmlMapper.writeValueAsString(serverActionResult));
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,9 @@ package com.alterdekim.game.controller.result.async;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
|
||||
@ToString
|
||||
@AllArgsConstructor
|
||||
public class UserName {
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Value")
|
||||
|
@ -0,0 +1,28 @@
|
||||
package com.alterdekim.game.controller.result.async.old;
|
||||
|
||||
import com.alterdekim.game.entity.MediaResource;
|
||||
import com.alterdekim.game.entity.ResourceObject;
|
||||
import com.alterdekim.game.entity.TextResource;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ResourcesResult {
|
||||
|
||||
@JacksonXmlProperty(isAttribute = false, localName = "MediaResources")
|
||||
@JacksonXmlElementWrapper(useWrapping = true, localName = "MediaResources")
|
||||
private List<MediaResource> mediaResources;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = false, localName = "TextResources")
|
||||
@JacksonXmlElementWrapper(useWrapping = true, localName = "TextResources")
|
||||
private List<TextResource> textResources;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = false, localName = "ResourcesOptions")
|
||||
@JacksonXmlElementWrapper(useWrapping = true, localName = "ResourcesOptions")
|
||||
private List<ResourceObject> resourceOptions;
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.alterdekim.game.controller.result.async.old;
|
||||
|
||||
|
||||
import com.alterdekim.game.controller.result.async.ServerActionConfig;
|
||||
import com.alterdekim.game.controller.result.async.ServerActionServers;
|
||||
import com.alterdekim.game.controller.result.async.ServerActionSystem;
|
||||
import com.alterdekim.game.controller.result.async.ServerActionUser;
|
||||
import com.alterdekim.game.entity.MediaResourcePath;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@AllArgsConstructor
|
||||
public class ServerActionCDataOld {
|
||||
@JacksonXmlProperty(isAttribute = false, localName = "user")
|
||||
private ServerActionUser user;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = false, localName = "config")
|
||||
private ServerActionConfig config;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = false, localName = "system")
|
||||
private ServerActionSystem system;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = false, localName = "servers")
|
||||
private ServerActionServers servers;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = false, localName = "mrtroot")
|
||||
@JacksonXmlElementWrapper(useWrapping = true, localName = "mrtroot")
|
||||
private List<MediaResourcePath> mrtRoot;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.alterdekim.game.controller.result.async.old;
|
||||
|
||||
import com.alterdekim.game.controller.result.async.ServerActionCData;
|
||||
import com.alterdekim.game.entity.MediaResourcePath;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonRootName(value = "mrtroot")
|
||||
public class ServerActionMRTS extends ServerActionCData {
|
||||
@JacksonXmlElementWrapper(useWrapping = false, localName = "mrtroot")
|
||||
private List<MediaResourcePath> mrtRoot;
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.alterdekim.game.controller.result.async.old;
|
||||
|
||||
import com.alterdekim.game.controller.result.async.*;
|
||||
import com.alterdekim.game.entity.*;
|
||||
import com.alterdekim.game.xml.CryptoSerializer;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
@JsonRootName(value = "response")
|
||||
public class ServerActionResultOld {
|
||||
|
||||
@JacksonXmlProperty(isAttribute = false, localName = "user_name")
|
||||
private UserName username;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = false, localName = "sn_status")
|
||||
private SnStatus snStatus;
|
||||
|
||||
@JacksonXmlProperty
|
||||
private List<Preloader> preloader;
|
||||
|
||||
@JacksonXmlProperty(localName = "magic_abilities")
|
||||
@JacksonXmlElementWrapper(useWrapping = true, localName = "magic_abilities")
|
||||
private List<MagicAbility> magicAbilities;
|
||||
|
||||
@JacksonXmlProperty
|
||||
private Flags flags;
|
||||
|
||||
@JacksonXmlProperty(localName = "tutorial")
|
||||
@JacksonXmlElementWrapper(useWrapping = true, localName = "tutorial")
|
||||
private List<Tutorial> tutorial;
|
||||
|
||||
@JacksonXmlProperty
|
||||
private Grants grants;
|
||||
|
||||
@JacksonXmlProperty
|
||||
private Grants requests;
|
||||
|
||||
@JacksonXmlProperty
|
||||
private List<Promotion> promotion;
|
||||
|
||||
@JacksonXmlProperty(localName = "promotion_banner")
|
||||
private List<PromotionBanner> promotionBanners;
|
||||
|
||||
@JacksonXmlProperty
|
||||
private PhoneMessages phone;
|
||||
|
||||
@JacksonXmlProperty
|
||||
private PostcardMessages postcard;
|
||||
|
||||
@JacksonXmlProperty
|
||||
@JacksonXmlElementWrapper(useWrapping = true, localName = "miniquest")
|
||||
private List<Miniquest> miniquest;
|
||||
|
||||
@JacksonXmlProperty(localName = "resources")
|
||||
private ResourcesResult resources;
|
||||
|
||||
@JacksonXmlProperty(localName = "cdata")
|
||||
@JsonSerialize(using = CryptoSerializer.class)
|
||||
@JacksonXmlElementWrapper(useWrapping = false, localName = "cdata")
|
||||
private List<ServerActionCData> cdata;
|
||||
}
|
@ -4,6 +4,7 @@ import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
@ -21,26 +22,32 @@ import lombok.*;
|
||||
public class MagicAbility {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Id")
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "TypeId")
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "TypeId")
|
||||
private Integer typeId;
|
||||
|
||||
@Column(nullable = true)
|
||||
@FlashField(name = "duration")
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Duration")
|
||||
private Integer duration;
|
||||
|
||||
@Column(nullable = true)
|
||||
@FlashField(name = "TweenerId")
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "TweenerId")
|
||||
private Integer tweenerId;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "MRId")
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "MediaResourceID")
|
||||
private Integer mediaResourceId;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "TRId")
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "TRId")
|
||||
private Integer textResourceId;
|
||||
|
||||
@Column(nullable = false)
|
||||
@ -53,5 +60,6 @@ public class MagicAbility {
|
||||
|
||||
@Column(nullable = true)
|
||||
@FlashField(name = "IsMovable")
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsMovable")
|
||||
private Boolean isMovable;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
@ -20,17 +21,21 @@ import lombok.*;
|
||||
@FlashClass(name = "mr")
|
||||
public class MediaResource {
|
||||
@Id
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Id")
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "TId")
|
||||
@FlashField(name = "TId")
|
||||
@Column(nullable = false)
|
||||
private Integer tId;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Url")
|
||||
@FlashField(name = "Url")
|
||||
@Column(nullable = false)
|
||||
private String url;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "V")
|
||||
@FlashField(name = "V")
|
||||
@Column(nullable = true)
|
||||
private String v;
|
||||
|
@ -3,6 +3,7 @@ package com.alterdekim.game.entity;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
@ -19,10 +20,12 @@ import lombok.*;
|
||||
@FlashClass(name = "mrt")
|
||||
public class MediaResourcePath {
|
||||
@Id
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Id")
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashValue(type = FlashValueType.Value)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Url")
|
||||
private String val;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
@ -21,22 +22,27 @@ import lombok.*;
|
||||
public class ResourceObject {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Id")
|
||||
private Long id;
|
||||
|
||||
@FlashField(name = "X")
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "X")
|
||||
@Column(nullable = true)
|
||||
private Double x;
|
||||
|
||||
@FlashField(name = "Y")
|
||||
@Column(nullable = true)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Y")
|
||||
private Double y;
|
||||
|
||||
@FlashField(name = "Width")
|
||||
@Column(nullable = true)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Width")
|
||||
private Double width;
|
||||
|
||||
@FlashField(name = "Height")
|
||||
@Column(nullable = true)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Height")
|
||||
private Double height;
|
||||
|
||||
@FlashField(name = "IsCloseHide")
|
||||
|
@ -4,6 +4,7 @@ import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
@ -21,13 +22,16 @@ import lombok.*;
|
||||
public class TextResource {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Id")
|
||||
private Long id;
|
||||
|
||||
@FlashField(name = "OId")
|
||||
@Column(nullable = true)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "OId")
|
||||
private Integer oId;
|
||||
|
||||
@FlashField(name = "H")
|
||||
@Column(nullable = false, length = 65555)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "H")
|
||||
private String h;
|
||||
}
|
||||
|
@ -7,6 +7,8 @@ import lombok.NoArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@NoArgsConstructor
|
||||
public class MAService implements OutputObjectCallback {
|
||||
@ -18,4 +20,8 @@ public class MAService implements OutputObjectCallback {
|
||||
public void onOutputObjectReady(Object o) {
|
||||
this.repository.save((MagicAbility) o);
|
||||
}
|
||||
|
||||
public List<MagicAbility> getAll() {
|
||||
return this.repository.findAll();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user