Registruotis Prisijungti Forumas Ieškoti DUK |
Offline Shop
2 pranešimai(ų)
• Puslapis 1 iš 1
Offline Shop
Pastacius charakteri ant pardavimo busenos, tiesiog paspaudus Logout mygtuka charakteris liks pardavimo busenoj, iki tol kol bus nupirktas pasirinktas daiktas.
- Kodas: Pasirinkti visus
Index: /trunk/L2_GameServer/java/config/l2jmods.properties
===================================================================
--- /trunk/L2_GameServer/java/config/l2jmods.properties (revision 2945)
+++ /trunk/L2_GameServer/java/config/l2jmods.properties (revision 3128)
@@ -198,4 +198,22 @@
# ---------------------------------------------------------------------------
+# Offline trade/craft
+# ---------------------------------------------------------------------------
+# Option to enable or disable offline trade feature.
+# Enable -> true, Disable -> false
+OfflineTradeEnable = False
+
+# Option to enable or disable offline craft feature.
+# Enable -> true, Disable -> false
+OfflineCraftEnable = False
+
+# If set to True, name color will be changed then entering offline mode
+OfflineSetNameColor = False
+
+# Color of the name in offline mode (if OfflineSetNameColor = True)
+OfflineNameColor = 808080
+
+
+# ---------------------------------------------------------------------------
# Mana Drugs/Potions
# ---------------------------------------------------------------------------
Index: /trunk/L2_GameServer/java/net/sf/l2j/Config.java
===================================================================
--- /trunk/L2_GameServer/java/net/sf/l2j/Config.java (revision 3120)
+++ /trunk/L2_GameServer/java/net/sf/l2j/Config.java (revision 3128)
@@ -567,4 +567,8 @@
public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE;
public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT;
+ public static boolean OFFLINE_TRADE_ENABLE;
+ public static boolean OFFLINE_CRAFT_ENABLE;
+ public static boolean OFFLINE_SET_NAME_COLOR;
+ public static int OFFLINE_NAME_COLOR;
public static boolean L2JMOD_ENABLE_MANA_POTIONS_SUPPORT;
@@ -1807,4 +1811,9 @@
BANKING_SYSTEM_ADENA = Integer.parseInt(L2JModSettings.getProperty("BankingAdenaCount", "500000000"));
+ OFFLINE_TRADE_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineTradeEnable", "false"));
+ OFFLINE_CRAFT_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineCraftEnable", "false"));
+ OFFLINE_SET_NAME_COLOR = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineSetNameColor", "false"));
+ OFFLINE_NAME_COLOR = Integer.decode("0x" + L2JModSettings.getProperty("OfflineNameColor", "808080"));
+
L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(L2JModSettings.getProperty("EnableManaPotionSupport", "false"));
}
Index: /trunk/L2_GameServer/java/net/sf/l2j/gameserver/network/L2GameClient.java
===================================================================
--- /trunk/L2_GameServer/java/net/sf/l2j/gameserver/network/L2GameClient.java (revision 2947)
+++ /trunk/L2_GameServer/java/net/sf/l2j/gameserver/network/L2GameClient.java (revision 3128)
@@ -41,4 +41,5 @@
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.entity.L2Event;
+import net.sf.l2j.gameserver.model.entity.TvTEvent;
import net.sf.l2j.gameserver.network.serverpackets.L2GameServerPacket;
import net.sf.l2j.util.EventData;
@@ -594,7 +595,26 @@
isDetached(true);
L2PcInstance player = L2GameClient.this.getActiveChar();
- if (player != null && player.isInCombat())
+ if (player != null)
{
- fast = false;
+ if (!player.isInOlympiadMode()
+ && !player.isFestivalParticipant()
+ && !TvTEvent.isPlayerParticipant(player.getObjectId()) && !player.isInJail())
+ {
+ if ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE)
+ || (player.isInCraftMode() && Config.OFFLINE_CRAFT_ENABLE))
+ {
+ player.leaveParty();
+ if (Config.OFFLINE_SET_NAME_COLOR)
+ {
+ player.getAppearance().setNameColor(Config.OFFLINE_NAME_COLOR);
+ player.broadcastUserInfo();
+ }
+ return;
+ }
+ }
}
cleanMe(fast);
@@ -644,5 +664,5 @@
}
- // we are going to mannually save the char bellow thus we can force the cancel
+ // we are going to manually save the char bellow thus we can force the cancel
if (_autoSaveInDB != null)
{
Index: /trunk/L2_GameServer/java/net/sf/l2j/gameserver/network/clientpackets/Logout.java
===================================================================
--- /trunk/L2_GameServer/java/net/sf/l2j/gameserver/network/clientpackets/Logout.java (revision 2948)
+++ /trunk/L2_GameServer/java/net/sf/l2j/gameserver/network/clientpackets/Logout.java (revision 3128)
@@ -105,4 +105,12 @@
TvTEvent.onLogout(player);
+
+ if ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE)
+ || (player.isInCraftMode() && Config.OFFLINE_CRAFT_ENABLE))
+ {
+ player.closeNetConnection();
+ return;
+ }
+
RegionBBSManager.getInstance().changeCommunityBoard();
===================================================================
--- /trunk/L2_GameServer/java/net/sf/l2j/gameserver/model/L2ClanMember.java (revision 2946)
+++ /trunk/L2_GameServer/java/net/sf/l2j/gameserver/model/L2ClanMember.java (revision 3128)
@@ -145,5 +145,12 @@
public boolean isOnline()
{
- return _player != null;
+ if (_player == null)
+ return false;
+ if (_player.getClient() == null)
+ return false;
+
+ return true;
}
Re: Offline Shop
Jei gali paaiškink kaip čia padaryti.
Ne snk nesusigaudau
Tai būtų gerai kad išsamiai aprašytum kaip šitą visą įsidiegti į Serverį.
Ne snk nesusigaudau
Tai būtų gerai kad išsamiai aprašytum kaip šitą visą įsidiegti į Serverį.
2 pranešimai(ų)
• Puslapis 1 iš 1
Grįžti į L2j serverio failai, gidai, skriptai
Dabar prisijungę
Vartotojai naršantys šį forumą: Registruotų vartotojų nėra ir 1 svečias