Skip to content

Commit

Permalink
- Reldens - v4.0.0-beta.36
Browse files Browse the repository at this point in the history
- Merge pull request #248 from damian-pastorini/v4.0.0-beta.36
  • Loading branch information
damian-pastorini authored Jul 18, 2024
2 parents 468257d + 4d8da77 commit f13f5cb
Show file tree
Hide file tree
Showing 159 changed files with 8,290 additions and 3,295 deletions.
36 changes: 17 additions & 19 deletions bin/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ const {
LayerElementsCompositeLoader,
MultipleByLoaderGenerator,
MultipleWithAssociationsByLoaderGenerator
} = require("@reldens/tile-map-generator");
} = require('@reldens/tile-map-generator');
const { FileHandler } = require('../lib/game/server/file-handler');
const path = require("path");
const {Logger} = require("@reldens/utils");
const { Logger } = require('@reldens/utils');

/**
*
Expand All @@ -38,15 +37,15 @@ const {Logger} = require("@reldens/utils");

let mapsGenerateModes = {
LayerElementsObjectLoader: async (commandParams) => {
const loader = new LayerElementsObjectLoader(commandParams);
let loader = new LayerElementsObjectLoader(commandParams);
await loader.load();
const generator = new RandomMapGenerator(loader.mapData);
let generator = new RandomMapGenerator(loader.mapData);
return await generator.generate();
},
LayerElementsCompositeLoader: async (commandParams) => {
const loader = new LayerElementsCompositeLoader(commandParams);
let loader = new LayerElementsCompositeLoader(commandParams);
await loader.load();
const generator = new RandomMapGenerator();
let generator = new RandomMapGenerator();
await generator.fromElementsProvider(loader.mapData);
return await generator.generate();
},
Expand All @@ -58,7 +57,7 @@ let mapsGenerateModes = {
let generator = new MultipleWithAssociationsByLoaderGenerator({loaderData: commandParams});
await generator.generate();
}
}
};

let validCommands = {
'players-experience-per-level': (commandParams) => {
Expand All @@ -74,7 +73,7 @@ let validCommands = {
attributesPerLevel.generate();
},
'maps': async (commandParams) => {
if (!mapsGenerateModes[commandParams.importMode]) {
if(!mapsGenerateModes[commandParams.importMode]){
console.error('- Invalid import mode. Valid options: '+Object.keys(mapsGenerateModes).join(', '));
}
let pathParts = commandParams.mapDataFile.split('/');
Expand Down Expand Up @@ -102,12 +101,12 @@ if(2 === args.length){
let extractedParams = args.slice(2);

let command = extractedParams[0] || false;
if (!command) {
if(!command){
console.error('- Missing command.');
return false;
}

if (-1 === Object.keys(validCommands).indexOf(command)) {
if(-1 === Object.keys(validCommands).indexOf(command)){
console.error('- Invalid command.', command);
return false;
}
Expand All @@ -116,25 +115,25 @@ let importJson = 'monsters-experience-per-level' === command
|| 'players-experience-per-level' === command
|| 'attributes-per-level' === command;

if (importJson) {
let filePath = path.join(process.cwd(), extractedParams[1] || '');
if(importJson){
let filePath = FileHandler.joinPaths(process.cwd(), extractedParams[1] || '');
if(!filePath){
Logger.error('Invalid data file path.', process.cwd(), filePath);
return false;
}
let importedJson = FileHandler.fetchFileJson(filePath);
if (!importedJson) {
if(!importedJson){
console.error('- Can not parse data file.');
return false;
}
if ('monsters-experience-per-level' === command) {
let secondaryFilePath = path.join(process.cwd(), extractedParams[2] || '');
if('monsters-experience-per-level' === command){
let secondaryFilePath = FileHandler.joinPaths(process.cwd(), extractedParams[2] || '');
if(!secondaryFilePath){
Logger.error('Invalid data file path.', process.cwd(), secondaryFilePath);
return false;
}
let importedPlayerLevelsJson = FileHandler.fetchFileJson(secondaryFilePath);
if (!importedPlayerLevelsJson) {
if(!importedPlayerLevelsJson){
console.error('- Can not parse data file for player levels.');
return false;
}
Expand All @@ -145,10 +144,9 @@ if (importJson) {
}


if ('maps' === command) {
if('maps' === command){
return validCommands[command]({
mapDataFile: extractedParams[1],
// mapData: fetchFileContents(extractedParams[1] || ''),
importMode: extractedParams[2] || ''
});
}
File renamed without changes
File renamed without changes
12 changes: 7 additions & 5 deletions install/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<title>DwDeveloper - Reldens | MMORPG Platform</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Play:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://www.gstatic.com/firebasejs/ui/4.6.0/firebase-ui-auth.css"/>
<link rel="apple-touch-icon" sizes="180x180" href="./assets/favicon/apple-touch-icon.png"/>
<link rel="icon" type="image/png" sizes="32x32" href="./assets/favicon/favicon-32x32.png"/>
<link rel="icon" type="image/png" sizes="16x16" href="./assets/favicon/favicon-16x16.png"/>
<link rel="apple-touch-icon" sizes="180x180" href="./assets/favicons/apple-touch-icon.png"/>
<link rel="icon" type="image/png" sizes="32x32" href="./assets/favicons/favicon-32x32.png"/>
<link rel="icon" type="image/png" sizes="16x16" href="./assets/favicons/favicon-16x16.png"/>
<link rel="manifest" href="./site.webmanifest"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
<link rel="stylesheet" type="text/css" href="./css/styles.scss"/>
Expand Down Expand Up @@ -37,11 +37,14 @@ <h3 class="form-title">- App -</h3>
<label for="app-public-url">Public URL (useful if you have a reverse proxy)</label>
<input type="text" name="app-public-url" id="app-public-url" value="{{app-public-url}}" class="required" required/>
</div>
<!--
<div class="input-box app-admin-path">
<label for="app-admin-path">Admin Panel Path</label>
<input type="text" name="app-admin-path" id="app-admin-path" value="{{app-admin-path}}"/>
</div>
<div class="input-box app-admin-secret">
<label for="app-admin-secret">Admin Panel Secret Key</label>
<input type="text" name="app-admin-secret" id="app-admin-secret" value="{{app-admin-secret}}"/>
</div>
<div class="input-box app-secure-admin">
<label for="app-secure-admin">Secure Admin (login with normal app users)</label>
<input type="checkbox" value="1" name="app-secure-admin" id="app-secure-admin"{{&app-secure-admin-checked}}/>
Expand All @@ -50,7 +53,6 @@ <h3 class="form-title">- App -</h3>
<label for="app-admin-hot-plug">Hot-Plug</label>
<input type="checkbox" value="1" name="app-admin-hot-plug" id="app-admin-hot-plug"{{&app-admin-hot-plug-checked}}/>
</div>
-->
<div class="input-box app-error">
<p class="installation-process-failed">There was an error during the installation process.</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion install/site.webmanifest
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"","short_name":"","icons":[{"src":"./assets/favicon/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"./assets/favicon/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
{"name":"","short_name":"","icons":[{"src":"./assets/favicons/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"./assets/favicons/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
2 changes: 1 addition & 1 deletion lib/actions/server/data-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class DataLoader
static async loadClassPathFullList(configProcessor, skillsModelsManager)
{
configProcessor.skills.classPaths = await skillsModelsManager.generateClassPathInstances(
(configProcessor.getWithoutLogs('server/customClasses/skills/classPath', {}))
configProcessor.getWithoutLogs('server/customClasses/skills/classPath', {})
);
}

Expand Down
1 change: 1 addition & 0 deletions lib/actions/server/entities-translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports.entitiesTranslations = {
skills_skill_group_relation: 'Groups Relation',
skills_skill_owner_conditions: 'Owner Conditions',
skills_skill_owner_effects: 'Owner Effects',
skills_groups: 'Groups',
skills_skill_type: 'Skill Types',
operation_types: 'Operation Types'
}
Expand Down
26 changes: 14 additions & 12 deletions lib/actions/server/entities/animations-entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ class AnimationsEntity extends EntityProperties

static propertiesConfig(extraProps)
{
let titleProperty = 'key';
let properties = {
id: {},
skill_id: {
type: 'reference',
reference: 'skills_skill',
alias: 'skill',
isRequired: true
},
key: {
isTitle: true,
[titleProperty]: {
isRequired: true
},
classKey: {},
Expand All @@ -28,19 +29,20 @@ class AnimationsEntity extends EntityProperties
}
};

let listPropertiesKeys = Object.keys(properties);
let editPropertiesKeys = [...listPropertiesKeys];

listPropertiesKeys.splice(listPropertiesKeys.indexOf('animationData'), 1);
listPropertiesKeys.splice(listPropertiesKeys.indexOf('classKey'), 1);
editPropertiesKeys.splice(editPropertiesKeys.indexOf('id'), 1);
let showProperties = Object.keys(properties);
let listProperties = [...showProperties];
let editProperties = [...listProperties];
listProperties.splice(listProperties.indexOf('animationData'), 1);
listProperties.splice(listProperties.indexOf('classKey'), 1);
editProperties.splice(editProperties.indexOf('id'), 1);

return {
listProperties: listPropertiesKeys,
showProperties: Object.keys(properties),
filterProperties: listPropertiesKeys,
editProperties: editPropertiesKeys,
showProperties,
editProperties,
listProperties,
filterProperties: showProperties,
properties,
titleProperty,
...extraProps
};
}
Expand Down
21 changes: 10 additions & 11 deletions lib/actions/server/entities/class-path-entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,31 @@ class ClassPathEntity extends EntityProperties

static propertiesConfig(extraProps)
{
let titleProperty = 'label';
let properties = {
id: {},
key: {
isRequired: true
},
label: {
isTitle: true
},
[titleProperty]: {},
levels_set_id: {
type: 'reference',
reference: 'skills_levels_set',
isRequired: true
}
};

let listPropertiesKeys = Object.keys(properties);
let editPropertiesKeys = [...listPropertiesKeys];

editPropertiesKeys.splice(editPropertiesKeys.indexOf('id'), 1);
let showProperties = Object.keys(properties);
let editProperties = [...showProperties];
editProperties.splice(editProperties.indexOf('id'), 1);

return {
listProperties: listPropertiesKeys,
showProperties: Object.keys(properties),
filterProperties: listPropertiesKeys,
editProperties: editPropertiesKeys,
showProperties,
editProperties,
listProperties: showProperties,
filterProperties: showProperties,
properties,
titleProperty,
...extraProps
};
}
Expand Down
22 changes: 12 additions & 10 deletions lib/actions/server/entities/class-path-level-label-entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,37 @@ class ClassPathLevelLabelEntity extends EntityProperties

static propertiesConfig(extraProps)
{
let titleProperty = 'label';
let properties = {
id: {},
class_path_id: {
type: 'reference',
reference: 'skills_class_path',
alias: 'class_path',
isRequired: true
},
level_id: {
type: 'reference',
reference: 'skills_levels',
alias: 'label_level',
isRequired: true
},
label: {
isTitle: true,
[titleProperty]: {
isRequired: true
},
};

let listPropertiesKeys = Object.keys(properties);
let editPropertiesKeys = [...listPropertiesKeys];

editPropertiesKeys.splice(editPropertiesKeys.indexOf('id'), 1);
let showProperties = Object.keys(properties);
let editProperties = [...showProperties];
editProperties.splice(editProperties.indexOf('id'), 1);

return {
listProperties: listPropertiesKeys,
showProperties: Object.keys(properties),
filterProperties: listPropertiesKeys,
editProperties: editPropertiesKeys,
showProperties,
editProperties,
listProperties: showProperties,
filterProperties: showProperties,
properties,
titleProperty,
...extraProps
};
}
Expand Down
18 changes: 10 additions & 8 deletions lib/actions/server/entities/class-path-level-skills-entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,32 @@ class ClassPathLevelSkillsEntity extends EntityProperties
class_path_id: {
type: 'reference',
reference: 'skills_class_path',
alias: 'class_path',
isRequired: true
},
level_id: {
type: 'reference',
reference: 'skills_levels',
alias: 'class_path_level',
isRequired: true
},
skill_id: {
type: 'reference',
reference: 'skills_skill',
alias: 'class_path_level_skill',
isRequired: true
},
};

let listPropertiesKeys = Object.keys(properties);
let editPropertiesKeys = [...listPropertiesKeys];

editPropertiesKeys.splice(editPropertiesKeys.indexOf('id'), 1);
let showProperties = Object.keys(properties);
let editProperties = [...showProperties];
editProperties.splice(editProperties.indexOf('id'), 1);

return {
listProperties: listPropertiesKeys,
showProperties: Object.keys(properties),
filterProperties: listPropertiesKeys,
editProperties: editPropertiesKeys,
showProperties,
editProperties,
listProperties: showProperties,
filterProperties: showProperties,
properties,
...extraProps
};
Expand Down
Loading

0 comments on commit f13f5cb

Please sign in to comment.