Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/4.8' into 4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
w4terbomb committed Jul 26, 2024
2 parents 1763269 + 657ffd9 commit 6330e95
Show file tree
Hide file tree
Showing 31 changed files with 275 additions and 372 deletions.
24 changes: 0 additions & 24 deletions game-server/config/main/membership.properties
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,6 @@ gameserver.instances.quest.requirement = 10
# Default: 10
gameserver.instances.cooldown = 10

# All items can be storable in warehouse
# Default: 10
gameserver.store.wh.all = 10

# All items can be storable in account warehouse
# Default: 10
gameserver.store.accountwh.all = 10

# All items can be storable in legion warehouse
# Default: 10
gameserver.store.legionwh.all = 10

# All items can be tradeable
# Default: 10
gameserver.trade.all = 10

# Soulbound items can be tradeable
# Default: 10
gameserver.disable.soulbind = 10

# All items can be remodelable
# Default: 10
gameserver.remodel.all = 10

# All emotions available
# Default: 10
gameserver.emotions.all = 10
Expand Down
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
2 changes: 1 addition & 1 deletion game-server/data/static_data/items/item_templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -919318,7 +919318,7 @@
</actions>
<uselimits usedelay="1000" usedelayid="85"/>
</item_template>
<item_template id="188053004" name="[Event] Dragon Lord's Weapon Chest" level="1" cName="world_wrap_event_winter_tiamat_weapon" mask="12360" max_stack_count="1" item_group="NONE" item_type="NORMAL" quality="EPIC" price="5" race="PC_ALL" restrict="1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1" desc="833629" activate_target="STANDALONE" activate_count="1">
<item_template id="188053004" name="[Event] Dragon Lord's Weapon Chest" level="1" cName="world_wrap_event_winter_tiamat_weapon" mask="4218" max_stack_count="1" item_group="NONE" item_type="NORMAL" quality="EPIC" price="5" race="PC_ALL" restrict="1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1" desc="833629" activate_target="STANDALONE" activate_count="1">
<actions>
<decompose/>
</actions>
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
Expand Up @@ -28,24 +28,6 @@ public class MembershipConfig {
@Property(key = "gameserver.instances.cooldown", defaultValue = "10")
public static byte INSTANCES_COOLDOWN;

@Property(key = "gameserver.store.wh.all", defaultValue = "10")
public static byte STORE_WH_ALL;

@Property(key = "gameserver.store.accountwh.all", defaultValue = "10")
public static byte STORE_AWH_ALL;

@Property(key = "gameserver.store.legionwh.all", defaultValue = "10")
public static byte STORE_LWH_ALL;

@Property(key = "gameserver.trade.all", defaultValue = "10")
public static byte TRADE_ALL;

@Property(key = "gameserver.disable.soulbind", defaultValue = "10")
public static byte DISABLE_SOULBIND;

@Property(key = "gameserver.remodel.all", defaultValue = "10")
public static byte REMODEL_ALL;

@Property(key = "gameserver.emotions.all", defaultValue = "10")
public static byte EMOTIONS_ALL;

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
61 changes: 12 additions & 49 deletions game-server/src/com/aionemu/gameserver/model/gameobjects/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.aionemu.gameserver.configs.main.MembershipConfig;
import com.aionemu.gameserver.dao.ItemStoneListDAO;
import com.aionemu.gameserver.dataholders.DataManager;
import com.aionemu.gameserver.model.Expirable;
Expand Down Expand Up @@ -550,13 +549,6 @@ public boolean isSoulBound() {
return isSoulBound;
}

private boolean isSoulBound(Player player) {
if (player.hasPermission(MembershipConfig.DISABLE_SOULBIND)) {
return false;
} else
return isSoulBound;
}

public void setSoulBound(boolean isSoulBound) {
this.isSoulBound = isSoulBound;
setPersistentState(PersistentState.UPDATE_REQUIRED);
Expand Down Expand Up @@ -630,57 +622,28 @@ public int getSockets(boolean isFusionItem) {
return 0;
}

public int getItemMask(Player player) {
return checkConfig(player, itemTemplate.getMask());
}

private int checkConfig(Player player, int mask) {
int newMask = mask;
if (player.hasPermission(MembershipConfig.STORE_WH_ALL)) {
newMask = newMask | ItemMask.STORABLE_IN_WH;
}
if (player.hasPermission(MembershipConfig.STORE_AWH_ALL)) {
newMask = newMask | ItemMask.STORABLE_IN_AWH;
}
if (player.hasPermission(MembershipConfig.STORE_LWH_ALL)) {
newMask = newMask | ItemMask.STORABLE_IN_LWH;
}
if (player.hasPermission(MembershipConfig.TRADE_ALL)) {
newMask = newMask | ItemMask.TRADEABLE;
}
if (player.hasPermission(MembershipConfig.REMODEL_ALL)) {
newMask = newMask | ItemMask.REMODELABLE;
}

return newMask;
}

public boolean isStorableinWarehouse(Player player) {
return (getItemMask(player) & ItemMask.STORABLE_IN_WH) == ItemMask.STORABLE_IN_WH;
public boolean isStorableInWarehouse() {
return (getItemMask() & ItemMask.STORABLE_IN_WH) == ItemMask.STORABLE_IN_WH;
}

public boolean isStorableinAccWarehouse(Player player) {
return (getItemMask(player) & ItemMask.STORABLE_IN_AWH) == ItemMask.STORABLE_IN_AWH && !isSoulBound(player);
public boolean isStorableInAccWarehouse() {
return (getItemMask() & ItemMask.STORABLE_IN_AWH) == ItemMask.STORABLE_IN_AWH && !isSoulBound();
}

public boolean isStorableinLegWarehouse(Player player) {
return (getItemMask(player) & ItemMask.STORABLE_IN_LWH) == ItemMask.STORABLE_IN_LWH && !isSoulBound(player);
public boolean isStorableInLegWarehouse() {
return (getItemMask() & ItemMask.STORABLE_IN_LWH) == ItemMask.STORABLE_IN_LWH && !isSoulBound();
}

public boolean isTradeable(Player player) {
return (getItemMask(player) & ItemMask.TRADEABLE) == ItemMask.TRADEABLE && !isSoulBound(player);
public boolean isTradeable() {
return (getItemMask() & ItemMask.TRADEABLE) == ItemMask.TRADEABLE && !isSoulBound();
}

public boolean isLegionTradeable(Player player, Player partner) {
if ((getItemMask(player) & ItemMask.LEGION_TRADEABLE) != ItemMask.LEGION_TRADEABLE || isSoulBound(player))
return false;
if (player.getLegion() == null || partner.getLegion() == null)
return false;
return player.getLegion().getLegionId() == partner.getLegion().getLegionId();
public boolean isLegionTradeable() {
return (getItemMask() & ItemMask.LEGION_TRADEABLE) == ItemMask.LEGION_TRADEABLE && !isSoulBound();
}

public boolean isRemodelable(Player player) {
return (getItemMask(player) & ItemMask.REMODELABLE) == ItemMask.REMODELABLE;
public boolean isRemodelable() {
return (getItemMask() & ItemMask.REMODELABLE) == ItemMask.REMODELABLE;
}

public boolean isSellable() {
Expand Down
Loading

0 comments on commit 6330e95

Please sign in to comment.