Skip to content

Commit

Permalink
- Reldens - v4.0.0-beta.38.1
Browse files Browse the repository at this point in the history
- Merge pull request #265 from damian-pastorini/v4.0.0-beta.38.1
  • Loading branch information
damian-pastorini authored Nov 19, 2024
2 parents f60bfbb + f2772f1 commit 00de50c
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 23 deletions.
4 changes: 2 additions & 2 deletions lib/game/server/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class Installer
}
}
));
// @NOTE: do not use session secret like this in the app, it is not secure.
// Include "secure: true" for that case (that only works through SSL):
// @IMPORTANT: do not use session secret like this in the app, it is not secure.
// @NOTE: Include "secure: true" for that case (that only works through SSL).
// app.use(session({secret: this.secretKey, resave: true, saveUninitialized: true, cookie: {secure: true}}));
app.use(session({secret: this.secretKey, resave: true, saveUninitialized: true}));
app.use(async (req, res, next) => {
Expand Down
3 changes: 1 addition & 2 deletions lib/objects/server/object/type/enemy-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,7 @@ class EnemyObject extends NpcObject
this.objectBody.originalCol = currentCol;
this.objectBody.originalRow = currentRow;
await this.events.emit('reldens.restoreObjectAfter', {enemyObject: this, room});
let respawnTime = this.respawnTime || 1000;
//Logger.debug('Respawn: '+this.uid+ ' - Time: '+respawnTime+' - Position x/y: '+x+' / '+y);
//Logger.debug('Respawn: '+this.uid+ ' - Time: '+(this.respawnTime || 1000)+' - Position x/y: '+x+' / '+y);
if(0 === this.respawnStateTime){
this.setActiveObjectState(room);
return;
Expand Down
8 changes: 4 additions & 4 deletions lib/objects/server/object/type/trader-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ class TraderObject extends NpcObject
// @TODO - BETA - Refactor when include false conditions in the shortcuts.
if(ItemsConst.TRADE_ACTIONS.SELL === tradeAction){
inventoryItems = [
...inventory.findItemsByPropertyValue('equipped', false),
...inventory.findItemsByPropertyValue('equipped', undefined)];
...(inventory.findItemsByPropertyValue('equipped', false) || []),
...(inventory.findItemsByPropertyValue('equipped', undefined) || [])];
}
let sendData = {
act: GameConst.UI,
Expand Down Expand Up @@ -231,8 +231,8 @@ class TraderObject extends NpcObject
// @TODO - BETA - Refactor when include false conditions in the shortcuts and a new property "canBeTraded".
if(ItemsConst.TRADE_ACTIONS.SELL === tradeAction){
inventoryItems = [
...inventory.findItemsByPropertyValue('equipped', false),
...inventory.findItemsByPropertyValue('equipped', undefined)
...(inventory.findItemsByPropertyValue('equipped', false) || []),
...(inventory.findItemsByPropertyValue('equipped', undefined) || [])
];
}
let sendData = {
Expand Down
2 changes: 1 addition & 1 deletion lib/rooms/server/world-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class WorldConfig
}),
groupWallsVertically: sc.get(globalWorldConfig, 'groupWallsVertically', false),
groupWallsHorizontally: sc.get(globalWorldConfig, 'groupWallsHorizontally', false)
}
};
let applyGravity = sc.get(room.customData, 'applyGravity', globalConfig.applyGravity);
let defaultsVariations = {
useFixedWorldStep: null !== globalConfig.useFixedWorldStep ? globalConfig.useFixedWorldStep : !applyGravity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
*
*/

const { Logger } = require('@reldens/utils');

class EndPlayerHitChangePointTeamHandler
{

static async savePlayerTeam(playerSchema, teamsPlugin)
{
let teamId = playerSchema.currentTeam;
if(!teamId){
//Logger.debug('Player "'+playerSchema?.playerName+'" ('+playerSchema?.player_id+'), team not saved.');
return false;
}
teamsPlugin.teamChangingRoomPlayers[playerSchema.player_id] = {
Expand Down
4 changes: 2 additions & 2 deletions lib/teams/server/event-handlers/stats-update-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

const { ClanUpdatesHandler } = require('../clan-updates-handler');
const { TeamUpdatesHandler } = require('../team-updates-handler');
const { Logger, sc } = require('@reldens/utils');
const { sc } = require('@reldens/utils');


class StatsUpdateHandler
Expand All @@ -20,7 +20,7 @@ class StatsUpdateHandler
}
let currentTeam = sc.get(props.teamsPlugin.teams, currentTeamId, false);
if(!currentTeam){
//Logger.debug('Expected, Team not found: '+currentTeamId);
// expected, team not found
return false;
}
return TeamUpdatesHandler.updateTeamPlayers(currentTeam);
Expand Down
3 changes: 1 addition & 2 deletions lib/teams/server/team-message-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { TryTeamStart } = require('./message-actions/try-team-start');
const { TeamJoin } = require('./message-actions/team-join');
const { TeamLeave } = require('./message-actions/team-leave');
const { TeamsConst } = require('../constants');
const { Logger, sc } = require('@reldens/utils');
const { sc } = require('@reldens/utils');

class TeamMessageActions
{
Expand Down Expand Up @@ -36,7 +36,6 @@ class TeamMessageActions
let playerSendingInvite = room.activePlayerByPlayerId(data.id, room.roomId);
if(!playerSendingInvite){
// expected when the player disconnects in between the invitation is sent:
//Logger.debug('Team invitation declined, player owner client not found.', data);
return false;
}
let playerRejectingName = playerSchema.playerName;
Expand Down
4 changes: 2 additions & 2 deletions lib/users/client/lifebar-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { ActionsConst } = require('../../actions/constants');
const { GameConst } = require('../../game/constants');
const { ObjectsConst } = require('../../objects/constants');
const { ObjectsHandler } = require('./objects-handler');
const { sc, Logger} = require('@reldens/utils');
const { sc } = require('@reldens/utils');

class LifebarUi
{
Expand Down Expand Up @@ -170,7 +170,7 @@ class LifebarUi
{
let currentPlayer = this.gameManager.getCurrentPlayer();
if(!sc.isFunction(currentPlayer?.isDeath)){
//Logger.debug('Expected, when changing scenes the next scene could not be active yet.', currentPlayer);
// expected, when changing scenes the next scene could not be active yet
return false;
}
let isCurrentPlayer = playerId === currentPlayer?.playerId;
Expand Down
4 changes: 0 additions & 4 deletions lib/world/server/collisions-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class CollisionsManager
let bulletB = false;
let player = false;
let roomObject = false;
let roomWall = false;
for(let body of pairs){
if(body.playerId && body.pStop){
body.stopFull();
Expand All @@ -58,9 +57,6 @@ class CollisionsManager
if(body.playerId){
player = body;
}
if(body.isWall){
roomWall = body;
}
if(body.isBullet){
if(bulletA && !bulletB){
bulletB = body;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reldens",
"version": "4.0.0-beta.38",
"version": "4.0.0-beta.38.1",
"description": "Reldens - MMORPG Platform",
"author": "Damian A. Pastorini",
"license": "MIT",
Expand Down

0 comments on commit 00de50c

Please sign in to comment.