Jump to content

Pws Na Perasete Voicedcommandhandler Se Acis!


Recommended Posts

Geia sas paidia...

Ton teleutaio kairo pou arxisa na asxoloumai panw sto aCis sto free ida pws dn eixe VoicedCommandHandler k eprepe na to perasw monos mou..

mias k exw dei3ei se polla atoma pws na to perasoun k ti code akrivws na valoun eipa na kanw ena guide gia na iparxei k na to vriskoun osa atoma theloun na valoun..

to VoicedCommandHandler einai ena java file sto opoio kanoume register ta commands pou vazoume sto pack mas(auto paei gia ta newbies pou isws dn 3eroun ti einai)

 

Loipon as arxisoume

gia arxi pame sto gameserver.java k kanoume insert ta parakatw

 

import net.sf.l2j.gameserver.handler.ItemHandler;
import net.sf.l2j.gameserver.handler.SkillHandler;
import net.sf.l2j.gameserver.handler.UserCommandHandler;
+ import net.sf.l2j.gameserver.handler.VoicedCommandHandler;
+ import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.idfactory.IdFactory;
import net.sf.l2j.gameserver.instancemanager.AuctionManager;
import net.sf.l2j.gameserver.instancemanager.BoatManager;
...

        _log.config("ItemHandler: Loaded " + ItemHandler.getInstance().size() + " handlers.");
        _log.config("SkillHandler: Loaded " + SkillHandler.getInstance().size() + " handlers.");
        _log.config("UserCommandHandler: Loaded " + UserCommandHandler.getInstance().size() + " handlers."); 
        + _log.config("VoicedCommandHandler: Loaded " + VoicedCommandHandler.getInstance().size() + " handlers.");

        if (Config.ALLOW_WEDDING)


            CoupleManager.getInstance();

 

Meta pame sto gameserver/handler/chathandlers/ChatAll.java

k vazoume ta parakatw

 

Index: ChatAll.java
===================================================================
--- ChatAll.java    (revision 7)
+++ ChatAll.java    (revision 8)
@@ -1,4 +1,5 @@
/*
+ /*
  * 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
@@ -14,7 +15,12 @@
  */
package net.sf.l2j.gameserver.handler.chathandlers;

+import java.util.StringTokenizer;
+
+import net.sf.l2j.Config;
import net.sf.l2j.gameserver.handler.IChatHandler;
+import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
+import net.sf.l2j.gameserver.handler.VoicedCommandHandler;
import net.sf.l2j.gameserver.model.BlockList;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
@@ -37,15 +43,52 @@
     @Override
     public void handleChat(int type, L2PcInstance activeChar, String params, String text)
     {
-        CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
-        
-        for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers())
+        boolean vcd_used = false;
+        if (text.startsWith("."))
         {
-            if (activeChar.isInsideRadius(player, 1250, false, true) && !BlockList.isBlocked(player, activeChar))
-                player.sendPacket(cs);
+            StringTokenizer st = new StringTokenizer(text);
+            IVoicedCommandHandler vch;
+            String command = "";
+            
+            if (st.countTokens() > 1)
+            {
+                command = st.nextToken().substring(1);
+                params = text.substring(command.length() + 2);
+                vch = VoicedCommandHandler.getInstance().getVoicedCommandHandler(command);
+            }
+            else
+            {
+                command = text.substring(1);
+                if (Config.DEBUG)
+                    System.out.println("Command: " + command);
+                vch = VoicedCommandHandler.getInstance().getVoicedCommandHandler(command);
+            }
+                                            
+            if (vch != null)
+            {
+                vch.useVoicedCommand(command, activeChar, command);
+                vcd_used = true;
+            }
+            else
+            {
+                if (Config.DEBUG)
+                    System.out.println("No handler registered for bypass '" + command + "'");
+                vcd_used = false;
+            }
         }
-        
-        activeChar.sendPacket(cs);
+                                        
+        if (!vcd_used)
+        {
+            CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text);
+            
+            for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers())
+            {
+                if (activeChar.isInsideRadius(player, 1250, false, true) && !BlockList.isBlocked(player, activeChar))
+                    player.sendPacket(cs);
+            }
+            
+            activeChar.sendPacket(cs);
+        }
     }
     
     /**

 

Meta pame sto gameserver/handler k kanoume new file onomati IVoicedCommandHandler

k vazoume ton parakatw kodika

 

/*
* 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 net.sf.l2j.gameserver.handler;

import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

public interface IVoicedCommandHandler
{

/**
     * this is the worker method that is called when someone uses an admin command.
     * @param activeChar
     * @param command
     * @param target
     * @return command success
     */

    public boolean useVoicedCommand(String command, L2PcInstance activeChar);

    public String[] getVoicedCommandList();
}

 

Meta pame pali sto gameserver/handler k kanoume new file me onoma VoicedCommandHandler

k vazoume to parakatw kodika

 

/*
* 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 net.sf.l2j.gameserver.handler;

import gnu.trove.map.hash.TIntObjectHashMap;

import java.util.logging.Logger;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.MakeMeHero;
public class VoicedCommandHandler
{
    private static Logger _log = Logger.getLogger(VoicedCommandHandler.class.getName());
    private final TIntObjectHashMap<IVoicedCommandHandler> _datatable;

    public static VoicedCommandHandler getInstance()
    {
        return SingletonHolder._instance;
    }

    protected VoicedCommandHandler()
    {
        _datatable = new TIntObjectHashMap<>();


    }

    public void registerVoicedCommandHandler(IVoicedCommandHandler handler)
    {
        String[] ids = handler.getVoicedCommandList();
        for (String id : ids)
        {
            if (Config.DEBUG)
                _log.fine("Adding handler for command " + id);
            _datatable.put(id.hashCode(), handler);
        }
    }

    public IVoicedCommandHandler getVoicedCommandHandler(String voicedCommand)
    {
        String command = voicedCommand;

        if (voicedCommand.indexOf(" ") != -1)
            command = voicedCommand.substring(0, voicedCommand.indexOf(" "));

        if (Config.DEBUG)
            _log.fine("getting handler for command: " + command + " -> " + (_datatable.get(command.hashCode()) != null));
        return _datatable.get(command.hashCode());
    }

    /**
     * @return
     */
    public int size()
    {
        return _datatable.size();
    }

    private static class SingletonHolder
    {
        protected static final VoicedCommandHandler _instance = new VoicedCommandHandler();
    }
}

 

K telos kanoume ena neo fakelo sto handler ston opoio tha vazoume ta commands mas..

 

P.S. an sas vgazei error sto ChatAll.java k sigkekrimena edw

for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers())

 

aplws peraste sto gameserver/mode/actor/knowlist/CharKnowList.java auto edw

public final Collection<L2PcInstance> getKnownPlayers()
{
	return _knownPlayers.values();
}

 

 

Dn 3erw an xrisimopoiw ta swsta prefix k an eimai sto swsto section

gia oti lathos iparxei diorthoste me k gia oti problem kante post k tha sas voithisw:)

Link to comment
Share on other sites

Δεν εχεις καπου λαθος. Αν και νομιζω οτι μαλλον θα το πανε στο [L2J Server] με prefix [cοde] αλλα τεσπα. :)

Στο θεμα μας. Νομιζω οτι υπαρχει κατι αναλογο στο english section αλλα καλα ειναι να υπαρχει κι εδω .. :P

Μπραβο για το guide σου ..

Link to comment
Share on other sites

Δεν εχεις καπου λαθος. Αν και νομιζω οτι μαλλον θα το πανε στο [L2J Server] με prefix [cοde] αλλα τεσπα. :)

Στο θεμα μας. Νομιζω οτι υπαρχει κατι αναλογο στο english section αλλα καλα ειναι να υπαρχει κι εδω .. :P

Μπραβο για το guide σου ..

Ok tha to psa3w..gt skeftomoun na to kanw k sta agglika

tsp se euxaristw file :D

Link to comment
Share on other sites

  • 4 months later...
  • 4 months later...

Έχω αυτά τα Errors εγώ..

 

http://prntscr.com/332uxe

 

http://prntscr.com/332unf

to prwto den einai error alla proeidwpoieisi

gia ekei pou exeis to error svistw kai grapse auto

 

 

for (L2PcInstance player : activeChar.getKnownList().getKnownType(L2PcInstance.class))
Link to comment
Share on other sites

  • 3 months later...

full axristo code mesa opos ola ta patch autou tou typou

 

oute gia code tis poutsas den eisai re malaka, trava ftiakse kana config ston frozen

Link to comment
Share on other sites

oute gia code tis poutsas den eisai re malaka, trava ftiakse kana config ston frozen

enw esi eisai gia code tis poutsas malaka pane ftiakse esi kana config sto frozen

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Posts

    • just a few things normally the 50/50 means first 50 is collateral in case you decide to go back in your agreement, for "closing" the job, using his time etc... (meaning non-refundable)   the fact that you had to pay for this extra work any amount of money is a joke..   the poor communication from ave side is known nothing new here i guess you knew that already, and no i dont mean his classic behaviour, a professional discusses the timeframes.   there are many (even free) alternatives for updaters and is cheaper to hire somebody to slap your logo in a background..   Note: the video and the discussion made my day both dont know how client works while working on it (for metaman i get it he pays for the service he dont know how it works)   but ave was funny as fuck "i am not client dev either" 
    • You should be thankfull that he even gave u back 100, just because u cant wait, u expect full refund while that guy already almost finished, i think ave is right, i worked with him, no issues ofc delay but thats life 😁  
    • *¶¶¶+2349158681268¶¶¶ Welcome to the home of wealth and fame.*        Many have seek for wealth and it’s quiet a thing of pity +2349158681268 that some do so in wrong places which made it doubtful of the true source and it is at this juncture that i approach you with the right source of wealth which you have really seek for. ZERUZANDAH BROTHERHOOD OCCULT is an association of those that has been blessed by Lord Lucifer zeruzandah the great and have decided to educate the masses on the possible ways of acquiring the wealth, power,protection fame and every other thing you could think of without human sacrifice. Gone are the days when human blood are required for sacrifice here at zeruzandah Brotherhood, human blood sacrifice has been abolished because the money you are seeking for should be used to help and sponsor your loved ones but you have to have it at the back of your mind that there is a very great sacrifice which you must pay to pierce the heart of the spiritual world so that you can be blessed here on human Earth and that sacrifice will be according to what zeruzandah wants you to do which the Grandmaster of this temple will tell you when you’ve been in contact with him. Here at zeruzandah Brotherhood we only demand some sacrificial items and some special animal blood for sacrifice in order to please the Lord Lucifer to bless you here on Earth. If anyone from anywhere tells you that we accept anything money from you in order for you to be initiated into this Brotherhood, inform the TEMPLE GRANDMASTER +2349158681268 zeruzandah Brotherhood do not accept any money from you except you are the one to fund your sacrificial items. Contact the temple Grandmaster at +2349158681268   Spiritual grandmaster of ZERUZANDAH BROTHERHOOD +2349158681268   I WANT TO JOIN SECRET OCCULT FOR MONEY RITUALS IN NIGERIA OR GHANA TO BE RICH AND TO MAKE MONEY, WITH NO HUMAN SACRIFICE OR BLOODSHED CALL +2349158681268 FOR YOUR BUSINESS SUCCESS TO WIN ELECTIONS TO BE FAMOUS AND POWERFUL,   The ZERUZANDAH Brotherhood is a spiritual fraternal society whose aims are the cultivation of Inner Power through the study and practice of esoteric arts for the improvement of body, mind and spirit.   It unites its members in brotherhood and in the quest for wisdom, successful living and finding one’s purpose in life. It has no secret agenda .While it is a deeply spiritual organization, it promote a particular religion or belief.   The Brotherhood transmits an esoteric tradition spanning thousands of years, with a universal vision born in the East and embracing the best of the West in the quest to return to the ancient and original Tao or Source of all wisdom.   WELCOME TO ZERUZANDAH BROTHERHOOD,   The Club of the Rich and Famous; is the world oldest and largest fraternity made up of 3 Millions Members. We are one Family under one father who is the Supreme Being. In ZERUZANDAH OCCULT Brotherhood we believe that we were born in paradise and no member should struggle in this world. Hence all our new members are given Money, Wealth,Fame , Power ETC.   Fear and anxiety has drawn so many people back to unfulfilled dreams and make their quest for wealth and power shambled, it is thing of fact that money ritual Occult is not and can never be a sin because Occult is still a religion despite what ever others are thinking and zeruzandah Brotherhood is here to give life to that dead hope of acquiring your desired wealth,fame and power without human sacrifice. Contact the Spiritual Grandmaster of ZERUZANDAH Brotherhood now at +2349158681268   The wealth of this life goes to those who deserve and desire it by their decision of breaking the wicked chain of poverty. It is actually a thing of fact that poverty is real and it’s not your fault that it exists but however will be your fault and greatest mistake if you allow poverty to exist in your life because of fear. Only the brave makes the move to liberate himself from humiliating nature of poverty…   +2349158681268   You can be rich, wealthy, famous etc without human blood@ZERUZANDAH BROTHERHOOD contact the Spiritual Grandmaster now +2349158681268   The desire to remove the garment of poverty rest on your shoulder and I will advise you do so now by being an initiated member of zeruzandah Brotherhood.   For enquires, contact the Spiritual Grandmaster now@ +2349158681268   The men of the world can only see within the limit of the eye and the things of the spirit are meant for the spirit to see. You can never be that wealthy,rich and famous without controlling the Spiritual wealth and fame that Lucifer the Great Spiritual father offers to those who are humble to him. You have been admiring the wealthy people around you and wish to be so wealthy or more than they do but you are yet to discover the Secret of WEALTH. There so many things known by the rich and the wealthy which the poor don’t know and don’t want to know because of their unnecessary fear. The secret to what you seek is to join a secret occult society.   Call now for enquiries +2349158681268.
    • *¶¶¶+2349158681268¶¶¶ Welcome to the home of wealth and fame.*        Many have seek for wealth and it’s quiet a thing of pity +2349158681268 that some do so in wrong places which made it doubtful of the true source and it is at this juncture that i approach you with the right source of wealth which you have really seek for. ZERUZANDAH BROTHERHOOD OCCULT is an association of those that has been blessed by Lord Lucifer zeruzandah the great and have decided to educate the masses on the possible ways of acquiring the wealth, power,protection fame and every other thing you could think of without human sacrifice. Gone are the days when human blood are required for sacrifice here at zeruzandah Brotherhood, human blood sacrifice has been abolished because the money you are seeking for should be used to help and sponsor your loved ones but you have to have it at the back of your mind that there is a very great sacrifice which you must pay to pierce the heart of the spiritual world so that you can be blessed here on human Earth and that sacrifice will be according to what zeruzandah wants you to do which the Grandmaster of this temple will tell you when you’ve been in contact with him. Here at zeruzandah Brotherhood we only demand some sacrificial items and some special animal blood for sacrifice in order to please the Lord Lucifer to bless you here on Earth. If anyone from anywhere tells you that we accept anything money from you in order for you to be initiated into this Brotherhood, inform the TEMPLE GRANDMASTER +2349158681268 zeruzandah Brotherhood do not accept any money from you except you are the one to fund your sacrificial items. Contact the temple Grandmaster at +2349158681268   Spiritual grandmaster of ZERUZANDAH BROTHERHOOD +2349158681268   I WANT TO JOIN SECRET OCCULT FOR MONEY RITUALS IN NIGERIA OR GHANA TO BE RICH AND TO MAKE MONEY, WITH NO HUMAN SACRIFICE OR BLOODSHED CALL +2349158681268 FOR YOUR BUSINESS SUCCESS TO WIN ELECTIONS TO BE FAMOUS AND POWERFUL,   The ZERUZANDAH Brotherhood is a spiritual fraternal society whose aims are the cultivation of Inner Power through the study and practice of esoteric arts for the improvement of body, mind and spirit.   It unites its members in brotherhood and in the quest for wisdom, successful living and finding one’s purpose in life. It has no secret agenda .While it is a deeply spiritual organization, it promote a particular religion or belief.   The Brotherhood transmits an esoteric tradition spanning thousands of years, with a universal vision born in the East and embracing the best of the West in the quest to return to the ancient and original Tao or Source of all wisdom.   WELCOME TO ZERUZANDAH BROTHERHOOD,   The Club of the Rich and Famous; is the world oldest and largest fraternity made up of 3 Millions Members. We are one Family under one father who is the Supreme Being. In ZERUZANDAH OCCULT Brotherhood we believe that we were born in paradise and no member should struggle in this world. Hence all our new members are given Money, Wealth,Fame , Power ETC.   Fear and anxiety has drawn so many people back to unfulfilled dreams and make their quest for wealth and power shambled, it is thing of fact that money ritual Occult is not and can never be a sin because Occult is still a religion despite what ever others are thinking and zeruzandah Brotherhood is here to give life to that dead hope of acquiring your desired wealth,fame and power without human sacrifice. Contact the Spiritual Grandmaster of ZERUZANDAH Brotherhood now at +2349158681268   The wealth of this life goes to those who deserve and desire it by their decision of breaking the wicked chain of poverty. It is actually a thing of fact that poverty is real and it’s not your fault that it exists but however will be your fault and greatest mistake if you allow poverty to exist in your life because of fear. Only the brave makes the move to liberate himself from humiliating nature of poverty…   +2349158681268   You can be rich, wealthy, famous etc without human blood@ZERUZANDAH BROTHERHOOD contact the Spiritual Grandmaster now +2349158681268   The desire to remove the garment of poverty rest on your shoulder and I will advise you do so now by being an initiated member of zeruzandah Brotherhood.   For enquires, contact the Spiritual Grandmaster now@ +2349158681268   The men of the world can only see within the limit of the eye and the things of the spirit are meant for the spirit to see. You can never be that wealthy,rich and famous without controlling the Spiritual wealth and fame that Lucifer the Great Spiritual father offers to those who are humble to him. You have been admiring the wealthy people around you and wish to be so wealthy or more than they do but you are yet to discover the Secret of WEALTH. There so many things known by the rich and the wealthy which the poor don’t know and don’t want to know because of their unnecessary fear. The secret to what you seek is to join a secret occult society.   Call now for enquiries +2349158681268.
  • Topics

×
×
  • Create New...