Skip to content

Commit

Permalink
Merge branch 'beyond-aion:4.8' into 4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
w4terbomb authored Jul 24, 2024
2 parents 09b96fb + 9181add commit 657ffd9
Show file tree
Hide file tree
Showing 20 changed files with 249 additions and 261 deletions.
15 changes: 9 additions & 6 deletions game-server/config/main/security.properties
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,15 @@ gameserver.security.validation.flypath = false
# Default: 20
gameserver.security.survey.delay.minute = 20

# Enable\disable checking for dualboxing
gameserver.security.check.dualboxing = false

# Enable\disable kicking of player in game when dualboxing is detected
# (only 1 player in game - GMs are excluded)
gameserver.security.kick.dualboxing = false
# Restriction mode for multi-clienting:
# NONE - Players are allowed to log in multiple accounts per computer
# FULL - Players are allowed to log in one account per computer
# SAME_FACTION - Players are allowed to log in multiple accounts per computer, but only log in characters of the same faction
gameserver.security.multi_clienting.restriction_mode = NONE

# If multi-clienting is restricted to the same faction, logging in characters of one faction will be denied until all characters of the opposite
# faction have been offline for the specified amount of time.
gameserver.security.multi_clienting.faction_switch_cooldown_minutes = 20

# Enable login checks for accounts that are locked to a SSD or HDD serial number.
# Locked accounts can only be logged in from the game client on a drive with the locked serial number.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void onEndUseSkill(SkillTemplate skillTemplate, int skillLevel) {
spawn(281267, 1163.5889f, 1231.9149f, 145.40042f, (byte) 118);
} else {
rndSpawnInRange(281268, 1, 2);
rndSpawnInRange(281268, 1, 1);
rndSpawnInRange(281268, 1, 2);
}
break;
case 19679: // You are unworthy.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@
<spot x="1461.19" y="1484.47" z="99" h="101"/>
<spot x="1462.03" y="1446.53" z="99.25" h="110"/>
<spot x="1466.7307" y="1333.2323" z="98.7477" h="75"/>
<spot x="1475.31" y="1499.46" z="99.76677"/>
<spot x="1475.31" y="1499.46" z="101.38437"/>
<spot x="1480.27" y="1522.43" z="103.4" h="94"/>
<spot x="1490.54" y="1540.18" z="101.558" h="68"/>
<spot x="1510.69" y="1576.03" z="99.5" h="102"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.aionemu.gameserver.configs.main;

import java.util.Set;

import com.aionemu.commons.configuration.Property;
import com.aionemu.gameserver.network.aion.AionClientPacket;

public class SecurityConfig {

Expand Down Expand Up @@ -79,15 +76,19 @@ public class SecurityConfig {
@Property(key = "gameserver.security.survey.delay.minute", defaultValue = "20")
public static int SURVEY_DELAY;

@Property(key = "gameserver.security.check.dualboxing", defaultValue = "false")
public static boolean DUALBOXING;
@Property(key = "gameserver.security.multi_clienting.restriction_mode", defaultValue = "NONE")
public static MultiClientingRestrictionMode MULTI_CLIENTING_RESTRICTION_MODE;

@Property(key = "gameserver.security.kick.dualboxing", defaultValue = "false")
public static boolean KICK_DUALBOXING;
@Property(key = "gameserver.security.multi_clienting.faction_switch_cooldown_minutes", defaultValue = "20")
public static int MULTI_CLIENTING_FACTION_SWITCH_COOLDOWN_MINUTES;

@Property(key = "gameserver.security.hdd_serial_lock.enable", defaultValue = "false")
public static boolean HDD_SERIAL_LOCK_ENABLE;

@Property(key = "gameserver.security.hdd_serial_lock.auto_lock", defaultValue = "false")
public static boolean HDD_SERIAL_LOCK_UNLOCKED_ACCOUNTS;

public enum MultiClientingRestrictionMode {
NONE, FULL, SAME_FACTION
}
}
14 changes: 5 additions & 9 deletions game-server/src/com/aionemu/gameserver/dao/PlayerMacrosDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.aionemu.commons.database.DB;
import com.aionemu.commons.database.DatabaseFactory;
import com.aionemu.commons.database.IUStH;
import com.aionemu.gameserver.model.gameobjects.player.MacroList;
import com.aionemu.gameserver.model.gameobjects.player.Macros;

/**
* Created on: 13.07.2009 17:05:56
Expand Down Expand Up @@ -67,20 +65,18 @@ public void handleInsertUpdate(PreparedStatement stmt) throws SQLException {
});
}

public static MacroList loadMacros(int playerId) {
Map<Integer, String> macros = new HashMap<>();
public static Macros loadMacros(int playerId) {
Macros macros = new Macros();
try (Connection con = DatabaseFactory.getConnection(); PreparedStatement stmt = con.prepareStatement(SELECT_QUERY)) {
stmt.setInt(1, playerId);
try (ResultSet rset = stmt.executeQuery()) {
while (rset.next()) {
int order = rset.getInt("order");
String text = rset.getString("macro");
macros.put(order, text);
macros.add(rset.getInt("order"), rset.getString("macro"));
}
}
} catch (Exception e) {
log.error("Could not load macros for player " + playerId, e);
}
return new MacroList(macros);
return macros;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void setParams(PreparedStatement ps) throws SQLException {
@Override
public void handleRead(ResultSet rs) throws SQLException {
while (rs.next()) {
charBan[0] = new CharacterBanInfo(playerId, rs.getLong("start_time"), rs.getLong("duration"), rs.getString("reason"));
charBan[0] = new CharacterBanInfo(rs.getLong("start_time"), rs.getLong("duration"), rs.getString("reason"));
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,24 @@
*/
public class CharacterBanInfo {

private int playerId;
private long start;
private long end;
private String reason;
private final long start;
private final long end;
private final String reason;

public CharacterBanInfo(int playerId, long start, long duration, String reason) {
this.playerId = playerId;
public CharacterBanInfo(long start, long duration, String reason) {
this.start = start;
this.end = duration + start;
this.reason = (reason.equals("") ? "You are suspected to have violated the server's rules" : reason);
this.reason = reason;
}

/**
* @return the playerId
*/
public int getPlayerId() {
return playerId;
}

/**
* @return the start
*/
public long getStart() {
return start;
}

/**
* @return the end
*/
public long getEnd() {
return end;
}

/**
* @return the reason
*/
public String getReason() {
return reason;
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.aionemu.gameserver.model.gameobjects.player;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* @author Aquanox, nrg
*/
public class Macros {

private final Map<Integer, Macro> macrosById = new HashMap<>(12);

public synchronized List<Macro> getAll() {
return new ArrayList<>(macrosById.values());
}

/**
* @return <tt>true</tt> if given macro ID was not used before.
*/
public synchronized boolean add(int macroId, String macroXML) {
if (macroId < 1 || macroId > 12)
throw new IllegalArgumentException("Invalid macro ID: " + macroId);
return macrosById.put(macroId, new Macro(macroId, macroXML)) == null;
}

public synchronized boolean remove(int macroId) {
return macrosById.remove(macroId) != null;
}

public record Macro(int id, String xml) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public class Player extends Creature {
private final Account playerAccount;
private LegionMember legionMember;

private MacroList macroList;
private Macros macros;
private PlayerSkillList skillList;
private FriendList friendList;
private BlockList blockList;
Expand Down Expand Up @@ -281,12 +281,12 @@ public AionConnection getClientConnection() {
return clientConnection;
}

public MacroList getMacroList() {
return macroList;
public Macros getMacros() {
return macros;
}

public void setMacroList(MacroList macroList) {
this.macroList = macroList;
public void setMacros(Macros macros) {
this.macros = macros;
}

public PlayerSkillList getSkillList() {
Expand Down
Loading

0 comments on commit 657ffd9

Please sign in to comment.