Ignore:
Timestamp:
Jan 16, 2012 7:56:19 AM (4 months ago)
Author:
MELERIX
Message:

STABLE: Sync with BETA [8629]

Location:
trunk/L2J_DataPack
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/L2J_DataPack

  • trunk/L2J_DataPack/dist/game/data/scripts/handlers/admincommandhandlers/AdminAnnouncements.java

    r8406 r8630  
    4949        { 
    5050                "admin_list_announcements", 
     51                "admin_list_critannouncements", 
    5152                "admin_reload_announcements", 
    5253                "admin_announce_announcements", 
    5354                "admin_add_announcement", 
    5455                "admin_del_announcement", 
     56                "admin_add_critannouncement", 
     57                "admin_del_critannouncement", 
    5558                "admin_announce", 
     59                "admin_critannounce", 
    5660                "admin_announce_menu", 
     61                "admin_critannounce_menu", 
    5762                "admin_list_autoann", 
    5863                "admin_reload_autoann", 
     
    6873                        Announcements.getInstance().listAnnouncements(activeChar); 
    6974                } 
     75                else if (command.equals("admin_list_critannouncements")) 
     76                { 
     77                        Announcements.getInstance().listCritAnnouncements(activeChar); 
     78                } 
    7079                else if (command.equals("admin_reload_announcements")) 
    7180                { 
     
    7786                        if (Config.GM_ANNOUNCER_NAME && command.length() > 20) 
    7887                                command += " ("+activeChar.getName()+")"; 
    79                         Announcements.getInstance().handleAnnounce(command, 20); 
     88                        Announcements.getInstance().handleAnnounce(command, 20, false); 
     89                        AdminHelpPage.showHelpPage(activeChar, "gm_menu.htm"); 
     90                } 
     91                else if (command.startsWith("admin_critannounce_menu")) 
     92                { 
     93                        try 
     94                        { 
     95                                command = command.substring(24); 
     96                                 
     97                                if (Config.GM_CRITANNOUNCER_NAME && command.length() > 0) 
     98                                        command = activeChar.getName() + ": " + command; 
     99                                Announcements.getInstance().handleAnnounce(command, 0, true); 
     100                        } 
     101                        catch (StringIndexOutOfBoundsException e) 
     102                        { 
     103                        } 
     104                         
    80105                        AdminHelpPage.showHelpPage(activeChar, "gm_menu.htm"); 
    81106                } 
     
    103128                        } 
    104129                } 
     130                else if (command.startsWith("admin_add_critannouncement")) 
     131                { 
     132                        // FIXME the player can send only 16 chars (if you try to send more 
     133                        // it sends null), remove this function or not? 
     134                        if (!command.equals("admin_add_critannouncement")) 
     135                        { 
     136                                try 
     137                                { 
     138                                        String val = command.substring(27); 
     139                                        Announcements.getInstance().addCritAnnouncement(val); 
     140                                        Announcements.getInstance().listCritAnnouncements(activeChar); 
     141                                } 
     142                                catch (StringIndexOutOfBoundsException e) 
     143                                { 
     144                                }// ignore errors 
     145                        } 
     146                } 
    105147                else if (command.startsWith("admin_del_announcement")) 
    106148                { 
     
    115157                        } 
    116158                } 
     159                else if (command.startsWith("admin_del_critannouncement")) 
     160                { 
     161                        try 
     162                        { 
     163                                int val = Integer.parseInt(command.substring(27)); 
     164                                Announcements.getInstance().delCritAnnouncement(val); 
     165                                Announcements.getInstance().listCritAnnouncements(activeChar); 
     166                        } 
     167                        catch (StringIndexOutOfBoundsException e) 
     168                        { 
     169                        } 
     170                } 
    117171                 
    118172                // Command is admin announce 
     
    122176                                command += " ("+activeChar.getName()+")"; 
    123177                        // Call method from another class 
    124                         Announcements.getInstance().handleAnnounce(command, 15); 
     178                        Announcements.getInstance().handleAnnounce(command, 15, false); 
     179                } 
     180                else if (command.startsWith("admin_critannounce")) 
     181                { 
     182                        try 
     183                        { 
     184                                command = command.substring(19); 
     185                                 
     186                                if (Config.GM_CRITANNOUNCER_NAME && command.length() > 0) 
     187                                        command = activeChar.getName() + ": " + command; 
     188                                Announcements.getInstance().handleAnnounce(command, 0, true); 
     189                        } 
     190                        catch (StringIndexOutOfBoundsException e) 
     191                        { 
     192                        } 
    125193                } 
    126194                else if (command.startsWith("admin_list_autoann")) 
     
    162230                                return false; 
    163231                        } 
     232                        boolean isCritical = Boolean.valueOf(st.nextToken()); 
     233                        if (!st.hasMoreTokens()) 
     234                        { 
     235                                activeChar.sendMessage("Not enough parameters for adding autoannounce!"); 
     236                                return false; 
     237                        } 
    164238                        TextBuilder memo = new TextBuilder(); 
    165239                        while (st.hasMoreTokens()) 
     
    169243                        } 
    170244                         
    171                         AutoAnnounceTaskManager.getInstance().addAutoAnnounce(initial*1000, delay*1000, repeat, memo.toString().trim()); 
     245                        AutoAnnounceTaskManager.getInstance().addAutoAnnounce(initial*1000, delay*1000, repeat, memo.toString().trim(), isCritical); 
    172246                        listAutoAnnouncements(activeChar); 
    173247                } 
     
    207281                                memo2.append("/n"); 
    208282                        } 
    209                         replyMSG.append("<table width=260><tr><td width=220>"); 
     283                        replyMSG.append("<table width=260><tr><td width=220><font color=\"" + (autoann.isCritical() ? "00FCFC" : "7FFCFC") + "\">"); 
    210284                        replyMSG.append(memo2.toString().trim()); 
    211                         replyMSG.append("</td><td width=40><button value=\"Delete\" action=\"bypass -h admin_del_autoann "); 
     285                        replyMSG.append("</font></td><td width=40><button value=\"Delete\" action=\"bypass -h admin_del_autoann "); 
    212286                        replyMSG.append(i); 
    213287                        replyMSG.append("\" width=60 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table>"); 
Note: See TracChangeset for help on using the changeset viewer.