Помощь - Поиск - Пользователи - Календарь
Полная версия этой страницы: Автолут
Форум мира Dark World > Lineage2 > Основной
IIIuJIoB
Как сказал Саня Бодрячок - серверу нужен автолут (авто подбор дропа с мобов)

10 тои,Варка,кетра,Фг,Бс, Фог,ВОА,Ит, и тд и тп. - завалены мусором ибо нубам не добратся что бы собрать - а старым игрокам важна только Експа))

Вадер зделай пожалуйсто автолут,намного урежет лаги,и не надо будет рестарты мутить через каждую неделю!!!
MOHAX
Я с Шиловым согласен.....Автолут не помешает.
Vader
Автолута нет в текущем экстендере, было бы - давно бы включили.
IIIuJIoB
А можно например что бы в часиков 5 утра серв рестарт делал?
Vader
К сожалению нет.
Кстати, сервер от дропа не лагает, лагает ваш клиент, когда прогружает 100500 итемов на земле. У кого канал толстый, это никак не должно влиять.
Write падаван
А оффторг тоже не реален? И сделайте возможность выкидывать на землю стопковые вещи .
IIIuJIoB
Дроп не поставят ибо Адепт много горя серверу натворил с дюпом
IIIuJIoB
Есть вариант поорать в хиро что в локации надо пылелсос) бывает прилетают - а бывает Вар летит)))))
LeadAcid
Цитата(Write падаван @ 3.2.2012, 13:30) *
А оффторг тоже не реален? И сделайте возможность выкидывать на землю стопковые вещи .


Отвечали же уже и через Дика в том числе: автолута не будет, запрет дропать споки не с потолка.
pindosik
читал где-то на форуме, что офф торговля реализуется довольно таки просто......
Bastardo
Цитата(pindosik @ 3.2.2012, 17:15) *
читал где-то на форуме, что офф торговля реализуется довольно таки просто......

как и фикс дюпа без запрета дропа стопковых вещей smile.gif
LeadAcid
Цитата(Bastardo @ 3.2.2012, 16:55) *
как и фикс дюпа без запрета дропа стопковых вещей smile.gif


Ну так найдите и решение и покажите.
"Читал гдето" != "сделал рабочее решение"
pindosik
Сообщение # 1
На многих серверах сталкивался с такой "примочкой" как оф-лайн трейд и настройки для персоонажа, рандомные квесты
всё через текстовые команды в чате
.offline - сидя на торге выключает клиент оставляя торговать чара
.cfg - настройки (Блок опыта и что то еще, вроде даже выбор языка описания скилов и предметов Русс и Англ)
в общем как это можно сделать ?
Заранее спасибо.

Сообщение # 2
Реализуеться все в ядре. Вот тебе оффлайн трейд:


Index: src/main/java/com/l2jfree/gameserver/model/actor/instance/L2PcInstance.java
================================================== =================
--- src/main/java/com/l2jfree/gameserver/model/actor/instance/L2PcInstance.java (revision 334)
+++ src/main/java/com/l2jfree/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -596,7 +596,10 @@
private L2ItemInstance _activeEnchantAttrItem = null;

private boolean _isOnline = false;
-
+
+ //offline trading
+ private boolean _isOfflineTrade = false;
+
protected boolean _inventoryDisable = false;

protected Map<Integer, L2CubicInstance> _cubics = new FastMap<Integer, L2CubicInstance>().setShared(true);
@@ -11368,6 +11371,21 @@
if (inObserverMode())
getPosition().setXYZ(_obsX, _obsY, _obsZ);

+ if (isOfflineTrade())
+ {
+ try
+ {
+ stopAllTimers();
+ }
+ catch (Exception e)
+ {
+ _log.fatal( "deleteMe()", e);
+ }
+ if(_log.isDebugEnabled())
+ _log.info("player="+getName()+" stay live on trade, client offline");
+ return;
+ }
+
// Set the online Flag to True or False and update the characters table of the database with online status and lastAccess (called when login and logout)
try
{
@@ -13944,4 +13962,68 @@
e.printStackTrace(); }
}
}
+ public boolean isOfflineTrade() {
+ return _isOfflineTrade;
+ }
+
+ /** Warning: Only sets boolean, does not do the process to change char to an offline trader - see doOffline() for that **/
+ public void setIsOfflineTrade(boolean newValue) {
+ _isOfflineTrade = newValue;
+ }
+
+ public boolean canStartOfflineTrade() {
+ if (isOfflineTrade())
+ return false;
+ if ((getPrivateStoreType() == 1
+ || getPrivateStoreType() == 3
+ || (getPrivateStoreType() == 5 && Config.OFFLINETRADE_ALLOW_CRAFT))
+ && isInsidePeaceZone(this)
+ )
+ {
+ //we're good, just continue. written like this b/c if is less confusing and we may want to check more conditions in the future
+ } else {
+ return false;
+ }
+ return true;
+
+ }
+
+ public final boolean doOffline()
+ {
+ //check conditions
+ synchronized (this) {
+ if (!canStartOfflineTrade())
+ return false;
+ setIsOfflineTrade(true);
+ }
+
+ try
+ {
+ if (Config.OFFLINETRADE_ALLOW_COLORNAME)
+ getAppearance().setNameColor(Config.OFFLINETRADE_C OLORNAME);
+ L2GameClient.saveCharToDisk(this);
+ sendMessage("Offline mode ON, goodbye.");
+
+ ThreadPoolManager.getInstance().schedule(new Runnable() {
+ public void run()
+ {
+ sendPacket(LeaveWorld.STATIC_PACKET);
+ deleteMe();
+ closeNetConnection();
+ getClient().setActiveChar(null);
+ }
+ }, 4000);
+
+ /*
+ sendPacket(LeaveWorld.STATIC_PACKET);
+ deleteMe();
+ //Thread.sleep(500);
+ //closeNetConnection();
+ getClient().setActiveChar(null);
+ //setClient(null);
+ */
+ }
+ catch (Exception e) {}
+ return true;
+ }
}
\ No newline at end of file
Index: src/main/java/com/l2jfree/gameserver/model/L2Character.java
================================================== =================
--- src/main/java/com/l2jfree/gameserver/model/L2Character.java (revision 334)
+++ src/main/java/com/l2jfree/gameserver/model/L2Character.java (working copy)
@@ -845,6 +845,12 @@

boolean transformed = false;

+ if (Config.OFFLINETRADE_PROTECT && target instanceof L2PcInstance && ((L2PcInstance)target).isOfflineTrade())
+ {
+ sendPacket(ActionFailed.STATIC_PACKET);
+ return;
+ }
+
if (this instanceof L2PcInstance)
{
if (((L2PcInstance) this).inObserverMode())
Index: config/other.properties
================================================== =================
--- config/other.properties (revision 334)
+++ config/other.properties (working copy)
@@ -160,6 +160,33 @@
BankingGoldbarCount = 1
# This is the amount of Adena someone will get when they do the .withdraw command, and also the same amount they will lose when they do .deposit
BankingAdenaCount = 500000000
+
+# ---------------------------------------
+# Section: offline trade
+# ---------------------------------------
+# Allow offline live characters on buy or sell trade
+# use model: sit to Buy or Sell and command .offline
+# Default = false for standard L2J
+AllowOfflineTrade = True
+
+# For private manufacture mode,
+# for use need AllowOfflineTrade = true !!!
+# Default false
+AllowOfflineCraft = True
+
+# AllowColorName characters in offline mode
+# Default = false
+AllowOfflineTradeColorName = False
+
+# Color charcters name in offline mode
+# Default = 999999 - gray
+OfflineTradeColorName = 999999
+
+# Protect offline traders
+# if true - any characters not may be phisical attack offline trader
+# Default = false
+AllowOfflineTradeProtect = true
+
#------------------------------------------
# Cruma Tower Config
#------------------------------------------
Index: src/main/java/com/l2jfree/gameserver/Shutdown.java
================================================== =================
--- src/main/java/com/l2jfree/gameserver/Shutdown.java (revision 334)
+++ src/main/java/com/l2jfree/gameserver/Shutdown.java (working copy)
@@ -473,6 +473,9 @@

// save player's stats and effects
L2GameClient.saveCharToDisk(player, true);
+ // Offline Trade
+ player.setIsOfflineTrade(false);
+ // Offline Trade
player.deleteMe();

// close server
Index: src/main/java/com/l2jfree/gameserver/handler/VoicedCommandHandler.java
================================================== =================
--- src/main/java/com/l2jfree/gameserver/handler/VoicedCommandHandler.java (revision 334)
+++ src/main/java/com/l2jfree/gameserver/handler/VoicedCommandHandler.java (working copy)
@@ -59,6 +59,10 @@
registerVoicedCommandHandler(new Wedding());

}
+ if (Config.OFFLINETRADE_ALLOW)
+ {
+ registerVoicedCommandHandler(new Offline());
+ }
_log.info("VoicedCommandHandler: Loaded " + _datatable.size() + " handlers.");
}

Index: src/main/java/com/l2jfree/gameserver/model/###.java
================================================== =================
--- src/main/java/com/l2jfree/gameserver/model/###.java (revision 334)
+++ src/main/java/com/l2jfree/gameserver/model/###.java (working copy)
@@ -328,19 +328,28 @@
L2PcInstance tmp = _allPlayers.get(player.getName().toLowerCase());
if (tmp != null && tmp != player)
{
- _log.warn("Duplicate character!? Closing both characters (" + player.getName() + ")");
- L2GameClient client = player.getClient();
- L2GameClient.saveCharToDisk(player); // Store character
- player.deleteMe();
- client.setActiveChar(null); // prevent deleteMe from being called a second time on disconnection
+ if (tmp.isOfflineTrade()) {
+
+ _log.warn("Duplicate character!? -- offline mode -- Closing offline character (" + player.getName() + ")");

- client = tmp.getClient();
- L2GameClient.saveCharToDisk(tmp, true); // Store character and items
- tmp.deleteMe();
- if(client!=null)
+ L2GameClient.saveCharToDisk(tmp, true); // Store character and items
+ tmp.deleteMe();
+ } else {
+ _log.warn("Duplicate character!? Closing both characters (" + player.getName() + ")");
+ L2GameClient client = player.getClient();
+ L2GameClient.saveCharToDisk(player); // Store character
+ //player.setIsOfflineTrade(false);
+ player.deleteMe();
client.setActiveChar(null); // prevent deleteMe from being called a second time on disconnection
-
- return;
+
+ client = tmp.getClient();
+ L2GameClient.saveCharToDisk(tmp, true); // Store character and items
+ tmp.deleteMe();
+ if(client!=null)
+ client.setActiveChar(null); // prevent deleteMe from being called a second time on disconnection
+
+ return;
+ }
}

_allPlayers.put(player.getName().toLowerCase(), player);
Index: src/main/java/com/l2jfree/gameserver/handler/admincommandhandlers/AdminKick.java
================================================== =================
--- src/main/java/com/l2jfree/gameserver/handler/admincommandhandlers/AdminKick.java (revision 334)
+++ src/main/java/com/l2jfree/gameserver/handler/admincommandhandlers/AdminKick.java (working copy)
@@ -73,6 +73,7 @@
{
L2GameClient client = player.getClient();
L2GameClient.saveCharToDisk(player, true); // Store character
+ player.setIsOfflineTrade(false);
player.deleteMe();
// prevent deleteMe from being called a second time on disconnection
client.setActiveChar(null);
Index: src/main/java/com/l2jfree/Config.java
================================================== =================
--- src/main/java/com/l2jfree/Config.java (revision 334)
+++ src/main/java/com/l2jfree/Config.java (working copy)
@@ -855,6 +855,12 @@
public static int BANKING_SYSTEM_GOLDBARS;
public static int BANKING_SYSTEM_ADENA;

+ public static boolean OFFLINETRADE_ALLOW;
+ public static boolean OFFLINETRADE_ALLOW_CRAFT;
+ public static boolean OFFLINETRADE_ALLOW_COLORNAME;
+ public static int OFFLINETRADE_COLORNAME;
+ public static boolean OFFLINETRADE_PROTECT;
+
// ************************************************** *****************************************
// ************************************************** *****************************************
public static void loadOtherConfig()
@@ -971,6 +977,14 @@
BANKING_SYSTEM_ENABLED = Boolean.parseBoolean(otherSettings.getProperty("Ba nkingEnabled", "false"));
BANKING_SYSTEM_GOLDBARS = Integer.parseInt(otherSettings.getProperty("Bankin gGoldbarCount", "1"));
BANKING_SYSTEM_ADENA = Integer.parseInt(otherSettings.getProperty("Bankin gAdenaCount", "500000000"));
+
+ // offline trade
+ OFFLINETRADE_ALLOW = Boolean.parseBoolean(otherSettings.getProperty("Al lowOfflineTrade", "false"));
+ OFFLINETRADE_ALLOW_CRAFT = Boolean.parseBoolean(otherSettings.getProperty("Al lowOfflineCraft", "true"));
+ OFFLINETRADE_ALLOW_COLORNAME = Boolean.parseBoolean(otherSettings.getProperty("Al lowOfflineTradeColorName", "true"));
+ OFFLINETRADE_COLORNAME = Integer.parseInt(otherSettings.getProperty("Offlin eTradeColorName", "999999"));
+ OFFLINETRADE_PROTECT = Boolean.parseBoolean(otherSettings.getProperty("Al lowOfflineTradeProtect", "true"));
+
}
catch (Exception e)
{
Index: src/main/java/com/l2jfree/gameserver/handler/voicedcommandhandlers/Offline.java
================================================== =================
--- src/main/java/com/l2jfree/gameserver/handler/voicedcommandhandlers/Offline.java (revision 0)
+++ src/main/java/com/l2jfree/gameserver/handler/voicedcommandhandlers/Offline.java (revision 0)
@@ -0,0 +1,52 @@
+/*
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package com.l2jfree.gameserver.handler.voicedcommandhandle rs;
+
+import com.l2jfree.Config;
+import com.l2jfree.gameserver.handler.IVoicedCommandHandl er;
+import com.l2jfree.gameserver.model.actor.instance.L2PcIn stance;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+
+/**
+ * @author evill33t
+ *
+ */
+
+public class Offline implements IVoicedCommandHandler
+{
+ protected static Log _log = LogFactory.getLog(Offline.class);
+ private static final String[] VOICED_COMMANDS = {"offline"};
+
+ public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+ {
+ if (activeChar.canStartOfflineTrade()) {
+ return activeChar.doOffline();
+ }
+ else
+ {
+ activeChar.sendMessage("Must be Buying / Selling / Creating");
+ activeChar.sendMessage("and inside a Peace Zone");
+ return false;
+ }
+ }
+
+ public String[] getVoicedCommandList()
+ {
+ return VOICED_COMMANDS;
+ }
+}
\ No newline at end of file
Index: src/main/java/com/l2jfree/gameserver/handler/admincommandhandlers/AdminBan.java
================================================== =================
--- src/main/java/com/l2jfree/gameserver/handler/admincommandhandlers/AdminBan.java (revision 334)
+++ src/main/java/com/l2jfree/gameserver/handler/admincommandhandlers/AdminBan.java (working copy)
@@ -81,6 +81,7 @@
{
L2GameClient client = plyr.getClient();
L2GameClient.saveCharToDisk(plyr, true); // Store character
+ plyr.setIsOfflineTrade(false);
plyr.deleteMe();
// prevent deleteMe from being called a second time on disconnection
client.setActiveChar(null);
pindosik
зашибись тут на форуме сполер работает:)
Vader
Зачем тут постить куски кода для ява сервера? На ДВ не ява.
pindosik
извините извините.... я в этом деле особо не силён и по куску кода беглым взглядом определить немогу для явы он или нет
Bastardo
Цитата(LeadAcid @ 3.2.2012, 17:18) *
Ну так найдите и решение и покажите.
"Читал гдето" != "сделал рабочее решение"

а оно нам надо?)
GamBit
тема закрыта =)))) вы все какашки =)
Для просмотра полной версии этой страницы, пожалуйста, пройдите по ссылке.
Форум IP.Board © 2001-2024 IPS, Inc.