So here I have one OFFLINE petition.. how does it works? if there is no gms on the list or online , the petition msg will be send into email of the choosen char.
I made it working for my rev , and fixed few bugs. I have only 2 small problems now.. I want to add Config on this system , to send the mail in more than 1 char.. Is this possible? and if Yes what type of Config will do the proper work? public static String ?
And my other problem is , If you register on /gmlist ( list on by admin panel ) After you cant be removed from list xD LIST OFF from admin panel not working after my edits to make it work with offline and mail :D
If gm restart , remove by list is working automatic like it should
/*
* 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.l2jserver.gameserver.network.clientpackets;
import com.l2jserver.Config;
import com.l2jserver.gameserver.GmListTable;
import com.l2jserver.gameserver.instancemanager.PetitionManager;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
import com.l2jserver.gameserver.datatables.CharNameTable;
import com.l2jserver.gameserver.idfactory.IdFactory;
import com.l2jserver.gameserver.instancemanager.MailManager;
import com.l2jserver.gameserver.model.entity.Message;
/**
* <p>Format: (c) Sd
* <ul>
* <li>S: content</li>
* <li>d: type</li>
* </ul></p>
* @author -Wooden-, TempyIncursion
*
*/
public final class RequestPetition extends L2GameClientPacket
{
private static final String _C__7F_RequestPetition = "[C] 7F RequestPetition";
//private static Logger _log = Logger.getLogger(RequestPetition.class.getName());
private String _content;
private int _type; // 1 = on : 0 = off;
/*
* SL2 ADDON: v0.3349 -- true=if no GM online, petition will be sent to specified character as mail
* (for him to be able to read it next logon...)
*/
private static boolean _SEND_MAIL_IF_NO_GM_FOR_PETITION = Config.OFFLINE_PETITION_ENABLE;
private static boolean _SEND_MAIL_ONLY_WHEN_NO_GM_ONLINE = false; //-- false=will send mail even when GM is on, just not on GM LIST (available for petitioning)
private static String _MAIL_PETITION_RECEIPT = "TESTTEST";
private static int _MAIL_PETITION_RECEIPT_ID = CharNameTable.getInstance().getIdByName(_MAIL_PETITION_RECEIPT);
@Override
protected void readImpl()
{
_content = readS();
_type = readD();
}
@Override
protected void runImpl()
{
L2PcInstance activeChar = getClient().getActiveChar();
if (activeChar == null)
return;
if (!GmListTable.getInstance().isGmOnline(false))
{
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NO_GM_PROVIDING_SERVICE_NOW));
if (!_SEND_MAIL_IF_NO_GM_FOR_PETITION && _MAIL_PETITION_RECEIPT_ID < 1)
return;
}
if (!PetitionManager.getInstance().isPetitioningAllowed())
{
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.GAME_CLIENT_UNABLE_TO_CONNECT_TO_PETITION_SERVER));
return;
}
if (PetitionManager.getInstance().isPlayerPetitionPending(activeChar))
{
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ONLY_ONE_ACTIVE_PETITION_AT_TIME));
return;
}
if (PetitionManager.getInstance().getPendingPetitionCount() == Config.MAX_PETITIONS_PENDING)
{
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.PETITION_SYSTEM_CURRENT_UNAVAILABLE));
return;
}
int totalPetitions = PetitionManager.getInstance().getPlayerTotalPetitionCount(activeChar) + 1;
if (totalPetitions > Config.MAX_PETITIONS_PER_PLAYER)
{
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.WE_HAVE_RECEIVED_S1_PETITIONS_TODAY);
sm.addNumber(totalPetitions);
activeChar.sendPacket(sm);
sm = null;
return;
}
if (_content.length() > 255)
{
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.PETITION_MAX_CHARS_255));
return;
}
if (!GmListTable.getInstance().isGmOnline(false))
{
// activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NO_GM_PROVIDING_SERVICE_NOW));
activeChar.sendPacket(new CreatureSay(1, Say2.PARTY, "Petition", "There are no GM's Online or on Gmlist!"));
activeChar.sendPacket(new CreatureSay(1, Say2.PARTY, "Petition", "Initializing OFFLINE Pettition System!"));
if (!_SEND_MAIL_IF_NO_GM_FOR_PETITION || (_SEND_MAIL_IF_NO_GM_FOR_PETITION && _MAIL_PETITION_RECEIPT_ID < 1))
return;
else
{
activeChar.sendMessage("=> YOUR PETITION MESSAGE WILL BE SENT TO ADMIN BY E-MAIL INSTEAD <=");
activeChar.sendMessage("Wait patiently for an answer, and always remember to describe petition/problem/question/matter of petition.");
//SEND SYSTEM MAIL (WITH PETITION MSG) TO DEFINED ADMIN/GM ACCOUNT
if (_SEND_MAIL_ONLY_WHEN_NO_GM_ONLINE && GmListTable.getInstance().isGmOnline(true))
{
activeChar.sendMessage("ERROR: You are not allowed to send offline petition.");
return;
}
int petitionId = IdFactory.getInstance().getNextId();
Message petitionMsg = new Message(activeChar.getObjectId(), _MAIL_PETITION_RECEIPT_ID, false, "[P: " + PetitionManager.getPetitionTypeString(_type) + "] " + petitionId, _content, 0);
activeChar.sendMessage("OFFLINE PETITION: Your petition is now going to be send with unique Petition ID: " + petitionId);
MailManager.getInstance().sendMessage(petitionMsg);
return;
}
}
int petitionId = PetitionManager.getInstance().submitPetition(activeChar, _content, _type);
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.PETITION_ACCEPTED_RECENT_NO_S1);
sm.addNumber(petitionId);
activeChar.sendPacket(sm);
sm = SystemMessage.getSystemMessage(SystemMessageId.SUBMITTED_YOU_S1_TH_PETITION_S2_LEFT);
sm.addNumber(totalPetitions);
sm.addNumber(Config.MAX_PETITIONS_PER_PLAYER - totalPetitions);
activeChar.sendPacket(sm);
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_PETITION_ON_WAITING_LIST);
sm.addNumber(PetitionManager.getInstance().getPendingPetitionCount());
activeChar.sendPacket(sm);
sm = null;
}
/* (non-Javadoc)
* @see com.l2jserver.gameserver.clientpackets.ClientBasePacket#getType()
*/
@Override
public String getType()
{
return _C__7F_RequestPetition;
}
}
I tryed This about configs
public static List<Integer> GM_NAMES_OFFLINE_PETITION = new ArrayList<Integer>();
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Hello. You may encounter the Push item fail error when trying to pick up an item dropped on the ground by a mob.
or
You can throw something out of your inventory and pick it up again, several times.
Probably this is a quantum dependency) I don't understand at what point this happens, sometimes two items one after another experience push item errors, and sometimes I don't have enough thousands of attempts to repeat this trick)
In any case, this is just a visual error and after the relog, the item appears in the inventory. I think first i need to disconnect the extender and check it on a bare server. I still need time to check this, maybe it's not even about the autoloot function.
https://youtu.be/6mcfmdImofE
-----------
In general, I would like to thank our wonderful Emca Eressea for her deep knowledge in programming and reverse engineering. And for the fact that her work is open to everyone, this is very amazing, and incredibly valuable.
Question
ČυяŞŀŅğ
So here I have one OFFLINE petition.. how does it works? if there is no gms on the list or online , the petition msg will be send into email of the choosen char.
I made it working for my rev , and fixed few bugs. I have only 2 small problems now.. I want to add Config on this system , to send the mail in more than 1 char.. Is this possible? and if Yes what type of Config will do the proper work? public static String ?
And my other problem is , If you register on /gmlist ( list on by admin panel ) After you cant be removed from list xD LIST OFF from admin panel not working after my edits to make it work with offline and mail :D
If gm restart , remove by list is working automatic like it should
I tryed This about configs
and on take config
But i have error on
The method getIdByName(String) in the type CharNameTable is not applicable for the arguments (List<Integer>)
any idea? :/
Edited by ČυяŞŀŅğ2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.