Changeset 8630 for trunk/L2J_DataPack/dist/game/data/scripts/handlers/admincommandhandlers/AdminAnnouncements.java
- Timestamp:
- Jan 16, 2012 7:56:19 AM (4 months ago)
- Location:
- trunk/L2J_DataPack
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
dist/game/data/scripts/handlers/admincommandhandlers/AdminAnnouncements.java (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/L2J_DataPack
- Property svn:mergeinfo changed
/branches/unstable/L2J_DataPack_BETA merged: 8407-8426,8428-8480,8482-8491,8493-8588,8590-8629
- Property svn:mergeinfo changed
-
trunk/L2J_DataPack/dist/game/data/scripts/handlers/admincommandhandlers/AdminAnnouncements.java
r8406 r8630 49 49 { 50 50 "admin_list_announcements", 51 "admin_list_critannouncements", 51 52 "admin_reload_announcements", 52 53 "admin_announce_announcements", 53 54 "admin_add_announcement", 54 55 "admin_del_announcement", 56 "admin_add_critannouncement", 57 "admin_del_critannouncement", 55 58 "admin_announce", 59 "admin_critannounce", 56 60 "admin_announce_menu", 61 "admin_critannounce_menu", 57 62 "admin_list_autoann", 58 63 "admin_reload_autoann", … … 68 73 Announcements.getInstance().listAnnouncements(activeChar); 69 74 } 75 else if (command.equals("admin_list_critannouncements")) 76 { 77 Announcements.getInstance().listCritAnnouncements(activeChar); 78 } 70 79 else if (command.equals("admin_reload_announcements")) 71 80 { … … 77 86 if (Config.GM_ANNOUNCER_NAME && command.length() > 20) 78 87 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 80 105 AdminHelpPage.showHelpPage(activeChar, "gm_menu.htm"); 81 106 } … … 103 128 } 104 129 } 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 } 105 147 else if (command.startsWith("admin_del_announcement")) 106 148 { … … 115 157 } 116 158 } 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 } 117 171 118 172 // Command is admin announce … … 122 176 command += " ("+activeChar.getName()+")"; 123 177 // 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 } 125 193 } 126 194 else if (command.startsWith("admin_list_autoann")) … … 162 230 return false; 163 231 } 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 } 164 238 TextBuilder memo = new TextBuilder(); 165 239 while (st.hasMoreTokens()) … … 169 243 } 170 244 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); 172 246 listAutoAnnouncements(activeChar); 173 247 } … … 207 281 memo2.append("/n"); 208 282 } 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") + "\">"); 210 284 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 "); 212 286 replyMSG.append(i); 213 287 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.
