Tópico: [Java] Shop offline
Ver um Único Post
Antigo 25-01-2011, 07:22 AM   #2 (permalink)
Mazokista
Membro - Veterano
 
Avatar de Mazokista
 
Registrado em: Dec 2009
Posts: 1,335
Agradeceu: 490
Agradecido 803 Vezes em 427 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
Meu Sistema
Rate Designer: Iniciante
Meu Estado:
Enviar mensagem via Windows Live Messenger para Mazokista
Nome Real: Roberto

Inventório de Mazokista

Padrão

Código: [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
Index: /TrunK/*********_CORE/java/config/l2jmods.properties
===================================================================
--- /TrunK/*********_CORE/java/config/l2jmods.properties (revision 101)
+++ /TrunK/*********_CORE/java/config/l2jmods.properties (revision 192)
@@ -133,2 +133,19 @@
 # no ";" at the start or end
 TvTEventDoorsCloseOpenonstartEnd =
+
+# --------------------------------------------------------------------------- 
+# 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
Index: /TrunK/*********_CORE/java/net/sf/l2j/Config.java
===================================================================
--- /TrunK/*********_CORE/java/net/sf/l2j/Config.java (revision 183)
+++ /TrunK/*********_CORE/java/net/sf/l2j/Config.java (revision 192)
@@ -834,4 +834,9 @@
     public static byte    TVT_EVENT_MAX_LVL;
 
+        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;
+
     /** L2JMOD Wedding system  */
     public static boolean L2JMOD_ALLOW_WEDDING;
@@ -1984,4 +1989,8 @@
                 TVT_EVENT_PARTICIPATION_NPC_ID         = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationNpcId", "0"));
 
+               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 Wedding system  */
                 L2JMOD_ALLOW_WEDDING                    = Boolean.valueOf(L2JModSettings.getProperty("AllowWedding", "False"));
Index: /TrunK/*********_CORE/java/net/sf/l2j/gameserver/clientpackets/Logout.java
===================================================================
--- /TrunK/*********_CORE/java/net/sf/l2j/gameserver/clientpackets/Logout.java (revision 56)
+++ /TrunK/*********_CORE/java/net/sf/l2j/gameserver/clientpackets/Logout.java (revision 192)
@@ -107,4 +107,10 @@
 
                TvTEvent.onLogout(player);
+               if ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) 
+                                || (player.isInCraftMode() && Config.OFFLINE_CRAFT_ENABLE)) 
+                { 
+                        player.closeNetConnection(); 
+                        return; 
+                }
                RegionBBSManager.getInstance().changeCommunityBoard();
 
Index: /TrunK/*********_CORE/java/net/sf/l2j/gameserver/network/L2GameClient.java
===================================================================
--- /TrunK/*********_CORE/java/net/sf/l2j/gameserver/network/L2GameClient.java (revision 110)
+++ /TrunK/*********_CORE/java/net/sf/l2j/gameserver/network/L2GameClient.java (revision 192)
@@ -40,4 +40,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.serverpackets.L2GameServerPacket;
 import net.sf.l2j.gameserver.serverpackets.UserInfo;
@@ -543,6 +544,23 @@
 
                    L2PcInstance player = L2GameClient.this.getActiveChar();
-                               if (player != null)  // this should only happen on connection loss
+                               if (player != null)
                                {
+
+                               if (!player.isInOlympiadMode() 
+                                                        && !player.isFestivalParticipant() 
+                                                        && !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; 
+                                                } 
+                                        } 
 
                        // we store all data from players who are disconnected while in an event in order to restore it in the next login
Index: /TrunK/*********_CORE/java/net/sf/l2j/gameserver/model/L2ClanMember.java
===================================================================
--- /TrunK/*********_CORE/java/net/sf/l2j/gameserver/model/L2ClanMember.java (revision 56)
+++ /TrunK/*********_CORE/java/net/sf/l2j/gameserver/model/L2ClanMember.java (revision 192)
@@ -121,5 +121,10 @@
        public boolean isOnline()
        {
-               return _player != null;
+               if (_player == null) 
+                        return false; 
+                if (_player.getClient() == null) 
+                        return false; 
+ 
+                return true;
        }

Mazokista está offline   Responder com Citação
 

Search Engine Optimization by vBSEO 3.3.0