Jump to content
  • 0

[Question] Clan Leader's Message


L2KingWorld

Question

Recommended Posts

  • 0

Dεbian μήπως το έφτιαξες?

Γιατι είπες θα το είχες έτοιμο χθες.

είμαι πολύ απασχολημένος.. όταν μπορέσω θα το κάνω.
Link to comment
Share on other sites

  • 0

είμαι πολύ απασχολημένος.. όταν μπορέσω θα το κάνω.

Αυτό που λες τώρα γιατί δεν το είπες χθές?

Εσυ είπες οτι χθες θα το έχετε έτοιμο και τώρα λες άλλα?

Τέλος πάντον...

Link to comment
Share on other sites

  • 0

Ευχαριστώ πολύ Dεbian θα το ποστάρεις εδω?

 

egw me ton Debian doulevoume mazi tha to exei ready smr ;) kai nai tha to postari edw.

Link to comment
Share on other sites

  • 0

egw me ton Debian doulevoume mazi tha to exei ready smr ;) kai nai tha to postari edw.

Το σήμερα πότε το εννοείς `Яoмɛo ?

Απλά για να ξέρουμε ρωτάω....

Link to comment
Share on other sites

  • 0

Το σήμερα πότε το εννοείς `Яoмɛo ?

Απλά για να ξέρουμε ρωτάω....

 

stile pm ston Debian aftos 3erei.

Link to comment
Share on other sites

  • 0

Ήθελα να ήξερα αφού δεν μπορείτε να κάνετε edit τον code γιατι δεν το λέτε να το ζητήσουμε απο αλλού.  :P

Αυτό έπρεπε να το καταλάβεις απο την αρχή , τα συγκεκριμένα άτομα πριν κάτι μέρες είχαν κάνει ενα  ποστ για να βοηθήσουν newbies

αλλα απο την τόση "δουλειά" που εχουν το ποστ έκλεισαι και φυσικά δεν βοήθησαν κανέναν.

Η ειρωνεία είναι οτι βοήθησε ο elfocrash κάποια άτομα και του την είπαν κιόλας.

Οποτε μην περιμένεις πολλά :)

Link to comment
Share on other sites

  • 0

### Eclipse Workspace Patch 1.0
#P L2jFrozen_GameServer
Index: head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/ClanMessageCmd.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/ClanMessageCmd.java	(revision 0)
+++ head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/ClanMessageCmd.java	(working copy)
@@ -0,0 +1,127 @@
+/*
+ * 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.l2jfrozen.gameserver.handler.voicedcommandhandlers;
+
+import java.util.StringTokenizer;
+
+import javolution.text.TextBuilder;
+
+import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.network.clientpackets.Say2;
+import com.l2jfrozen.gameserver.network.serverpackets.CreatureSay;
+import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
+
+/**
+ * @author Elfocrash
+ *
+ */
+public class ClanMessageCmd implements IVoicedCommandHandler
+{
+    private static String[]    VOICED_COMMANDS    =
+                                            { "setclanmes", "setmes" , "clanmes" };
+
+
+    @Override
+    public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+    {
+            if(command.equals("clanmes"))
+            {
+                if(activeChar.getClan() != null)
+                {
+                    if(activeChar.getClan().getClanMes() != null)
+                    {
+                        CreatureSay np = new CreatureSay(0, Say2.ALLIANCE,activeChar.getClan().getLeader().getName() , activeChar.getClan().getClanMes());
+                        activeChar.sendPacket(np);
+                    }
+                }
+                return true;
+            }
+
+
+            if(command.equals("setclanmes"))
+            {
+                if(activeChar.isClanLeader())
+                    mainHtml(activeChar);
+            }
+
+            if(command.startsWith("setmes"))
+            {
+                if(activeChar.isClanLeader())
+                {
+                    String clanmes = "";
+                    StringTokenizer s = new StringTokenizer(command);
+                    s.nextToken();
+
+                    try{
+
+                        while(s.hasMoreTokens())
+                        clanmes = clanmes + s.nextToken() + " ";
+                        activeChar.getClan().setClanMes(clanmes);
+                        mainHtml(activeChar);
+                        return true;
+
+                    }
+                    catch(Exception e)
+                    {
+                        e.printStackTrace();
+                    }
+                    return true;
+                }
+                activeChar.sendMessage("You are not a clan leader. You cannot set a clan message.");
+                return false;
+            }
+
+
+     return true;
+    }
+
+    public static void mainHtml(L2PcInstance activeChar)
+    {
+        String clanMes = null;
+        clanMes = activeChar.getClan().getClanMes();
+        if(clanMes == null)
+            clanMes = "No clan message set.";
+        NpcHtmlMessage nhm = new NpcHtmlMessage(5);
+        TextBuilder tb = new TextBuilder("");
+
+        tb.append("<html><head><title>Clan Message</title></head><body>");
+        tb.append("<center>");
+        tb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">");
+        tb.append("<tr>");
+        tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"L2ui_ch3.menubutton4\" width=\"38\" height=\"38\"></td>");
+        tb.append("<td valign=\"top\"><font color=\"FF6600\">Set Clan Message</font>");
+        tb.append("<br1><font color=\"00FF00\">"+activeChar.getName()+"</font>,here you can set your clan's message.<br1></td>");
+        tb.append("</tr>");
+        tb.append("</table>");
+        tb.append("The current message set is: <br><font color=\"77FB99\">" + clanMes+"</font>");
+        tb.append("<multiedit var=\"mes\" width=170 height=20><br>");
+        tb.append("<a action=\"bypass voiced_setmes $mes\">Save Message</a></center>");
+
+        tb.append("</center>");
+        tb.append("</body></html>");
+
+
+        nhm.setHtml(tb.toString());
+        activeChar.sendPacket(nhm);
+
+    }
+
+    @Override
+    public String[] getVoicedCommandList()
+    {
+        return VOICED_COMMANDS;
+    }
+}
\ No newline at end of file
Index: head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java	(revision 972)
+++ head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java	(working copy)
@@ -28,6 +28,7 @@
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.AwayCmd;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.BankingCmd;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.CTFCmd;
+import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.ClanMessageCmd;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.DMCmd;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.FarmPvpCmd;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Online;
@@ -112,6 +113,8 @@
		{
			registerVoicedCommandHandler(new Online());
		}
+		
+		registerVoicedCommandHandler(new ClanMessageCmd());

		_log.config("VoicedCommandHandler: Loaded " + _datatable.size() + " handlers.");

Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java	(revision 972)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java	(working copy)
@@ -295,6 +295,15 @@
		if (Config.CHECK_SKILLS_ON_ENTER && !Config.ALT_GAME_SKILL_LEARN)
		    if (!activeChar.isAio())
		    		activeChar.checkAllowedSkills();
+		
+		if(activeChar.getClan() != null)
+		{
+			if(activeChar.getClan().getClanMes() != null)
+			{
+                 CreatureSay np = new CreatureSay(0, Say2.ALLIANCE,activeChar.getClan().getLeader().getName() , activeChar.getClan().getClanMes());
+			     activeChar.sendPacket(np);
+			}
+		}

		PetitionManager.getInstance().checkPetitionMessages(activeChar);

Index: head-src/com/l2jfrozen/gameserver/model/L2Clan.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/L2Clan.java	(revision 972)
+++ head-src/com/l2jfrozen/gameserver/model/L2Clan.java	(working copy)
@@ -565,6 +565,41 @@

		return limit;
	}
+	
+	    public String getClanMes()
+	    {
+	        String clanMes = null;
+	        Connection con = null;
+	        PreparedStatement statement = null;
+	        try
+	        {
+	                con = L2DatabaseFactory.getInstance().getConnection();
+	                   
+	                statement = con.prepareStatement("SELECT clan_mes FROM clan_data WHERE clan_id=?");
+	                statement.setInt(1, getClanId());
+	                
+	                ResultSet rset = statement.executeQuery();
+	                while (rset.next())
+	                {
+	                    clanMes = rset.getString("clan_mes");
+	                }
+	                    
+	        }
+	        catch (Exception e)
+	        {}
+	        finally
+	        {
+	        try
+	        {
+	        if(con != null)
+	            con.close();
+	        }
+	              catch(Exception e) {}
+	        }
+	        return clanMes;
+	        
+	    }
+	

	public L2PcInstance[] getOnlineMembers(String exclude)
	{
@@ -1314,6 +1349,32 @@
			}
		}
	}
+	
+	    public void setClanMes(String clanmes)
+	    {
+	          Connection con = null;
+	                     
+	          try
+	          {
+	                con = L2DatabaseFactory.getInstance().getConnection();
+	                PreparedStatement statement = con.prepareStatement("UPDATE clan_data SET clan_mes=? WHERE clan_id=?");
+	                statement.setString(1, clanmes);
+	                statement.setInt(2, getClanId());
+	                statement.execute();
+	                statement.close();
+	          }
+	          catch (Exception e)
+	          {}
+	          finally
+	          {
+	          try
+	          {
+	          if(con != null)
+	                  con.close();
+	          }
+	                  catch(Exception e) {}
+	          }
+	    }

	public void broadcastToOnlineAllyMembers(L2GameServerPacket packet)
	{

 

το sql δεν το έκανα.

Link to comment
Share on other sites

  • 0

  [javac] C:\workspace\old\trunk\CORE\java\net\sf\l2j\gameserver\model\L2Clan.java:473: cannot find symbol

    [javac] symbol  : class Connection

    [javac] location: class net.sf.l2j.gameserver.model.L2Clan

    [javac]         Connection con = null;

    [javac]         ^

    [javac] C:\workspace\old\trunk\CORE\java\net\sf\l2j\gameserver\model\L2Clan.java:1199: cannot find symbol

    [javac] symbol  : class Connection

    [javac] location: class net.sf.l2j.gameserver.model.L2Clan

    [javac]           Connection con = null;

    [javac]           ^

    [javac] Note: C:\workspace\old\trunk\CORE\java\net\sf\l2j\gameserver\GeoEngine.java uses or overrides a deprecated API.

    [javac] Note: Recompile with -Xlint:deprecation for details.

    [javac] 2 errors

 

 

oriste ke ta error

Link to comment
Share on other sites

  • 0

Τελικά δεν νομίζω οτι μπορείς να το κάνεις.

Νόμιζες οτι αλλάζοντας τα imports οτι θα δούλευε τέλος πάντον.

Aqueen πολύ καλά τα λες φίλε. ;)

Link to comment
Share on other sites

  • 0

Τελικά δεν νομίζω οτι μπορείς να το κάνεις.

Νόμιζες οτι αλλάζοντας τα imports οτι θα δούλευε τέλος πάντον.

Aqueen πολύ καλά τα λες φίλε. ;)

ke esy to idio provlimma exis ???

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.



×
×
  • Create New...