Forráskód Böngészése

BETA: More misc changes:
* Using default encode for all files (except shell scripts), requested by MELERIX.
* Deleting empty folders from [5146].
* Renaming hitConditionBonus to HitConditionBonus.

Zoey76 13 éve
szülő
commit
c1917e0380
65 módosított fájl, 6275 hozzáadás és 6275 törlés
  1. 336 336
      L2J_Server_BETA/dist/doc/mail_LICENSE.txt
  2. 504 504
      L2J_Server_BETA/dist/doc/trove_LICENSE.txt
  3. 79 79
      L2J_Server_BETA/dist/languages/gsregister/GSRegister.properties
  4. 8 8
      L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/HitConditionBonus.java
  5. 96 96
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/DropProtection.java
  6. 210 210
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2ContactList.java
  7. 68 68
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/conditions/ConditionTargetActiveSkillId.java
  8. 2 2
      L2J_Server_BETA/java/com/l2jserver/gameserver/model/stats/Formulas.java
  9. 53 53
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestEx2ndPasswordCheck.java
  10. 68 68
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestEx2ndPasswordReq.java
  11. 52 52
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestEx2ndPasswordVerify.java
  12. 61 61
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestExAddContactToContactList.java
  13. 58 58
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestExDeleteContactFromContactList.java
  14. 52 52
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestExFriendListExtended.java
  15. 66 66
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java
  16. 54 54
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestExShowContactList.java
  17. 41 41
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/gameserverpackets/SendMail.java
  18. 49 49
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/gameserverpackets/TempBan.java
  19. 54 54
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/Ex2ndPasswordAck.java
  20. 54 54
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/Ex2ndPasswordCheck.java
  21. 52 52
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/Ex2ndPasswordVerify.java
  22. 50 50
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExConfirmAddingContact.java
  23. 90 90
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExOlympiadMatchList.java
  24. 64 64
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowContactList.java
  25. 142 142
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/FriendListExtended.java
  26. 67 67
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/MyTargetSelected.java
  27. 71 71
      L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/TargetSelected.java
  28. 324 324
      L2J_Server_BETA/java/com/l2jserver/gameserver/security/SecondaryPasswordAuth.java
  29. 169 169
      L2J_Server_BETA/java/com/l2jserver/loginserver/mail/BaseMail.java
  30. 151 151
      L2J_Server_BETA/java/com/l2jserver/loginserver/mail/MailSystem.java
  31. 119 119
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/L2JGameServerPacketHandler.java
  32. 294 294
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/L2LoginClient.java
  33. 95 95
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/L2LoginPacketHandler.java
  34. 93 93
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/clientpackets/AuthGameGuard.java
  35. 50 50
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/clientpackets/L2LoginClientPacket.java
  36. 164 164
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/clientpackets/RequestAuthLogin.java
  37. 83 83
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/clientpackets/RequestServerList.java
  38. 99 99
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/clientpackets/RequestServerLogin.java
  39. 76 76
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/BlowFishKey.java
  40. 44 44
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/ChangeAccessLevel.java
  41. 170 170
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/GameServerAuth.java
  42. 75 75
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/PlayerAuthRequest.java
  43. 51 51
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/PlayerInGame.java
  44. 49 49
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/PlayerLogout.java
  45. 50 50
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/PlayerTracert.java
  46. 45 45
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/ReplyCharacters.java
  47. 46 46
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/RequestSendMail.java
  48. 89 89
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/RequestTempBan.java
  49. 104 104
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/ServerStatus.java
  50. 40 40
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/loginserverpackets/AuthResponse.java
  51. 45 45
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/loginserverpackets/InitLS.java
  52. 35 35
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/loginserverpackets/KickPlayer.java
  53. 49 49
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/loginserverpackets/LoginServerFail.java
  54. 36 36
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/loginserverpackets/PlayerAuthResponse.java
  55. 36 36
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/loginserverpackets/RequestCharacters.java
  56. 63 63
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/AccountKicked.java
  57. 56 56
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/GGAuth.java
  58. 73 73
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/Init.java
  59. 29 29
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/L2LoginServerPacket.java
  60. 95 95
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/LoginFail.java
  61. 57 57
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/LoginOk.java
  62. 96 96
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/PlayFail.java
  63. 42 42
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/PlayOk.java
  64. 163 163
      L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/ServerList.java
  65. 419 419
      L2J_Server_BETA/java/com/l2jserver/tools/gsregistering/GUserInterface.java

+ 336 - 336
L2J_Server_BETA/dist/doc/mail_LICENSE.txt

@@ -1,337 +1,337 @@
-Oracle Corporation ("ORACLE") ENTITLEMENT for SOFTWARE
-
-Licensee/Company: Entity receiving Software.
-
-Effective Date: Date of delivery of the Software to You.
-
-Software: JavaMail 1.4.4
-
-License Term:  Perpetual (subject to termination under the SLA).
-
-Licensed Unit: Software Copy.
-
-Licensed unit Count: Unlimited.
-
-Permitted Uses: 
-
-1. You may reproduce and use the Software for Your own Individual,
-Commercial and Research and Instructional Use only for the purposes of
-designing, developing, testing, and running Your applets and
-applications ("Programs").
-
-2. Subject to the terms and conditions of this Agreement and
-restrictions and exceptions set forth in the Software's documentation,
-You may reproduce and distribute portions of Software identified as a
-redistributable in the documentation (each a "Redistributable"),
-provided that You comply with the following (note that You may be
-entitled to reproduce and distribute other portions of the Software not
-defined in the documentation as a Redistributable under certain other
-licenses as described in the THIRDPARTYLICENSEREADME, if applicable):
-
-(a) You distribute Redistributable complete and unmodified and only
-bundled as part of Your Programs,
-
-(b) Your Programs add significant and primary functionality to the
-Redistributable,
-
-(c) You distribute Redistributable for the sole purpose of running Your
-Programs,
-
-(d) You do not distribute additional software intended to replace any
-component(s) of the Redistributable,
-
-(e) You do not remove or alter any proprietary legends or notices
-contained in or on the Redistributable.
-
-(f) You only distribute the Redistributable subject to a license
-agreement that protects Oracle's interests consistent with the terms
-contained in this Agreement, and
-
-(g) You agree to defend and indemnify Oracle and its licensors from and
-against any damages, costs, liabilities, settlement amounts and/or
-expenses  (including attorneys' fees) incurred in connection with any
-claim, lawsuit or action by any third party that arises or results from
-the use or distribution of any and all Programs and/or
-Redistributable.
-
-3. Java Technology Restrictions.  You may not create, modify, or change
-the behavior of, or authorize Your licensees to create, modify, or
-change the behavior of, classes, interfaces, or subpackages that are in
-any way identified as "java", "javax", "sun" or similar convention as
-specified by Oracle in any naming convention designation.
-
-4. No Diagnostic, Maintenance, Repair or Technical Support Services.
-The scope of Your license does not include any right, express or
-implied, (i) to access, copy, distribute, display or use the Software
-to provide diagnostic, maintenance, repair or technical support
-services for Oracle software or Oracle hardware on behalf of any third party
-for Your direct or indirect commercial gain or advantage, without Oracle's
-prior written authorization, or (ii) for any third party to access,
-copy, distribute, display or use the Software to provide diagnostic,
-maintenance, repair or technical support services for Oracle software or
-Oracle hardware on Your behalf for such party's direct or indirect
-commercial gain or advantage, without Oracle's prior written
-authorization. The limitations set forth in this paragraph apply to any
-and all error corrections, patches, updates, and upgrades to the
-Software You may receive, access, download or otherwise obtain from
-Oracle.
-
-5. Records and Documentation.  During the term of the SLA and
-Entitlement, and for a period of three (3) years thereafter, You agree
-to keep proper records and documentation of Your compliance with the
-SLA and Entitlement. Upon Oracle's reasonable request, You will provide
-copies of such records and documentation to Oracle for the purpose of
-confirming Your compliance with the terms and conditions of the SLA and
-Entitlement. This section will survive any termination of the SLA and
-Entitlement. You may terminate this SLA and Entitlement at any time by
-destroying all copies of the Software in which case the obligations set
-forth in Section 7 of the SLA shall apply.
-
-
-Oracle Corporation ("ORACLE")
-SOFTWARE LICENSE AGREEMENT
-
-READ THE TERMS OF THIS AGREEMENT ("AGREEMENT") CAREFULLY BEFORE OPENING
-SOFTWARE MEDIA PACKAGE. BY OPENING SOFTWARE MEDIA PACKAGE, YOU AGREE TO
-THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCESSING SOFTWARE
-ELECTRONICALLY, INDICATE YOUR ACCEPTANCE OF THESE TERMS BY SELECTING
-THE "ACCEPT" BUTTON AT THE END OF THIS AGREEMENT. IF YOU DO NOT AGREE
-TO ALL OF THE TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE
-OF PURCHASE FOR A REFUND OR, IF SOFTWARE IS ACCESSED ELECTRONICALLY,
-SELECT THE "DECLINE" (OR "EXIT") BUTTON AT THE END OF THIS AGREEMENT.
-IF YOU HAVE SEPARATELY AGREED TO LICENSE TERMS ("MASTER TERMS") FOR
-YOUR LICENSE TO THIS SOFTWARE, THEN SECTIONS 1-6 OF THIS AGREEMENT
-("SUPPLEMENTAL LICENSE TERMS") SHALL SUPPLEMENT AND SUPERSEDE THE
-MASTER TERMS IN RELATION TO THIS SOFTWARE.
-
-1.	Definitions.
-
-(a)     "Entitlement" means the collective set of applicable documents
-authorized by Oracle evidencing your obligation to pay associated fees (if
-any) for the license, associated Services, and the authorized scope of
-use of Software under this Agreement.
-
-(b)     "Licensed Unit" means the unit of measure by which your use of
-Software and/or Service is licensed, as described in your Entitlement.
-
-(c)     "Permitted Use" means the licensed Software use(s) authorized
-in this Agreement as specified in your Entitlement. The Permitted Use
-for any bundled Oracle software not specified in your Entitlement will be
-evaluation use as provided in Section 3.
-
-(d)     "Service" means the service(s) that Oracle or its delegate will
-provide, if any, as selected in your Entitlement and as further
-described in the applicable service listings at
-www.sun.com/service/servicelist.
-
-(e)     "Software" means the Oracle software described in your
-Entitlement. Also, certain software may be included for evaluation use
-under Section 3.
-
-(f)     "You" and "Your" means the individual or legal entity specified
-in the Entitlement, or for evaluation purposes, the entity performing
-the evaluation.
-
-2.      License Grant and Entitlement.
-
-Subject to the terms of your Entitlement, Oracle grants you a
-nonexclusive, nontransferable limited license to use Software for its
-Permitted Use for the license term. Your Entitlement will specify (a)
-Software licensed, (b) the Permitted Use, (c) the license term, and (d)
-the Licensed Units.
-
-Additionally, if your Entitlement includes Services, then it will also
-specify the (e) Service and (f) service term.
-
-If your rights to Software or Services are limited in duration and the
-date such rights begin is other than the purchase date, your
-Entitlement will provide that beginning date(s).
-
-The Entitlement may be delivered to you in various ways depending on
-the manner in which you obtain Software and Services, for example, the
-Entitlement may be provided in your receipt, invoice or your contract
-with Oracle or authorized Oracle reseller. It may also be in electronic
-format if you download Software.
-
-3.      Permitted Use.
-
-As selected in your Entitlement, one or more of the following Permitted
-Uses will apply to your use of Software. Unless you have an Entitlement
-that expressly permits it, you may not use Software for any of the
-other Permitted Uses. If you don't have an Entitlement, or if your
-Entitlement doesn't cover additional software delivered to you, then
-such software is for your Evaluation Use.
-
-(a) Evaluation Use. You may evaluate Software internally for a period
-of 90 days from your first use.
-
-(b) Research and Instructional Use. You may use Software internally to
-design, develop and test, and also to provide instruction on such
-uses.
-
-(c) Individual Use. You may use Software internally for personal,
-individual use.
-
-(d) Commercial Use. You may use Software internally for your own
-commercial purposes.
-
-(e) Service Provider Use. You may make Software functionality
-accessible (but not by providing Software itself or through outsourcing
-services) to your end users in an extranet deployment, but not to your
-affiliated companies or to government agencies.
-
-4.      Licensed Units.
-
-Your Permitted Use is limited to the number of Licensed Units stated in
-your Entitlement. If you require additional Licensed Units, you will
-need additional Entitlement(s).
-
-5.      Restrictions.
-
-(a) The copies of Software provided to you under this Agreement are
-licensed, not sold, to you by Oracle. Oracle reserves all rights not
-expressly granted. (b) You may make a single archival copy of Software,
-but otherwise may not copy, modify, or distribute Software. However if
-the Oracle documentation accompanying Software lists specific portions of
-Software, such as header files, class libraries, reference source code,
-and/or redistributable files, that may be handled differently, you may
-do so only as provided in the Oracle documentation. (c) You may not rent,
-lease, lend or encumber Software. (d) Unless enforcement is prohibited
-by applicable law, you may not decompile, or reverse engineer Software.
-(e) The terms and conditions of this Agreement will apply to any
-Software updates, provided to you at Oracle's discretion, that replace
-and/or supplement the original Software, unless such update contains a
-separate license. (f) You may not publish or provide the results of any
-benchmark or comparison tests run on Software to any third party
-without the prior written consent of Oracle. (g) Software is confidential
-and copyrighted. (h) Unless otherwise specified, if Software is
-delivered with embedded or bundled software that enables functionality
-of Software, you may not use such software on a stand-alone basis or
-use any portion of such software to interoperate with any program(s)
-other than Software. (i) Software may contain programs that perform
-automated collection of system data and/or automated software updating
-services. System data collected through such programs may be used by
-Oracle, its subcontractors, and its service delivery partners for the
-purpose of providing you with remote system services and/or improving
-Oracle's software and systems. (j) Software is not designed, licensed or
-intended for use in the design, construction, operation or maintenance
-of any nuclear facility and Oracle and its licensors disclaim any express
-or implied warranty of fitness for such uses. (k) No right, title or
-interest in or to any trademark, service mark, logo or trade name of
-Oracle or its licensors is granted under this Agreement.
-
-6.      Java Compatibility and Open Source.
-
-Software may contain Java technology. You may not create additional
-classes to, or modifications of, the Java technology, except under
-compatibility requirements available under a separate agreement
-available at www.java.net.
-
-Oracle supports and benefits from the global community of open source
-developers, and thanks the community for its important contributions
-and open standards-based technology, which Oracle has adopted into many of
-its products.
-
-Please note that portions of Software may be provided with notices and
-open source licenses from such communities and third parties that
-govern the use of those portions, and any licenses granted hereunder do
-not alter any rights and obligations you may have under such open
-source licenses, however, the disclaimer of warranty and limitation of
-liability provisions in this Agreement will apply to all Software in
-this distribution.
-
-7.      Term and Termination.
-
-The license and service term are set forth in your Entitlement(s). Your
-rights under this Agreement will terminate immediately without notice
-from Oracle if you materially breach it or take any action in derogation
-of Oracle's and/or its licensors' rights to Software. Oracle may terminate
-this Agreement should any Software become, or in Oracle's reasonable
-opinion likely to become, the subject of a claim of intellectual
-property infringement or trade secret misappropriation. Upon
-termination, you will cease use of, and destroy, Software and confirm
-compliance in writing to Oracle. Sections 1, 5, 6, 7, and 9-15 will
-survive termination of the Agreement.
-
-8.      Limited Warranty.
-
-Oracle warrants to you that for a period of 90 days from the date of
-purchase, as evidenced by a copy of the receipt, the media on which
-Software is furnished (if any) will be free of defects in materials and
-workmanship under normal use. Except for the foregoing, Software is
-provided "AS IS". Your exclusive remedy and Oracle's entire liability
-under this limited warranty will be at Oracle's option to replace Software
-media or refund the fee paid for Software. Some states do not allow
-limitations on certain implied warranties, so the above may not apply
-to you. This limited warranty gives you specific legal rights. You may
-have others, which vary from state to state.
-
-9.      Disclaimer of Warranty.
-
-UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS OR IMPLIED CONDITIONS,
-REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT
-ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO
-BE LEGALLY INVALID.
-
-10.     Limitation of Liability.
-
-TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL ORACLE OR ITS
-LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
-SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES,
-HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR
-RELATED TO THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF ORACLE HAS
-BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event will Oracle's
-liability to you, whether in contract, tort (including negligence), or
-otherwise, exceed the amount paid by you for Software under this
-Agreement. The foregoing limitations will apply even if the above
-stated warranty fails of its essential purpose. Some states do not
-allow the exclusion of incidental or consequential damages, so some of
-the terms above may not be applicable to you.
-
-11.     Export Regulations.
-
-All Software, documents, technical data, and any other materials
-delivered under this Agreement are subject to U.S. export control laws
-and may be subject to export or import regulations in other countries.
-You agree to comply strictly with these laws and regulations and
-acknowledge that you have the responsibility to obtain any licenses to
-export, re-export, or import as may be required after delivery to you.
-
-12.     U.S. Government Restricted Rights.
-
-If Software is being acquired by or on behalf of the U.S. Government or
-by a U.S. Government prime contractor or subcontractor (at any tier),
-then the Government's rights in Software and accompanying documentation
-will be only as set forth in this Agreement; this is in accordance with
-48 CFR 227.7201 through 227.7202-4 (for Department of Defense (DOD)
-acquisitions) and with 48 CFR 2.101 and 12.212 (for non-DOD
-acquisitions).
-
-13.     Governing Law.
-
-Any action related to this Agreement will be governed by California law
-and controlling U.S. federal law. No choice of law rules of any
-jurisdiction will apply.
-
-14.     Severability.
-
-If any provision of this Agreement is held to be unenforceable, this
-Agreement will remain in effect with the provision omitted, unless
-omission would frustrate the intent of the parties, in which case this
-Agreement will immediately terminate.
-
-15.     Integration.
-
-This Agreement, including any terms contained in your Entitlement, is
-the entire agreement between you and Oracle relating to its subject
-matter. It supersedes all prior or contemporaneous oral or written
-communications, proposals, representations and warranties and prevails
-over any conflicting or additional terms of any quote, order,
-acknowledgment, or other communication between the parties relating to
-its subject matter during the term of this Agreement. No modification
-of this Agreement will be binding, unless in writing and signed by an
-authorized representative of each party.
-
-For inquiries please contact: Oracle Corporation, 500 Oracle Parkway,
+Oracle Corporation ("ORACLE") ENTITLEMENT for SOFTWARE
+
+Licensee/Company: Entity receiving Software.
+
+Effective Date: Date of delivery of the Software to You.
+
+Software: JavaMail 1.4.4
+
+License Term:  Perpetual (subject to termination under the SLA).
+
+Licensed Unit: Software Copy.
+
+Licensed unit Count: Unlimited.
+
+Permitted Uses: 
+
+1. You may reproduce and use the Software for Your own Individual,
+Commercial and Research and Instructional Use only for the purposes of
+designing, developing, testing, and running Your applets and
+applications ("Programs").
+
+2. Subject to the terms and conditions of this Agreement and
+restrictions and exceptions set forth in the Software's documentation,
+You may reproduce and distribute portions of Software identified as a
+redistributable in the documentation (each a "Redistributable"),
+provided that You comply with the following (note that You may be
+entitled to reproduce and distribute other portions of the Software not
+defined in the documentation as a Redistributable under certain other
+licenses as described in the THIRDPARTYLICENSEREADME, if applicable):
+
+(a) You distribute Redistributable complete and unmodified and only
+bundled as part of Your Programs,
+
+(b) Your Programs add significant and primary functionality to the
+Redistributable,
+
+(c) You distribute Redistributable for the sole purpose of running Your
+Programs,
+
+(d) You do not distribute additional software intended to replace any
+component(s) of the Redistributable,
+
+(e) You do not remove or alter any proprietary legends or notices
+contained in or on the Redistributable.
+
+(f) You only distribute the Redistributable subject to a license
+agreement that protects Oracle's interests consistent with the terms
+contained in this Agreement, and
+
+(g) You agree to defend and indemnify Oracle and its licensors from and
+against any damages, costs, liabilities, settlement amounts and/or
+expenses  (including attorneys' fees) incurred in connection with any
+claim, lawsuit or action by any third party that arises or results from
+the use or distribution of any and all Programs and/or
+Redistributable.
+
+3. Java Technology Restrictions.  You may not create, modify, or change
+the behavior of, or authorize Your licensees to create, modify, or
+change the behavior of, classes, interfaces, or subpackages that are in
+any way identified as "java", "javax", "sun" or similar convention as
+specified by Oracle in any naming convention designation.
+
+4. No Diagnostic, Maintenance, Repair or Technical Support Services.
+The scope of Your license does not include any right, express or
+implied, (i) to access, copy, distribute, display or use the Software
+to provide diagnostic, maintenance, repair or technical support
+services for Oracle software or Oracle hardware on behalf of any third party
+for Your direct or indirect commercial gain or advantage, without Oracle's
+prior written authorization, or (ii) for any third party to access,
+copy, distribute, display or use the Software to provide diagnostic,
+maintenance, repair or technical support services for Oracle software or
+Oracle hardware on Your behalf for such party's direct or indirect
+commercial gain or advantage, without Oracle's prior written
+authorization. The limitations set forth in this paragraph apply to any
+and all error corrections, patches, updates, and upgrades to the
+Software You may receive, access, download or otherwise obtain from
+Oracle.
+
+5. Records and Documentation.  During the term of the SLA and
+Entitlement, and for a period of three (3) years thereafter, You agree
+to keep proper records and documentation of Your compliance with the
+SLA and Entitlement. Upon Oracle's reasonable request, You will provide
+copies of such records and documentation to Oracle for the purpose of
+confirming Your compliance with the terms and conditions of the SLA and
+Entitlement. This section will survive any termination of the SLA and
+Entitlement. You may terminate this SLA and Entitlement at any time by
+destroying all copies of the Software in which case the obligations set
+forth in Section 7 of the SLA shall apply.
+
+
+Oracle Corporation ("ORACLE")
+SOFTWARE LICENSE AGREEMENT
+
+READ THE TERMS OF THIS AGREEMENT ("AGREEMENT") CAREFULLY BEFORE OPENING
+SOFTWARE MEDIA PACKAGE. BY OPENING SOFTWARE MEDIA PACKAGE, YOU AGREE TO
+THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCESSING SOFTWARE
+ELECTRONICALLY, INDICATE YOUR ACCEPTANCE OF THESE TERMS BY SELECTING
+THE "ACCEPT" BUTTON AT THE END OF THIS AGREEMENT. IF YOU DO NOT AGREE
+TO ALL OF THE TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE
+OF PURCHASE FOR A REFUND OR, IF SOFTWARE IS ACCESSED ELECTRONICALLY,
+SELECT THE "DECLINE" (OR "EXIT") BUTTON AT THE END OF THIS AGREEMENT.
+IF YOU HAVE SEPARATELY AGREED TO LICENSE TERMS ("MASTER TERMS") FOR
+YOUR LICENSE TO THIS SOFTWARE, THEN SECTIONS 1-6 OF THIS AGREEMENT
+("SUPPLEMENTAL LICENSE TERMS") SHALL SUPPLEMENT AND SUPERSEDE THE
+MASTER TERMS IN RELATION TO THIS SOFTWARE.
+
+1.	Definitions.
+
+(a)     "Entitlement" means the collective set of applicable documents
+authorized by Oracle evidencing your obligation to pay associated fees (if
+any) for the license, associated Services, and the authorized scope of
+use of Software under this Agreement.
+
+(b)     "Licensed Unit" means the unit of measure by which your use of
+Software and/or Service is licensed, as described in your Entitlement.
+
+(c)     "Permitted Use" means the licensed Software use(s) authorized
+in this Agreement as specified in your Entitlement. The Permitted Use
+for any bundled Oracle software not specified in your Entitlement will be
+evaluation use as provided in Section 3.
+
+(d)     "Service" means the service(s) that Oracle or its delegate will
+provide, if any, as selected in your Entitlement and as further
+described in the applicable service listings at
+www.sun.com/service/servicelist.
+
+(e)     "Software" means the Oracle software described in your
+Entitlement. Also, certain software may be included for evaluation use
+under Section 3.
+
+(f)     "You" and "Your" means the individual or legal entity specified
+in the Entitlement, or for evaluation purposes, the entity performing
+the evaluation.
+
+2.      License Grant and Entitlement.
+
+Subject to the terms of your Entitlement, Oracle grants you a
+nonexclusive, nontransferable limited license to use Software for its
+Permitted Use for the license term. Your Entitlement will specify (a)
+Software licensed, (b) the Permitted Use, (c) the license term, and (d)
+the Licensed Units.
+
+Additionally, if your Entitlement includes Services, then it will also
+specify the (e) Service and (f) service term.
+
+If your rights to Software or Services are limited in duration and the
+date such rights begin is other than the purchase date, your
+Entitlement will provide that beginning date(s).
+
+The Entitlement may be delivered to you in various ways depending on
+the manner in which you obtain Software and Services, for example, the
+Entitlement may be provided in your receipt, invoice or your contract
+with Oracle or authorized Oracle reseller. It may also be in electronic
+format if you download Software.
+
+3.      Permitted Use.
+
+As selected in your Entitlement, one or more of the following Permitted
+Uses will apply to your use of Software. Unless you have an Entitlement
+that expressly permits it, you may not use Software for any of the
+other Permitted Uses. If you don't have an Entitlement, or if your
+Entitlement doesn't cover additional software delivered to you, then
+such software is for your Evaluation Use.
+
+(a) Evaluation Use. You may evaluate Software internally for a period
+of 90 days from your first use.
+
+(b) Research and Instructional Use. You may use Software internally to
+design, develop and test, and also to provide instruction on such
+uses.
+
+(c) Individual Use. You may use Software internally for personal,
+individual use.
+
+(d) Commercial Use. You may use Software internally for your own
+commercial purposes.
+
+(e) Service Provider Use. You may make Software functionality
+accessible (but not by providing Software itself or through outsourcing
+services) to your end users in an extranet deployment, but not to your
+affiliated companies or to government agencies.
+
+4.      Licensed Units.
+
+Your Permitted Use is limited to the number of Licensed Units stated in
+your Entitlement. If you require additional Licensed Units, you will
+need additional Entitlement(s).
+
+5.      Restrictions.
+
+(a) The copies of Software provided to you under this Agreement are
+licensed, not sold, to you by Oracle. Oracle reserves all rights not
+expressly granted. (b) You may make a single archival copy of Software,
+but otherwise may not copy, modify, or distribute Software. However if
+the Oracle documentation accompanying Software lists specific portions of
+Software, such as header files, class libraries, reference source code,
+and/or redistributable files, that may be handled differently, you may
+do so only as provided in the Oracle documentation. (c) You may not rent,
+lease, lend or encumber Software. (d) Unless enforcement is prohibited
+by applicable law, you may not decompile, or reverse engineer Software.
+(e) The terms and conditions of this Agreement will apply to any
+Software updates, provided to you at Oracle's discretion, that replace
+and/or supplement the original Software, unless such update contains a
+separate license. (f) You may not publish or provide the results of any
+benchmark or comparison tests run on Software to any third party
+without the prior written consent of Oracle. (g) Software is confidential
+and copyrighted. (h) Unless otherwise specified, if Software is
+delivered with embedded or bundled software that enables functionality
+of Software, you may not use such software on a stand-alone basis or
+use any portion of such software to interoperate with any program(s)
+other than Software. (i) Software may contain programs that perform
+automated collection of system data and/or automated software updating
+services. System data collected through such programs may be used by
+Oracle, its subcontractors, and its service delivery partners for the
+purpose of providing you with remote system services and/or improving
+Oracle's software and systems. (j) Software is not designed, licensed or
+intended for use in the design, construction, operation or maintenance
+of any nuclear facility and Oracle and its licensors disclaim any express
+or implied warranty of fitness for such uses. (k) No right, title or
+interest in or to any trademark, service mark, logo or trade name of
+Oracle or its licensors is granted under this Agreement.
+
+6.      Java Compatibility and Open Source.
+
+Software may contain Java technology. You may not create additional
+classes to, or modifications of, the Java technology, except under
+compatibility requirements available under a separate agreement
+available at www.java.net.
+
+Oracle supports and benefits from the global community of open source
+developers, and thanks the community for its important contributions
+and open standards-based technology, which Oracle has adopted into many of
+its products.
+
+Please note that portions of Software may be provided with notices and
+open source licenses from such communities and third parties that
+govern the use of those portions, and any licenses granted hereunder do
+not alter any rights and obligations you may have under such open
+source licenses, however, the disclaimer of warranty and limitation of
+liability provisions in this Agreement will apply to all Software in
+this distribution.
+
+7.      Term and Termination.
+
+The license and service term are set forth in your Entitlement(s). Your
+rights under this Agreement will terminate immediately without notice
+from Oracle if you materially breach it or take any action in derogation
+of Oracle's and/or its licensors' rights to Software. Oracle may terminate
+this Agreement should any Software become, or in Oracle's reasonable
+opinion likely to become, the subject of a claim of intellectual
+property infringement or trade secret misappropriation. Upon
+termination, you will cease use of, and destroy, Software and confirm
+compliance in writing to Oracle. Sections 1, 5, 6, 7, and 9-15 will
+survive termination of the Agreement.
+
+8.      Limited Warranty.
+
+Oracle warrants to you that for a period of 90 days from the date of
+purchase, as evidenced by a copy of the receipt, the media on which
+Software is furnished (if any) will be free of defects in materials and
+workmanship under normal use. Except for the foregoing, Software is
+provided "AS IS". Your exclusive remedy and Oracle's entire liability
+under this limited warranty will be at Oracle's option to replace Software
+media or refund the fee paid for Software. Some states do not allow
+limitations on certain implied warranties, so the above may not apply
+to you. This limited warranty gives you specific legal rights. You may
+have others, which vary from state to state.
+
+9.      Disclaimer of Warranty.
+
+UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS OR IMPLIED CONDITIONS,
+REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT
+ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO
+BE LEGALLY INVALID.
+
+10.     Limitation of Liability.
+
+TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL ORACLE OR ITS
+LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES,
+HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR
+RELATED TO THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF ORACLE HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event will Oracle's
+liability to you, whether in contract, tort (including negligence), or
+otherwise, exceed the amount paid by you for Software under this
+Agreement. The foregoing limitations will apply even if the above
+stated warranty fails of its essential purpose. Some states do not
+allow the exclusion of incidental or consequential damages, so some of
+the terms above may not be applicable to you.
+
+11.     Export Regulations.
+
+All Software, documents, technical data, and any other materials
+delivered under this Agreement are subject to U.S. export control laws
+and may be subject to export or import regulations in other countries.
+You agree to comply strictly with these laws and regulations and
+acknowledge that you have the responsibility to obtain any licenses to
+export, re-export, or import as may be required after delivery to you.
+
+12.     U.S. Government Restricted Rights.
+
+If Software is being acquired by or on behalf of the U.S. Government or
+by a U.S. Government prime contractor or subcontractor (at any tier),
+then the Government's rights in Software and accompanying documentation
+will be only as set forth in this Agreement; this is in accordance with
+48 CFR 227.7201 through 227.7202-4 (for Department of Defense (DOD)
+acquisitions) and with 48 CFR 2.101 and 12.212 (for non-DOD
+acquisitions).
+
+13.     Governing Law.
+
+Any action related to this Agreement will be governed by California law
+and controlling U.S. federal law. No choice of law rules of any
+jurisdiction will apply.
+
+14.     Severability.
+
+If any provision of this Agreement is held to be unenforceable, this
+Agreement will remain in effect with the provision omitted, unless
+omission would frustrate the intent of the parties, in which case this
+Agreement will immediately terminate.
+
+15.     Integration.
+
+This Agreement, including any terms contained in your Entitlement, is
+the entire agreement between you and Oracle relating to its subject
+matter. It supersedes all prior or contemporaneous oral or written
+communications, proposals, representations and warranties and prevails
+over any conflicting or additional terms of any quote, order,
+acknowledgment, or other communication between the parties relating to
+its subject matter during the term of this Agreement. No modification
+of this Agreement will be binding, unless in writing and signed by an
+authorized representative of each party.
+
+For inquiries please contact: Oracle Corporation, 500 Oracle Parkway,
 Redwood Shores, California 94065, USA.

+ 504 - 504
L2J_Server_BETA/dist/doc/trove_LICENSE.txt

@@ -1,504 +1,504 @@
-          GNU LESSER GENERAL PUBLIC LICENSE
-               Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-                Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
-          GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-  
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-                NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-             END OF TERMS AND CONDITIONS
-
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
-
-
+          GNU LESSER GENERAL PUBLIC LICENSE
+               Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+          GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+             END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+

+ 79 - 79
L2J_Server_BETA/dist/languages/gsregister/GSRegister.properties

@@ -1,80 +1,80 @@
-language = English
-toolName = GS Registering Tool
-
-error = Error
-reason = Reason:
-yes = Yes
-no = No
-
-fileMenu = File
-exitItem = Exit
-helpMenu = Help
-aboutItem = About
-
-btnRemove = Remove
-btnRemoveAll = Remove All
-btnRegister = Register GameServer
-confirmRemoveTitle = Confirm Removal
-confirmRemoveText = Are you sure you want to remove GameServer %d - %s?
-confirmRemoveAllText = Are you sure you want to remove ALL GameServers?
-gsListRetrieveError = There was an error while attempting to retrieve the list of currently registered GameServers.
-
-gsName = GameServer Name
-gsAction = Action
-
-registerGS = Register GameServer
-serverName = Server name:
-save = Save
-cancel = Cancel
-saveHexId = The hexid.txt file should be saved on GameServer's 'configs' folder to properly complete this process.
-hexidDest = Choose hexid file destination folder...
-
-purpose = Allows to register/remove GameServers from LoginServer.
-options = Options:
-fallbackOpt = If during the register operation the specified GameServer ID is in use, an attempt with the first available ID will be made.
-forceOpt = Forces GameServer register operation to overwrite a previous registration on the specified ID, if necessary.
-cmdOpt = Forces this application to run in console mode, even if GUI is supported.
-helpOpt = Shows this help message and exits.
-languageOpt = Attempts to use the language for the specified locale, on failure reverts to auto-detection.
-registerOpt1 = Registers a GameServer on ID <id> and saves the hexid.txt file on <hexid_dest_dir>.
-registerOpt2 = You can provide a negative value for <id> to register under the first available ID.
-registerOpt3 = Nothing is done if <id> is already in use, unless --force or --fallback is used.
-unregisterOpt = Removes the GameServer specified by <id>, use "all" to remove all currently registered GameServers.
-wrongUnregisterArg = wrong argument for GameServer removal, specify a numeric ID or "all" without quotes to remove all.
-noAction = No action to be taken.
-checkingIdInUse = Checking if GameServer ID %d is in use...
-removingGsId = Removing GameServer ID: %d
-forcingRegistration = Forcing registration on ID %d, an existing registration on this ID is being overwritten.
-fallingBack = Trying to register on the first available ID.
-registrationOk = GameServer successfully registered on LoginServer with ID %d.
-unregisterOk = GameServer ID: %d was successfully removed from LoginServer.
-unregisterAllOk = All GameServers were successfully removed.
-noFreeId = There was no free ID available to register.
-sqlErrorRegister = An SQL error occurred while trying to register the GameServer.
-ioErrorRegister = An error saving the hexid file occurred while trying to register the GameServer.
-errorRegister = An error occurred while trying to register the GameServer.
-errorUnregister = An error occurred while trying to remove the GameServer.
-sqlErrorUnregister = An SQL error occurred while trying to remove the GameServer.
-sqlErrorUnregisterAll = An SQL error occurred while trying to remove ALL GameServers.
-noServerNames = No available names for GameServer, verify servername.xml file exists in the LoginServer folder.
-noNameForId = No name for ID: %d
-idIsNotFree = This ID is not available.
-noServerForId = No GameServer is registered on ID: %d
-
-
-cmdMenuRegister = Register GameServer
-cmdMenuListNames = List GameServers Names and IDs
-cmdMenuRemoveGS = Remove GameServer
-cmdMenuRemoveAll = Remove ALL GameServers
-cmdMenuExit = Exit
-yourChoice = Choice:
-invalidChoice = Invalid Choice: %s
-gsInUse = In Use
-gsFree = Free
-enterDesiredId = Enter desired ID:
-
-credits = © 2008-2009 L2J Team. All rights reserved.
-language = Language: English
-icons = Icons by http://www.famfamfam.com
-translation = Translation: L2J Team
+language = English
+toolName = GS Registering Tool
+
+error = Error
+reason = Reason:
+yes = Yes
+no = No
+
+fileMenu = File
+exitItem = Exit
+helpMenu = Help
+aboutItem = About
+
+btnRemove = Remove
+btnRemoveAll = Remove All
+btnRegister = Register GameServer
+confirmRemoveTitle = Confirm Removal
+confirmRemoveText = Are you sure you want to remove GameServer %d - %s?
+confirmRemoveAllText = Are you sure you want to remove ALL GameServers?
+gsListRetrieveError = There was an error while attempting to retrieve the list of currently registered GameServers.
+
+gsName = GameServer Name
+gsAction = Action
+
+registerGS = Register GameServer
+serverName = Server name:
+save = Save
+cancel = Cancel
+saveHexId = The hexid.txt file should be saved on GameServer's 'configs' folder to properly complete this process.
+hexidDest = Choose hexid file destination folder...
+
+purpose = Allows to register/remove GameServers from LoginServer.
+options = Options:
+fallbackOpt = If during the register operation the specified GameServer ID is in use, an attempt with the first available ID will be made.
+forceOpt = Forces GameServer register operation to overwrite a previous registration on the specified ID, if necessary.
+cmdOpt = Forces this application to run in console mode, even if GUI is supported.
+helpOpt = Shows this help message and exits.
+languageOpt = Attempts to use the language for the specified locale, on failure reverts to auto-detection.
+registerOpt1 = Registers a GameServer on ID <id> and saves the hexid.txt file on <hexid_dest_dir>.
+registerOpt2 = You can provide a negative value for <id> to register under the first available ID.
+registerOpt3 = Nothing is done if <id> is already in use, unless --force or --fallback is used.
+unregisterOpt = Removes the GameServer specified by <id>, use "all" to remove all currently registered GameServers.
+wrongUnregisterArg = wrong argument for GameServer removal, specify a numeric ID or "all" without quotes to remove all.
+noAction = No action to be taken.
+checkingIdInUse = Checking if GameServer ID %d is in use...
+removingGsId = Removing GameServer ID: %d
+forcingRegistration = Forcing registration on ID %d, an existing registration on this ID is being overwritten.
+fallingBack = Trying to register on the first available ID.
+registrationOk = GameServer successfully registered on LoginServer with ID %d.
+unregisterOk = GameServer ID: %d was successfully removed from LoginServer.
+unregisterAllOk = All GameServers were successfully removed.
+noFreeId = There was no free ID available to register.
+sqlErrorRegister = An SQL error occurred while trying to register the GameServer.
+ioErrorRegister = An error saving the hexid file occurred while trying to register the GameServer.
+errorRegister = An error occurred while trying to register the GameServer.
+errorUnregister = An error occurred while trying to remove the GameServer.
+sqlErrorUnregister = An SQL error occurred while trying to remove the GameServer.
+sqlErrorUnregisterAll = An SQL error occurred while trying to remove ALL GameServers.
+noServerNames = No available names for GameServer, verify servername.xml file exists in the LoginServer folder.
+noNameForId = No name for ID: %d
+idIsNotFree = This ID is not available.
+noServerForId = No GameServer is registered on ID: %d
+
+
+cmdMenuRegister = Register GameServer
+cmdMenuListNames = List GameServers Names and IDs
+cmdMenuRemoveGS = Remove GameServer
+cmdMenuRemoveAll = Remove ALL GameServers
+cmdMenuExit = Exit
+yourChoice = Choice:
+invalidChoice = Invalid Choice: %s
+gsInUse = In Use
+gsFree = Free
+enterDesiredId = Enter desired ID:
+
+credits = © 2008-2009 L2J Team. All rights reserved.
+language = Language: English
+icons = Icons by http://www.famfamfam.com
+translation = Translation: L2J Team
 bugReports = Bug Reports:

+ 8 - 8
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/hitConditionBonus.java → L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/HitConditionBonus.java

@@ -32,9 +32,9 @@ import com.l2jserver.gameserver.model.actor.L2Character;
  * @author Nik
  *
  */
-public class hitConditionBonus
+public class HitConditionBonus
 {
-	protected static final Logger _log = Logger.getLogger(hitConditionBonus.class.getName());
+	protected static final Logger _log = Logger.getLogger(HitConditionBonus.class.getName());
 	
 	private static int frontBonus = 0;
 	private static int sideBonus = 0;
@@ -49,23 +49,23 @@ public class hitConditionBonus
 		double mod = 100;
 		// Get high or low bonus
 		if (attacker.getZ() - target.getZ() > 50)
-			mod += hitConditionBonus.highBonus;
+			mod += HitConditionBonus.highBonus;
 		else if (attacker.getZ() - target.getZ() < -50)
-			mod += hitConditionBonus.lowBonus;
+			mod += HitConditionBonus.lowBonus;
 		
 		// Get weather bonus
 		if (GameTimeController.getInstance().isNowNight())
-			mod += hitConditionBonus.darkBonus;
+			mod += HitConditionBonus.darkBonus;
 		//else if () No rain support yet.
 			//chance += hitConditionBonus.rainBonus;
 		
 		// Get side bonus
 		if(attacker.isBehindTarget())
-			mod += hitConditionBonus.backBonus;
+			mod += HitConditionBonus.backBonus;
 		else if(attacker.isInFrontOfTarget())
-			mod += hitConditionBonus.frontBonus;
+			mod += HitConditionBonus.frontBonus;
 		else
-			mod += hitConditionBonus.sideBonus;
+			mod += HitConditionBonus.sideBonus;
 		
 		// If (mod / 10) is less than 0, return 0, because we cant lower more than 100%.
 		return Math.max(mod / 100, 0); 

+ 96 - 96
L2J_Server_BETA/java/com/l2jserver/gameserver/model/DropProtection.java

@@ -1,96 +1,96 @@
-/*
- * 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.model;
-
-import java.util.concurrent.ScheduledFuture;
-
-import com.l2jserver.gameserver.ThreadPoolManager;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
-
-/**
- * 
- * @author DrHouse
- *
- */
-public class DropProtection implements Runnable
-{
-	private volatile boolean _isProtected = false;
-	private L2PcInstance _owner = null;
-	private ScheduledFuture<?> _task = null;
-	
-	private static final long PROTECTED_MILLIS_TIME = 15000;
-	
-	@Override
-	public synchronized void run()
-	{
-		_isProtected = false;
-		_owner = null;
-		_task = null;
-	}
-	
-	public boolean isProtected()
-	{
-		return _isProtected;
-	}
-	
-	public L2PcInstance getOwner()
-	{
-		return _owner;
-	}
-	
-	public synchronized boolean tryPickUp(L2PcInstance actor)
-	{
-		if (!_isProtected)
-			return true;
-		
-		if (_owner == actor)
-			return true;
-		
-		if (_owner.getParty() != null && _owner.getParty() == actor.getParty())
-			return true;
-		
-		/*if (_owner.getClan() != null && _owner.getClan() == actor.getClan())
-			return true;*/
-		
-		return false;
-	}
-	
-	public boolean tryPickUp(L2PetInstance pet)
-	{
-		return tryPickUp(pet.getOwner());
-	}
-	
-	public synchronized void unprotect()
-	{
-		if (_task != null)
-			_task.cancel(false);
-		_isProtected = false;
-		_owner = null;
-		_task = null;
-	}
-	
-	public synchronized void protect(L2PcInstance player)
-	{
-		unprotect();
-		
-		_isProtected = true;
-		
-		if ((_owner = player) == null)
-			throw new NullPointerException("Trying to protect dropped item to null owner");
-		
-		_task = ThreadPoolManager.getInstance().scheduleGeneral(this, PROTECTED_MILLIS_TIME);
-	}
-}
+/*
+ * 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.model;
+
+import java.util.concurrent.ScheduledFuture;
+
+import com.l2jserver.gameserver.ThreadPoolManager;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
+
+/**
+ * 
+ * @author DrHouse
+ *
+ */
+public class DropProtection implements Runnable
+{
+	private volatile boolean _isProtected = false;
+	private L2PcInstance _owner = null;
+	private ScheduledFuture<?> _task = null;
+	
+	private static final long PROTECTED_MILLIS_TIME = 15000;
+	
+	@Override
+	public synchronized void run()
+	{
+		_isProtected = false;
+		_owner = null;
+		_task = null;
+	}
+	
+	public boolean isProtected()
+	{
+		return _isProtected;
+	}
+	
+	public L2PcInstance getOwner()
+	{
+		return _owner;
+	}
+	
+	public synchronized boolean tryPickUp(L2PcInstance actor)
+	{
+		if (!_isProtected)
+			return true;
+		
+		if (_owner == actor)
+			return true;
+		
+		if (_owner.getParty() != null && _owner.getParty() == actor.getParty())
+			return true;
+		
+		/*if (_owner.getClan() != null && _owner.getClan() == actor.getClan())
+			return true;*/
+		
+		return false;
+	}
+	
+	public boolean tryPickUp(L2PetInstance pet)
+	{
+		return tryPickUp(pet.getOwner());
+	}
+	
+	public synchronized void unprotect()
+	{
+		if (_task != null)
+			_task.cancel(false);
+		_isProtected = false;
+		_owner = null;
+		_task = null;
+	}
+	
+	public synchronized void protect(L2PcInstance player)
+	{
+		unprotect();
+		
+		_isProtected = true;
+		
+		if ((_owner = player) == null)
+			throw new NullPointerException("Trying to protect dropped item to null owner");
+		
+		_task = ThreadPoolManager.getInstance().scheduleGeneral(this, PROTECTED_MILLIS_TIME);
+	}
+}

+ 210 - 210
L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2ContactList.java

@@ -1,210 +1,210 @@
-/*
- * 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.model;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javolution.util.FastList;
-
-import com.l2jserver.L2DatabaseFactory;
-import com.l2jserver.gameserver.datatables.CharNameTable;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
-
-/**
- * @author UnAfraid & mrTJO
- * TODO: System Messages:
- * 	ADD:
-		3223: The previous name is being registered. Please try again later.
- *	END OF ADD
- *	DEL
- * 		3219: $s1 was successfully deleted from your Contact List.
-		3217: The name is not currently registered.
-	END OF DEL
- */
-public class L2ContactList
-{
-	private final Logger _log = Logger.getLogger(getClass().getName());
-	private final L2PcInstance activeChar;
-	private final List<String> _contacts;
-	
-	private final String QUERY_ADD = "INSERT INTO character_contacts (charId, contactId) VALUES (?, ?)";
-	private final String QUERY_REMOVE = "DELETE FROM character_contacts WHERE charId = ? and contactId = ?";
-	private final String QUERY_LOAD = "SELECT contactId FROM character_contacts WHERE charId = ?";
-		
-	public L2ContactList(L2PcInstance player)
-	{
-		activeChar = player;
-		_contacts = new FastList<String>().shared();
-		restore();
-	}
-	
-	public void restore()
-	{
-		_contacts.clear();
-		
-		Connection con = null;
-		
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement(QUERY_LOAD);
-			statement.setInt(1, activeChar.getObjectId());
-			ResultSet rset = statement.executeQuery();
-			
-			int contactId;
-			String contactName;
-			while (rset.next())
-			{
-				contactId = rset.getInt(1);
-				contactName = CharNameTable.getInstance().getNameById(contactId);
-				if (contactName == null || contactName.equals(activeChar.getName()) || contactId == activeChar.getObjectId())
-					continue;
-				
-				_contacts.add(contactName);
-			}
-			
-			rset.close();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			_log.log(Level.WARNING, "Error found in " + activeChar.getName() + "'s ContactsList: " + e.getMessage(), e);
-		}
-		finally
-		{
-			L2DatabaseFactory.close(con);
-		}
-	}
-	
-	public boolean add(String name)
-	{
-		SystemMessage sm;
-		
-		int contactId = CharNameTable.getInstance().getIdByName(name);
-		if (_contacts.contains(name))
-		{
-			activeChar.sendPacket(SystemMessageId.NAME_ALREADY_EXIST_ON_CONTACT_LIST);
-			return false;
-		}
-		else if (activeChar.getName().equals(name))
-		{
-			activeChar.sendPacket(SystemMessageId.CANNOT_ADD_YOUR_NAME_ON_CONTACT_LIST);
-			return false;
-		}
-		else if (_contacts.size() >= 100)
-		{
-			activeChar.sendPacket(SystemMessageId.CONTACT_LIST_LIMIT_REACHED);
-			return false;
-		}
-		else if (contactId < 1)
-		{
-			sm = SystemMessage.getSystemMessage(SystemMessageId.NAME_S1_NOT_EXIST_TRY_ANOTHER_NAME);
-			sm.addString(name);
-			activeChar.sendPacket(sm);
-			return false;
-		}
-		else
-		{
-			for (String contactName : _contacts)
-			{
-				if (contactName.equalsIgnoreCase(name))
-				{
-					activeChar.sendPacket(SystemMessageId.NAME_ALREADY_EXIST_ON_CONTACT_LIST);
-					return false;
-				}
-			}
-		}
-		
-		Connection con = null;
-		try
-		{	
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement(QUERY_ADD);
-			statement.setInt(1, activeChar.getObjectId());
-			statement.setInt(2, contactId);
-			statement.execute();
-			statement.close();
-			
-			_contacts.add(name);
-			
-			sm = SystemMessage.getSystemMessage(SystemMessageId.S1_SUCCESSFULLY_ADDED_TO_CONTACT_LIST);
-			sm.addString(name);
-			activeChar.sendPacket(sm);
-		}
-		catch (Exception e)
-		{
-			_log.log(Level.WARNING, "Error found in " + activeChar.getName() + "'s ContactsList: " + e.getMessage(), e);
-		}
-		finally
-		{
-			L2DatabaseFactory.close(con);
-		}
-		return true;
-	}
-	
-	public void remove(String name)
-	{
-		int contactId = CharNameTable.getInstance().getIdByName(name);
-		
-		if (!_contacts.contains(name))
-		{
-			activeChar.sendPacket(SystemMessageId.NAME_NOT_REGISTERED_ON_CONTACT_LIST);
-			return;
-		}
-		
-		else if (contactId < 1)
-		{
-			//TODO: Message?
-			return;
-		}
-		
-		_contacts.remove(name);
-		
-		Connection con = null;
-		
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement(QUERY_REMOVE);
-			statement.setInt(1, activeChar.getObjectId());
-			statement.setInt(2, contactId);
-			statement.execute();
-			statement.close();
-			SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_SUCCESFULLY_DELETED_FROM_CONTACT_LIST);
-			sm.addString(name);
-			activeChar.sendPacket(sm);
-		}
-		catch (Exception e)
-		{
-			_log.log(Level.WARNING, "Error found in " + activeChar.getName() + "'s ContactsList: " + e.getMessage(), e);
-		}
-		finally
-		{
-			L2DatabaseFactory.close(con);
-		}
-	}
-	
-	public List<String> getAllContacts()
-	{
-		return _contacts;
-	}
-}
+/*
+ * 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.model;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javolution.util.FastList;
+
+import com.l2jserver.L2DatabaseFactory;
+import com.l2jserver.gameserver.datatables.CharNameTable;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.network.SystemMessageId;
+import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
+
+/**
+ * @author UnAfraid & mrTJO
+ * TODO: System Messages:
+ * 	ADD:
+		3223: The previous name is being registered. Please try again later.
+ *	END OF ADD
+ *	DEL
+ * 		3219: $s1 was successfully deleted from your Contact List.
+		3217: The name is not currently registered.
+	END OF DEL
+ */
+public class L2ContactList
+{
+	private final Logger _log = Logger.getLogger(getClass().getName());
+	private final L2PcInstance activeChar;
+	private final List<String> _contacts;
+	
+	private final String QUERY_ADD = "INSERT INTO character_contacts (charId, contactId) VALUES (?, ?)";
+	private final String QUERY_REMOVE = "DELETE FROM character_contacts WHERE charId = ? and contactId = ?";
+	private final String QUERY_LOAD = "SELECT contactId FROM character_contacts WHERE charId = ?";
+		
+	public L2ContactList(L2PcInstance player)
+	{
+		activeChar = player;
+		_contacts = new FastList<String>().shared();
+		restore();
+	}
+	
+	public void restore()
+	{
+		_contacts.clear();
+		
+		Connection con = null;
+		
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(QUERY_LOAD);
+			statement.setInt(1, activeChar.getObjectId());
+			ResultSet rset = statement.executeQuery();
+			
+			int contactId;
+			String contactName;
+			while (rset.next())
+			{
+				contactId = rset.getInt(1);
+				contactName = CharNameTable.getInstance().getNameById(contactId);
+				if (contactName == null || contactName.equals(activeChar.getName()) || contactId == activeChar.getObjectId())
+					continue;
+				
+				_contacts.add(contactName);
+			}
+			
+			rset.close();
+			statement.close();
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.WARNING, "Error found in " + activeChar.getName() + "'s ContactsList: " + e.getMessage(), e);
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+	}
+	
+	public boolean add(String name)
+	{
+		SystemMessage sm;
+		
+		int contactId = CharNameTable.getInstance().getIdByName(name);
+		if (_contacts.contains(name))
+		{
+			activeChar.sendPacket(SystemMessageId.NAME_ALREADY_EXIST_ON_CONTACT_LIST);
+			return false;
+		}
+		else if (activeChar.getName().equals(name))
+		{
+			activeChar.sendPacket(SystemMessageId.CANNOT_ADD_YOUR_NAME_ON_CONTACT_LIST);
+			return false;
+		}
+		else if (_contacts.size() >= 100)
+		{
+			activeChar.sendPacket(SystemMessageId.CONTACT_LIST_LIMIT_REACHED);
+			return false;
+		}
+		else if (contactId < 1)
+		{
+			sm = SystemMessage.getSystemMessage(SystemMessageId.NAME_S1_NOT_EXIST_TRY_ANOTHER_NAME);
+			sm.addString(name);
+			activeChar.sendPacket(sm);
+			return false;
+		}
+		else
+		{
+			for (String contactName : _contacts)
+			{
+				if (contactName.equalsIgnoreCase(name))
+				{
+					activeChar.sendPacket(SystemMessageId.NAME_ALREADY_EXIST_ON_CONTACT_LIST);
+					return false;
+				}
+			}
+		}
+		
+		Connection con = null;
+		try
+		{	
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(QUERY_ADD);
+			statement.setInt(1, activeChar.getObjectId());
+			statement.setInt(2, contactId);
+			statement.execute();
+			statement.close();
+			
+			_contacts.add(name);
+			
+			sm = SystemMessage.getSystemMessage(SystemMessageId.S1_SUCCESSFULLY_ADDED_TO_CONTACT_LIST);
+			sm.addString(name);
+			activeChar.sendPacket(sm);
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.WARNING, "Error found in " + activeChar.getName() + "'s ContactsList: " + e.getMessage(), e);
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+		return true;
+	}
+	
+	public void remove(String name)
+	{
+		int contactId = CharNameTable.getInstance().getIdByName(name);
+		
+		if (!_contacts.contains(name))
+		{
+			activeChar.sendPacket(SystemMessageId.NAME_NOT_REGISTERED_ON_CONTACT_LIST);
+			return;
+		}
+		
+		else if (contactId < 1)
+		{
+			//TODO: Message?
+			return;
+		}
+		
+		_contacts.remove(name);
+		
+		Connection con = null;
+		
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(QUERY_REMOVE);
+			statement.setInt(1, activeChar.getObjectId());
+			statement.setInt(2, contactId);
+			statement.execute();
+			statement.close();
+			SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_SUCCESFULLY_DELETED_FROM_CONTACT_LIST);
+			sm.addString(name);
+			activeChar.sendPacket(sm);
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.WARNING, "Error found in " + activeChar.getName() + "'s ContactsList: " + e.getMessage(), e);
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+	}
+	
+	public List<String> getAllContacts()
+	{
+		return _contacts;
+	}
+}

+ 68 - 68
L2J_Server_BETA/java/com/l2jserver/gameserver/model/conditions/ConditionTargetActiveSkillId.java

@@ -1,68 +1,68 @@
-/*
- * 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.model.conditions;
-
-import com.l2jserver.gameserver.model.skills.L2Skill;
-import com.l2jserver.gameserver.model.stats.Env;
-
-/**
- * The Class ConditionTargetActiveSkillId.
- */
-public class ConditionTargetActiveSkillId extends Condition
-{
-	
-	private final int _skillId;
-	private final int _skillLevel;
-	
-	/**
-	 * Instantiates a new condition target active skill id.
-	 *
-	 * @param skillId the skill id
-	 */
-	public ConditionTargetActiveSkillId(int skillId)
-	{
-		_skillId = skillId;
-		_skillLevel = -1;
-	}
-	
-	/**
-	 * Instantiates a new condition target active skill id.
-	 *
-	 * @param skillId the skill id
-	 * @param skillLevel the skill level
-	 */
-	public ConditionTargetActiveSkillId(int skillId, int skillLevel)
-	{
-		_skillId = skillId;
-		_skillLevel = skillLevel;
-	}
-	
-	@Override
-	public boolean testImpl(Env env)
-	{
-		for (L2Skill sk : env.target.getAllSkills())
-		{
-			if (sk != null)
-			{
-				if (sk.getId() == _skillId)
-				{
-					if (_skillLevel == -1 || _skillLevel <= sk.getLevel())
-						return true;
-				}
-			}
-		}
-		return false;
-	}
-}
+/*
+ * 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.model.conditions;
+
+import com.l2jserver.gameserver.model.skills.L2Skill;
+import com.l2jserver.gameserver.model.stats.Env;
+
+/**
+ * The Class ConditionTargetActiveSkillId.
+ */
+public class ConditionTargetActiveSkillId extends Condition
+{
+	
+	private final int _skillId;
+	private final int _skillLevel;
+	
+	/**
+	 * Instantiates a new condition target active skill id.
+	 *
+	 * @param skillId the skill id
+	 */
+	public ConditionTargetActiveSkillId(int skillId)
+	{
+		_skillId = skillId;
+		_skillLevel = -1;
+	}
+	
+	/**
+	 * Instantiates a new condition target active skill id.
+	 *
+	 * @param skillId the skill id
+	 * @param skillLevel the skill level
+	 */
+	public ConditionTargetActiveSkillId(int skillId, int skillLevel)
+	{
+		_skillId = skillId;
+		_skillLevel = skillLevel;
+	}
+	
+	@Override
+	public boolean testImpl(Env env)
+	{
+		for (L2Skill sk : env.target.getAllSkills())
+		{
+			if (sk != null)
+			{
+				if (sk.getId() == _skillId)
+				{
+					if (_skillLevel == -1 || _skillLevel <= sk.getLevel())
+						return true;
+				}
+			}
+		}
+		return false;
+	}
+}

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/stats/Formulas.java

@@ -20,7 +20,7 @@ import java.util.logging.Logger;
 import com.l2jserver.Config;
 import com.l2jserver.gameserver.SevenSigns;
 import com.l2jserver.gameserver.SevenSignsFestival;
-import com.l2jserver.gameserver.datatables.hitConditionBonus;
+import com.l2jserver.gameserver.datatables.HitConditionBonus;
 import com.l2jserver.gameserver.instancemanager.CastleManager;
 import com.l2jserver.gameserver.instancemanager.ClanHallManager;
 import com.l2jserver.gameserver.instancemanager.FortManager;
@@ -2156,7 +2156,7 @@ public final class Formulas
 		int chance = (80 + (2 * (attacker.getAccuracy() - target.getEvasionRate(attacker))))*10;
 		
 		// Get additional bonus from the conditions when you are attacking
-		chance *= hitConditionBonus.getConditionBonus(attacker, target);
+		chance *= HitConditionBonus.getConditionBonus(attacker, target);
 		
 		chance = Math.max(chance, 200);
 		chance = Math.min(chance, 980);

+ 53 - 53
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestEx2ndPasswordCheck.java

@@ -1,53 +1,53 @@
-/*
- * 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.network.serverpackets.Ex2ndPasswordCheck;
-
-/**
- * Format: (ch)
- * 
- * @author mrTJO
- */
-public class RequestEx2ndPasswordCheck extends L2GameClientPacket
-{
-	private static final String _C__D0_AD_REQUESTEX2NDPASSWORDCHECK = "[C] D0:AD RequestEx2ndPasswordCheck";
-	//private static Logger _log = Logger.getLogger(RequestEx2ndPasswordCheck.class.getName());
-	
-	@Override
-	protected void readImpl()
-	{
-		
-	}
-	
-	@Override
-	protected void runImpl()
-	{
-		if (!Config.SECOND_AUTH_ENABLED || getClient().getSecondaryAuth().isAuthed())
-		{
-			sendPacket(new Ex2ndPasswordCheck(Ex2ndPasswordCheck.PASSWORD_OK));
-			return;
-		}
-		
-		getClient().getSecondaryAuth().openDialog();
-	}
-	
-	@Override
-	public String getType()
-	{
-		return _C__D0_AD_REQUESTEX2NDPASSWORDCHECK;
-	}
-}
+/*
+ * 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.network.serverpackets.Ex2ndPasswordCheck;
+
+/**
+ * Format: (ch)
+ * 
+ * @author mrTJO
+ */
+public class RequestEx2ndPasswordCheck extends L2GameClientPacket
+{
+	private static final String _C__D0_AD_REQUESTEX2NDPASSWORDCHECK = "[C] D0:AD RequestEx2ndPasswordCheck";
+	//private static Logger _log = Logger.getLogger(RequestEx2ndPasswordCheck.class.getName());
+	
+	@Override
+	protected void readImpl()
+	{
+		
+	}
+	
+	@Override
+	protected void runImpl()
+	{
+		if (!Config.SECOND_AUTH_ENABLED || getClient().getSecondaryAuth().isAuthed())
+		{
+			sendPacket(new Ex2ndPasswordCheck(Ex2ndPasswordCheck.PASSWORD_OK));
+			return;
+		}
+		
+		getClient().getSecondaryAuth().openDialog();
+	}
+	
+	@Override
+	public String getType()
+	{
+		return _C__D0_AD_REQUESTEX2NDPASSWORDCHECK;
+	}
+}

+ 68 - 68
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestEx2ndPasswordReq.java

@@ -1,68 +1,68 @@
-/*
- * 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.network.serverpackets.Ex2ndPasswordAck;
-import com.l2jserver.gameserver.security.SecondaryPasswordAuth;
-
-/**
- * (ch)cS{S}
- * c: change pass?
- * S: current password
- * S: new password
- * 
- * @author mrTJO
- */
-public class RequestEx2ndPasswordReq extends L2GameClientPacket
-{
-	private static final String _C__D0_AF_REQUESTEX2NDPASSWORDREQ = "[C] D0:AF RequestEx2ndPasswordReq";
-	//private static Logger _log = Logger.getLogger(RequestEx2ndPasswordReq.class.getName());
-	int _changePass;
-	String _password, _newPassword;
-	
-	@Override
-	protected void readImpl()
-	{
-		_changePass = readC();
-		_password = readS();
-		if (_changePass == 2)
-			_newPassword = readS();
-	}
-	
-	@Override
-	protected void runImpl()
-	{
-		if (!Config.SECOND_AUTH_ENABLED)
-			return;
-		
-		SecondaryPasswordAuth spa = getClient().getSecondaryAuth();
-		boolean exVal = false;
-		
-		if (_changePass == 0 && !spa.passwordExist())
-			exVal = spa.savePassword(_password);
-		else if (_changePass == 2 && spa.passwordExist())
-			exVal = spa.changePassword(_password, _newPassword);
-		
-		if (exVal)
-			getClient().sendPacket(new Ex2ndPasswordAck(Ex2ndPasswordAck.SUCCESS));
-	}
-	
-	@Override
-	public String getType()
-	{
-		return _C__D0_AF_REQUESTEX2NDPASSWORDREQ;
-	}
-}
+/*
+ * 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.network.serverpackets.Ex2ndPasswordAck;
+import com.l2jserver.gameserver.security.SecondaryPasswordAuth;
+
+/**
+ * (ch)cS{S}
+ * c: change pass?
+ * S: current password
+ * S: new password
+ * 
+ * @author mrTJO
+ */
+public class RequestEx2ndPasswordReq extends L2GameClientPacket
+{
+	private static final String _C__D0_AF_REQUESTEX2NDPASSWORDREQ = "[C] D0:AF RequestEx2ndPasswordReq";
+	//private static Logger _log = Logger.getLogger(RequestEx2ndPasswordReq.class.getName());
+	int _changePass;
+	String _password, _newPassword;
+	
+	@Override
+	protected void readImpl()
+	{
+		_changePass = readC();
+		_password = readS();
+		if (_changePass == 2)
+			_newPassword = readS();
+	}
+	
+	@Override
+	protected void runImpl()
+	{
+		if (!Config.SECOND_AUTH_ENABLED)
+			return;
+		
+		SecondaryPasswordAuth spa = getClient().getSecondaryAuth();
+		boolean exVal = false;
+		
+		if (_changePass == 0 && !spa.passwordExist())
+			exVal = spa.savePassword(_password);
+		else if (_changePass == 2 && spa.passwordExist())
+			exVal = spa.changePassword(_password, _newPassword);
+		
+		if (exVal)
+			getClient().sendPacket(new Ex2ndPasswordAck(Ex2ndPasswordAck.SUCCESS));
+	}
+	
+	@Override
+	public String getType()
+	{
+		return _C__D0_AF_REQUESTEX2NDPASSWORDREQ;
+	}
+}

+ 52 - 52
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestEx2ndPasswordVerify.java

@@ -1,52 +1,52 @@
-/*
- * 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;
-
-/**
- * Format: (ch)S
- * S: numerical password
- * 
- * @author mrTJO
- */
-public class RequestEx2ndPasswordVerify extends L2GameClientPacket
-{
-	private static final String _C__D0_AE_REQUESTEX2NDPASSWORDVERIFY = "[C] D0:AE RequestEx2ndPasswordVerify";
-	
-	//private static Logger _log = Logger.getLogger(RequestEx2ndPasswordVerify.class.getName());
-	String _password;
-	
-	@Override
-	protected void readImpl()
-	{
-		_password = readS();
-	}
-	
-	@Override
-	protected void runImpl()
-	{
-		if (!Config.SECOND_AUTH_ENABLED)
-			return;
-		
-		getClient().getSecondaryAuth().checkPassword(_password, false);
-	}
-	
-	@Override
-	public String getType()
-	{
-		return _C__D0_AE_REQUESTEX2NDPASSWORDVERIFY;
-	}
-}
+/*
+ * 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;
+
+/**
+ * Format: (ch)S
+ * S: numerical password
+ * 
+ * @author mrTJO
+ */
+public class RequestEx2ndPasswordVerify extends L2GameClientPacket
+{
+	private static final String _C__D0_AE_REQUESTEX2NDPASSWORDVERIFY = "[C] D0:AE RequestEx2ndPasswordVerify";
+	
+	//private static Logger _log = Logger.getLogger(RequestEx2ndPasswordVerify.class.getName());
+	String _password;
+	
+	@Override
+	protected void readImpl()
+	{
+		_password = readS();
+	}
+	
+	@Override
+	protected void runImpl()
+	{
+		if (!Config.SECOND_AUTH_ENABLED)
+			return;
+		
+		getClient().getSecondaryAuth().checkPassword(_password, false);
+	}
+	
+	@Override
+	public String getType()
+	{
+		return _C__D0_AE_REQUESTEX2NDPASSWORDVERIFY;
+	}
+}

+ 61 - 61
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestExAddContactToContactList.java

@@ -1,61 +1,61 @@
-/*
- * 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.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.network.serverpackets.ExConfirmAddingContact;
-
-/**
- * Format: (ch)S
- * S: Character Name
- * 
- * @author UnAfraid & mrTJO
- */
-public class RequestExAddContactToContactList extends L2GameClientPacket
-{
-	private static final String _C__D0_84_REQUESTEXADDCONTACTTOCONTACTLIST = "[C] D0:84 RequestExAddContactToContactList";
-	private String _name;
-	
-	@Override
-	protected void readImpl()
-	{
-		_name = readS();
-	}
-
-	@Override
-	protected void runImpl()
-	{
-		if (!Config.ALLOW_MAIL)
-			return;
-		
-		if (_name == null)
-			return;
-		
-		final L2PcInstance activeChar = getClient().getActiveChar();
-		if (activeChar == null)
-			return;
-		
-		boolean charAdded = activeChar.getContactList().add(_name);
-		activeChar.sendPacket(new ExConfirmAddingContact(_name, charAdded));
-	}
-
-	
-	@Override
-	public String getType()
-	{
-		return _C__D0_84_REQUESTEXADDCONTACTTOCONTACTLIST;
-	}	
-}
+/*
+ * 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.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.network.serverpackets.ExConfirmAddingContact;
+
+/**
+ * Format: (ch)S
+ * S: Character Name
+ * 
+ * @author UnAfraid & mrTJO
+ */
+public class RequestExAddContactToContactList extends L2GameClientPacket
+{
+	private static final String _C__D0_84_REQUESTEXADDCONTACTTOCONTACTLIST = "[C] D0:84 RequestExAddContactToContactList";
+	private String _name;
+	
+	@Override
+	protected void readImpl()
+	{
+		_name = readS();
+	}
+
+	@Override
+	protected void runImpl()
+	{
+		if (!Config.ALLOW_MAIL)
+			return;
+		
+		if (_name == null)
+			return;
+		
+		final L2PcInstance activeChar = getClient().getActiveChar();
+		if (activeChar == null)
+			return;
+		
+		boolean charAdded = activeChar.getContactList().add(_name);
+		activeChar.sendPacket(new ExConfirmAddingContact(_name, charAdded));
+	}
+
+	
+	@Override
+	public String getType()
+	{
+		return _C__D0_84_REQUESTEXADDCONTACTTOCONTACTLIST;
+	}	
+}

+ 58 - 58
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestExDeleteContactFromContactList.java

@@ -1,58 +1,58 @@
-/*
- * 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.model.actor.instance.L2PcInstance;
-
-/**
- * Format: (ch)S
- * S: Character Name
- * 
- * @author UnAfraid & mrTJO
- */
-public class RequestExDeleteContactFromContactList extends L2GameClientPacket
-{
-	private static final String _C__D0_85_REQUESTEXDELETECONTACTFROMCONTACTLIST = "[C] D0:85 RequestExDeleteContactFromContactList";
-	private String _name;
-	
-	@Override
-	protected void readImpl()
-	{
-		_name = readS();
-	}
-	
-	@Override
-	protected void runImpl()
-	{
-		if (!Config.ALLOW_MAIL)
-			return;
-		
-		if (_name == null)
-			return;
-		
-		final L2PcInstance activeChar = getClient().getActiveChar();
-		if (activeChar == null)
-			return;
-		
-		activeChar.getContactList().remove(_name);
-	}
-	
-	@Override
-	public String getType()
-	{
-		return _C__D0_85_REQUESTEXDELETECONTACTFROMCONTACTLIST;
-	}	
-}
+/*
+ * 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.model.actor.instance.L2PcInstance;
+
+/**
+ * Format: (ch)S
+ * S: Character Name
+ * 
+ * @author UnAfraid & mrTJO
+ */
+public class RequestExDeleteContactFromContactList extends L2GameClientPacket
+{
+	private static final String _C__D0_85_REQUESTEXDELETECONTACTFROMCONTACTLIST = "[C] D0:85 RequestExDeleteContactFromContactList";
+	private String _name;
+	
+	@Override
+	protected void readImpl()
+	{
+		_name = readS();
+	}
+	
+	@Override
+	protected void runImpl()
+	{
+		if (!Config.ALLOW_MAIL)
+			return;
+		
+		if (_name == null)
+			return;
+		
+		final L2PcInstance activeChar = getClient().getActiveChar();
+		if (activeChar == null)
+			return;
+		
+		activeChar.getContactList().remove(_name);
+	}
+	
+	@Override
+	public String getType()
+	{
+		return _C__D0_85_REQUESTEXDELETECONTACTFROMCONTACTLIST;
+	}	
+}

+ 52 - 52
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestExFriendListExtended.java

@@ -1,52 +1,52 @@
-/*
- * 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.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.network.serverpackets.FriendListExtended;
-
-/**
- * @author mrTJO & UnAfraid
- */
-public final class RequestExFriendListExtended extends L2GameClientPacket
-{
-	private static final String _C__D0_87_REQUESTEXFRIENDLISTEXTENDED = "[C] D0:87 RequestExFriendListExtended";
-	
-	@Override
-	protected void readImpl()
-	{
-		// trigger packet
-	}
-	
-	@Override
-	public void runImpl()
-	{
-		if (!Config.ALLOW_MAIL)
-			return;
-		
-		final L2PcInstance activeChar = getClient().getActiveChar();
-		if (activeChar == null)
-			return;
-		
-		activeChar.sendPacket(new FriendListExtended(activeChar));
-	}
-	
-	@Override
-	public String getType()
-	{
-		return _C__D0_87_REQUESTEXFRIENDLISTEXTENDED;
-	}
-}
+/*
+ * 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.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.network.serverpackets.FriendListExtended;
+
+/**
+ * @author mrTJO & UnAfraid
+ */
+public final class RequestExFriendListExtended extends L2GameClientPacket
+{
+	private static final String _C__D0_87_REQUESTEXFRIENDLISTEXTENDED = "[C] D0:87 RequestExFriendListExtended";
+	
+	@Override
+	protected void readImpl()
+	{
+		// trigger packet
+	}
+	
+	@Override
+	public void runImpl()
+	{
+		if (!Config.ALLOW_MAIL)
+			return;
+		
+		final L2PcInstance activeChar = getClient().getActiveChar();
+		if (activeChar == null)
+			return;
+		
+		activeChar.sendPacket(new FriendListExtended(activeChar));
+	}
+	
+	@Override
+	public String getType()
+	{
+		return _C__D0_87_REQUESTEXFRIENDLISTEXTENDED;
+	}
+}

+ 66 - 66
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java

@@ -1,67 +1,67 @@
-/*
- * 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 java.util.ArrayList;
-import java.util.List;
-
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.model.olympiad.OlympiadGameManager;
-import com.l2jserver.gameserver.model.olympiad.OlympiadGameTask;
-import com.l2jserver.gameserver.network.serverpackets.ExOlympiadMatchList;
-
-/**
- * Format: (ch)d
- * d: unknown (always 0?)
- * 
- * @author  mrTJO
- */
-public class RequestExOlympiadMatchListRefresh extends L2GameClientPacket
-{
-	private static final String _C__D0_88_REQUESTEXOLYMPIADMATCHLISTREFRESH = "[C] D0:88 RequestExOlympiadMatchListRefresh";
-	
-	@Override
-	protected void readImpl()
-	{
-		// readD();
-	}
-	
-	@Override
-	protected void runImpl()
-	{
-		final L2PcInstance activeChar = getClient().getActiveChar();
-		if (activeChar == null || !activeChar.inObserverMode())
-			return;
-		
-		List<OlympiadGameTask> games = new ArrayList<OlympiadGameTask>();
-		OlympiadGameTask task;
-		for (int i = 0; i < OlympiadGameManager.getInstance().getNumberOfStadiums(); i++)
-		{
-			task = OlympiadGameManager.getInstance().getOlympiadTask(i);
-			if (task != null)
-			{
-				if (!task.isBattleFinished())
-					games.add(task);
-			}
-		}
-		activeChar.sendPacket(new ExOlympiadMatchList(games));
-	}
-	
-	@Override
-	public String getType()
-	{
-		return _C__D0_88_REQUESTEXOLYMPIADMATCHLISTREFRESH;
-	}
+/*
+ * 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 java.util.ArrayList;
+import java.util.List;
+
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.olympiad.OlympiadGameManager;
+import com.l2jserver.gameserver.model.olympiad.OlympiadGameTask;
+import com.l2jserver.gameserver.network.serverpackets.ExOlympiadMatchList;
+
+/**
+ * Format: (ch)d
+ * d: unknown (always 0?)
+ * 
+ * @author  mrTJO
+ */
+public class RequestExOlympiadMatchListRefresh extends L2GameClientPacket
+{
+	private static final String _C__D0_88_REQUESTEXOLYMPIADMATCHLISTREFRESH = "[C] D0:88 RequestExOlympiadMatchListRefresh";
+	
+	@Override
+	protected void readImpl()
+	{
+		// readD();
+	}
+	
+	@Override
+	protected void runImpl()
+	{
+		final L2PcInstance activeChar = getClient().getActiveChar();
+		if (activeChar == null || !activeChar.inObserverMode())
+			return;
+		
+		List<OlympiadGameTask> games = new ArrayList<OlympiadGameTask>();
+		OlympiadGameTask task;
+		for (int i = 0; i < OlympiadGameManager.getInstance().getNumberOfStadiums(); i++)
+		{
+			task = OlympiadGameManager.getInstance().getOlympiadTask(i);
+			if (task != null)
+			{
+				if (!task.isBattleFinished())
+					games.add(task);
+			}
+		}
+		activeChar.sendPacket(new ExOlympiadMatchList(games));
+	}
+	
+	@Override
+	public String getType()
+	{
+		return _C__D0_88_REQUESTEXOLYMPIADMATCHLISTREFRESH;
+	}
 }

+ 54 - 54
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestExShowContactList.java

@@ -1,54 +1,54 @@
-/*
- * 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.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.network.serverpackets.ExShowContactList;
-
-/**
- * Format: (ch)
- * 
- * @author mrTJO & UnAfraid
- */
-public final class RequestExShowContactList extends L2GameClientPacket
-{
-	private static final String _C__D0_86_REQUESTEXSHOWCONTACTLIST = "[C] D0:86 RequestExShowContactList";
-	
-	@Override
-	protected void readImpl()
-	{
-		// trigger packet
-	}
-	
-	@Override
-	public void runImpl()
-	{
-		if (!Config.ALLOW_MAIL)
-			return;
-		
-		final L2PcInstance activeChar = getClient().getActiveChar();
-		if (activeChar == null)
-			return;
-		
-		activeChar.sendPacket(new ExShowContactList(activeChar));
-	}
-	
-	@Override
-	public String getType()
-	{
-		return _C__D0_86_REQUESTEXSHOWCONTACTLIST;
-	}
-}
+/*
+ * 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.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.network.serverpackets.ExShowContactList;
+
+/**
+ * Format: (ch)
+ * 
+ * @author mrTJO & UnAfraid
+ */
+public final class RequestExShowContactList extends L2GameClientPacket
+{
+	private static final String _C__D0_86_REQUESTEXSHOWCONTACTLIST = "[C] D0:86 RequestExShowContactList";
+	
+	@Override
+	protected void readImpl()
+	{
+		// trigger packet
+	}
+	
+	@Override
+	public void runImpl()
+	{
+		if (!Config.ALLOW_MAIL)
+			return;
+		
+		final L2PcInstance activeChar = getClient().getActiveChar();
+		if (activeChar == null)
+			return;
+		
+		activeChar.sendPacket(new ExShowContactList(activeChar));
+	}
+	
+	@Override
+	public String getType()
+	{
+		return _C__D0_86_REQUESTEXSHOWCONTACTLIST;
+	}
+}

+ 41 - 41
L2J_Server_BETA/java/com/l2jserver/gameserver/network/gameserverpackets/SendMail.java

@@ -1,41 +1,41 @@
-/*
- * 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.gameserverpackets;
-
-import com.l2jserver.util.network.BaseSendablePacket;
-
-/**
- * @author mrTJO
- */
-public class SendMail extends BaseSendablePacket
-{	
-	public SendMail(String accountName, String mailId, String... args)
-	{
-		writeC(0x09);
-		writeS(accountName);
-		writeS(mailId);
-		writeC(args.length);
-		for (int i = 0; i < args.length; i++)
-		{
-			writeS(args[i]);
-		}
-	}
-	
-	@Override
-	public byte[] getContent()
-	{
-		return getBytes();
-	}
-}
+/*
+ * 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.gameserverpackets;
+
+import com.l2jserver.util.network.BaseSendablePacket;
+
+/**
+ * @author mrTJO
+ */
+public class SendMail extends BaseSendablePacket
+{	
+	public SendMail(String accountName, String mailId, String... args)
+	{
+		writeC(0x09);
+		writeS(accountName);
+		writeS(mailId);
+		writeC(args.length);
+		for (int i = 0; i < args.length; i++)
+		{
+			writeS(args[i]);
+		}
+	}
+	
+	@Override
+	public byte[] getContent()
+	{
+		return getBytes();
+	}
+}

+ 49 - 49
L2J_Server_BETA/java/com/l2jserver/gameserver/network/gameserverpackets/TempBan.java

@@ -1,49 +1,49 @@
-/*
- * 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.gameserverpackets;
-
-import com.l2jserver.util.network.BaseSendablePacket;
-
-/**
- * @author mrTJO
- */
-public class TempBan extends BaseSendablePacket
-{	
-	public TempBan(String accountName, String ip, long time, String reason)
-	{
-		writeC(0x0A);
-		writeS(accountName);
-		writeS(ip);
-		writeQ(System.currentTimeMillis()+(time*60000));
-		if (reason != null)
-		{
-			writeC(0x01);
-			writeS(reason);
-		}
-		else
-			writeC(0x00);
-	}
-	
-	public TempBan(String accountName, String ip, long time)
-	{
-		this(accountName, ip, time, null);
-	}
-	
-	@Override
-	public byte[] getContent()
-	{
-		return getBytes();
-	}
-}
+/*
+ * 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.gameserverpackets;
+
+import com.l2jserver.util.network.BaseSendablePacket;
+
+/**
+ * @author mrTJO
+ */
+public class TempBan extends BaseSendablePacket
+{	
+	public TempBan(String accountName, String ip, long time, String reason)
+	{
+		writeC(0x0A);
+		writeS(accountName);
+		writeS(ip);
+		writeQ(System.currentTimeMillis()+(time*60000));
+		if (reason != null)
+		{
+			writeC(0x01);
+			writeS(reason);
+		}
+		else
+			writeC(0x00);
+	}
+	
+	public TempBan(String accountName, String ip, long time)
+	{
+		this(accountName, ip, time, null);
+	}
+	
+	@Override
+	public byte[] getContent()
+	{
+		return getBytes();
+	}
+}

+ 54 - 54
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/Ex2ndPasswordAck.java

@@ -1,54 +1,54 @@
-/*
- * 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.serverpackets;
-
-/**
- * 
- * @author mrTJO
- */
-public class Ex2ndPasswordAck extends L2GameServerPacket
-{
-	
-	private static final String _S__FE_10B_EX2NDPASSWORDACKPACKET = "[S] FE:10B Ex2NDPasswordAckPacket";
-	int _response;
-	
-	public static int SUCCESS = 0x00;
-	public static int WRONG_PATTERN = 0x01;
-	
-	public Ex2ndPasswordAck(int response)
-	{
-		_response = response;
-	}
-	
-	@Override
-	protected void writeImpl()
-	{
-		writeC(0xFE);
-		//writeH(0x109);
-		writeH(0xe7);
-		writeC(0x00);
-		if (_response == WRONG_PATTERN)
-			writeD(0x01);
-		else
-			writeD(0x00);
-		writeD(0x00);
-	}
-	
-	@Override
-	public String getType()
-	{
-		return _S__FE_10B_EX2NDPASSWORDACKPACKET;
-	}
-}
+/*
+ * 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.serverpackets;
+
+/**
+ * 
+ * @author mrTJO
+ */
+public class Ex2ndPasswordAck extends L2GameServerPacket
+{
+	
+	private static final String _S__FE_10B_EX2NDPASSWORDACKPACKET = "[S] FE:10B Ex2NDPasswordAckPacket";
+	int _response;
+	
+	public static int SUCCESS = 0x00;
+	public static int WRONG_PATTERN = 0x01;
+	
+	public Ex2ndPasswordAck(int response)
+	{
+		_response = response;
+	}
+	
+	@Override
+	protected void writeImpl()
+	{
+		writeC(0xFE);
+		//writeH(0x109);
+		writeH(0xe7);
+		writeC(0x00);
+		if (_response == WRONG_PATTERN)
+			writeD(0x01);
+		else
+			writeD(0x00);
+		writeD(0x00);
+	}
+	
+	@Override
+	public String getType()
+	{
+		return _S__FE_10B_EX2NDPASSWORDACKPACKET;
+	}
+}

+ 54 - 54
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/Ex2ndPasswordCheck.java

@@ -1,54 +1,54 @@
-/*
- * 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.serverpackets;
-
-/**
- * Format (ch)dd
- * d: window type
- * d: ban user (1)
- * 
- * @author mrTJO
- */
-public class Ex2ndPasswordCheck extends L2GameServerPacket
-{
-	private static final String _S__FE_109_EX2NDPASSWORDCHECKPACKET = "[S] FE:109 Ex2NDPasswordCheckPacket";
-	
-	public static final int PASSWORD_NEW = 0x00;
-	public static final int PASSWORD_PROMPT = 0x01;
-	public static final int PASSWORD_OK = 0x02;
-	
-	int _windowType;
-	
-	public Ex2ndPasswordCheck(int windowType)
-	{
-		_windowType = windowType;
-	}
-	
-	@Override
-	protected void writeImpl()
-	{
-		writeC(0xFE);
-		//writeH(0x109);
-		writeH(0xe5);
-		writeD(_windowType);
-		writeD(0x00);
-	}
-	
-	@Override
-	public String getType()
-	{
-		return _S__FE_109_EX2NDPASSWORDCHECKPACKET;
-	}
-}
+/*
+ * 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.serverpackets;
+
+/**
+ * Format (ch)dd
+ * d: window type
+ * d: ban user (1)
+ * 
+ * @author mrTJO
+ */
+public class Ex2ndPasswordCheck extends L2GameServerPacket
+{
+	private static final String _S__FE_109_EX2NDPASSWORDCHECKPACKET = "[S] FE:109 Ex2NDPasswordCheckPacket";
+	
+	public static final int PASSWORD_NEW = 0x00;
+	public static final int PASSWORD_PROMPT = 0x01;
+	public static final int PASSWORD_OK = 0x02;
+	
+	int _windowType;
+	
+	public Ex2ndPasswordCheck(int windowType)
+	{
+		_windowType = windowType;
+	}
+	
+	@Override
+	protected void writeImpl()
+	{
+		writeC(0xFE);
+		//writeH(0x109);
+		writeH(0xe5);
+		writeD(_windowType);
+		writeD(0x00);
+	}
+	
+	@Override
+	public String getType()
+	{
+		return _S__FE_109_EX2NDPASSWORDCHECKPACKET;
+	}
+}

+ 52 - 52
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/Ex2ndPasswordVerify.java

@@ -1,52 +1,52 @@
-/*
- * 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.serverpackets;
-
-/**
- * 
- * @author mrTJO
- */
-public class Ex2ndPasswordVerify extends L2GameServerPacket
-{
-	private static final String _S__FE_10A_EX2NDPASSWORDVERIFYPACKET = "[S] FE:10A Ex2NDPasswordVerifyPacket";
-	
-	public static final int PASSWORD_OK = 0x00;
-	public static final int PASSWORD_WRONG = 0x01;
-	public static final int PASSWORD_BAN = 0x02;
-	
-	int _wrongTentatives, _mode;
-	
-	public Ex2ndPasswordVerify(int mode, int wrongTentatives)
-	{
-		_mode = mode;
-		_wrongTentatives = wrongTentatives;
-	}
-	
-	@Override
-	protected void writeImpl()
-	{
-		writeC(0xFE);
-		//writeH(0x109);
-		writeH(0xe6);
-		writeD(_mode);
-		writeD(_wrongTentatives);
-	}
-	
-	@Override
-	public String getType()
-	{
-		return _S__FE_10A_EX2NDPASSWORDVERIFYPACKET;
-	}
-}
+/*
+ * 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.serverpackets;
+
+/**
+ * 
+ * @author mrTJO
+ */
+public class Ex2ndPasswordVerify extends L2GameServerPacket
+{
+	private static final String _S__FE_10A_EX2NDPASSWORDVERIFYPACKET = "[S] FE:10A Ex2NDPasswordVerifyPacket";
+	
+	public static final int PASSWORD_OK = 0x00;
+	public static final int PASSWORD_WRONG = 0x01;
+	public static final int PASSWORD_BAN = 0x02;
+	
+	int _wrongTentatives, _mode;
+	
+	public Ex2ndPasswordVerify(int mode, int wrongTentatives)
+	{
+		_mode = mode;
+		_wrongTentatives = wrongTentatives;
+	}
+	
+	@Override
+	protected void writeImpl()
+	{
+		writeC(0xFE);
+		//writeH(0x109);
+		writeH(0xe6);
+		writeD(_mode);
+		writeD(_wrongTentatives);
+	}
+	
+	@Override
+	public String getType()
+	{
+		return _S__FE_10A_EX2NDPASSWORDVERIFYPACKET;
+	}
+}

+ 50 - 50
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExConfirmAddingContact.java

@@ -1,50 +1,50 @@
-/*
- * 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.serverpackets;
-
-/**
- * Format: (ch)Sd
- * S: Character Name
- * d: Status
- * 
- * @author mrTJO & UnAfraid
- */
-public class ExConfirmAddingContact extends L2GameServerPacket
-{
-	private static final String _S__FE_D2_EXCONFIRMADDINGCONTACT = "[S] FE:D2 ExConfirmAddingContact";
-	private final String _charName;
-	private final boolean _added;
-	
-	public ExConfirmAddingContact(String charName, boolean added)
-	{
-		_charName = charName;
-		_added = added;
-	}
-	
-	@Override
-	protected void writeImpl()
-	{
-		writeC(0xFE);
-		writeH(0xD2);
-		writeS(_charName);
-		writeD(_added ? 0x01 : 0x00);
-	}
-	
-	@Override
-	public String getType()
-	{
-		return _S__FE_D2_EXCONFIRMADDINGCONTACT;
-	}
-}
+/*
+ * 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.serverpackets;
+
+/**
+ * Format: (ch)Sd
+ * S: Character Name
+ * d: Status
+ * 
+ * @author mrTJO & UnAfraid
+ */
+public class ExConfirmAddingContact extends L2GameServerPacket
+{
+	private static final String _S__FE_D2_EXCONFIRMADDINGCONTACT = "[S] FE:D2 ExConfirmAddingContact";
+	private final String _charName;
+	private final boolean _added;
+	
+	public ExConfirmAddingContact(String charName, boolean added)
+	{
+		_charName = charName;
+		_added = added;
+	}
+	
+	@Override
+	protected void writeImpl()
+	{
+		writeC(0xFE);
+		writeH(0xD2);
+		writeS(_charName);
+		writeD(_added ? 0x01 : 0x00);
+	}
+	
+	@Override
+	public String getType()
+	{
+		return _S__FE_D2_EXCONFIRMADDINGCONTACT;
+	}
+}

+ 90 - 90
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExOlympiadMatchList.java

@@ -1,90 +1,90 @@
-/*
- * 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.serverpackets;
- 
-import java.util.List;
-
-import com.l2jserver.gameserver.model.olympiad.AbstractOlympiadGame;
-import com.l2jserver.gameserver.model.olympiad.OlympiadGameClassed;
-import com.l2jserver.gameserver.model.olympiad.OlympiadGameNonClassed;
-import com.l2jserver.gameserver.model.olympiad.OlympiadGameTask;
-import com.l2jserver.gameserver.model.olympiad.OlympiadGameTeams;
- 
-/**
- * Format: (chd) ddd[dddS]
- * d: number of matches
- * d: unknown (always 0)
- * [
- *  d: arena
- *  d: match type
- *  d: status
- *  S: player 1 name
- *  S: player 2 name
- * ]
- * 
- * @author mrTJO
- */
-public class ExOlympiadMatchList extends L2GameServerPacket
-{
-	private static final String _S__FE_D4_OLYMPIADMATCHLIST = "[S] FE:D4 ExOlympiadMatchList";
-	private final List<OlympiadGameTask> _games;
-	
-	/**
-	 * @param games competitions list
-	 */
-	public ExOlympiadMatchList(List<OlympiadGameTask> games)
-	{
-		_games = games;
-	}
-	
-	@Override
-	protected final void writeImpl()
-	{
-		writeC(0xfe);
-		writeH(0xd4);
-		writeD(0x00);
-		
-		writeD(_games.size());
-		writeD(0x00);
-		
-		for (OlympiadGameTask curGame : _games)
-		{
-			AbstractOlympiadGame game = curGame.getGame();
-			if (game != null)
-			{
-				writeD(game.getStadiumId()); // Stadium Id (Arena 1 = 0)
-				
-				if (game instanceof OlympiadGameNonClassed)
-					writeD(1);
-				else if (game instanceof OlympiadGameClassed)
-					writeD(2);
-				else if (game instanceof OlympiadGameTeams)
-					writeD(-1);
-				else
-					writeD(0);
-				
-				writeD(curGame.isRunning() ? 0x02 : 0x01); // (1 = Standby, 2 = Playing)
-				writeS(game.getPlayerNames()[0]); // Player 1 Name
-				writeS(game.getPlayerNames()[1]); // Player 2 Name
-			}
-		}
-	}
-	
-	@Override
-	public String getType()
-	{
-		return _S__FE_D4_OLYMPIADMATCHLIST;
-	}
-}
+/*
+ * 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.serverpackets;
+ 
+import java.util.List;
+
+import com.l2jserver.gameserver.model.olympiad.AbstractOlympiadGame;
+import com.l2jserver.gameserver.model.olympiad.OlympiadGameClassed;
+import com.l2jserver.gameserver.model.olympiad.OlympiadGameNonClassed;
+import com.l2jserver.gameserver.model.olympiad.OlympiadGameTask;
+import com.l2jserver.gameserver.model.olympiad.OlympiadGameTeams;
+ 
+/**
+ * Format: (chd) ddd[dddS]
+ * d: number of matches
+ * d: unknown (always 0)
+ * [
+ *  d: arena
+ *  d: match type
+ *  d: status
+ *  S: player 1 name
+ *  S: player 2 name
+ * ]
+ * 
+ * @author mrTJO
+ */
+public class ExOlympiadMatchList extends L2GameServerPacket
+{
+	private static final String _S__FE_D4_OLYMPIADMATCHLIST = "[S] FE:D4 ExOlympiadMatchList";
+	private final List<OlympiadGameTask> _games;
+	
+	/**
+	 * @param games competitions list
+	 */
+	public ExOlympiadMatchList(List<OlympiadGameTask> games)
+	{
+		_games = games;
+	}
+	
+	@Override
+	protected final void writeImpl()
+	{
+		writeC(0xfe);
+		writeH(0xd4);
+		writeD(0x00);
+		
+		writeD(_games.size());
+		writeD(0x00);
+		
+		for (OlympiadGameTask curGame : _games)
+		{
+			AbstractOlympiadGame game = curGame.getGame();
+			if (game != null)
+			{
+				writeD(game.getStadiumId()); // Stadium Id (Arena 1 = 0)
+				
+				if (game instanceof OlympiadGameNonClassed)
+					writeD(1);
+				else if (game instanceof OlympiadGameClassed)
+					writeD(2);
+				else if (game instanceof OlympiadGameTeams)
+					writeD(-1);
+				else
+					writeD(0);
+				
+				writeD(curGame.isRunning() ? 0x02 : 0x01); // (1 = Standby, 2 = Playing)
+				writeS(game.getPlayerNames()[0]); // Player 1 Name
+				writeS(game.getPlayerNames()[1]); // Player 2 Name
+			}
+		}
+	}
+	
+	@Override
+	public String getType()
+	{
+		return _S__FE_D4_OLYMPIADMATCHLIST;
+	}
+}

+ 64 - 64
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ExShowContactList.java

@@ -1,64 +1,64 @@
-/*
- * 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.serverpackets;
-
-import java.util.List;
-
-import javolution.util.FastList;
-
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-
-/**
- * Format: (ch)d[S]
- * d: Number of Contacts
- * [
- * 	S: Character Name
- * ]
- * 
- * @author UnAfraid & mrTJO
- */
-public class ExShowContactList extends L2GameServerPacket
-{
-	private static final String _S__FE_D3_EXSHOWCONTACTLIST = "[S] FE:D3 ExShowContactList";
-	private final List<String> _contacts;
-	
-	public ExShowContactList(L2PcInstance player)
-	{
-		_contacts = new FastList<String>();
-		_contacts.addAll(player.getContactList().getAllContacts());
-	}
-	
-	@Override
-	protected void writeImpl()
-	{
-		if (_contacts.size() < 1)
-			return;
-		
-		writeC(0xFE);
-		writeH(0xD3);
-		writeD(_contacts.size());
-		for (String name : _contacts)
-		{
-			writeS(name);
-		}
-	}
-	
-	@Override
-	public String getType()
-	{
-		return _S__FE_D3_EXSHOWCONTACTLIST;
-	}
-	
-}
+/*
+ * 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.serverpackets;
+
+import java.util.List;
+
+import javolution.util.FastList;
+
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ * Format: (ch)d[S]
+ * d: Number of Contacts
+ * [
+ * 	S: Character Name
+ * ]
+ * 
+ * @author UnAfraid & mrTJO
+ */
+public class ExShowContactList extends L2GameServerPacket
+{
+	private static final String _S__FE_D3_EXSHOWCONTACTLIST = "[S] FE:D3 ExShowContactList";
+	private final List<String> _contacts;
+	
+	public ExShowContactList(L2PcInstance player)
+	{
+		_contacts = new FastList<String>();
+		_contacts.addAll(player.getContactList().getAllContacts());
+	}
+	
+	@Override
+	protected void writeImpl()
+	{
+		if (_contacts.size() < 1)
+			return;
+		
+		writeC(0xFE);
+		writeH(0xD3);
+		writeD(_contacts.size());
+		for (String name : _contacts)
+		{
+			writeS(name);
+		}
+	}
+	
+	@Override
+	public String getType()
+	{
+		return _S__FE_D3_EXSHOWCONTACTLIST;
+	}
+	
+}

+ 142 - 142
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/FriendListExtended.java

@@ -1,142 +1,142 @@
-/*
- * 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.serverpackets;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.List;
-
-import javolution.util.FastList;
-
-import com.l2jserver.L2DatabaseFactory;
-import com.l2jserver.gameserver.datatables.CharNameTable;
-import com.l2jserver.gameserver.model.L2World;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-
-/**
- * Support for "Chat with Friends" dialog.
- *
- * This packet is sent only at login.
- *
- * Format: (c) d[dSdddd]
- * d: Total Friend Count
- *
- * d: Friend ID
- * S: Friend Name
- * d: Online/Offline
- * d: Player Object Id (0 if offline)
- * d: Player Class Id
- * d: Player Level
- *
- * @author mrTJO & UnAfraid
- * 
- */
-public class FriendListExtended extends L2GameServerPacket
-{
-	// private static Logger _log = Logger.getLogger(FriendList.class.getName());
-	private static final String _S__FA_FRIENDLISTEXTENDED = "[S] 75 FriendListExtended";
-	private final List<FriendInfo> _info;
-	
-	private static class FriendInfo
-	{
-		int objId;
-		String name;
-		boolean online;
-		int classid;
-		int level;
-		
-		public FriendInfo(int objId, String name, boolean online, int classid, int level)
-		{
-			this.objId = objId;
-			this.name = name;
-			this.online = online;
-			this.classid = classid;
-			this.level = level;
-		}
-	}
-	
-	public FriendListExtended(L2PcInstance player)
-	{
-		_info = new FastList<FriendInfo>(player.getFriendList().size());
-		for (int objId : player.getFriendList())
-		{
-			String name = CharNameTable.getInstance().getNameById(objId);
-			L2PcInstance player1 = L2World.getInstance().getPlayer(objId);
-			
-			boolean online = false;
-			int classid = 0;
-			int level = 0;
-			
-			if (player1 == null)
-			{
-				Connection con = null;
-				try
-				{
-					con = L2DatabaseFactory.getInstance().getConnection();
-					PreparedStatement statement = con.prepareStatement("SELECT char_name, online, classid, level FROM characters WHERE charId = ?");
-					statement.setInt(1, objId);
-					ResultSet rset = statement.executeQuery();
-					if (rset.next())
-					{
-						_info.add(new FriendInfo(objId, rset.getString(1), rset.getInt(2) == 1, rset.getInt(3), rset.getInt(4)));
-					}
-					else
-						continue;
-				}
-				catch (Exception e)
-				{
-					// Who cares?
-				}
-				finally
-				{
-					L2DatabaseFactory.close(con);
-				}
-				
-				continue;
-			}
-			
-			if (player1.isOnline())
-				online = true;
-			
-			classid = player1.getClassId().getId();
-			level = player1.getLevel();
-			
-			_info.add(new FriendInfo(objId, name, online, classid, level));
-		}
-	}
-	
-	@Override
-	protected final void writeImpl()
-	{
-		writeC(0x58);
-		writeD(_info.size());
-		for (FriendInfo info : _info)
-		{
-			writeD(info.objId); // character id
-			writeS(info.name);
-			writeD(info.online ? 0x01 : 0x00); // online
-			writeD(info.online ? info.objId : 0x00); // object id if online
-			writeD(info.classid);
-			writeD(info.level);
-		}
-	}
-	
-	@Override
-	public String getType()
-	{
-		return _S__FA_FRIENDLISTEXTENDED;
-	}
-}
+/*
+ * 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.serverpackets;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.List;
+
+import javolution.util.FastList;
+
+import com.l2jserver.L2DatabaseFactory;
+import com.l2jserver.gameserver.datatables.CharNameTable;
+import com.l2jserver.gameserver.model.L2World;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ * Support for "Chat with Friends" dialog.
+ *
+ * This packet is sent only at login.
+ *
+ * Format: (c) d[dSdddd]
+ * d: Total Friend Count
+ *
+ * d: Friend ID
+ * S: Friend Name
+ * d: Online/Offline
+ * d: Player Object Id (0 if offline)
+ * d: Player Class Id
+ * d: Player Level
+ *
+ * @author mrTJO & UnAfraid
+ * 
+ */
+public class FriendListExtended extends L2GameServerPacket
+{
+	// private static Logger _log = Logger.getLogger(FriendList.class.getName());
+	private static final String _S__FA_FRIENDLISTEXTENDED = "[S] 75 FriendListExtended";
+	private final List<FriendInfo> _info;
+	
+	private static class FriendInfo
+	{
+		int objId;
+		String name;
+		boolean online;
+		int classid;
+		int level;
+		
+		public FriendInfo(int objId, String name, boolean online, int classid, int level)
+		{
+			this.objId = objId;
+			this.name = name;
+			this.online = online;
+			this.classid = classid;
+			this.level = level;
+		}
+	}
+	
+	public FriendListExtended(L2PcInstance player)
+	{
+		_info = new FastList<FriendInfo>(player.getFriendList().size());
+		for (int objId : player.getFriendList())
+		{
+			String name = CharNameTable.getInstance().getNameById(objId);
+			L2PcInstance player1 = L2World.getInstance().getPlayer(objId);
+			
+			boolean online = false;
+			int classid = 0;
+			int level = 0;
+			
+			if (player1 == null)
+			{
+				Connection con = null;
+				try
+				{
+					con = L2DatabaseFactory.getInstance().getConnection();
+					PreparedStatement statement = con.prepareStatement("SELECT char_name, online, classid, level FROM characters WHERE charId = ?");
+					statement.setInt(1, objId);
+					ResultSet rset = statement.executeQuery();
+					if (rset.next())
+					{
+						_info.add(new FriendInfo(objId, rset.getString(1), rset.getInt(2) == 1, rset.getInt(3), rset.getInt(4)));
+					}
+					else
+						continue;
+				}
+				catch (Exception e)
+				{
+					// Who cares?
+				}
+				finally
+				{
+					L2DatabaseFactory.close(con);
+				}
+				
+				continue;
+			}
+			
+			if (player1.isOnline())
+				online = true;
+			
+			classid = player1.getClassId().getId();
+			level = player1.getLevel();
+			
+			_info.add(new FriendInfo(objId, name, online, classid, level));
+		}
+	}
+	
+	@Override
+	protected final void writeImpl()
+	{
+		writeC(0x58);
+		writeD(_info.size());
+		for (FriendInfo info : _info)
+		{
+			writeD(info.objId); // character id
+			writeS(info.name);
+			writeD(info.online ? 0x01 : 0x00); // online
+			writeD(info.online ? info.objId : 0x00); // object id if online
+			writeD(info.classid);
+			writeD(info.level);
+		}
+	}
+	
+	@Override
+	public String getType()
+	{
+		return _S__FA_FRIENDLISTEXTENDED;
+	}
+}

+ 67 - 67
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/MyTargetSelected.java

@@ -1,67 +1,67 @@
-/*
- * 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.serverpackets;
-
-/**
- *
- * <p>
- * sample  bf 73 5d 30 49 01 00
- * <p>
- * format dh	(objectid, color)
- * <p>
- * color 	-xx -> -9 	red<p>
- * 			-8  -> -6	light-red<p>
- * 			-5	-> -3	yellow<p>
- * 			-2	-> 2    white<p>
- * 			 3	-> 5	green<p>
- * 			 6	-> 8	light-blue<p>
- * 			 9	-> xx	blue<p>
- * <p>
- * usually the color equals the level difference to the selected target
- *
- * @version $Revision: 1.3.2.1.2.3 $ $Date: 2005/03/27 15:29:39 $
- */
-public class MyTargetSelected extends L2GameServerPacket
-{
-	private static final String _S__BF_MYTARGETSELECTED = "[S] b9 MyTargetSelected";
-	private int _objectId;
-	private int _color;
-	
-	/**
-	 * @param objectId of the target
-	 * @param color the level difference to the target, name color is calculated from that.
-	 */
-	public MyTargetSelected(int objectId, int color)
-	{
-		_objectId = objectId;
-		_color = color;
-	}
-	
-	@Override
-	protected final void writeImpl()
-	{
-		writeC(0xb9);
-		writeD(_objectId);
-		writeH(_color);
-		writeD(0x00);
-	}
-	
-	@Override
-	public String getType()
-	{
-		return _S__BF_MYTARGETSELECTED;
-	}
-	
-}
+/*
+ * 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.serverpackets;
+
+/**
+ *
+ * <p>
+ * sample  bf 73 5d 30 49 01 00
+ * <p>
+ * format dh	(objectid, color)
+ * <p>
+ * color 	-xx -> -9 	red<p>
+ * 			-8  -> -6	light-red<p>
+ * 			-5	-> -3	yellow<p>
+ * 			-2	-> 2    white<p>
+ * 			 3	-> 5	green<p>
+ * 			 6	-> 8	light-blue<p>
+ * 			 9	-> xx	blue<p>
+ * <p>
+ * usually the color equals the level difference to the selected target
+ *
+ * @version $Revision: 1.3.2.1.2.3 $ $Date: 2005/03/27 15:29:39 $
+ */
+public class MyTargetSelected extends L2GameServerPacket
+{
+	private static final String _S__BF_MYTARGETSELECTED = "[S] b9 MyTargetSelected";
+	private int _objectId;
+	private int _color;
+	
+	/**
+	 * @param objectId of the target
+	 * @param color the level difference to the target, name color is calculated from that.
+	 */
+	public MyTargetSelected(int objectId, int color)
+	{
+		_objectId = objectId;
+		_color = color;
+	}
+	
+	@Override
+	protected final void writeImpl()
+	{
+		writeC(0xb9);
+		writeD(_objectId);
+		writeH(_color);
+		writeD(0x00);
+	}
+	
+	@Override
+	public String getType()
+	{
+		return _S__BF_MYTARGETSELECTED;
+	}
+	
+}

+ 71 - 71
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/TargetSelected.java

@@ -1,71 +1,71 @@
-/*
- * 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.serverpackets;
-
-/**
- * format   ddddd
- *
- * sample
- * 0000: 39  0b 07 10 48  3e 31 10 48  3a f6 00 00  91 5b 00    9...H>1.H:....[.
- * 0010: 00  4c f1 ff ff                                     .L...
- *
- * @version $Revision: 1.3.2.1.2.3 $ $Date: 2005/03/27 15:29:39 $
- */
-public final class TargetSelected extends L2GameServerPacket
-{
-	private static final String _S__39_TARGETSELECTED = "[S] 23 TargetSelected";
-	private int _objectId;
-	private int _targetObjId;
-	private int _x;
-	private int _y;
-	private int _z;
-	
-	/**
-	 * @param objectId
-	 * @param targetId
-	 * @param x
-	 * @param y
-	 * @param z
-	 */
-	public TargetSelected(int objectId, int targetId, int x, int y, int z)
-	{
-		_objectId = objectId;
-		_targetObjId = targetId;
-		_x = x;
-		_y = y;
-		_z = z;
-	}
-	
-	@Override
-	protected final void writeImpl()
-	{
-		writeC(0x23);
-		writeD(_objectId);
-		writeD(_targetObjId);
-		writeD(_x);
-		writeD(_y);
-		writeD(_z);
-		writeD(0x00);
-	}
-	
-	/**
-	 * @see com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket#getType()
-	 */
-	@Override
-	public String getType()
-	{
-		return _S__39_TARGETSELECTED;
-	}
-}
+/*
+ * 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.serverpackets;
+
+/**
+ * format   ddddd
+ *
+ * sample
+ * 0000: 39  0b 07 10 48  3e 31 10 48  3a f6 00 00  91 5b 00    9...H>1.H:....[.
+ * 0010: 00  4c f1 ff ff                                     .L...
+ *
+ * @version $Revision: 1.3.2.1.2.3 $ $Date: 2005/03/27 15:29:39 $
+ */
+public final class TargetSelected extends L2GameServerPacket
+{
+	private static final String _S__39_TARGETSELECTED = "[S] 23 TargetSelected";
+	private int _objectId;
+	private int _targetObjId;
+	private int _x;
+	private int _y;
+	private int _z;
+	
+	/**
+	 * @param objectId
+	 * @param targetId
+	 * @param x
+	 * @param y
+	 * @param z
+	 */
+	public TargetSelected(int objectId, int targetId, int x, int y, int z)
+	{
+		_objectId = objectId;
+		_targetObjId = targetId;
+		_x = x;
+		_y = y;
+		_z = z;
+	}
+	
+	@Override
+	protected final void writeImpl()
+	{
+		writeC(0x23);
+		writeD(_objectId);
+		writeD(_targetObjId);
+		writeD(_x);
+		writeD(_y);
+		writeD(_z);
+		writeD(0x00);
+	}
+	
+	/**
+	 * @see com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket#getType()
+	 */
+	@Override
+	public String getType()
+	{
+		return _S__39_TARGETSELECTED;
+	}
+}

+ 324 - 324
L2J_Server_BETA/java/com/l2jserver/gameserver/security/SecondaryPasswordAuth.java

@@ -1,325 +1,325 @@
-/*
- * 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.security;
-
-import java.io.UnsupportedEncodingException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import com.l2jserver.Config;
-import com.l2jserver.L2DatabaseFactory;
-import com.l2jserver.gameserver.LoginServerThread;
-import com.l2jserver.gameserver.network.L2GameClient;
-import com.l2jserver.gameserver.network.serverpackets.Ex2ndPasswordAck;
-import com.l2jserver.gameserver.network.serverpackets.Ex2ndPasswordCheck;
-import com.l2jserver.gameserver.network.serverpackets.Ex2ndPasswordVerify;
-import com.l2jserver.gameserver.util.Util;
-import com.l2jserver.util.Base64;
-
-/**
- * @author mrTJO
- */
-public class SecondaryPasswordAuth
-{
-	private final Logger _log = Logger.getLogger(SecondaryPasswordAuth.class.getName());
-	private final L2GameClient _activeClient;
-	
-	private String _password;
-	private int _wrongAttempts;
-	private boolean _authed;
-	
-	private static final String VAR_PWD = "secauth_pwd";
-	private static final String VAR_WTE = "secauth_wte";
-	
-	private static final String SELECT_PASSWORD = "SELECT var, value FROM account_gsdata WHERE account_name=? AND var LIKE 'secauth_%'";
-	private static final String INSERT_PASSWORD = "INSERT INTO account_gsdata VALUES (?, ?, ?)";
-	private static final String UPDATE_PASSWORD = "UPDATE account_gsdata SET value=? WHERE account_name=? AND var=?";
-	
-	private static final String INSERT_ATTEMPT = "INSERT INTO account_gsdata VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE value=?";
-	
-	/**
-	 * @param activeClient 
-	 */
-	public SecondaryPasswordAuth(L2GameClient activeClient)
-	{
-		_activeClient = activeClient;
-		_password = null;
-		_wrongAttempts = 0;
-		_authed = false;
-		loadPassword();
-	}
-	
-	private void loadPassword()
-	{
-		String var, value = null;
-		
-		Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement(SELECT_PASSWORD);
-			statement.setString(1, _activeClient.getAccountName());
-			ResultSet rs = statement.executeQuery();
-			while (rs.next())
-			{
-				var = rs.getString("var");
-				value = rs.getString("value");
-				
-				if (var.equals(VAR_PWD))
-				{
-					_password = value;
-				}
-				else if (var.equals(VAR_WTE))
-				{
-					_wrongAttempts = Integer.parseInt(value);
-				}
-			}
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			_log.log(Level.SEVERE, "Error while reading password.", e);
-		}
-		finally
-		{
-			L2DatabaseFactory.close(con);
-		}
-	}
-	
-	public boolean savePassword(String password)
-	{
-		if (passwordExist())
-		{
-			_log.warning("[SecondaryPasswordAuth]"+_activeClient.getAccountName()+" forced savePassword");
-			_activeClient.closeNow();
-			return false;
-		}
-		
-		if (!validatePassword(password))
-		{
-			_activeClient.sendPacket(new Ex2ndPasswordAck(Ex2ndPasswordAck.WRONG_PATTERN));
-			return false;
-		}
-		
-		password = cryptPassword(password);
-		
-		Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement(INSERT_PASSWORD);
-			statement.setString(1, _activeClient.getAccountName());
-			statement.setString(2, VAR_PWD);
-			statement.setString(3, password);
-			statement.execute();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			_log.log(Level.SEVERE, "Error while writing password.", e);
-			return false;
-		}
-		finally
-		{
-			L2DatabaseFactory.close(con);
-		}
-		_password = password;
-		return true;
-	}
-	
-	public boolean insertWrongAttempt(int attempts)
-	{
-		Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement(INSERT_ATTEMPT);
-			statement.setString(1, _activeClient.getAccountName());
-			statement.setString(2, VAR_WTE);
-			statement.setString(3, Integer.toString(attempts));
-			statement.setString(4, Integer.toString(attempts));
-			statement.execute();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			_log.log(Level.SEVERE, "Error while writing wrong attempts.", e);
-			return false;
-		}
-		finally
-		{
-			L2DatabaseFactory.close(con);
-		}
-		return true;
-	}
-	
-	public boolean changePassword(String oldPassword, String newPassword)
-	{
-		if (!passwordExist())
-		{
-			_log.warning("[SecondaryPasswordAuth]"+_activeClient.getAccountName()+" forced changePassword");
-			_activeClient.closeNow();
-			return false;
-		}
-		
-		if (!checkPassword(oldPassword, true))
-			return false;
-		
-		if (!validatePassword(newPassword))
-		{
-			_activeClient.sendPacket(new Ex2ndPasswordAck(Ex2ndPasswordAck.WRONG_PATTERN));
-			return false;
-		}
-		
-		newPassword = cryptPassword(newPassword);
-		
-		Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement(UPDATE_PASSWORD);
-			statement.setString(1, newPassword);
-			statement.setString(2, _activeClient.getAccountName());
-			statement.setString(3, VAR_PWD);
-			statement.execute();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			_log.log(Level.SEVERE, "Error while reading password.", e);
-			return false;
-		}
-		finally
-		{
-			L2DatabaseFactory.close(con);
-		}
-		_password = newPassword;
-		_authed = false;
-		return true;
-	}
-	
-	public boolean checkPassword(String password, boolean skipAuth)
-	{
-		password = cryptPassword(password);
-		
-		if (!password.equals(_password))
-		{
-			_wrongAttempts++;
-			if (_wrongAttempts < Config.SECOND_AUTH_MAX_ATTEMPTS)
-			{
-				_activeClient.sendPacket(new Ex2ndPasswordVerify(Ex2ndPasswordVerify.PASSWORD_WRONG, _wrongAttempts));
-				insertWrongAttempt(_wrongAttempts);
-			}
-			else
-			{
-				LoginServerThread.getInstance().sendTempBan(_activeClient.getAccountName(), _activeClient.getConnectionAddress().getHostAddress(), Config.SECOND_AUTH_BAN_TIME);
-				LoginServerThread.getInstance().sendMail(_activeClient.getAccountName(), "SATempBan", 
-						_activeClient.getConnectionAddress().getHostAddress(), Integer.toString(Config.SECOND_AUTH_MAX_ATTEMPTS),
-						Long.toString(Config.SECOND_AUTH_BAN_TIME), Config.SECOND_AUTH_REC_LINK);
-				_log.warning(_activeClient.getAccountName()+" - ("+
-						_activeClient.getConnectionAddress().getHostAddress()+") has inputted the wrong password "+
-						_wrongAttempts+" times in row.");
-				insertWrongAttempt(0);
-				_activeClient.close(new Ex2ndPasswordVerify(Ex2ndPasswordVerify.PASSWORD_BAN, Config.SECOND_AUTH_MAX_ATTEMPTS));
-			}
-			return false;
-		}
-		if (!skipAuth)
-		{
-			_authed = true;
-			_activeClient.sendPacket(new Ex2ndPasswordVerify(Ex2ndPasswordVerify.PASSWORD_OK, _wrongAttempts));
-		}
-		insertWrongAttempt(0);
-		return true;
-	}
-	
-	public boolean passwordExist()
-	{
-		return _password == null ? false : true;
-	}
-	
-	public void openDialog()
-	{
-		if (passwordExist())
-			_activeClient.sendPacket(new Ex2ndPasswordCheck(Ex2ndPasswordCheck.PASSWORD_PROMPT));
-		else
-			_activeClient.sendPacket(new Ex2ndPasswordCheck(Ex2ndPasswordCheck.PASSWORD_NEW));
-	}
-	
-	public boolean isAuthed()
-	{
-		return _authed;
-	}
-	
-	private String cryptPassword(String password)
-	{
-		try
-		{
-			MessageDigest md = MessageDigest.getInstance("SHA");
-			byte[] raw = password.getBytes("UTF-8");
-			byte[] hash = md.digest(raw);
-			return Base64.encodeBytes(hash);
-		}
-		catch (NoSuchAlgorithmException e)
-		{
-			_log.severe("[SecondaryPasswordAuth]Unsupported Algorythm");
-		}
-		catch (UnsupportedEncodingException e)
-		{
-			_log.severe("[SecondaryPasswordAuth]Unsupported Encoding");
-		}
-		return null;
-	}
-	
-	private boolean validatePassword(String password)
-	{
-		if (!Util.isDigit(password))
-			return false;
-		
-		if (password.length() < 6 || password.length() > 8)
-			return false;
-		
-		for (int i = 0; i < password.length()-1; i++)
-		{
-			char curCh = password.charAt(i);
-			char nxtCh = password.charAt(i+1);
-			
-			if (curCh+1 == nxtCh)
-				return false;
-			else if (curCh-1 == nxtCh)
-				return false;
-			else if (curCh == nxtCh)
-				return false;
-		}
-		
-		for (int i = 0; i < password.length()-2; i++)
-		{
-			String toChk = password.substring(i+1);
-			StringBuffer chkEr = new StringBuffer(password.substring(i, i+2));
-			
-			if (toChk.contains(chkEr))
-				return false;
-			else if (toChk.contains(chkEr.reverse()))
-				return false;
-		}
-		_wrongAttempts = 0;
-		return true;
-	}
+/*
+ * 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.security;
+
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import com.l2jserver.Config;
+import com.l2jserver.L2DatabaseFactory;
+import com.l2jserver.gameserver.LoginServerThread;
+import com.l2jserver.gameserver.network.L2GameClient;
+import com.l2jserver.gameserver.network.serverpackets.Ex2ndPasswordAck;
+import com.l2jserver.gameserver.network.serverpackets.Ex2ndPasswordCheck;
+import com.l2jserver.gameserver.network.serverpackets.Ex2ndPasswordVerify;
+import com.l2jserver.gameserver.util.Util;
+import com.l2jserver.util.Base64;
+
+/**
+ * @author mrTJO
+ */
+public class SecondaryPasswordAuth
+{
+	private final Logger _log = Logger.getLogger(SecondaryPasswordAuth.class.getName());
+	private final L2GameClient _activeClient;
+	
+	private String _password;
+	private int _wrongAttempts;
+	private boolean _authed;
+	
+	private static final String VAR_PWD = "secauth_pwd";
+	private static final String VAR_WTE = "secauth_wte";
+	
+	private static final String SELECT_PASSWORD = "SELECT var, value FROM account_gsdata WHERE account_name=? AND var LIKE 'secauth_%'";
+	private static final String INSERT_PASSWORD = "INSERT INTO account_gsdata VALUES (?, ?, ?)";
+	private static final String UPDATE_PASSWORD = "UPDATE account_gsdata SET value=? WHERE account_name=? AND var=?";
+	
+	private static final String INSERT_ATTEMPT = "INSERT INTO account_gsdata VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE value=?";
+	
+	/**
+	 * @param activeClient 
+	 */
+	public SecondaryPasswordAuth(L2GameClient activeClient)
+	{
+		_activeClient = activeClient;
+		_password = null;
+		_wrongAttempts = 0;
+		_authed = false;
+		loadPassword();
+	}
+	
+	private void loadPassword()
+	{
+		String var, value = null;
+		
+		Connection con = null;
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(SELECT_PASSWORD);
+			statement.setString(1, _activeClient.getAccountName());
+			ResultSet rs = statement.executeQuery();
+			while (rs.next())
+			{
+				var = rs.getString("var");
+				value = rs.getString("value");
+				
+				if (var.equals(VAR_PWD))
+				{
+					_password = value;
+				}
+				else if (var.equals(VAR_WTE))
+				{
+					_wrongAttempts = Integer.parseInt(value);
+				}
+			}
+			statement.close();
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.SEVERE, "Error while reading password.", e);
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+	}
+	
+	public boolean savePassword(String password)
+	{
+		if (passwordExist())
+		{
+			_log.warning("[SecondaryPasswordAuth]"+_activeClient.getAccountName()+" forced savePassword");
+			_activeClient.closeNow();
+			return false;
+		}
+		
+		if (!validatePassword(password))
+		{
+			_activeClient.sendPacket(new Ex2ndPasswordAck(Ex2ndPasswordAck.WRONG_PATTERN));
+			return false;
+		}
+		
+		password = cryptPassword(password);
+		
+		Connection con = null;
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(INSERT_PASSWORD);
+			statement.setString(1, _activeClient.getAccountName());
+			statement.setString(2, VAR_PWD);
+			statement.setString(3, password);
+			statement.execute();
+			statement.close();
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.SEVERE, "Error while writing password.", e);
+			return false;
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+		_password = password;
+		return true;
+	}
+	
+	public boolean insertWrongAttempt(int attempts)
+	{
+		Connection con = null;
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(INSERT_ATTEMPT);
+			statement.setString(1, _activeClient.getAccountName());
+			statement.setString(2, VAR_WTE);
+			statement.setString(3, Integer.toString(attempts));
+			statement.setString(4, Integer.toString(attempts));
+			statement.execute();
+			statement.close();
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.SEVERE, "Error while writing wrong attempts.", e);
+			return false;
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+		return true;
+	}
+	
+	public boolean changePassword(String oldPassword, String newPassword)
+	{
+		if (!passwordExist())
+		{
+			_log.warning("[SecondaryPasswordAuth]"+_activeClient.getAccountName()+" forced changePassword");
+			_activeClient.closeNow();
+			return false;
+		}
+		
+		if (!checkPassword(oldPassword, true))
+			return false;
+		
+		if (!validatePassword(newPassword))
+		{
+			_activeClient.sendPacket(new Ex2ndPasswordAck(Ex2ndPasswordAck.WRONG_PATTERN));
+			return false;
+		}
+		
+		newPassword = cryptPassword(newPassword);
+		
+		Connection con = null;
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(UPDATE_PASSWORD);
+			statement.setString(1, newPassword);
+			statement.setString(2, _activeClient.getAccountName());
+			statement.setString(3, VAR_PWD);
+			statement.execute();
+			statement.close();
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.SEVERE, "Error while reading password.", e);
+			return false;
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+		_password = newPassword;
+		_authed = false;
+		return true;
+	}
+	
+	public boolean checkPassword(String password, boolean skipAuth)
+	{
+		password = cryptPassword(password);
+		
+		if (!password.equals(_password))
+		{
+			_wrongAttempts++;
+			if (_wrongAttempts < Config.SECOND_AUTH_MAX_ATTEMPTS)
+			{
+				_activeClient.sendPacket(new Ex2ndPasswordVerify(Ex2ndPasswordVerify.PASSWORD_WRONG, _wrongAttempts));
+				insertWrongAttempt(_wrongAttempts);
+			}
+			else
+			{
+				LoginServerThread.getInstance().sendTempBan(_activeClient.getAccountName(), _activeClient.getConnectionAddress().getHostAddress(), Config.SECOND_AUTH_BAN_TIME);
+				LoginServerThread.getInstance().sendMail(_activeClient.getAccountName(), "SATempBan", 
+						_activeClient.getConnectionAddress().getHostAddress(), Integer.toString(Config.SECOND_AUTH_MAX_ATTEMPTS),
+						Long.toString(Config.SECOND_AUTH_BAN_TIME), Config.SECOND_AUTH_REC_LINK);
+				_log.warning(_activeClient.getAccountName()+" - ("+
+						_activeClient.getConnectionAddress().getHostAddress()+") has inputted the wrong password "+
+						_wrongAttempts+" times in row.");
+				insertWrongAttempt(0);
+				_activeClient.close(new Ex2ndPasswordVerify(Ex2ndPasswordVerify.PASSWORD_BAN, Config.SECOND_AUTH_MAX_ATTEMPTS));
+			}
+			return false;
+		}
+		if (!skipAuth)
+		{
+			_authed = true;
+			_activeClient.sendPacket(new Ex2ndPasswordVerify(Ex2ndPasswordVerify.PASSWORD_OK, _wrongAttempts));
+		}
+		insertWrongAttempt(0);
+		return true;
+	}
+	
+	public boolean passwordExist()
+	{
+		return _password == null ? false : true;
+	}
+	
+	public void openDialog()
+	{
+		if (passwordExist())
+			_activeClient.sendPacket(new Ex2ndPasswordCheck(Ex2ndPasswordCheck.PASSWORD_PROMPT));
+		else
+			_activeClient.sendPacket(new Ex2ndPasswordCheck(Ex2ndPasswordCheck.PASSWORD_NEW));
+	}
+	
+	public boolean isAuthed()
+	{
+		return _authed;
+	}
+	
+	private String cryptPassword(String password)
+	{
+		try
+		{
+			MessageDigest md = MessageDigest.getInstance("SHA");
+			byte[] raw = password.getBytes("UTF-8");
+			byte[] hash = md.digest(raw);
+			return Base64.encodeBytes(hash);
+		}
+		catch (NoSuchAlgorithmException e)
+		{
+			_log.severe("[SecondaryPasswordAuth]Unsupported Algorythm");
+		}
+		catch (UnsupportedEncodingException e)
+		{
+			_log.severe("[SecondaryPasswordAuth]Unsupported Encoding");
+		}
+		return null;
+	}
+	
+	private boolean validatePassword(String password)
+	{
+		if (!Util.isDigit(password))
+			return false;
+		
+		if (password.length() < 6 || password.length() > 8)
+			return false;
+		
+		for (int i = 0; i < password.length()-1; i++)
+		{
+			char curCh = password.charAt(i);
+			char nxtCh = password.charAt(i+1);
+			
+			if (curCh+1 == nxtCh)
+				return false;
+			else if (curCh-1 == nxtCh)
+				return false;
+			else if (curCh == nxtCh)
+				return false;
+		}
+		
+		for (int i = 0; i < password.length()-2; i++)
+		{
+			String toChk = password.substring(i+1);
+			StringBuffer chkEr = new StringBuffer(password.substring(i, i+2));
+			
+			if (toChk.contains(chkEr))
+				return false;
+			else if (toChk.contains(chkEr.reverse()))
+				return false;
+		}
+		_wrongAttempts = 0;
+		return true;
+	}
 }

+ 169 - 169
L2J_Server_BETA/java/com/l2jserver/loginserver/mail/BaseMail.java

@@ -1,169 +1,169 @@
-/*
- * 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.loginserver.mail;
-
-import java.io.UnsupportedEncodingException;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.Properties;
-import java.util.logging.Logger;
-
-import javax.mail.Authenticator;
-import javax.mail.Message;
-import javax.mail.MessagingException;
-import javax.mail.PasswordAuthentication;
-import javax.mail.Session;
-import javax.mail.Transport;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMessage;
-
-import com.l2jserver.Config;
-import com.l2jserver.L2DatabaseFactory;
-import com.l2jserver.loginserver.mail.MailSystem.MailContent;
-
-/**
- * @author mrTJO
- */
-public class BaseMail implements Runnable
-{
-	private final static Logger _log = Logger.getLogger(BaseMail.class.getName());
-		
-	private final Properties _mailProp = new Properties();
-	private final SmtpAuthenticator _authenticator;
-	private MimeMessage _messageMime = null;
-	
-	private class SmtpAuthenticator extends Authenticator
-	{
-		private final PasswordAuthentication _auth;
-		
-		public SmtpAuthenticator()
-		{
-			_auth = new PasswordAuthentication(Config.EMAIL_SYS_USERNAME, Config.EMAIL_SYS_PASSWORD);
-		}
-		
-		@Override
-		public PasswordAuthentication getPasswordAuthentication()
-		{
-			return _auth;
-		}
-	}
-	
-	public BaseMail(String account, String mailId, String... args)
-	{
-		_mailProp.put("mail.smtp.host", Config.EMAIL_SYS_HOST);
-		_mailProp.put("mail.smtp.auth", Config.EMAIL_SYS_SMTP_AUTH);
-		_mailProp.put("mail.smtp.port", Config.EMAIL_SYS_PORT);
-		_mailProp.put("mail.smtp.socketFactory.port", Config.EMAIL_SYS_PORT);
-		_mailProp.put("mail.smtp.socketFactory.class", Config.EMAIL_SYS_FACTORY);
-		_mailProp.put("mail.smtp.socketFactory.fallback", Config.EMAIL_SYS_FACTORY_CALLBACK);
-		
-		_authenticator = Config.EMAIL_SYS_SMTP_AUTH ? new SmtpAuthenticator() : null;
-		
-		String mailAddr = getUserMail(account);
-		
-		if (mailAddr == null)
-			return;
-		
-		MailContent content = MailSystem.getInstance().getMailContent(mailId);
-		if (content == null)
-			return;
-		
-		String message = compileHtml(account, content.getText(), args);
-		
-		Session mailSession = Session.getDefaultInstance(_mailProp, _authenticator);
-		
-		try
-		{
-			_messageMime = new MimeMessage(mailSession);
-			_messageMime.setSubject(content.getSubject());
-			try
-			{
-				_messageMime.setFrom(new InternetAddress(Config.EMAIL_SYS_ADDRESS, Config.EMAIL_SERVERINFO_NAME));
-			}
-			catch (UnsupportedEncodingException e)
-			{
-				_log.warning("Sender Address not Valid!");
-			}
-			_messageMime.setContent(message, "text/html");
-			_messageMime.setRecipient(Message.RecipientType.TO, new InternetAddress(mailAddr));
-		}
-		catch (MessagingException e)
-		{
-			_log.warning(getClass().getSimpleName() + ": " + e.getMessage());
-		}
-	}
-	
-	private String compileHtml(String account, String html, String[] args)
-	{
-		if (args != null)
-		{
-			for (int i = 0; i < args.length; i++)
-			{
-				html = html.replace("%var"+i+"%", args[i]);
-			}
-		}
-		html = html.replace("%accountname%", account);
-		return html;
-	}
-	
-	private String getUserMail(String username)
-	{
-		Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement(Config.EMAIL_SYS_SELECTQUERY);
-			statement.setString(1, username);
-			ResultSet rset = statement.executeQuery();
-			if (rset.next())
-			{
-				String mail = rset.getString(Config.EMAIL_SYS_DBFIELD);
-				return mail;
-			}
-			rset.close();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			_log.warning("Cannot select user mail: Exception");
-		}
-		finally
-		{
-			try
-			{
-				L2DatabaseFactory.close(con);
-			}
-			catch (Exception e)
-			{
-			}
-		}
-		return null;
-	}
-	
-	@Override
-	public void run()
-	{
-		try
-		{
-			if (_messageMime != null)
-				Transport.send(_messageMime);
-		}
-		catch (MessagingException e)
-		{
-			_log.warning("Error encounterd while sending email");
-		}
-	}
-}
+/*
+ * 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.loginserver.mail;
+
+import java.io.UnsupportedEncodingException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.Properties;
+import java.util.logging.Logger;
+
+import javax.mail.Authenticator;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.PasswordAuthentication;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+
+import com.l2jserver.Config;
+import com.l2jserver.L2DatabaseFactory;
+import com.l2jserver.loginserver.mail.MailSystem.MailContent;
+
+/**
+ * @author mrTJO
+ */
+public class BaseMail implements Runnable
+{
+	private final static Logger _log = Logger.getLogger(BaseMail.class.getName());
+		
+	private final Properties _mailProp = new Properties();
+	private final SmtpAuthenticator _authenticator;
+	private MimeMessage _messageMime = null;
+	
+	private class SmtpAuthenticator extends Authenticator
+	{
+		private final PasswordAuthentication _auth;
+		
+		public SmtpAuthenticator()
+		{
+			_auth = new PasswordAuthentication(Config.EMAIL_SYS_USERNAME, Config.EMAIL_SYS_PASSWORD);
+		}
+		
+		@Override
+		public PasswordAuthentication getPasswordAuthentication()
+		{
+			return _auth;
+		}
+	}
+	
+	public BaseMail(String account, String mailId, String... args)
+	{
+		_mailProp.put("mail.smtp.host", Config.EMAIL_SYS_HOST);
+		_mailProp.put("mail.smtp.auth", Config.EMAIL_SYS_SMTP_AUTH);
+		_mailProp.put("mail.smtp.port", Config.EMAIL_SYS_PORT);
+		_mailProp.put("mail.smtp.socketFactory.port", Config.EMAIL_SYS_PORT);
+		_mailProp.put("mail.smtp.socketFactory.class", Config.EMAIL_SYS_FACTORY);
+		_mailProp.put("mail.smtp.socketFactory.fallback", Config.EMAIL_SYS_FACTORY_CALLBACK);
+		
+		_authenticator = Config.EMAIL_SYS_SMTP_AUTH ? new SmtpAuthenticator() : null;
+		
+		String mailAddr = getUserMail(account);
+		
+		if (mailAddr == null)
+			return;
+		
+		MailContent content = MailSystem.getInstance().getMailContent(mailId);
+		if (content == null)
+			return;
+		
+		String message = compileHtml(account, content.getText(), args);
+		
+		Session mailSession = Session.getDefaultInstance(_mailProp, _authenticator);
+		
+		try
+		{
+			_messageMime = new MimeMessage(mailSession);
+			_messageMime.setSubject(content.getSubject());
+			try
+			{
+				_messageMime.setFrom(new InternetAddress(Config.EMAIL_SYS_ADDRESS, Config.EMAIL_SERVERINFO_NAME));
+			}
+			catch (UnsupportedEncodingException e)
+			{
+				_log.warning("Sender Address not Valid!");
+			}
+			_messageMime.setContent(message, "text/html");
+			_messageMime.setRecipient(Message.RecipientType.TO, new InternetAddress(mailAddr));
+		}
+		catch (MessagingException e)
+		{
+			_log.warning(getClass().getSimpleName() + ": " + e.getMessage());
+		}
+	}
+	
+	private String compileHtml(String account, String html, String[] args)
+	{
+		if (args != null)
+		{
+			for (int i = 0; i < args.length; i++)
+			{
+				html = html.replace("%var"+i+"%", args[i]);
+			}
+		}
+		html = html.replace("%accountname%", account);
+		return html;
+	}
+	
+	private String getUserMail(String username)
+	{
+		Connection con = null;
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(Config.EMAIL_SYS_SELECTQUERY);
+			statement.setString(1, username);
+			ResultSet rset = statement.executeQuery();
+			if (rset.next())
+			{
+				String mail = rset.getString(Config.EMAIL_SYS_DBFIELD);
+				return mail;
+			}
+			rset.close();
+			statement.close();
+		}
+		catch (Exception e)
+		{
+			_log.warning("Cannot select user mail: Exception");
+		}
+		finally
+		{
+			try
+			{
+				L2DatabaseFactory.close(con);
+			}
+			catch (Exception e)
+			{
+			}
+		}
+		return null;
+	}
+	
+	@Override
+	public void run()
+	{
+		try
+		{
+			if (_messageMime != null)
+				Transport.send(_messageMime);
+		}
+		catch (MessagingException e)
+		{
+			_log.warning("Error encounterd while sending email");
+		}
+	}
+}

+ 151 - 151
L2J_Server_BETA/java/com/l2jserver/loginserver/mail/MailSystem.java

@@ -1,151 +1,151 @@
-/*
- * 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.loginserver.mail;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import javolution.util.FastMap;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-import com.l2jserver.Config;
-
-/**
- * @author mrTJO
- */
-public class MailSystem
-{
-	private final static Logger _log = Logger.getLogger(MailSystem.class.getName());
-	private final Map<String, MailContent> _mailData = new FastMap<String, MailContent>();
-	
-	public static MailSystem getInstance()
-	{
-		return SingletonHolder._instance;
-	}
-	
-	public MailSystem()
-	{
-		loadMails();
-	}
-	
-	public void sendMail(String account, String messageId, String... args)
-	{
-		BaseMail mail = new BaseMail(account, messageId, args);
-		mail.run();
-	}
-	
-	private void loadMails()
-	{
-		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-		factory.setValidating(false);
-		factory.setIgnoringComments(true);
-		File file = new File(Config.DATAPACK_ROOT, "data/mail/MailList.xml");
-		Document doc = null;
-		if (file.exists())
-		{
-			try
-			{
-				doc = factory.newDocumentBuilder().parse(file);
-			}
-			catch (Exception e)
-			{
-				_log.log(Level.WARNING, "Could not parse MailList.xml file: " + e.getMessage(), e);
-				return;
-			}
-			
-			Node n = doc.getFirstChild();
-			for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
-			{
-				if (d.getNodeName().equals("mail"))
-				{
-					String mailId = d.getAttributes().getNamedItem("id").getNodeValue();
-					String subject = d.getAttributes().getNamedItem("subject").getNodeValue();
-					String maFile = d.getAttributes().getNamedItem("file").getNodeValue();
-					
-					try
-					{
-						FileInputStream fis = new FileInputStream(new File(Config.DATAPACK_ROOT, "data/mail/" + maFile));
-						BufferedInputStream bis = new BufferedInputStream(fis);
-						int bytes = bis.available();
-						byte[] raw = new byte[bytes];
-						
-						bis.read(raw);
-						String html = new String(raw, "UTF-8");
-						html = html.replaceAll("\r\n", "\n");
-						html = html.replace("%servermail%", Config.EMAIL_SERVERINFO_ADDRESS);
-						html = html.replace("%servername%", Config.EMAIL_SERVERINFO_NAME);
-						
-						_mailData.put(mailId, new MailContent(subject, html));
-					}
-					catch (IOException e)
-					{
-						_log.warning("IOException while reading " + maFile);
-					}
-				}
-			}
-			_log.info("eMail System Loaded");
-		}
-		else
-		{
-			_log.warning("Cannot load eMail System - Missing file MailList.xml");
-		}
-	}
-	
-	public class MailContent
-	{
-		private final String _subject;
-		private final String _text;
-		
-		/**
-		 * @param subject
-		 * @param text
-		 */
-		public MailContent(String subject, String text)
-		{
-			_subject = subject;
-			_text = text;
-		}
-		
-		public String getSubject()
-		{
-			return _subject;
-		}
-		
-		public String getText()
-		{
-			return _text;
-		}
-	}
-	
-	public MailContent getMailContent(String mailId)
-	{
-		return _mailData.get(mailId);
-	}
-	
-	@SuppressWarnings("synthetic-access")
-	private static class SingletonHolder
-	{
-		protected static final MailSystem _instance = new MailSystem();
-	}
-}
+/*
+ * 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.loginserver.mail;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import javolution.util.FastMap;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+import com.l2jserver.Config;
+
+/**
+ * @author mrTJO
+ */
+public class MailSystem
+{
+	private final static Logger _log = Logger.getLogger(MailSystem.class.getName());
+	private final Map<String, MailContent> _mailData = new FastMap<String, MailContent>();
+	
+	public static MailSystem getInstance()
+	{
+		return SingletonHolder._instance;
+	}
+	
+	public MailSystem()
+	{
+		loadMails();
+	}
+	
+	public void sendMail(String account, String messageId, String... args)
+	{
+		BaseMail mail = new BaseMail(account, messageId, args);
+		mail.run();
+	}
+	
+	private void loadMails()
+	{
+		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+		factory.setValidating(false);
+		factory.setIgnoringComments(true);
+		File file = new File(Config.DATAPACK_ROOT, "data/mail/MailList.xml");
+		Document doc = null;
+		if (file.exists())
+		{
+			try
+			{
+				doc = factory.newDocumentBuilder().parse(file);
+			}
+			catch (Exception e)
+			{
+				_log.log(Level.WARNING, "Could not parse MailList.xml file: " + e.getMessage(), e);
+				return;
+			}
+			
+			Node n = doc.getFirstChild();
+			for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
+			{
+				if (d.getNodeName().equals("mail"))
+				{
+					String mailId = d.getAttributes().getNamedItem("id").getNodeValue();
+					String subject = d.getAttributes().getNamedItem("subject").getNodeValue();
+					String maFile = d.getAttributes().getNamedItem("file").getNodeValue();
+					
+					try
+					{
+						FileInputStream fis = new FileInputStream(new File(Config.DATAPACK_ROOT, "data/mail/" + maFile));
+						BufferedInputStream bis = new BufferedInputStream(fis);
+						int bytes = bis.available();
+						byte[] raw = new byte[bytes];
+						
+						bis.read(raw);
+						String html = new String(raw, "UTF-8");
+						html = html.replaceAll("\r\n", "\n");
+						html = html.replace("%servermail%", Config.EMAIL_SERVERINFO_ADDRESS);
+						html = html.replace("%servername%", Config.EMAIL_SERVERINFO_NAME);
+						
+						_mailData.put(mailId, new MailContent(subject, html));
+					}
+					catch (IOException e)
+					{
+						_log.warning("IOException while reading " + maFile);
+					}
+				}
+			}
+			_log.info("eMail System Loaded");
+		}
+		else
+		{
+			_log.warning("Cannot load eMail System - Missing file MailList.xml");
+		}
+	}
+	
+	public class MailContent
+	{
+		private final String _subject;
+		private final String _text;
+		
+		/**
+		 * @param subject
+		 * @param text
+		 */
+		public MailContent(String subject, String text)
+		{
+			_subject = subject;
+			_text = text;
+		}
+		
+		public String getSubject()
+		{
+			return _subject;
+		}
+		
+		public String getText()
+		{
+			return _text;
+		}
+	}
+	
+	public MailContent getMailContent(String mailId)
+	{
+		return _mailData.get(mailId);
+	}
+	
+	@SuppressWarnings("synthetic-access")
+	private static class SingletonHolder
+	{
+		protected static final MailSystem _instance = new MailSystem();
+	}
+}

+ 119 - 119
L2J_Server_BETA/java/com/l2jserver/loginserver/network/L2JGameServerPacketHandler.java

@@ -1,119 +1,119 @@
-/*
- * 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.loginserver.network;
-
-import java.util.logging.Logger;
-
-import com.l2jserver.Config;
-import com.l2jserver.loginserver.GameServerThread;
-import com.l2jserver.loginserver.network.gameserverpackets.BlowFishKey;
-import com.l2jserver.loginserver.network.gameserverpackets.ChangeAccessLevel;
-import com.l2jserver.loginserver.network.gameserverpackets.ChangePassword;
-import com.l2jserver.loginserver.network.gameserverpackets.GameServerAuth;
-import com.l2jserver.loginserver.network.gameserverpackets.PlayerAuthRequest;
-import com.l2jserver.loginserver.network.gameserverpackets.PlayerInGame;
-import com.l2jserver.loginserver.network.gameserverpackets.PlayerLogout;
-import com.l2jserver.loginserver.network.gameserverpackets.PlayerTracert;
-import com.l2jserver.loginserver.network.gameserverpackets.ReplyCharacters;
-import com.l2jserver.loginserver.network.gameserverpackets.RequestSendMail;
-import com.l2jserver.loginserver.network.gameserverpackets.RequestTempBan;
-import com.l2jserver.loginserver.network.gameserverpackets.ServerStatus;
-import com.l2jserver.loginserver.network.loginserverpackets.LoginServerFail;
-import com.l2jserver.util.network.BaseRecievePacket;
-
-/**
- * 
- * @author mrTJO
- */
-public class L2JGameServerPacketHandler
-{
-	protected static Logger _log = Logger.getLogger(L2JGameServerPacketHandler.class.getName());
-	public static enum GameServerState { CONNECTED, BF_CONNECTED, AUTHED }
-	
-	public static BaseRecievePacket handlePacket(byte[] data, GameServerThread server)
-	{
-		BaseRecievePacket msg = null;
-		int opcode = data[0] & 0xff;
-		GameServerState state = server.getLoginConnectionState();
-		switch (state)
-		{
-			case CONNECTED:
-				switch (opcode)
-				{
-					case 0x00:
-						msg = new BlowFishKey(data, server);
-						break;
-					default:
-						_log.warning("Unknown Opcode ("+Integer.toHexString(opcode).toUpperCase()+") in state "+state.name()+" from GameServer, closing connection.");
-						server.forceClose(LoginServerFail.NOT_AUTHED);
-						break;
-				}
-				break;
-			case BF_CONNECTED:
-				switch (opcode)
-				{
-					case 0x01:
-						msg = new GameServerAuth(data, server);
-						break;
-					default:
-						_log.warning("Unknown Opcode ("+Integer.toHexString(opcode).toUpperCase()+") in state "+state.name()+" from GameServer, closing connection.");
-						server.forceClose(LoginServerFail.NOT_AUTHED);
-						break;
-				}
-				break;
-			case AUTHED:
-				switch (opcode)
-				{
-					case 0x02:
-						msg = new PlayerInGame(data, server);
-						break;
-					case 0x03:
-						msg = new PlayerLogout(data, server);
-						break;
-					case 0x04:
-						msg = new ChangeAccessLevel(data, server);
-						break;
-					case 0x05:
-						msg = new PlayerAuthRequest(data, server);
-						break;
-					case 0x06:
-						msg = new ServerStatus(data, server);
-						break;
-					case 0x07:
-						msg = new PlayerTracert(data);
-						break;
-					case 0x08:
-						msg = new ReplyCharacters(data, server);
-						break;
-					case 0x09:
-						if (Config.EMAIL_SYS_ENABLED)
-							msg = new RequestSendMail(data);
-						break;
-					case 0x0A:
-						msg = new RequestTempBan(data);
-						break;
-					case 0x0B:
-						new ChangePassword(data);
-						break;
-					default:
-						_log.warning("Unknown Opcode ("+Integer.toHexString(opcode).toUpperCase()+") in state "+state.name()+" from GameServer, closing connection.");
-						server.forceClose(LoginServerFail.NOT_AUTHED);
-						break;
-				}
-				break;
-		}
-		return msg;
-	}
-}
+/*
+ * 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.loginserver.network;
+
+import java.util.logging.Logger;
+
+import com.l2jserver.Config;
+import com.l2jserver.loginserver.GameServerThread;
+import com.l2jserver.loginserver.network.gameserverpackets.BlowFishKey;
+import com.l2jserver.loginserver.network.gameserverpackets.ChangeAccessLevel;
+import com.l2jserver.loginserver.network.gameserverpackets.ChangePassword;
+import com.l2jserver.loginserver.network.gameserverpackets.GameServerAuth;
+import com.l2jserver.loginserver.network.gameserverpackets.PlayerAuthRequest;
+import com.l2jserver.loginserver.network.gameserverpackets.PlayerInGame;
+import com.l2jserver.loginserver.network.gameserverpackets.PlayerLogout;
+import com.l2jserver.loginserver.network.gameserverpackets.PlayerTracert;
+import com.l2jserver.loginserver.network.gameserverpackets.ReplyCharacters;
+import com.l2jserver.loginserver.network.gameserverpackets.RequestSendMail;
+import com.l2jserver.loginserver.network.gameserverpackets.RequestTempBan;
+import com.l2jserver.loginserver.network.gameserverpackets.ServerStatus;
+import com.l2jserver.loginserver.network.loginserverpackets.LoginServerFail;
+import com.l2jserver.util.network.BaseRecievePacket;
+
+/**
+ * 
+ * @author mrTJO
+ */
+public class L2JGameServerPacketHandler
+{
+	protected static Logger _log = Logger.getLogger(L2JGameServerPacketHandler.class.getName());
+	public static enum GameServerState { CONNECTED, BF_CONNECTED, AUTHED }
+	
+	public static BaseRecievePacket handlePacket(byte[] data, GameServerThread server)
+	{
+		BaseRecievePacket msg = null;
+		int opcode = data[0] & 0xff;
+		GameServerState state = server.getLoginConnectionState();
+		switch (state)
+		{
+			case CONNECTED:
+				switch (opcode)
+				{
+					case 0x00:
+						msg = new BlowFishKey(data, server);
+						break;
+					default:
+						_log.warning("Unknown Opcode ("+Integer.toHexString(opcode).toUpperCase()+") in state "+state.name()+" from GameServer, closing connection.");
+						server.forceClose(LoginServerFail.NOT_AUTHED);
+						break;
+				}
+				break;
+			case BF_CONNECTED:
+				switch (opcode)
+				{
+					case 0x01:
+						msg = new GameServerAuth(data, server);
+						break;
+					default:
+						_log.warning("Unknown Opcode ("+Integer.toHexString(opcode).toUpperCase()+") in state "+state.name()+" from GameServer, closing connection.");
+						server.forceClose(LoginServerFail.NOT_AUTHED);
+						break;
+				}
+				break;
+			case AUTHED:
+				switch (opcode)
+				{
+					case 0x02:
+						msg = new PlayerInGame(data, server);
+						break;
+					case 0x03:
+						msg = new PlayerLogout(data, server);
+						break;
+					case 0x04:
+						msg = new ChangeAccessLevel(data, server);
+						break;
+					case 0x05:
+						msg = new PlayerAuthRequest(data, server);
+						break;
+					case 0x06:
+						msg = new ServerStatus(data, server);
+						break;
+					case 0x07:
+						msg = new PlayerTracert(data);
+						break;
+					case 0x08:
+						msg = new ReplyCharacters(data, server);
+						break;
+					case 0x09:
+						if (Config.EMAIL_SYS_ENABLED)
+							msg = new RequestSendMail(data);
+						break;
+					case 0x0A:
+						msg = new RequestTempBan(data);
+						break;
+					case 0x0B:
+						new ChangePassword(data);
+						break;
+					default:
+						_log.warning("Unknown Opcode ("+Integer.toHexString(opcode).toUpperCase()+") in state "+state.name()+" from GameServer, closing connection.");
+						server.forceClose(LoginServerFail.NOT_AUTHED);
+						break;
+				}
+				break;
+		}
+		return msg;
+	}
+}

+ 294 - 294
L2J_Server_BETA/java/com/l2jserver/loginserver/network/L2LoginClient.java

@@ -1,294 +1,294 @@
-/*
- * 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.loginserver.network;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.nio.ByteBuffer;
-import java.security.interfaces.RSAPrivateKey;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import org.mmocore.network.MMOClient;
-import org.mmocore.network.MMOConnection;
-import org.mmocore.network.SendablePacket;
-
-import com.l2jserver.Config;
-import com.l2jserver.loginserver.LoginController;
-import com.l2jserver.loginserver.SessionKey;
-import com.l2jserver.loginserver.network.serverpackets.L2LoginServerPacket;
-import com.l2jserver.loginserver.network.serverpackets.LoginFail;
-import com.l2jserver.loginserver.network.serverpackets.LoginFail.LoginFailReason;
-import com.l2jserver.loginserver.network.serverpackets.PlayFail;
-import com.l2jserver.loginserver.network.serverpackets.PlayFail.PlayFailReason;
-import com.l2jserver.util.Rnd;
-import com.l2jserver.util.crypt.LoginCrypt;
-import com.l2jserver.util.crypt.ScrambledKeyPair;
-
-/**
- * Represents a client connected into the LoginServer
- *
- * @author  KenM
- */
-public final class L2LoginClient extends MMOClient<MMOConnection<L2LoginClient>>
-{
-	private static Logger _log = Logger.getLogger(L2LoginClient.class.getName());
-	
-	public static enum LoginClientState { CONNECTED, AUTHED_GG, AUTHED_LOGIN}
-	
-	private LoginClientState _state;
-	
-	// Crypt
-	private LoginCrypt _loginCrypt;
-	private ScrambledKeyPair _scrambledPair;
-	private byte[] _blowfishKey;
-	
-	private String _account;
-	private int _accessLevel;
-	private int _lastServer;
-	private SessionKey _sessionKey;
-	private int _sessionId;
-	private boolean _joinedGS;
-	private Map<Integer, Integer> _charsOnServers;
-	private Map<Integer, long[]> _charsToDelete;
-	
-	private long _connectionStartTime;
-	
-	/**
-	 * @param con
-	 */
-	public L2LoginClient(MMOConnection<L2LoginClient> con)
-	{
-		super(con);
-		_state = LoginClientState.CONNECTED;
-		_scrambledPair = LoginController.getInstance().getScrambledRSAKeyPair();
-		_blowfishKey = LoginController.getInstance().getBlowfishKey();
-		_sessionId = Rnd.nextInt();
-		_connectionStartTime = System.currentTimeMillis();
-		_loginCrypt = new LoginCrypt();
-		_loginCrypt.setKey(_blowfishKey);
-	}
-	
-	/**
-	 * @see org.mmocore.network.MMOClient#decrypt(java.nio.ByteBuffer, int)
-	 */
-	@Override
-	public boolean decrypt(ByteBuffer buf, int size)
-	{
-		boolean ret = false;
-		try
-		{
-			ret = _loginCrypt.decrypt(buf.array(), buf.position(), size);
-		}
-		catch (IOException e)
-		{
-			_log.warning(getClass().getSimpleName() + ": " + e.getMessage());
-			super.getConnection().close((SendablePacket<L2LoginClient>) null);
-			return false;
-		}
-		
-		if (!ret)
-		{
-			byte[] dump = new byte[size];
-			System.arraycopy(buf.array(), buf.position(), dump, 0, size);
-			_log.warning("Wrong checksum from client: "+toString());
-			super.getConnection().close((SendablePacket<L2LoginClient>)null);
-		}
-		
-		return ret;
-	}
-	
-	/**
-	 * @see org.mmocore.network.MMOClient#encrypt(java.nio.ByteBuffer, int)
-	 */
-	@Override
-	public boolean encrypt(ByteBuffer buf, int size)
-	{
-		final int offset = buf.position();
-		try
-		{
-			size = _loginCrypt.encrypt(buf.array(), offset, size);
-		}
-		catch (IOException e)
-		{
-			_log.warning(getClass().getSimpleName() + ": " + e.getMessage());
-			return false;
-		}
-		
-		buf.position(offset + size);
-		return true;
-	}
-	
-	public LoginClientState getState()
-	{
-		return _state;
-	}
-	
-	public void setState(LoginClientState state)
-	{
-		_state = state;
-	}
-	
-	public byte[] getBlowfishKey()
-	{
-		return _blowfishKey;
-	}
-	
-	public byte[] getScrambledModulus()
-	{
-		return _scrambledPair._scrambledModulus;
-	}
-	
-	public RSAPrivateKey getRSAPrivateKey()
-	{
-		return (RSAPrivateKey) _scrambledPair._pair.getPrivate();
-	}
-	
-	public String getAccount()
-	{
-		return _account;
-	}
-	
-	public void setAccount(String account)
-	{
-		_account = account;
-	}
-	
-	public void setAccessLevel(int accessLevel)
-	{
-		_accessLevel = accessLevel;
-	}
-	
-	public int getAccessLevel()
-	{
-		return _accessLevel;
-	}
-	
-	public void setLastServer(int lastServer)
-	{
-		_lastServer = lastServer;
-	}
-	
-	public int getLastServer()
-	{
-		return _lastServer;
-	}
-	
-	public int getSessionId()
-	{
-		return _sessionId;
-	}
-	
-	public boolean hasJoinedGS()
-	{
-		return _joinedGS;
-	}
-	
-	public void setJoinedGS(boolean val)
-	{
-		_joinedGS = val;
-	}
-	
-	public void setSessionKey(SessionKey sessionKey)
-	{
-		_sessionKey = sessionKey;
-	}
-	
-	public SessionKey getSessionKey()
-	{
-		return _sessionKey;
-	}
-	
-	public long getConnectionStartTime()
-	{
-		return _connectionStartTime;
-	}
-	
-	public void sendPacket(L2LoginServerPacket lsp)
-	{
-		getConnection().sendPacket(lsp);
-	}
-	
-	public void close(LoginFailReason reason)
-	{
-		getConnection().close(new LoginFail(reason));
-	}
-	
-	public void close(PlayFailReason reason)
-	{
-		getConnection().close(new PlayFail(reason));
-	}
-	
-	public void close(L2LoginServerPacket lsp)
-	{
-		getConnection().close(lsp);
-	}
-	
-	public void setCharsOnServ(int servId, int chars)
-	{
-		if (_charsOnServers == null)
-			_charsOnServers = new HashMap<Integer, Integer>();
-		_charsOnServers.put(servId, chars);
-	}
-	
-	public Map<Integer, Integer> getCharsOnServ()
-	{
-		return _charsOnServers;
-	}
-	
-	public void serCharsWaitingDelOnServ(int servId, long[] charsToDel)
-	{
-		if (_charsToDelete == null)
-			_charsToDelete = new HashMap<Integer, long[]>();
-		_charsToDelete.put(servId, charsToDel);
-	}
-	
-	public Map<Integer, long[]> getCharsWaitingDelOnServ()
-	{
-		return _charsToDelete;
-	}
-	
-	@Override
-	public void onDisconnection()
-	{
-		if (Config.DEBUG)
-		{
-			_log.info("DISCONNECTED: "+toString());
-		}
-		
-		if (!hasJoinedGS() || (getConnectionStartTime() + LoginController.LOGIN_TIMEOUT) < System.currentTimeMillis())
-		{
-			LoginController.getInstance().removeAuthedLoginClient(getAccount());
-		}
-	}
-	
-	@Override
-	public String toString()
-	{
-		InetAddress address = getConnection().getInetAddress();
-		if (getState() == LoginClientState.AUTHED_LOGIN)
-		{
-			return "["+getAccount()+" ("+(address == null ? "disconnected" : address.getHostAddress())+")]";
-		}
-		return "["+(address == null ? "disconnected" : address.getHostAddress())+"]";
-	}
-	
-	@Override
-	protected void onForcedDisconnection()
-	{
-		// Empty
-	}
-}
+/*
+ * 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.loginserver.network;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.nio.ByteBuffer;
+import java.security.interfaces.RSAPrivateKey;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import org.mmocore.network.MMOClient;
+import org.mmocore.network.MMOConnection;
+import org.mmocore.network.SendablePacket;
+
+import com.l2jserver.Config;
+import com.l2jserver.loginserver.LoginController;
+import com.l2jserver.loginserver.SessionKey;
+import com.l2jserver.loginserver.network.serverpackets.L2LoginServerPacket;
+import com.l2jserver.loginserver.network.serverpackets.LoginFail;
+import com.l2jserver.loginserver.network.serverpackets.LoginFail.LoginFailReason;
+import com.l2jserver.loginserver.network.serverpackets.PlayFail;
+import com.l2jserver.loginserver.network.serverpackets.PlayFail.PlayFailReason;
+import com.l2jserver.util.Rnd;
+import com.l2jserver.util.crypt.LoginCrypt;
+import com.l2jserver.util.crypt.ScrambledKeyPair;
+
+/**
+ * Represents a client connected into the LoginServer
+ *
+ * @author  KenM
+ */
+public final class L2LoginClient extends MMOClient<MMOConnection<L2LoginClient>>
+{
+	private static Logger _log = Logger.getLogger(L2LoginClient.class.getName());
+	
+	public static enum LoginClientState { CONNECTED, AUTHED_GG, AUTHED_LOGIN}
+	
+	private LoginClientState _state;
+	
+	// Crypt
+	private LoginCrypt _loginCrypt;
+	private ScrambledKeyPair _scrambledPair;
+	private byte[] _blowfishKey;
+	
+	private String _account;
+	private int _accessLevel;
+	private int _lastServer;
+	private SessionKey _sessionKey;
+	private int _sessionId;
+	private boolean _joinedGS;
+	private Map<Integer, Integer> _charsOnServers;
+	private Map<Integer, long[]> _charsToDelete;
+	
+	private long _connectionStartTime;
+	
+	/**
+	 * @param con
+	 */
+	public L2LoginClient(MMOConnection<L2LoginClient> con)
+	{
+		super(con);
+		_state = LoginClientState.CONNECTED;
+		_scrambledPair = LoginController.getInstance().getScrambledRSAKeyPair();
+		_blowfishKey = LoginController.getInstance().getBlowfishKey();
+		_sessionId = Rnd.nextInt();
+		_connectionStartTime = System.currentTimeMillis();
+		_loginCrypt = new LoginCrypt();
+		_loginCrypt.setKey(_blowfishKey);
+	}
+	
+	/**
+	 * @see org.mmocore.network.MMOClient#decrypt(java.nio.ByteBuffer, int)
+	 */
+	@Override
+	public boolean decrypt(ByteBuffer buf, int size)
+	{
+		boolean ret = false;
+		try
+		{
+			ret = _loginCrypt.decrypt(buf.array(), buf.position(), size);
+		}
+		catch (IOException e)
+		{
+			_log.warning(getClass().getSimpleName() + ": " + e.getMessage());
+			super.getConnection().close((SendablePacket<L2LoginClient>) null);
+			return false;
+		}
+		
+		if (!ret)
+		{
+			byte[] dump = new byte[size];
+			System.arraycopy(buf.array(), buf.position(), dump, 0, size);
+			_log.warning("Wrong checksum from client: "+toString());
+			super.getConnection().close((SendablePacket<L2LoginClient>)null);
+		}
+		
+		return ret;
+	}
+	
+	/**
+	 * @see org.mmocore.network.MMOClient#encrypt(java.nio.ByteBuffer, int)
+	 */
+	@Override
+	public boolean encrypt(ByteBuffer buf, int size)
+	{
+		final int offset = buf.position();
+		try
+		{
+			size = _loginCrypt.encrypt(buf.array(), offset, size);
+		}
+		catch (IOException e)
+		{
+			_log.warning(getClass().getSimpleName() + ": " + e.getMessage());
+			return false;
+		}
+		
+		buf.position(offset + size);
+		return true;
+	}
+	
+	public LoginClientState getState()
+	{
+		return _state;
+	}
+	
+	public void setState(LoginClientState state)
+	{
+		_state = state;
+	}
+	
+	public byte[] getBlowfishKey()
+	{
+		return _blowfishKey;
+	}
+	
+	public byte[] getScrambledModulus()
+	{
+		return _scrambledPair._scrambledModulus;
+	}
+	
+	public RSAPrivateKey getRSAPrivateKey()
+	{
+		return (RSAPrivateKey) _scrambledPair._pair.getPrivate();
+	}
+	
+	public String getAccount()
+	{
+		return _account;
+	}
+	
+	public void setAccount(String account)
+	{
+		_account = account;
+	}
+	
+	public void setAccessLevel(int accessLevel)
+	{
+		_accessLevel = accessLevel;
+	}
+	
+	public int getAccessLevel()
+	{
+		return _accessLevel;
+	}
+	
+	public void setLastServer(int lastServer)
+	{
+		_lastServer = lastServer;
+	}
+	
+	public int getLastServer()
+	{
+		return _lastServer;
+	}
+	
+	public int getSessionId()
+	{
+		return _sessionId;
+	}
+	
+	public boolean hasJoinedGS()
+	{
+		return _joinedGS;
+	}
+	
+	public void setJoinedGS(boolean val)
+	{
+		_joinedGS = val;
+	}
+	
+	public void setSessionKey(SessionKey sessionKey)
+	{
+		_sessionKey = sessionKey;
+	}
+	
+	public SessionKey getSessionKey()
+	{
+		return _sessionKey;
+	}
+	
+	public long getConnectionStartTime()
+	{
+		return _connectionStartTime;
+	}
+	
+	public void sendPacket(L2LoginServerPacket lsp)
+	{
+		getConnection().sendPacket(lsp);
+	}
+	
+	public void close(LoginFailReason reason)
+	{
+		getConnection().close(new LoginFail(reason));
+	}
+	
+	public void close(PlayFailReason reason)
+	{
+		getConnection().close(new PlayFail(reason));
+	}
+	
+	public void close(L2LoginServerPacket lsp)
+	{
+		getConnection().close(lsp);
+	}
+	
+	public void setCharsOnServ(int servId, int chars)
+	{
+		if (_charsOnServers == null)
+			_charsOnServers = new HashMap<Integer, Integer>();
+		_charsOnServers.put(servId, chars);
+	}
+	
+	public Map<Integer, Integer> getCharsOnServ()
+	{
+		return _charsOnServers;
+	}
+	
+	public void serCharsWaitingDelOnServ(int servId, long[] charsToDel)
+	{
+		if (_charsToDelete == null)
+			_charsToDelete = new HashMap<Integer, long[]>();
+		_charsToDelete.put(servId, charsToDel);
+	}
+	
+	public Map<Integer, long[]> getCharsWaitingDelOnServ()
+	{
+		return _charsToDelete;
+	}
+	
+	@Override
+	public void onDisconnection()
+	{
+		if (Config.DEBUG)
+		{
+			_log.info("DISCONNECTED: "+toString());
+		}
+		
+		if (!hasJoinedGS() || (getConnectionStartTime() + LoginController.LOGIN_TIMEOUT) < System.currentTimeMillis())
+		{
+			LoginController.getInstance().removeAuthedLoginClient(getAccount());
+		}
+	}
+	
+	@Override
+	public String toString()
+	{
+		InetAddress address = getConnection().getInetAddress();
+		if (getState() == LoginClientState.AUTHED_LOGIN)
+		{
+			return "["+getAccount()+" ("+(address == null ? "disconnected" : address.getHostAddress())+")]";
+		}
+		return "["+(address == null ? "disconnected" : address.getHostAddress())+"]";
+	}
+	
+	@Override
+	protected void onForcedDisconnection()
+	{
+		// Empty
+	}
+}

+ 95 - 95
L2J_Server_BETA/java/com/l2jserver/loginserver/network/L2LoginPacketHandler.java

@@ -1,95 +1,95 @@
-/*
- * 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.loginserver.network;
-
-import java.nio.ByteBuffer;
-import java.util.logging.Logger;
-
-import org.mmocore.network.IPacketHandler;
-import org.mmocore.network.ReceivablePacket;
-
-import com.l2jserver.loginserver.network.L2LoginClient.LoginClientState;
-import com.l2jserver.loginserver.network.clientpackets.AuthGameGuard;
-import com.l2jserver.loginserver.network.clientpackets.RequestAuthLogin;
-import com.l2jserver.loginserver.network.clientpackets.RequestServerList;
-import com.l2jserver.loginserver.network.clientpackets.RequestServerLogin;
-
-/**
- * Handler for packets received by Login Server
- *
- * @author  KenM
- */
-public final class L2LoginPacketHandler implements IPacketHandler<L2LoginClient>
-{
-	protected static final Logger _log = Logger.getLogger(L2LoginPacketHandler.class.getName());
-	
-	/**
-	 * @see org.mmocore.network.IPacketHandler#handlePacket(java.nio.ByteBuffer, org.mmocore.network.MMOClient)
-	 */
-	@Override
-	public ReceivablePacket<L2LoginClient> handlePacket(ByteBuffer buf, L2LoginClient client)
-	{
-		int opcode = buf.get() & 0xFF;
-		
-		ReceivablePacket<L2LoginClient> packet = null;
-		LoginClientState state = client.getState();
-		
-		switch (state)
-		{
-			case CONNECTED:
-				switch (opcode)
-				{
-					case 0x07:
-						packet = new AuthGameGuard();
-						break;
-					default:
-						debugOpcode(opcode, state);
-						break;
-				}
-				break;
-			case AUTHED_GG:
-				switch (opcode)
-				{
-					case 0x00:
-						packet = new RequestAuthLogin();
-						break;
-					default:
-						debugOpcode(opcode, state);
-						break;
-				}
-				break;
-			case AUTHED_LOGIN:
-				switch (opcode)
-				{
-					case 0x02:
-						packet = new RequestServerLogin();
-						break;
-					case 0x05:
-						packet = new RequestServerList();
-						break;
-					default:
-						debugOpcode(opcode, state);
-						break;
-				}
-				break;
-		}
-		return packet;
-	}
-	
-	private void debugOpcode(int opcode, LoginClientState state)
-	{
-		_log.info("Unknown Opcode: "+opcode+" for state: "+state.name());
-	}
-}
+/*
+ * 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.loginserver.network;
+
+import java.nio.ByteBuffer;
+import java.util.logging.Logger;
+
+import org.mmocore.network.IPacketHandler;
+import org.mmocore.network.ReceivablePacket;
+
+import com.l2jserver.loginserver.network.L2LoginClient.LoginClientState;
+import com.l2jserver.loginserver.network.clientpackets.AuthGameGuard;
+import com.l2jserver.loginserver.network.clientpackets.RequestAuthLogin;
+import com.l2jserver.loginserver.network.clientpackets.RequestServerList;
+import com.l2jserver.loginserver.network.clientpackets.RequestServerLogin;
+
+/**
+ * Handler for packets received by Login Server
+ *
+ * @author  KenM
+ */
+public final class L2LoginPacketHandler implements IPacketHandler<L2LoginClient>
+{
+	protected static final Logger _log = Logger.getLogger(L2LoginPacketHandler.class.getName());
+	
+	/**
+	 * @see org.mmocore.network.IPacketHandler#handlePacket(java.nio.ByteBuffer, org.mmocore.network.MMOClient)
+	 */
+	@Override
+	public ReceivablePacket<L2LoginClient> handlePacket(ByteBuffer buf, L2LoginClient client)
+	{
+		int opcode = buf.get() & 0xFF;
+		
+		ReceivablePacket<L2LoginClient> packet = null;
+		LoginClientState state = client.getState();
+		
+		switch (state)
+		{
+			case CONNECTED:
+				switch (opcode)
+				{
+					case 0x07:
+						packet = new AuthGameGuard();
+						break;
+					default:
+						debugOpcode(opcode, state);
+						break;
+				}
+				break;
+			case AUTHED_GG:
+				switch (opcode)
+				{
+					case 0x00:
+						packet = new RequestAuthLogin();
+						break;
+					default:
+						debugOpcode(opcode, state);
+						break;
+				}
+				break;
+			case AUTHED_LOGIN:
+				switch (opcode)
+				{
+					case 0x02:
+						packet = new RequestServerLogin();
+						break;
+					case 0x05:
+						packet = new RequestServerList();
+						break;
+					default:
+						debugOpcode(opcode, state);
+						break;
+				}
+				break;
+		}
+		return packet;
+	}
+	
+	private void debugOpcode(int opcode, LoginClientState state)
+	{
+		_log.info("Unknown Opcode: "+opcode+" for state: "+state.name());
+	}
+}

+ 93 - 93
L2J_Server_BETA/java/com/l2jserver/loginserver/network/clientpackets/AuthGameGuard.java

@@ -1,93 +1,93 @@
-/*
- * 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.loginserver.network.clientpackets;
-
-import com.l2jserver.loginserver.network.L2LoginClient.LoginClientState;
-import com.l2jserver.loginserver.network.serverpackets.GGAuth;
-import com.l2jserver.loginserver.network.serverpackets.LoginFail.LoginFailReason;
-
-/**
- * @author -Wooden-
- * Format: ddddd
- *
- */
-public class AuthGameGuard extends L2LoginClientPacket
-{
-	private int _sessionId;
-	private int _data1;
-	private int _data2;
-	private int _data3;
-	private int _data4;
-	
-	public int getSessionId()
-	{
-		return _sessionId;
-	}
-	
-	public int getData1()
-	{
-		return _data1;
-	}
-	
-	public int getData2()
-	{
-		return _data2;
-	}
-	
-	public int getData3()
-	{
-		return _data3;
-	}
-	
-	public int getData4()
-	{
-		return _data4;
-	}
-	
-	/**
-	 * @see com.l2jserver.loginserver.network.clientpackets.L2LoginClientPacket#readImpl()
-	 */
-	@Override
-	protected boolean readImpl()
-	{
-		if (super._buf.remaining() >= 20)
-		{
-			_sessionId = readD();
-			_data1 = readD();
-			_data2 = readD();
-			_data3 = readD();
-			_data4 = readD();
-			return true;
-		}
-		return false;
-	}
-	
-	/**
-	 * @see org.mmocore.network.ReceivablePacket#run()
-	 */
-	@Override
-	public void run()
-	{
-		if (_sessionId == getClient().getSessionId())
-		{
-			getClient().setState(LoginClientState.AUTHED_GG);
-			getClient().sendPacket(new GGAuth(getClient().getSessionId()));
-		}
-		else
-		{
-			getClient().close(LoginFailReason.REASON_ACCESS_FAILED);
-		}
-	}
-}
+/*
+ * 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.loginserver.network.clientpackets;
+
+import com.l2jserver.loginserver.network.L2LoginClient.LoginClientState;
+import com.l2jserver.loginserver.network.serverpackets.GGAuth;
+import com.l2jserver.loginserver.network.serverpackets.LoginFail.LoginFailReason;
+
+/**
+ * @author -Wooden-
+ * Format: ddddd
+ *
+ */
+public class AuthGameGuard extends L2LoginClientPacket
+{
+	private int _sessionId;
+	private int _data1;
+	private int _data2;
+	private int _data3;
+	private int _data4;
+	
+	public int getSessionId()
+	{
+		return _sessionId;
+	}
+	
+	public int getData1()
+	{
+		return _data1;
+	}
+	
+	public int getData2()
+	{
+		return _data2;
+	}
+	
+	public int getData3()
+	{
+		return _data3;
+	}
+	
+	public int getData4()
+	{
+		return _data4;
+	}
+	
+	/**
+	 * @see com.l2jserver.loginserver.network.clientpackets.L2LoginClientPacket#readImpl()
+	 */
+	@Override
+	protected boolean readImpl()
+	{
+		if (super._buf.remaining() >= 20)
+		{
+			_sessionId = readD();
+			_data1 = readD();
+			_data2 = readD();
+			_data3 = readD();
+			_data4 = readD();
+			return true;
+		}
+		return false;
+	}
+	
+	/**
+	 * @see org.mmocore.network.ReceivablePacket#run()
+	 */
+	@Override
+	public void run()
+	{
+		if (_sessionId == getClient().getSessionId())
+		{
+			getClient().setState(LoginClientState.AUTHED_GG);
+			getClient().sendPacket(new GGAuth(getClient().getSessionId()));
+		}
+		else
+		{
+			getClient().close(LoginFailReason.REASON_ACCESS_FAILED);
+		}
+	}
+}

+ 50 - 50
L2J_Server_BETA/java/com/l2jserver/loginserver/network/clientpackets/L2LoginClientPacket.java

@@ -1,50 +1,50 @@
-/*
- * 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.loginserver.network.clientpackets;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.mmocore.network.ReceivablePacket;
-
-import com.l2jserver.loginserver.network.L2LoginClient;
-
-/**
- *
- * @author  KenM
- */
-public abstract class L2LoginClientPacket extends ReceivablePacket<L2LoginClient>
-{
-	private static Logger _log = Logger.getLogger(L2LoginClientPacket.class.getName());
-	
-	/**
-	 * @see org.mmocore.network.ReceivablePacket#read()
-	 */
-	@Override
-	protected final boolean read()
-	{
-		try
-		{
-			return readImpl();
-		}
-		catch (Exception e)
-		{
-			_log.log(Level.SEVERE, "ERROR READING: "+this.getClass().getSimpleName() + ": " + e.getMessage(), e);
-			return false;
-		}
-	}
-	
-	protected abstract boolean readImpl();
-}
+/*
+ * 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.loginserver.network.clientpackets;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.mmocore.network.ReceivablePacket;
+
+import com.l2jserver.loginserver.network.L2LoginClient;
+
+/**
+ *
+ * @author  KenM
+ */
+public abstract class L2LoginClientPacket extends ReceivablePacket<L2LoginClient>
+{
+	private static Logger _log = Logger.getLogger(L2LoginClientPacket.class.getName());
+	
+	/**
+	 * @see org.mmocore.network.ReceivablePacket#read()
+	 */
+	@Override
+	protected final boolean read()
+	{
+		try
+		{
+			return readImpl();
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.SEVERE, "ERROR READING: "+this.getClass().getSimpleName() + ": " + e.getMessage(), e);
+			return false;
+		}
+	}
+	
+	protected abstract boolean readImpl();
+}

+ 164 - 164
L2J_Server_BETA/java/com/l2jserver/loginserver/network/clientpackets/RequestAuthLogin.java

@@ -1,164 +1,164 @@
-/*
- * 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.loginserver.network.clientpackets;
-
-import java.security.GeneralSecurityException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.crypto.Cipher;
-
-import com.l2jserver.Config;
-import com.l2jserver.loginserver.GameServerTable.GameServerInfo;
-import com.l2jserver.loginserver.LoginController;
-import com.l2jserver.loginserver.LoginController.AuthLoginResult;
-import com.l2jserver.loginserver.network.L2LoginClient;
-import com.l2jserver.loginserver.network.L2LoginClient.LoginClientState;
-import com.l2jserver.loginserver.network.serverpackets.AccountKicked;
-import com.l2jserver.loginserver.network.serverpackets.AccountKicked.AccountKickedReason;
-import com.l2jserver.loginserver.network.serverpackets.LoginFail.LoginFailReason;
-import com.l2jserver.loginserver.network.serverpackets.LoginOk;
-import com.l2jserver.loginserver.network.serverpackets.ServerList;
-
-/**
- * Format: x
- * 0 (a leading null)
- * x: the rsa encrypted block with the login an password
- */
-public class RequestAuthLogin extends L2LoginClientPacket
-{
-	private static Logger _log = Logger.getLogger(RequestAuthLogin.class.getName());
-	
-	private final byte[] _raw = new byte[128];
-	
-	private String _user;
-	private String _password;
-	private int _ncotp;
-	
-	/**
-	 * @return
-	 */
-	public String getPassword()
-	{
-		return _password;
-	}
-	
-	/**
-	 * @return
-	 */
-	public String getUser()
-	{
-		return _user;
-	}
-	
-	public int getOneTimePassword()
-	{
-		return _ncotp;
-	}
-	
-	@Override
-	public boolean readImpl()
-	{
-		if (super._buf.remaining() >= 128)
-		{
-			readB(_raw);
-			return true;
-		}
-		return false;
-	}
-	
-	@Override
-	public void run()
-	{
-		byte[] decrypted = null;
-		final L2LoginClient client = getClient();
-		try
-		{
-			final Cipher rsaCipher = Cipher.getInstance("RSA/ECB/nopadding");
-			rsaCipher.init(Cipher.DECRYPT_MODE, client.getRSAPrivateKey());
-			decrypted = rsaCipher.doFinal(_raw, 0x00, 0x80);
-		}
-		catch (GeneralSecurityException e)
-		{
-			_log.log(Level.INFO, "", e);
-			return;
-		}
-		
-		try
-		{
-			_user = new String(decrypted, 0x5E, 14).trim().toLowerCase();
-			_password = new String(decrypted, 0x6C, 16).trim();
-			_ncotp = decrypted[0x7c];
-			_ncotp |= decrypted[0x7d] << 8;
-			_ncotp |= decrypted[0x7e] << 16;
-			_ncotp |= decrypted[0x7f] << 24;
-		}
-		catch (Exception e)
-		{
-			_log.log(Level.WARNING, "", e);
-			return;
-		}
-		
-		final LoginController lc = LoginController.getInstance();
-		AuthLoginResult result = lc.tryAuthLogin(_user, _password, client);
-		switch (result)
-		{
-			case AUTH_SUCCESS:
-				client.setAccount(_user);
-				client.setState(LoginClientState.AUTHED_LOGIN);
-				client.setSessionKey(lc.assignSessionKeyToClient(_user, client));
-				lc.getCharactersOnAccount(_user);
-				if (Config.SHOW_LICENCE)
-				{
-					client.sendPacket(new LoginOk(getClient().getSessionKey()));
-				}
-				else
-				{
-					getClient().sendPacket(new ServerList(getClient()));
-				}
-				break;
-			case INVALID_PASSWORD:
-				client.close(LoginFailReason.REASON_USER_OR_PASS_WRONG);
-				break;
-			case ACCOUNT_BANNED:
-				client.close(new AccountKicked(AccountKickedReason.REASON_PERMANENTLY_BANNED));
-				break;
-			case ALREADY_ON_LS:
-				L2LoginClient oldClient;
-				if ((oldClient = lc.getAuthedClient(_user)) != null)
-				{
-					// kick the other client
-					oldClient.close(LoginFailReason.REASON_ACCOUNT_IN_USE);
-					lc.removeAuthedLoginClient(_user);
-				}
-				// kick also current client
-				client.close(LoginFailReason.REASON_ACCOUNT_IN_USE);
-				break;
-			case ALREADY_ON_GS:
-				GameServerInfo gsi;
-				if ((gsi = lc.getAccountOnGameServer(_user)) != null)
-				{
-					client.close(LoginFailReason.REASON_ACCOUNT_IN_USE);
-					
-					// kick from there
-					if (gsi.isAuthed())
-					{
-						gsi.getGameServerThread().kickPlayer(_user);
-					}
-				}
-				break;
-		}
-	}
-}
+/*
+ * 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.loginserver.network.clientpackets;
+
+import java.security.GeneralSecurityException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.crypto.Cipher;
+
+import com.l2jserver.Config;
+import com.l2jserver.loginserver.GameServerTable.GameServerInfo;
+import com.l2jserver.loginserver.LoginController;
+import com.l2jserver.loginserver.LoginController.AuthLoginResult;
+import com.l2jserver.loginserver.network.L2LoginClient;
+import com.l2jserver.loginserver.network.L2LoginClient.LoginClientState;
+import com.l2jserver.loginserver.network.serverpackets.AccountKicked;
+import com.l2jserver.loginserver.network.serverpackets.AccountKicked.AccountKickedReason;
+import com.l2jserver.loginserver.network.serverpackets.LoginFail.LoginFailReason;
+import com.l2jserver.loginserver.network.serverpackets.LoginOk;
+import com.l2jserver.loginserver.network.serverpackets.ServerList;
+
+/**
+ * Format: x
+ * 0 (a leading null)
+ * x: the rsa encrypted block with the login an password
+ */
+public class RequestAuthLogin extends L2LoginClientPacket
+{
+	private static Logger _log = Logger.getLogger(RequestAuthLogin.class.getName());
+	
+	private final byte[] _raw = new byte[128];
+	
+	private String _user;
+	private String _password;
+	private int _ncotp;
+	
+	/**
+	 * @return
+	 */
+	public String getPassword()
+	{
+		return _password;
+	}
+	
+	/**
+	 * @return
+	 */
+	public String getUser()
+	{
+		return _user;
+	}
+	
+	public int getOneTimePassword()
+	{
+		return _ncotp;
+	}
+	
+	@Override
+	public boolean readImpl()
+	{
+		if (super._buf.remaining() >= 128)
+		{
+			readB(_raw);
+			return true;
+		}
+		return false;
+	}
+	
+	@Override
+	public void run()
+	{
+		byte[] decrypted = null;
+		final L2LoginClient client = getClient();
+		try
+		{
+			final Cipher rsaCipher = Cipher.getInstance("RSA/ECB/nopadding");
+			rsaCipher.init(Cipher.DECRYPT_MODE, client.getRSAPrivateKey());
+			decrypted = rsaCipher.doFinal(_raw, 0x00, 0x80);
+		}
+		catch (GeneralSecurityException e)
+		{
+			_log.log(Level.INFO, "", e);
+			return;
+		}
+		
+		try
+		{
+			_user = new String(decrypted, 0x5E, 14).trim().toLowerCase();
+			_password = new String(decrypted, 0x6C, 16).trim();
+			_ncotp = decrypted[0x7c];
+			_ncotp |= decrypted[0x7d] << 8;
+			_ncotp |= decrypted[0x7e] << 16;
+			_ncotp |= decrypted[0x7f] << 24;
+		}
+		catch (Exception e)
+		{
+			_log.log(Level.WARNING, "", e);
+			return;
+		}
+		
+		final LoginController lc = LoginController.getInstance();
+		AuthLoginResult result = lc.tryAuthLogin(_user, _password, client);
+		switch (result)
+		{
+			case AUTH_SUCCESS:
+				client.setAccount(_user);
+				client.setState(LoginClientState.AUTHED_LOGIN);
+				client.setSessionKey(lc.assignSessionKeyToClient(_user, client));
+				lc.getCharactersOnAccount(_user);
+				if (Config.SHOW_LICENCE)
+				{
+					client.sendPacket(new LoginOk(getClient().getSessionKey()));
+				}
+				else
+				{
+					getClient().sendPacket(new ServerList(getClient()));
+				}
+				break;
+			case INVALID_PASSWORD:
+				client.close(LoginFailReason.REASON_USER_OR_PASS_WRONG);
+				break;
+			case ACCOUNT_BANNED:
+				client.close(new AccountKicked(AccountKickedReason.REASON_PERMANENTLY_BANNED));
+				break;
+			case ALREADY_ON_LS:
+				L2LoginClient oldClient;
+				if ((oldClient = lc.getAuthedClient(_user)) != null)
+				{
+					// kick the other client
+					oldClient.close(LoginFailReason.REASON_ACCOUNT_IN_USE);
+					lc.removeAuthedLoginClient(_user);
+				}
+				// kick also current client
+				client.close(LoginFailReason.REASON_ACCOUNT_IN_USE);
+				break;
+			case ALREADY_ON_GS:
+				GameServerInfo gsi;
+				if ((gsi = lc.getAccountOnGameServer(_user)) != null)
+				{
+					client.close(LoginFailReason.REASON_ACCOUNT_IN_USE);
+					
+					// kick from there
+					if (gsi.isAuthed())
+					{
+						gsi.getGameServerThread().kickPlayer(_user);
+					}
+				}
+				break;
+		}
+	}
+}

+ 83 - 83
L2J_Server_BETA/java/com/l2jserver/loginserver/network/clientpackets/RequestServerList.java

@@ -1,83 +1,83 @@
-/*
- * 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.loginserver.network.clientpackets;
-
-import com.l2jserver.loginserver.network.serverpackets.LoginFail.LoginFailReason;
-import com.l2jserver.loginserver.network.serverpackets.ServerList;
-
-/**
- * Format: ddc
- * d: fist part of session id
- * d: second part of session id
- * c: ?
- */
-public class RequestServerList extends L2LoginClientPacket
-{
-	private int _skey1;
-	private int _skey2;
-	private int _data3;
-	
-	/**
-	 * @return
-	 */
-	public int getSessionKey1()
-	{
-		return _skey1;
-	}
-	
-	/**
-	 * @return
-	 */
-	public int getSessionKey2()
-	{
-		return _skey2;
-	}
-	
-	/**
-	 * @return
-	 */
-	public int getData3()
-	{
-		return _data3;
-	}
-	
-	@Override
-	public boolean readImpl()
-	{
-		if (super._buf.remaining() >= 8)
-		{
-			_skey1  = readD(); // loginOk 1
-			_skey2  = readD(); // loginOk 2
-			return true;
-		}
-		return false;
-	}
-	
-	/**
-	 * @see org.mmocore.network.ReceivablePacket#run()
-	 */
-	@Override
-	public void run()
-	{
-		if (getClient().getSessionKey().checkLoginPair(_skey1, _skey2))
-		{
-			getClient().sendPacket(new ServerList(getClient()));
-		}
-		else
-		{
-			getClient().close(LoginFailReason.REASON_ACCESS_FAILED);
-		}
-	}
-}
+/*
+ * 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.loginserver.network.clientpackets;
+
+import com.l2jserver.loginserver.network.serverpackets.LoginFail.LoginFailReason;
+import com.l2jserver.loginserver.network.serverpackets.ServerList;
+
+/**
+ * Format: ddc
+ * d: fist part of session id
+ * d: second part of session id
+ * c: ?
+ */
+public class RequestServerList extends L2LoginClientPacket
+{
+	private int _skey1;
+	private int _skey2;
+	private int _data3;
+	
+	/**
+	 * @return
+	 */
+	public int getSessionKey1()
+	{
+		return _skey1;
+	}
+	
+	/**
+	 * @return
+	 */
+	public int getSessionKey2()
+	{
+		return _skey2;
+	}
+	
+	/**
+	 * @return
+	 */
+	public int getData3()
+	{
+		return _data3;
+	}
+	
+	@Override
+	public boolean readImpl()
+	{
+		if (super._buf.remaining() >= 8)
+		{
+			_skey1  = readD(); // loginOk 1
+			_skey2  = readD(); // loginOk 2
+			return true;
+		}
+		return false;
+	}
+	
+	/**
+	 * @see org.mmocore.network.ReceivablePacket#run()
+	 */
+	@Override
+	public void run()
+	{
+		if (getClient().getSessionKey().checkLoginPair(_skey1, _skey2))
+		{
+			getClient().sendPacket(new ServerList(getClient()));
+		}
+		else
+		{
+			getClient().close(LoginFailReason.REASON_ACCESS_FAILED);
+		}
+	}
+}

+ 99 - 99
L2J_Server_BETA/java/com/l2jserver/loginserver/network/clientpackets/RequestServerLogin.java

@@ -1,99 +1,99 @@
-/*
- * 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.loginserver.network.clientpackets;
-
-import com.l2jserver.Config;
-import com.l2jserver.loginserver.LoginController;
-import com.l2jserver.loginserver.SessionKey;
-import com.l2jserver.loginserver.network.serverpackets.LoginFail.LoginFailReason;
-import com.l2jserver.loginserver.network.serverpackets.PlayFail.PlayFailReason;
-import com.l2jserver.loginserver.network.serverpackets.PlayOk;
-
-/**
- * Fromat is ddc
- * d: first part of session id
- * d: second part of session id
- * c: server ID
- */
-public class RequestServerLogin extends L2LoginClientPacket
-{
-	private int _skey1;
-	private int _skey2;
-	private int _serverId;
-	
-	/**
-	 * @return
-	 */
-	public int getSessionKey1()
-	{
-		return _skey1;
-	}
-	
-	/**
-	 * @return
-	 */
-	public int getSessionKey2()
-	{
-		return _skey2;
-	}
-	
-	/**
-	 * @return
-	 */
-	public int getServerID()
-	{
-		return _serverId;
-	}
-	
-	@Override
-	public boolean readImpl()
-	{
-		if (super._buf.remaining() >= 9)
-		{
-			_skey1 = readD();
-			_skey2 = readD();
-			_serverId = readC();
-			return true;
-		}
-		return false;
-	}
-	
-	/**
-	 * @see org.mmocore.network.ReceivablePacket#run()
-	 */
-	@Override
-	public void run()
-	{
-		SessionKey sk = getClient().getSessionKey();
-		
-		// if we didnt showed the license we cant check these values
-		if (!Config.SHOW_LICENCE || sk.checkLoginPair(_skey1, _skey2))
-		{
-			if (LoginController.getInstance().isLoginPossible(getClient(), _serverId))
-			{
-				getClient().setJoinedGS(true);
-				getClient().sendPacket(new PlayOk(sk));
-			}
-			else
-			{
-				getClient().close(PlayFailReason.REASON_SERVER_OVERLOADED);
-			}
-		}
-		else
-		{
-			getClient().close(LoginFailReason.REASON_ACCESS_FAILED);
-		}
-	}
-}
+/*
+ * 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.loginserver.network.clientpackets;
+
+import com.l2jserver.Config;
+import com.l2jserver.loginserver.LoginController;
+import com.l2jserver.loginserver.SessionKey;
+import com.l2jserver.loginserver.network.serverpackets.LoginFail.LoginFailReason;
+import com.l2jserver.loginserver.network.serverpackets.PlayFail.PlayFailReason;
+import com.l2jserver.loginserver.network.serverpackets.PlayOk;
+
+/**
+ * Fromat is ddc
+ * d: first part of session id
+ * d: second part of session id
+ * c: server ID
+ */
+public class RequestServerLogin extends L2LoginClientPacket
+{
+	private int _skey1;
+	private int _skey2;
+	private int _serverId;
+	
+	/**
+	 * @return
+	 */
+	public int getSessionKey1()
+	{
+		return _skey1;
+	}
+	
+	/**
+	 * @return
+	 */
+	public int getSessionKey2()
+	{
+		return _skey2;
+	}
+	
+	/**
+	 * @return
+	 */
+	public int getServerID()
+	{
+		return _serverId;
+	}
+	
+	@Override
+	public boolean readImpl()
+	{
+		if (super._buf.remaining() >= 9)
+		{
+			_skey1 = readD();
+			_skey2 = readD();
+			_serverId = readC();
+			return true;
+		}
+		return false;
+	}
+	
+	/**
+	 * @see org.mmocore.network.ReceivablePacket#run()
+	 */
+	@Override
+	public void run()
+	{
+		SessionKey sk = getClient().getSessionKey();
+		
+		// if we didnt showed the license we cant check these values
+		if (!Config.SHOW_LICENCE || sk.checkLoginPair(_skey1, _skey2))
+		{
+			if (LoginController.getInstance().isLoginPossible(getClient(), _serverId))
+			{
+				getClient().setJoinedGS(true);
+				getClient().sendPacket(new PlayOk(sk));
+			}
+			else
+			{
+				getClient().close(PlayFailReason.REASON_SERVER_OVERLOADED);
+			}
+		}
+		else
+		{
+			getClient().close(LoginFailReason.REASON_ACCESS_FAILED);
+		}
+	}
+}

+ 76 - 76
L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/BlowFishKey.java

@@ -1,76 +1,76 @@
-/*
- * 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.loginserver.network.gameserverpackets;
-
-import java.security.GeneralSecurityException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.crypto.Cipher;
-
-import com.l2jserver.Config;
-import com.l2jserver.loginserver.GameServerThread;
-import com.l2jserver.loginserver.network.L2JGameServerPacketHandler.GameServerState;
-import com.l2jserver.util.crypt.NewCrypt;
-import com.l2jserver.util.network.BaseRecievePacket;
-
-
-/**
- * @author -Wooden-
- *
- */
-public class BlowFishKey extends BaseRecievePacket
-{
-	protected static final Logger _log = Logger.getLogger(BlowFishKey.class.getName());
-	
-	/**
-	 * @param decrypt
-	 * @param server 
-	 */
-	public BlowFishKey(byte[] decrypt, GameServerThread server)
-	{
-		super(decrypt);
-		int size = readD();
-		byte[] tempKey = readB(size);
-		try
-		{
-			byte [] tempDecryptKey;
-			Cipher rsaCipher = Cipher.getInstance("RSA/ECB/nopadding");
-			rsaCipher.init(Cipher.DECRYPT_MODE, server.getPrivateKey());
-			tempDecryptKey = rsaCipher.doFinal(tempKey);
-			// there are nulls before the key we must remove them
-			int i = 0;
-			int len = tempDecryptKey.length;
-			for(; i < len; i++)
-			{
-				if(tempDecryptKey[i] != 0)
-					break;
-			}
-			byte[] key = new byte[len-i];
-			System.arraycopy(tempDecryptKey,i,key,0,len-i);
-			
-			server.SetBlowFish(new NewCrypt(key));
-			if (Config.DEBUG)
-			{
-				_log.info("New BlowFish key received, Blowfih Engine initialized:");
-			}
-			server.setLoginConnectionState(GameServerState.BF_CONNECTED);
-		}
-		catch(GeneralSecurityException e)
-		{
-			_log.log(Level.SEVERE, "Error While decrypting blowfish key (RSA): " + e.getMessage(), e);
-		}
-	}
-}
+/*
+ * 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.loginserver.network.gameserverpackets;
+
+import java.security.GeneralSecurityException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.crypto.Cipher;
+
+import com.l2jserver.Config;
+import com.l2jserver.loginserver.GameServerThread;
+import com.l2jserver.loginserver.network.L2JGameServerPacketHandler.GameServerState;
+import com.l2jserver.util.crypt.NewCrypt;
+import com.l2jserver.util.network.BaseRecievePacket;
+
+
+/**
+ * @author -Wooden-
+ *
+ */
+public class BlowFishKey extends BaseRecievePacket
+{
+	protected static final Logger _log = Logger.getLogger(BlowFishKey.class.getName());
+	
+	/**
+	 * @param decrypt
+	 * @param server 
+	 */
+	public BlowFishKey(byte[] decrypt, GameServerThread server)
+	{
+		super(decrypt);
+		int size = readD();
+		byte[] tempKey = readB(size);
+		try
+		{
+			byte [] tempDecryptKey;
+			Cipher rsaCipher = Cipher.getInstance("RSA/ECB/nopadding");
+			rsaCipher.init(Cipher.DECRYPT_MODE, server.getPrivateKey());
+			tempDecryptKey = rsaCipher.doFinal(tempKey);
+			// there are nulls before the key we must remove them
+			int i = 0;
+			int len = tempDecryptKey.length;
+			for(; i < len; i++)
+			{
+				if(tempDecryptKey[i] != 0)
+					break;
+			}
+			byte[] key = new byte[len-i];
+			System.arraycopy(tempDecryptKey,i,key,0,len-i);
+			
+			server.SetBlowFish(new NewCrypt(key));
+			if (Config.DEBUG)
+			{
+				_log.info("New BlowFish key received, Blowfih Engine initialized:");
+			}
+			server.setLoginConnectionState(GameServerState.BF_CONNECTED);
+		}
+		catch(GeneralSecurityException e)
+		{
+			_log.log(Level.SEVERE, "Error While decrypting blowfish key (RSA): " + e.getMessage(), e);
+		}
+	}
+}

+ 44 - 44
L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/ChangeAccessLevel.java

@@ -1,44 +1,44 @@
-/*
- * 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.loginserver.network.gameserverpackets;
-
-import java.util.logging.Logger;
-
-import com.l2jserver.loginserver.GameServerThread;
-import com.l2jserver.loginserver.LoginController;
-import com.l2jserver.util.network.BaseRecievePacket;
-
-/**
- * @author -Wooden-
- *
- */
-public class ChangeAccessLevel extends BaseRecievePacket
-{
-	protected static Logger _log = Logger.getLogger(ChangeAccessLevel.class.getName());
-	
-	/**
-	 * @param decrypt
-	 * @param server 
-	 */
-	public ChangeAccessLevel(byte[] decrypt, GameServerThread server)
-	{
-		super(decrypt);
-		int level = readD();
-		String account = readS();
-		
-		LoginController.getInstance().setAccountAccessLevel(account, level);
-		_log.info("Changed "+account+" access level to "+level);
-	}	
-}
+/*
+ * 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.loginserver.network.gameserverpackets;
+
+import java.util.logging.Logger;
+
+import com.l2jserver.loginserver.GameServerThread;
+import com.l2jserver.loginserver.LoginController;
+import com.l2jserver.util.network.BaseRecievePacket;
+
+/**
+ * @author -Wooden-
+ *
+ */
+public class ChangeAccessLevel extends BaseRecievePacket
+{
+	protected static Logger _log = Logger.getLogger(ChangeAccessLevel.class.getName());
+	
+	/**
+	 * @param decrypt
+	 * @param server 
+	 */
+	public ChangeAccessLevel(byte[] decrypt, GameServerThread server)
+	{
+		super(decrypt);
+		int level = readD();
+		String account = readS();
+		
+		LoginController.getInstance().setAccountAccessLevel(account, level);
+		_log.info("Changed "+account+" access level to "+level);
+	}	
+}

+ 170 - 170
L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/GameServerAuth.java

@@ -1,170 +1,170 @@
-/*
- * 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.loginserver.network.gameserverpackets;
-
-import java.util.Arrays;
-import java.util.logging.Logger;
-
-import com.l2jserver.Config;
-import com.l2jserver.loginserver.GameServerTable;
-import com.l2jserver.loginserver.GameServerTable.GameServerInfo;
-import com.l2jserver.loginserver.GameServerThread;
-import com.l2jserver.loginserver.network.L2JGameServerPacketHandler.GameServerState;
-import com.l2jserver.loginserver.network.loginserverpackets.AuthResponse;
-import com.l2jserver.loginserver.network.loginserverpackets.LoginServerFail;
-import com.l2jserver.util.network.BaseRecievePacket;
-
-
-/**
- * Format: cccddb
- * c desired ID
- * c accept alternative ID
- * c reserve Host
- * s ExternalHostName
- * s InetranlHostName
- * d max players
- * d hexid size
- * b hexid
- * @author -Wooden-
- *
- */
-public class GameServerAuth extends BaseRecievePacket
-{
-	protected static Logger _log = Logger.getLogger(GameServerAuth.class.getName());
-	GameServerThread _server;
-	private byte[] _hexId;
-	private int _desiredId;
-	@SuppressWarnings("unused")
-	private boolean _hostReserved;
-	private boolean _acceptAlternativeId;
-	private int _maxPlayers;
-	private int _port;
-	private String[] _hosts;
-	
-	/**
-	 * @param decrypt
-	 * @param server 
-	 */
-	public GameServerAuth(byte[] decrypt, GameServerThread server)
-	{
-		super(decrypt);
-		_server = server;
-		_desiredId = readC();
-		_acceptAlternativeId = (readC() == 0 ? false : true);
-		_hostReserved = (readC() == 0 ? false : true);
-		_port = readH();
-		_maxPlayers = readD();
-		int size = readD();
-		_hexId = readB(size);
-		size = 2 * readD();
-		_hosts = new String[size];
-		for (int i = 0; i < size; i++)
-			_hosts[i] = readS();
-		
-		if (Config.DEBUG)
-			_log.info("Auth request received");
-		
-		if (handleRegProcess())
-		{
-			AuthResponse ar = new AuthResponse(server.getGameServerInfo().getId());
-			server.sendPacket(ar);
-			if (Config.DEBUG)
-			{
-				_log.info("Authed: id: "+server.getGameServerInfo().getId());
-			}
-			server.broadcastToTelnet("GameServer ["+server.getServerId()+"] "+GameServerTable.getInstance().getServerNameById(server.getServerId())+" is connected");
-			server.setLoginConnectionState(GameServerState.AUTHED);
-		}
-	}
-	
-	private boolean handleRegProcess()
-	{
-		GameServerTable gameServerTable = GameServerTable.getInstance();
-		
-		int id = _desiredId;
-		byte[] hexId = _hexId;
-		
-		GameServerInfo gsi = gameServerTable.getRegisteredGameServerById(id);
-		// is there a gameserver registered with this id?
-		if (gsi != null)
-		{
-			// does the hex id match?
-			if (Arrays.equals(gsi.getHexId(), hexId))
-			{
-				// check to see if this GS is already connected
-				synchronized (gsi)
-				{
-					if (gsi.isAuthed())
-					{
-						_server.forceClose(LoginServerFail.REASON_ALREADY_LOGGED8IN);
-						return false;
-					}
-					_server.attachGameServerInfo(gsi, _port, _hosts, _maxPlayers);
-				}
-			}
-			else
-			{
-				// there is already a server registered with the desired id and different hex id
-				// try to register this one with an alternative id
-				if (Config.ACCEPT_NEW_GAMESERVER && _acceptAlternativeId)
-				{
-					gsi = new GameServerInfo(id, hexId, _server);
-					if (gameServerTable.registerWithFirstAvaliableId(gsi))
-					{
-						_server.attachGameServerInfo(gsi, _port, _hosts, _maxPlayers);
-						gameServerTable.registerServerOnDB(gsi);
-					}
-					else
-					{
-						_server.forceClose(LoginServerFail.REASON_NO_FREE_ID);
-						return false;
-					}
-				}
-				else
-				{
-					// server id is already taken, and we cant get a new one for you
-					_server.forceClose(LoginServerFail.REASON_WRONG_HEXID);
-					return false;
-				}
-			}
-		}
-		else
-		{
-			// can we register on this id?
-			if (Config.ACCEPT_NEW_GAMESERVER)
-			{
-				gsi = new GameServerInfo(id, hexId, _server);
-				if (gameServerTable.register(id, gsi))
-				{
-					_server.attachGameServerInfo(gsi, _port, _hosts, _maxPlayers);
-					gameServerTable.registerServerOnDB(gsi);
-				}
-				else
-				{
-					// some one took this ID meanwhile
-					_server.forceClose(LoginServerFail.REASON_ID_RESERVED);
-					return false;
-				}
-			}
-			else
-			{
-				_server.forceClose(LoginServerFail.REASON_WRONG_HEXID);
-				return false;
-			}
-		}
-		
-		return true;
-	}
-}
+/*
+ * 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.loginserver.network.gameserverpackets;
+
+import java.util.Arrays;
+import java.util.logging.Logger;
+
+import com.l2jserver.Config;
+import com.l2jserver.loginserver.GameServerTable;
+import com.l2jserver.loginserver.GameServerTable.GameServerInfo;
+import com.l2jserver.loginserver.GameServerThread;
+import com.l2jserver.loginserver.network.L2JGameServerPacketHandler.GameServerState;
+import com.l2jserver.loginserver.network.loginserverpackets.AuthResponse;
+import com.l2jserver.loginserver.network.loginserverpackets.LoginServerFail;
+import com.l2jserver.util.network.BaseRecievePacket;
+
+
+/**
+ * Format: cccddb
+ * c desired ID
+ * c accept alternative ID
+ * c reserve Host
+ * s ExternalHostName
+ * s InetranlHostName
+ * d max players
+ * d hexid size
+ * b hexid
+ * @author -Wooden-
+ *
+ */
+public class GameServerAuth extends BaseRecievePacket
+{
+	protected static Logger _log = Logger.getLogger(GameServerAuth.class.getName());
+	GameServerThread _server;
+	private byte[] _hexId;
+	private int _desiredId;
+	@SuppressWarnings("unused")
+	private boolean _hostReserved;
+	private boolean _acceptAlternativeId;
+	private int _maxPlayers;
+	private int _port;
+	private String[] _hosts;
+	
+	/**
+	 * @param decrypt
+	 * @param server 
+	 */
+	public GameServerAuth(byte[] decrypt, GameServerThread server)
+	{
+		super(decrypt);
+		_server = server;
+		_desiredId = readC();
+		_acceptAlternativeId = (readC() == 0 ? false : true);
+		_hostReserved = (readC() == 0 ? false : true);
+		_port = readH();
+		_maxPlayers = readD();
+		int size = readD();
+		_hexId = readB(size);
+		size = 2 * readD();
+		_hosts = new String[size];
+		for (int i = 0; i < size; i++)
+			_hosts[i] = readS();
+		
+		if (Config.DEBUG)
+			_log.info("Auth request received");
+		
+		if (handleRegProcess())
+		{
+			AuthResponse ar = new AuthResponse(server.getGameServerInfo().getId());
+			server.sendPacket(ar);
+			if (Config.DEBUG)
+			{
+				_log.info("Authed: id: "+server.getGameServerInfo().getId());
+			}
+			server.broadcastToTelnet("GameServer ["+server.getServerId()+"] "+GameServerTable.getInstance().getServerNameById(server.getServerId())+" is connected");
+			server.setLoginConnectionState(GameServerState.AUTHED);
+		}
+	}
+	
+	private boolean handleRegProcess()
+	{
+		GameServerTable gameServerTable = GameServerTable.getInstance();
+		
+		int id = _desiredId;
+		byte[] hexId = _hexId;
+		
+		GameServerInfo gsi = gameServerTable.getRegisteredGameServerById(id);
+		// is there a gameserver registered with this id?
+		if (gsi != null)
+		{
+			// does the hex id match?
+			if (Arrays.equals(gsi.getHexId(), hexId))
+			{
+				// check to see if this GS is already connected
+				synchronized (gsi)
+				{
+					if (gsi.isAuthed())
+					{
+						_server.forceClose(LoginServerFail.REASON_ALREADY_LOGGED8IN);
+						return false;
+					}
+					_server.attachGameServerInfo(gsi, _port, _hosts, _maxPlayers);
+				}
+			}
+			else
+			{
+				// there is already a server registered with the desired id and different hex id
+				// try to register this one with an alternative id
+				if (Config.ACCEPT_NEW_GAMESERVER && _acceptAlternativeId)
+				{
+					gsi = new GameServerInfo(id, hexId, _server);
+					if (gameServerTable.registerWithFirstAvaliableId(gsi))
+					{
+						_server.attachGameServerInfo(gsi, _port, _hosts, _maxPlayers);
+						gameServerTable.registerServerOnDB(gsi);
+					}
+					else
+					{
+						_server.forceClose(LoginServerFail.REASON_NO_FREE_ID);
+						return false;
+					}
+				}
+				else
+				{
+					// server id is already taken, and we cant get a new one for you
+					_server.forceClose(LoginServerFail.REASON_WRONG_HEXID);
+					return false;
+				}
+			}
+		}
+		else
+		{
+			// can we register on this id?
+			if (Config.ACCEPT_NEW_GAMESERVER)
+			{
+				gsi = new GameServerInfo(id, hexId, _server);
+				if (gameServerTable.register(id, gsi))
+				{
+					_server.attachGameServerInfo(gsi, _port, _hosts, _maxPlayers);
+					gameServerTable.registerServerOnDB(gsi);
+				}
+				else
+				{
+					// some one took this ID meanwhile
+					_server.forceClose(LoginServerFail.REASON_ID_RESERVED);
+					return false;
+				}
+			}
+			else
+			{
+				_server.forceClose(LoginServerFail.REASON_WRONG_HEXID);
+				return false;
+			}
+		}
+		
+		return true;
+	}
+}

+ 75 - 75
L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/PlayerAuthRequest.java

@@ -1,75 +1,75 @@
-/*
- * 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.loginserver.network.gameserverpackets;
-
-import java.util.logging.Logger;
-
-import com.l2jserver.Config;
-import com.l2jserver.loginserver.GameServerThread;
-import com.l2jserver.loginserver.LoginController;
-import com.l2jserver.loginserver.SessionKey;
-import com.l2jserver.loginserver.network.loginserverpackets.PlayerAuthResponse;
-import com.l2jserver.util.network.BaseRecievePacket;
-
-/**
- * @author -Wooden-
- *
- */
-public class PlayerAuthRequest extends BaseRecievePacket
-{	
-	private static Logger _log = Logger.getLogger(PlayerAuthRequest.class.getName());
-	
-	/**
-	 * @param decrypt
-	 * @param server 
-	 */
-	public PlayerAuthRequest(byte[] decrypt, GameServerThread server)
-	{
-		super(decrypt);
-		String account = readS();
-		int playKey1 = readD();
-		int playKey2 = readD();
-		int loginKey1 = readD();
-		int loginKey2 = readD();
-		SessionKey sessionKey = new SessionKey(loginKey1, loginKey2, playKey1, playKey2);
-		
-		PlayerAuthResponse authResponse;
-		if (Config.DEBUG)
-		{
-			_log.info("auth request received for Player "+account);
-		}
-		SessionKey key = LoginController.getInstance().getKeyForAccount(account);
-		if (key != null && key.equals(sessionKey))
-		{
-			if (Config.DEBUG)
-			{
-				_log.info("auth request: OK");
-			}
-			LoginController.getInstance().removeAuthedLoginClient(account);
-			authResponse = new PlayerAuthResponse(account, true);
-		}
-		else
-		{
-			if (Config.DEBUG)
-			{
-				_log.info("auth request: NO");
-				_log.info("session key from self: "+key);
-				_log.info("session key sent: "+sessionKey);
-			}
-			authResponse = new PlayerAuthResponse(account, false);
-		}
-		server.sendPacket(authResponse);
-	}
-}
+/*
+ * 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.loginserver.network.gameserverpackets;
+
+import java.util.logging.Logger;
+
+import com.l2jserver.Config;
+import com.l2jserver.loginserver.GameServerThread;
+import com.l2jserver.loginserver.LoginController;
+import com.l2jserver.loginserver.SessionKey;
+import com.l2jserver.loginserver.network.loginserverpackets.PlayerAuthResponse;
+import com.l2jserver.util.network.BaseRecievePacket;
+
+/**
+ * @author -Wooden-
+ *
+ */
+public class PlayerAuthRequest extends BaseRecievePacket
+{	
+	private static Logger _log = Logger.getLogger(PlayerAuthRequest.class.getName());
+	
+	/**
+	 * @param decrypt
+	 * @param server 
+	 */
+	public PlayerAuthRequest(byte[] decrypt, GameServerThread server)
+	{
+		super(decrypt);
+		String account = readS();
+		int playKey1 = readD();
+		int playKey2 = readD();
+		int loginKey1 = readD();
+		int loginKey2 = readD();
+		SessionKey sessionKey = new SessionKey(loginKey1, loginKey2, playKey1, playKey2);
+		
+		PlayerAuthResponse authResponse;
+		if (Config.DEBUG)
+		{
+			_log.info("auth request received for Player "+account);
+		}
+		SessionKey key = LoginController.getInstance().getKeyForAccount(account);
+		if (key != null && key.equals(sessionKey))
+		{
+			if (Config.DEBUG)
+			{
+				_log.info("auth request: OK");
+			}
+			LoginController.getInstance().removeAuthedLoginClient(account);
+			authResponse = new PlayerAuthResponse(account, true);
+		}
+		else
+		{
+			if (Config.DEBUG)
+			{
+				_log.info("auth request: NO");
+				_log.info("session key from self: "+key);
+				_log.info("session key sent: "+sessionKey);
+			}
+			authResponse = new PlayerAuthResponse(account, false);
+		}
+		server.sendPacket(authResponse);
+	}
+}

+ 51 - 51
L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/PlayerInGame.java

@@ -1,51 +1,51 @@
-/*
- * 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.loginserver.network.gameserverpackets;
-
-import java.util.logging.Logger;
-
-import com.l2jserver.Config;
-import com.l2jserver.loginserver.GameServerTable;
-import com.l2jserver.loginserver.GameServerThread;
-import com.l2jserver.util.network.BaseRecievePacket;
-
-/**
- * @author -Wooden-
- *
- */
-public class PlayerInGame extends BaseRecievePacket
-{
-	private static Logger _log = Logger.getLogger(PlayerInGame.class.getName());
-	
-	/**
-	 * @param decrypt
-	 * @param server 
-	 */
-	public PlayerInGame(byte[] decrypt, GameServerThread server)
-	{
-		super(decrypt);
-		int size = readH();
-		for (int i = 0; i < size; i++)
-		{
-			String account = readS();
-			server.addAccountOnGameServer(account);
-			if (Config.DEBUG)
-			{
-				_log.info("Account "+account+" logged in GameServer: ["+server.getServerId()+"] "+GameServerTable.getInstance().getServerNameById(server.getServerId()));
-			}
-			server.broadcastToTelnet("Account "+account+" logged in GameServer "+server.getServerId());
-		}
-	}
-}
+/*
+ * 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.loginserver.network.gameserverpackets;
+
+import java.util.logging.Logger;
+
+import com.l2jserver.Config;
+import com.l2jserver.loginserver.GameServerTable;
+import com.l2jserver.loginserver.GameServerThread;
+import com.l2jserver.util.network.BaseRecievePacket;
+
+/**
+ * @author -Wooden-
+ *
+ */
+public class PlayerInGame extends BaseRecievePacket
+{
+	private static Logger _log = Logger.getLogger(PlayerInGame.class.getName());
+	
+	/**
+	 * @param decrypt
+	 * @param server 
+	 */
+	public PlayerInGame(byte[] decrypt, GameServerThread server)
+	{
+		super(decrypt);
+		int size = readH();
+		for (int i = 0; i < size; i++)
+		{
+			String account = readS();
+			server.addAccountOnGameServer(account);
+			if (Config.DEBUG)
+			{
+				_log.info("Account "+account+" logged in GameServer: ["+server.getServerId()+"] "+GameServerTable.getInstance().getServerNameById(server.getServerId()));
+			}
+			server.broadcastToTelnet("Account "+account+" logged in GameServer "+server.getServerId());
+		}
+	}
+}

+ 49 - 49
L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/PlayerLogout.java

@@ -1,49 +1,49 @@
-/*
- * 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.loginserver.network.gameserverpackets;
-
-import java.util.logging.Logger;
-
-import com.l2jserver.Config;
-import com.l2jserver.loginserver.GameServerTable;
-import com.l2jserver.loginserver.GameServerThread;
-import com.l2jserver.util.network.BaseRecievePacket;
-
-/**
- * @author -Wooden-
- *
- */
-public class PlayerLogout extends BaseRecievePacket
-{
-	protected static Logger _log = Logger.getLogger(PlayerLogout.class.getName());
-	
-	/**
-	 * @param decrypt
-	 * @param server 
-	 */
-	public PlayerLogout(byte[] decrypt, GameServerThread server)
-	{
-		super(decrypt);
-		String account = readS();
-		
-		server.removeAccountOnGameServer(account);
-		if (Config.DEBUG)
-		{
-			_log.info("Player "+account+" logged out from gameserver ["+server.getServerId()+"] "+GameServerTable.getInstance().getServerNameById(server.getServerId()));
-		}
-		
-		server.broadcastToTelnet("Player "+account+" disconnected from GameServer "+server.getServerId());
-	}
-}
+/*
+ * 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.loginserver.network.gameserverpackets;
+
+import java.util.logging.Logger;
+
+import com.l2jserver.Config;
+import com.l2jserver.loginserver.GameServerTable;
+import com.l2jserver.loginserver.GameServerThread;
+import com.l2jserver.util.network.BaseRecievePacket;
+
+/**
+ * @author -Wooden-
+ *
+ */
+public class PlayerLogout extends BaseRecievePacket
+{
+	protected static Logger _log = Logger.getLogger(PlayerLogout.class.getName());
+	
+	/**
+	 * @param decrypt
+	 * @param server 
+	 */
+	public PlayerLogout(byte[] decrypt, GameServerThread server)
+	{
+		super(decrypt);
+		String account = readS();
+		
+		server.removeAccountOnGameServer(account);
+		if (Config.DEBUG)
+		{
+			_log.info("Player "+account+" logged out from gameserver ["+server.getServerId()+"] "+GameServerTable.getInstance().getServerNameById(server.getServerId()));
+		}
+		
+		server.broadcastToTelnet("Player "+account+" disconnected from GameServer "+server.getServerId());
+	}
+}

+ 50 - 50
L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/PlayerTracert.java

@@ -1,50 +1,50 @@
-/*
- * 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.loginserver.network.gameserverpackets;
-
-import java.util.logging.Logger;
-
-import com.l2jserver.Config;
-import com.l2jserver.loginserver.LoginController;
-import com.l2jserver.util.network.BaseRecievePacket;
-
-/**
- * @author mrTJO
- *
- */
-public class PlayerTracert extends BaseRecievePacket
-{
-	protected static Logger _log = Logger.getLogger(PlayerTracert.class.getName());
-	
-	/**
-	 * @param decrypt
-	 */
-	public PlayerTracert(byte[] decrypt)
-	{
-		super(decrypt);
-		String account = readS();
-		String pcIp = readS();
-		String hop1 = readS();
-		String hop2 = readS();
-		String hop3 = readS();
-		String hop4 = readS();
-		
-		LoginController.getInstance().setAccountLastTracert(account, pcIp, hop1, hop2, hop3, hop4);
-		if (Config.DEBUG)
-		{
-			_log.info("Saved "+account+" last tracert");
-		}
-	}
-}
+/*
+ * 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.loginserver.network.gameserverpackets;
+
+import java.util.logging.Logger;
+
+import com.l2jserver.Config;
+import com.l2jserver.loginserver.LoginController;
+import com.l2jserver.util.network.BaseRecievePacket;
+
+/**
+ * @author mrTJO
+ *
+ */
+public class PlayerTracert extends BaseRecievePacket
+{
+	protected static Logger _log = Logger.getLogger(PlayerTracert.class.getName());
+	
+	/**
+	 * @param decrypt
+	 */
+	public PlayerTracert(byte[] decrypt)
+	{
+		super(decrypt);
+		String account = readS();
+		String pcIp = readS();
+		String hop1 = readS();
+		String hop2 = readS();
+		String hop3 = readS();
+		String hop4 = readS();
+		
+		LoginController.getInstance().setAccountLastTracert(account, pcIp, hop1, hop2, hop3, hop4);
+		if (Config.DEBUG)
+		{
+			_log.info("Saved "+account+" last tracert");
+		}
+	}
+}

+ 45 - 45
L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/ReplyCharacters.java

@@ -1,45 +1,45 @@
-/*
- * 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.loginserver.network.gameserverpackets;
-
-import com.l2jserver.loginserver.GameServerThread;
-import com.l2jserver.loginserver.LoginController;
-import com.l2jserver.util.network.BaseRecievePacket;
-
-/**
- * @author mrTJO
- * Thanks to mochitto
- */
-public class ReplyCharacters extends BaseRecievePacket
-{
-	/**
-	 * @param decrypt
-	 * @param server 
-	 */
-	public ReplyCharacters(byte[] decrypt, GameServerThread server)
-	{
-		super(decrypt);
-		String account = readS();
-		int chars = readC();
-		int charsToDel = readC();
-		long[] charsList = new long[charsToDel];
-		for (int i = 0; i < charsToDel; i++)
-		{
-			charsList[i] = readQ();
-		}
-		LoginController.getInstance().setCharactersOnServer(account,
-				chars, charsList, server.getServerId());
-	}
-}
+/*
+ * 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.loginserver.network.gameserverpackets;
+
+import com.l2jserver.loginserver.GameServerThread;
+import com.l2jserver.loginserver.LoginController;
+import com.l2jserver.util.network.BaseRecievePacket;
+
+/**
+ * @author mrTJO
+ * Thanks to mochitto
+ */
+public class ReplyCharacters extends BaseRecievePacket
+{
+	/**
+	 * @param decrypt
+	 * @param server 
+	 */
+	public ReplyCharacters(byte[] decrypt, GameServerThread server)
+	{
+		super(decrypt);
+		String account = readS();
+		int chars = readC();
+		int charsToDel = readC();
+		long[] charsList = new long[charsToDel];
+		for (int i = 0; i < charsToDel; i++)
+		{
+			charsList[i] = readQ();
+		}
+		LoginController.getInstance().setCharactersOnServer(account,
+				chars, charsList, server.getServerId());
+	}
+}

+ 46 - 46
L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/RequestSendMail.java

@@ -1,46 +1,46 @@
-/*
- * 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.loginserver.network.gameserverpackets;
-
-import com.l2jserver.loginserver.mail.MailSystem;
-import com.l2jserver.util.network.BaseRecievePacket;
-
-/**
- * 
- * @author mrTJO
- */
-public class RequestSendMail extends BaseRecievePacket
-{
-	String _accountName, _mailId;
-	String[] _args;
-	
-	/**
-	 * @param decrypt
-	 */
-	public RequestSendMail(byte[] decrypt)
-	{
-		super(decrypt);
-		_accountName = readS();
-		_mailId = readS();
-		int argNum = readC();
-		_args = new String[argNum];
-		for (int i = 0; i < argNum; i++)
-		{
-			_args[i] = readS();
-		}
-		
-		MailSystem.getInstance().sendMail(_accountName, _mailId, _args);
-	}
-}
+/*
+ * 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.loginserver.network.gameserverpackets;
+
+import com.l2jserver.loginserver.mail.MailSystem;
+import com.l2jserver.util.network.BaseRecievePacket;
+
+/**
+ * 
+ * @author mrTJO
+ */
+public class RequestSendMail extends BaseRecievePacket
+{
+	String _accountName, _mailId;
+	String[] _args;
+	
+	/**
+	 * @param decrypt
+	 */
+	public RequestSendMail(byte[] decrypt)
+	{
+		super(decrypt);
+		_accountName = readS();
+		_mailId = readS();
+		int argNum = readC();
+		_args = new String[argNum];
+		for (int i = 0; i < argNum; i++)
+		{
+			_args[i] = readS();
+		}
+		
+		MailSystem.getInstance().sendMail(_accountName, _mailId, _args);
+	}
+}

+ 89 - 89
L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/RequestTempBan.java

@@ -1,89 +1,89 @@
-/*
- * 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.loginserver.network.gameserverpackets;
-
-import java.net.UnknownHostException;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.util.logging.Logger;
-
-import com.l2jserver.L2DatabaseFactory;
-import com.l2jserver.loginserver.LoginController;
-import com.l2jserver.util.network.BaseRecievePacket;
-
-/**
- * @author mrTJO
- */
-public class RequestTempBan extends BaseRecievePacket
-{
-	private static final Logger _log = Logger.getLogger(RequestTempBan.class.getName());
-	
-	private final String _accountName;
-	@SuppressWarnings("unused")
-	private String _banReason;
-	private String _ip;
-	long _banTime;
-	
-	/**
-	 * @param decrypt
-	 */
-	public RequestTempBan(byte[] decrypt)
-	{
-		super(decrypt);
-		_accountName = readS();
-		_ip = readS();
-		_banTime = readQ();
-		boolean haveReason = readC() == 0 ? false : true;
-		if (haveReason)
-		{
-			_banReason = readS();
-		}
-		banUser();
-	}
-	
-	private void banUser()
-	{
-		Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("INSERT INTO account_data VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE value=?");
-			statement.setString(1, _accountName);
-			statement.setString(2, "ban_temp");
-			statement.setString(3, Long.toString(_banTime));
-			statement.setString(4, Long.toString(_banTime));
-			statement.execute();
-			statement.close();
-		}
-		catch (SQLException e)
-		{
-			_log.warning(getClass().getSimpleName() + ": " + e.getMessage());
-		}
-		finally
-		{
-			L2DatabaseFactory.close(con);
-		}
-		
-		try
-		{
-			LoginController.getInstance().addBanForAddress(_ip, _banTime);
-		}
-		catch (UnknownHostException e)
-		{
-			
-		}
-	}
-}
+/*
+ * 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.loginserver.network.gameserverpackets;
+
+import java.net.UnknownHostException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.util.logging.Logger;
+
+import com.l2jserver.L2DatabaseFactory;
+import com.l2jserver.loginserver.LoginController;
+import com.l2jserver.util.network.BaseRecievePacket;
+
+/**
+ * @author mrTJO
+ */
+public class RequestTempBan extends BaseRecievePacket
+{
+	private static final Logger _log = Logger.getLogger(RequestTempBan.class.getName());
+	
+	private final String _accountName;
+	@SuppressWarnings("unused")
+	private String _banReason;
+	private String _ip;
+	long _banTime;
+	
+	/**
+	 * @param decrypt
+	 */
+	public RequestTempBan(byte[] decrypt)
+	{
+		super(decrypt);
+		_accountName = readS();
+		_ip = readS();
+		_banTime = readQ();
+		boolean haveReason = readC() == 0 ? false : true;
+		if (haveReason)
+		{
+			_banReason = readS();
+		}
+		banUser();
+	}
+	
+	private void banUser()
+	{
+		Connection con = null;
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement("INSERT INTO account_data VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE value=?");
+			statement.setString(1, _accountName);
+			statement.setString(2, "ban_temp");
+			statement.setString(3, Long.toString(_banTime));
+			statement.setString(4, Long.toString(_banTime));
+			statement.execute();
+			statement.close();
+		}
+		catch (SQLException e)
+		{
+			_log.warning(getClass().getSimpleName() + ": " + e.getMessage());
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+		
+		try
+		{
+			LoginController.getInstance().addBanForAddress(_ip, _banTime);
+		}
+		catch (UnknownHostException e)
+		{
+			
+		}
+	}
+}

+ 104 - 104
L2J_Server_BETA/java/com/l2jserver/loginserver/network/gameserverpackets/ServerStatus.java

@@ -1,104 +1,104 @@
-/*
- * 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.loginserver.network.gameserverpackets;
-
-import java.util.logging.Logger;
-
-import com.l2jserver.loginserver.GameServerTable;
-import com.l2jserver.loginserver.GameServerTable.GameServerInfo;
-import com.l2jserver.loginserver.GameServerThread;
-import com.l2jserver.util.network.BaseRecievePacket;
-
-
-/**
- * @author -Wooden-
- *
- */
-public class ServerStatus extends BaseRecievePacket
-{
-	protected static Logger _log = Logger.getLogger(ServerStatus.class.getName());
-	
-	public static final String [] STATUS_STRING = {"Auto", "Good", "Normal", "Full", "Down", "Gm Only"};
-	
-	public static final int SERVER_LIST_STATUS = 0x01;
-	public static final int SERVER_TYPE = 0x02;
-	public static final int SERVER_LIST_SQUARE_BRACKET = 0x03;
-	public static final int MAX_PLAYERS = 0x04;
-	public static final int TEST_SERVER = 0x05;
-	public static final int SERVER_AGE = 0x06;
-	
-	// Server Status
-	public static final int STATUS_AUTO = 0x00;
-	public static final int STATUS_GOOD = 0x01;
-	public static final int STATUS_NORMAL = 0x02;
-	public static final int STATUS_FULL = 0x03;
-	public static final int STATUS_DOWN = 0x04;
-	public static final int STATUS_GM_ONLY = 0x05;
-	
-	// Server Types
-	public static final int SERVER_NORMAL = 0x01;
-	public static final int SERVER_RELAX = 0x02;
-	public static final int SERVER_TEST = 0x04;
-	public static final int SERVER_NOLABEL = 0x08;
-	public static final int SERVER_CREATION_RESTRICTED = 0x10;
-	public static final int SERVER_EVENT = 0x20;
-	public static final int SERVER_FREE = 0x40;
-	
-	// Server Ages
-	public static final int SERVER_AGE_ALL = 0x00;
-	public static final int SERVER_AGE_15 = 0x0F;
-	public static final int SERVER_AGE_18 = 0x12;
-	
-	public static final int ON = 0x01;
-	public static final int OFF = 0x00;
-	
-	/**
-	 * @param decrypt
-	 * @param server 
-	 */
-	public ServerStatus(byte[] decrypt, GameServerThread server)
-	{
-		super(decrypt);
-		
-		GameServerInfo gsi = GameServerTable.getInstance().getRegisteredGameServerById(server.getServerId());
-		if (gsi != null)
-		{
-			int size = readD();
-			for (int i = 0; i < size; i++)
-			{
-				int type = readD();
-				int value = readD();
-				switch (type)
-				{
-					case SERVER_LIST_STATUS:
-						gsi.setStatus(value);
-						break;
-					case SERVER_LIST_SQUARE_BRACKET:
-						gsi.setShowingBrackets(value == ON);
-						break;
-					case MAX_PLAYERS:
-						gsi.setMaxPlayers(value);
-						break;
-					case SERVER_TYPE:
-						gsi.setServerType(value);
-						break;
-					case SERVER_AGE:
-						gsi.setAgeLimit(value);
-						break;
-				}
-			}
-		}
-	}
-}
+/*
+ * 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.loginserver.network.gameserverpackets;
+
+import java.util.logging.Logger;
+
+import com.l2jserver.loginserver.GameServerTable;
+import com.l2jserver.loginserver.GameServerTable.GameServerInfo;
+import com.l2jserver.loginserver.GameServerThread;
+import com.l2jserver.util.network.BaseRecievePacket;
+
+
+/**
+ * @author -Wooden-
+ *
+ */
+public class ServerStatus extends BaseRecievePacket
+{
+	protected static Logger _log = Logger.getLogger(ServerStatus.class.getName());
+	
+	public static final String [] STATUS_STRING = {"Auto", "Good", "Normal", "Full", "Down", "Gm Only"};
+	
+	public static final int SERVER_LIST_STATUS = 0x01;
+	public static final int SERVER_TYPE = 0x02;
+	public static final int SERVER_LIST_SQUARE_BRACKET = 0x03;
+	public static final int MAX_PLAYERS = 0x04;
+	public static final int TEST_SERVER = 0x05;
+	public static final int SERVER_AGE = 0x06;
+	
+	// Server Status
+	public static final int STATUS_AUTO = 0x00;
+	public static final int STATUS_GOOD = 0x01;
+	public static final int STATUS_NORMAL = 0x02;
+	public static final int STATUS_FULL = 0x03;
+	public static final int STATUS_DOWN = 0x04;
+	public static final int STATUS_GM_ONLY = 0x05;
+	
+	// Server Types
+	public static final int SERVER_NORMAL = 0x01;
+	public static final int SERVER_RELAX = 0x02;
+	public static final int SERVER_TEST = 0x04;
+	public static final int SERVER_NOLABEL = 0x08;
+	public static final int SERVER_CREATION_RESTRICTED = 0x10;
+	public static final int SERVER_EVENT = 0x20;
+	public static final int SERVER_FREE = 0x40;
+	
+	// Server Ages
+	public static final int SERVER_AGE_ALL = 0x00;
+	public static final int SERVER_AGE_15 = 0x0F;
+	public static final int SERVER_AGE_18 = 0x12;
+	
+	public static final int ON = 0x01;
+	public static final int OFF = 0x00;
+	
+	/**
+	 * @param decrypt
+	 * @param server 
+	 */
+	public ServerStatus(byte[] decrypt, GameServerThread server)
+	{
+		super(decrypt);
+		
+		GameServerInfo gsi = GameServerTable.getInstance().getRegisteredGameServerById(server.getServerId());
+		if (gsi != null)
+		{
+			int size = readD();
+			for (int i = 0; i < size; i++)
+			{
+				int type = readD();
+				int value = readD();
+				switch (type)
+				{
+					case SERVER_LIST_STATUS:
+						gsi.setStatus(value);
+						break;
+					case SERVER_LIST_SQUARE_BRACKET:
+						gsi.setShowingBrackets(value == ON);
+						break;
+					case MAX_PLAYERS:
+						gsi.setMaxPlayers(value);
+						break;
+					case SERVER_TYPE:
+						gsi.setServerType(value);
+						break;
+					case SERVER_AGE:
+						gsi.setAgeLimit(value);
+						break;
+				}
+			}
+		}
+	}
+}

+ 40 - 40
L2J_Server_BETA/java/com/l2jserver/loginserver/network/loginserverpackets/AuthResponse.java

@@ -1,40 +1,40 @@
-/*
- * 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.loginserver.network.loginserverpackets;
-
-import com.l2jserver.loginserver.GameServerTable;
-import com.l2jserver.util.network.BaseSendablePacket;
-
-/**
- * @author -Wooden-
- */
-public class AuthResponse extends BaseSendablePacket
-{
-	/**
-	 * @param serverId
-	 */
-	public AuthResponse(int serverId)
-	{
-		writeC(0x02);
-		writeC(serverId);
-		writeS(GameServerTable.getInstance().getServerNameById(serverId));
-	}
-	
-	@Override
-	public byte[] getContent()
-	{
-		return getBytes();
-	}
-}
+/*
+ * 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.loginserver.network.loginserverpackets;
+
+import com.l2jserver.loginserver.GameServerTable;
+import com.l2jserver.util.network.BaseSendablePacket;
+
+/**
+ * @author -Wooden-
+ */
+public class AuthResponse extends BaseSendablePacket
+{
+	/**
+	 * @param serverId
+	 */
+	public AuthResponse(int serverId)
+	{
+		writeC(0x02);
+		writeC(serverId);
+		writeS(GameServerTable.getInstance().getServerNameById(serverId));
+	}
+	
+	@Override
+	public byte[] getContent()
+	{
+		return getBytes();
+	}
+}

+ 45 - 45
L2J_Server_BETA/java/com/l2jserver/loginserver/network/loginserverpackets/InitLS.java

@@ -1,45 +1,45 @@
-/*
- * 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.loginserver.network.loginserverpackets;
-
-import com.l2jserver.loginserver.L2LoginServer;
-import com.l2jserver.util.network.BaseSendablePacket;
-
-/**
- * @author -Wooden-
- *
- */
-public class InitLS extends BaseSendablePacket
-{
-	// ID 0x00
-	// format
-	// d proto rev
-	// d key size
-	// b key
-	
-	public InitLS(byte[] publickey)
-	{
-		writeC(0x00);
-		writeD(L2LoginServer.PROTOCOL_REV);
-		writeD(publickey.length);
-		writeB(publickey);
-	}
-	
-	@Override
-	public byte[] getContent()
-	{
-		return getBytes();
-	}
-}
+/*
+ * 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.loginserver.network.loginserverpackets;
+
+import com.l2jserver.loginserver.L2LoginServer;
+import com.l2jserver.util.network.BaseSendablePacket;
+
+/**
+ * @author -Wooden-
+ *
+ */
+public class InitLS extends BaseSendablePacket
+{
+	// ID 0x00
+	// format
+	// d proto rev
+	// d key size
+	// b key
+	
+	public InitLS(byte[] publickey)
+	{
+		writeC(0x00);
+		writeD(L2LoginServer.PROTOCOL_REV);
+		writeD(publickey.length);
+		writeB(publickey);
+	}
+	
+	@Override
+	public byte[] getContent()
+	{
+		return getBytes();
+	}
+}

+ 35 - 35
L2J_Server_BETA/java/com/l2jserver/loginserver/network/loginserverpackets/KickPlayer.java

@@ -1,35 +1,35 @@
-/*
- * 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.loginserver.network.loginserverpackets;
-
-import com.l2jserver.util.network.BaseSendablePacket;
-
-/**
- * @author -Wooden-
- */
-public class KickPlayer extends BaseSendablePacket
-{
-	public KickPlayer(String account)
-	{
-		writeC(0x04);
-		writeS(account);
-	}
-	
-	@Override
-	public byte[] getContent()
-	{
-		return getBytes();
-	}
-}
+/*
+ * 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.loginserver.network.loginserverpackets;
+
+import com.l2jserver.util.network.BaseSendablePacket;
+
+/**
+ * @author -Wooden-
+ */
+public class KickPlayer extends BaseSendablePacket
+{
+	public KickPlayer(String account)
+	{
+		writeC(0x04);
+		writeS(account);
+	}
+	
+	@Override
+	public byte[] getContent()
+	{
+		return getBytes();
+	}
+}

+ 49 - 49
L2J_Server_BETA/java/com/l2jserver/loginserver/network/loginserverpackets/LoginServerFail.java

@@ -1,49 +1,49 @@
-/*
- * 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.loginserver.network.loginserverpackets;
-
-import com.l2jserver.util.network.BaseSendablePacket;
-
-/**
- * @author -Wooden-
- *
- */
-public class LoginServerFail extends BaseSendablePacket
-{
-	
-	/**
-	 * @param reason
-	 */
-	public LoginServerFail(int reason)
-	{
-		writeC(0x01);
-		writeC(reason);
-	}
-	
-	@Override
-	public byte[] getContent()
-	{
-		return getBytes();
-	}
-	
-	public static final int REASON_IP_BANNED = 1;
-	public static final int REASON_IP_RESERVED = 2;
-	public static final int REASON_WRONG_HEXID = 3;
-	public static final int REASON_ID_RESERVED = 4;
-	public static final int REASON_NO_FREE_ID = 5;
-	public static final int NOT_AUTHED = 6;
-	public static final int REASON_ALREADY_LOGGED8IN = 7;
-	
-}
+/*
+ * 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.loginserver.network.loginserverpackets;
+
+import com.l2jserver.util.network.BaseSendablePacket;
+
+/**
+ * @author -Wooden-
+ *
+ */
+public class LoginServerFail extends BaseSendablePacket
+{
+	
+	/**
+	 * @param reason
+	 */
+	public LoginServerFail(int reason)
+	{
+		writeC(0x01);
+		writeC(reason);
+	}
+	
+	@Override
+	public byte[] getContent()
+	{
+		return getBytes();
+	}
+	
+	public static final int REASON_IP_BANNED = 1;
+	public static final int REASON_IP_RESERVED = 2;
+	public static final int REASON_WRONG_HEXID = 3;
+	public static final int REASON_ID_RESERVED = 4;
+	public static final int REASON_NO_FREE_ID = 5;
+	public static final int NOT_AUTHED = 6;
+	public static final int REASON_ALREADY_LOGGED8IN = 7;
+	
+}

+ 36 - 36
L2J_Server_BETA/java/com/l2jserver/loginserver/network/loginserverpackets/PlayerAuthResponse.java

@@ -1,36 +1,36 @@
-/*
- * 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.loginserver.network.loginserverpackets;
-
-import com.l2jserver.util.network.BaseSendablePacket;
-
-/**
- * @author -Wooden-
- */
-public class PlayerAuthResponse extends BaseSendablePacket
-{
-	public PlayerAuthResponse(String account, boolean response)
-	{
-		writeC(0x03);
-		writeS(account);
-		writeC(response ? 1 : 0);
-	}
-	
-	@Override
-	public byte[] getContent()
-	{
-		return getBytes();
-	}
-}
+/*
+ * 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.loginserver.network.loginserverpackets;
+
+import com.l2jserver.util.network.BaseSendablePacket;
+
+/**
+ * @author -Wooden-
+ */
+public class PlayerAuthResponse extends BaseSendablePacket
+{
+	public PlayerAuthResponse(String account, boolean response)
+	{
+		writeC(0x03);
+		writeS(account);
+		writeC(response ? 1 : 0);
+	}
+	
+	@Override
+	public byte[] getContent()
+	{
+		return getBytes();
+	}
+}

+ 36 - 36
L2J_Server_BETA/java/com/l2jserver/loginserver/network/loginserverpackets/RequestCharacters.java

@@ -1,36 +1,36 @@
-/*
- * 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.loginserver.network.loginserverpackets;
-
-import com.l2jserver.util.network.BaseSendablePacket;
-
-/**
- * @author mrTJO
- * Thanks to mochitto
- */
-public class RequestCharacters extends BaseSendablePacket
-{
-	public RequestCharacters(String account)
-	{
-		writeC(0x05);
-		writeS(account);
-	}
-	
-	@Override
-	public byte[] getContent()
-	{
-		return getBytes();
-	}
-}
+/*
+ * 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.loginserver.network.loginserverpackets;
+
+import com.l2jserver.util.network.BaseSendablePacket;
+
+/**
+ * @author mrTJO
+ * Thanks to mochitto
+ */
+public class RequestCharacters extends BaseSendablePacket
+{
+	public RequestCharacters(String account)
+	{
+		writeC(0x05);
+		writeS(account);
+	}
+	
+	@Override
+	public byte[] getContent()
+	{
+		return getBytes();
+	}
+}

+ 63 - 63
L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/AccountKicked.java

@@ -1,63 +1,63 @@
-/*
- * 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.loginserver.network.serverpackets;
-
-/**
- *
- * @author  KenM
- */
-public final class AccountKicked extends L2LoginServerPacket
-{
-	public static enum AccountKickedReason
-	{
-		REASON_DATA_STEALER			(0x01),
-		REASON_GENERIC_VIOLATION	(0x08),
-		REASON_7_DAYS_SUSPENDED		(0x10),
-		REASON_PERMANENTLY_BANNED	(0x20);
-		
-		private final int _code;
-		
-		AccountKickedReason(int code)
-		{
-			_code = code;
-		}
-		
-		public final int getCode()
-		{
-			return _code;
-		}
-	}
-	
-	private AccountKickedReason _reason;
-	
-	/**
-	 * @param reason
-	 */
-	public AccountKicked(AccountKickedReason reason)
-	{
-		_reason = reason;
-	}
-	
-	/**
-	 * @see org.mmocore.network.SendablePacket#write()
-	 */
-	@Override
-	protected void write()
-	{
-		writeC(0x02);
-		writeD(_reason.getCode());
-	}
-	
-}
+/*
+ * 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.loginserver.network.serverpackets;
+
+/**
+ *
+ * @author  KenM
+ */
+public final class AccountKicked extends L2LoginServerPacket
+{
+	public static enum AccountKickedReason
+	{
+		REASON_DATA_STEALER			(0x01),
+		REASON_GENERIC_VIOLATION	(0x08),
+		REASON_7_DAYS_SUSPENDED		(0x10),
+		REASON_PERMANENTLY_BANNED	(0x20);
+		
+		private final int _code;
+		
+		AccountKickedReason(int code)
+		{
+			_code = code;
+		}
+		
+		public final int getCode()
+		{
+			return _code;
+		}
+	}
+	
+	private AccountKickedReason _reason;
+	
+	/**
+	 * @param reason
+	 */
+	public AccountKicked(AccountKickedReason reason)
+	{
+		_reason = reason;
+	}
+	
+	/**
+	 * @see org.mmocore.network.SendablePacket#write()
+	 */
+	@Override
+	protected void write()
+	{
+		writeC(0x02);
+		writeD(_reason.getCode());
+	}
+	
+}

+ 56 - 56
L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/GGAuth.java

@@ -1,56 +1,56 @@
-/*
- * 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.loginserver.network.serverpackets;
-
-import java.util.logging.Logger;
-
-import com.l2jserver.Config;
-
-
-/**
- * Fromat: d
- * d: response
- */
-public final class GGAuth extends L2LoginServerPacket
-{
-	static final Logger _log = Logger.getLogger(GGAuth.class.getName());
-	public static final int SKIP_GG_AUTH_REQUEST = 0x0b;
-	
-	private int _response;
-	
-	public GGAuth(int response)
-	{
-		_response = response;
-		if (Config.DEBUG)
-		{
-			_log.warning("Reason Hex: "+(Integer.toHexString(response)));
-		}
-	}
-	
-	/**
-	 * @see org.mmocore.network.SendablePacket#write()
-	 */
-	@Override
-	protected void write()
-	{
-		writeC(0x0b);
-		writeD(_response);
-		writeD(0x00);
-		writeD(0x00);
-		writeD(0x00);
-		writeD(0x00);
-	}
-}
-
+/*
+ * 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.loginserver.network.serverpackets;
+
+import java.util.logging.Logger;
+
+import com.l2jserver.Config;
+
+
+/**
+ * Fromat: d
+ * d: response
+ */
+public final class GGAuth extends L2LoginServerPacket
+{
+	static final Logger _log = Logger.getLogger(GGAuth.class.getName());
+	public static final int SKIP_GG_AUTH_REQUEST = 0x0b;
+	
+	private int _response;
+	
+	public GGAuth(int response)
+	{
+		_response = response;
+		if (Config.DEBUG)
+		{
+			_log.warning("Reason Hex: "+(Integer.toHexString(response)));
+		}
+	}
+	
+	/**
+	 * @see org.mmocore.network.SendablePacket#write()
+	 */
+	@Override
+	protected void write()
+	{
+		writeC(0x0b);
+		writeD(_response);
+		writeD(0x00);
+		writeD(0x00);
+		writeD(0x00);
+		writeD(0x00);
+	}
+}
+

+ 73 - 73
L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/Init.java

@@ -1,73 +1,73 @@
-/*
- * 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.loginserver.network.serverpackets;
-
-import com.l2jserver.loginserver.network.L2LoginClient;
-
-/**
- * Format: dd b dddd s
- * d: session id
- * d: protocol revision
- * b: 0x90 bytes : 0x80 bytes for the scrambled RSA public key
- *                 0x10 bytes at 0x00
- * d: unknow
- * d: unknow
- * d: unknow
- * d: unknow
- * s: blowfish key
- *
- */
-public final class Init extends L2LoginServerPacket
-{
-	private int _sessionId;
-	
-	private byte[] _publicKey;
-	private byte[] _blowfishKey;
-	
-	public Init(L2LoginClient client)
-	{
-		this(client.getScrambledModulus(), client.getBlowfishKey(), client.getSessionId());
-	}
-	
-	public Init(byte[] publickey, byte[] blowfishkey, int sessionId)
-	{
-		_sessionId = sessionId;
-		_publicKey = publickey;
-		_blowfishKey = blowfishkey;
-	}
-	
-	/**
-	 * @see org.mmocore.network.SendablePacket#write()
-	 */
-	@Override
-	protected void write()
-	{
-		writeC(0x00); // init packet id
-		
-		writeD(_sessionId); // session id
-		writeD(0x0000c621); // protocol revision
-		
-		writeB(_publicKey); // RSA Public Key
-		
-		// unk GG related?
-		writeD(0x29DD954E);
-		writeD(0x77C39CFC);
-		writeD(0x97ADB620);
-		writeD(0x07BDE0F7);
-		
-		writeB(_blowfishKey); // BlowFish key
-		writeC(0x00); // null termination ;)
-	}
-}
+/*
+ * 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.loginserver.network.serverpackets;
+
+import com.l2jserver.loginserver.network.L2LoginClient;
+
+/**
+ * Format: dd b dddd s
+ * d: session id
+ * d: protocol revision
+ * b: 0x90 bytes : 0x80 bytes for the scrambled RSA public key
+ *                 0x10 bytes at 0x00
+ * d: unknow
+ * d: unknow
+ * d: unknow
+ * d: unknow
+ * s: blowfish key
+ *
+ */
+public final class Init extends L2LoginServerPacket
+{
+	private int _sessionId;
+	
+	private byte[] _publicKey;
+	private byte[] _blowfishKey;
+	
+	public Init(L2LoginClient client)
+	{
+		this(client.getScrambledModulus(), client.getBlowfishKey(), client.getSessionId());
+	}
+	
+	public Init(byte[] publickey, byte[] blowfishkey, int sessionId)
+	{
+		_sessionId = sessionId;
+		_publicKey = publickey;
+		_blowfishKey = blowfishkey;
+	}
+	
+	/**
+	 * @see org.mmocore.network.SendablePacket#write()
+	 */
+	@Override
+	protected void write()
+	{
+		writeC(0x00); // init packet id
+		
+		writeD(_sessionId); // session id
+		writeD(0x0000c621); // protocol revision
+		
+		writeB(_publicKey); // RSA Public Key
+		
+		// unk GG related?
+		writeD(0x29DD954E);
+		writeD(0x77C39CFC);
+		writeD(0x97ADB620);
+		writeD(0x07BDE0F7);
+		
+		writeB(_blowfishKey); // BlowFish key
+		writeC(0x00); // null termination ;)
+	}
+}

+ 29 - 29
L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/L2LoginServerPacket.java

@@ -1,29 +1,29 @@
-/*
- * 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.loginserver.network.serverpackets;
-
-
-import org.mmocore.network.SendablePacket;
-
-import com.l2jserver.loginserver.network.L2LoginClient;
-
-/**
- *
- * @author  KenM
- */
-public abstract class L2LoginServerPacket extends SendablePacket<L2LoginClient>
-{
-	
-}
+/*
+ * 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.loginserver.network.serverpackets;
+
+
+import org.mmocore.network.SendablePacket;
+
+import com.l2jserver.loginserver.network.L2LoginClient;
+
+/**
+ *
+ * @author  KenM
+ */
+public abstract class L2LoginServerPacket extends SendablePacket<L2LoginClient>
+{
+	
+}

+ 95 - 95
L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/LoginFail.java

@@ -1,95 +1,95 @@
-/*
- * 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.loginserver.network.serverpackets;
-
-/**
- * Fromat: d
- * d: the failure reason
- */
-public final class LoginFail extends L2LoginServerPacket
-{
-	public static enum LoginFailReason
-	{
-		REASON_NO_MESSAGE											(0x00),
-		REASON_SYSTEM_ERROR_LOGIN_LATER								(0x01),
-		REASON_USER_OR_PASS_WRONG									(0x02),
-		REASON_ACCESS_FAILED_TRY_AGAIN_LATER						(0x04),
-		REASON_ACCOUNT_INFO_INCORRECT_CONTACT_SUPPORT				(0x05),
-		REASON_ACCOUNT_IN_USE										(0x07),
-		REASON_UNDER_18_YEARS_KR									(0x0C),
-		REASON_SERVER_OVERLOADED									(0x0F),
-		REASON_SERVER_MAINTENANCE									(0x10),
-		REASON_TEMP_PASS_EXPIRED									(0x11),
-		REASON_GAME_TIME_EXPIRED									(0x12),
-		REASON_NO_TIME_LEFT											(0x13),
-		REASON_SYSTEM_ERROR											(0x14),
-		REASON_ACCESS_FAILED										(0x15),
-		REASON_RESTRICTED_IP										(0x16),
-		REASON_WEEK_USAGE_FINISHED									(0x1E),
-		REASON_SECURITY_CARD_NUMBER_INVALID							(0x1F),
-		REASON_AGE_NOT_VERIFIED_CANT_LOG_BEETWEEN_10PM_6AM			(0x20),
-		REASON_SERVER_CANNOT_BE_ACCESSED_BY_YOUR_COUPON				(0x21),
-		REASON_DUAL_BOX												(0x23),
-		REASON_INACTIVE												(0x24),
-		REASON_USER_AGREEMENT_REJECTED_ON_WEBSITE					(0x25),
-		REASON_GUARDIAN_CONSENT_REQUIRED							(0x26),
-		REASON_USER_AGREEMENT_DECLINED_OR_WITHDRAWL_REQUEST			(0x27),
-		REASON_ACCOUNT_SUSPENDED_CALL								(0x28),
-		REASON_CHANGE_PASSWORD_AND_QUIZ_ON_WEBSITE					(0x29),
-		REASON_ALREADY_LOGGED_INTO_10_ACCOUNTS						(0x2A),
-		REASON_MASTER_ACCOUNT_RESTRICTED							(0x2B),
-		REASON_CERTIFICATION_FAILED									(0x2E),
-		REASON_TELEPHONE_CERTIFICATION_UNAVAILABLE					(0x2F),
-		REASON_TELEPHONE_SIGNALS_DELAYED							(0x30),
-		REASON_CERTIFICATION_FAILED_LINE_BUSY						(0x31),
-		REASON_CERTIFICATION_SERVICE_NUMBER_EXPIRED_OR_INCORRECT	(0x32),
-		REASON_CERTIFICATION_SERVICE_CURRENTLY_BEING_CHECKED		(0x33),
-		REASON_CERTIFICATION_SERVICE_CANT_BE_USED_HEAVY_VOLUME		(0x34),
-		REASON_CERTIFICATION_SERVICE_EXPIRED_GAMEPLAY_BLOCKED		(0x35),
-		REASON_CERTIFICATION_FAILED_3_TIMES_GAMEPLAY_BLOCKED_30_MIN	(0x36),
-		REASON_CERTIFICATION_DAILY_USE_EXCEEDED						(0x37),
-		REASON_CERTIFICATION_UNDERWAY_TRY_AGAIN_LATER				(0x38);
-		
-		private final int _code;
-		
-		LoginFailReason(int code)
-		{
-			_code = code;
-		}
-		
-		public final int getCode()
-		{
-			return _code;
-		}
-	}
-	
-	private LoginFailReason _reason;
-	
-	
-	public LoginFail(LoginFailReason reason)
-	{
-		_reason = reason;
-	}
-	
-	/**
-	 * @see org.mmocore.network.SendablePacket#write()
-	 */
-	@Override
-	protected void write()
-	{
-		writeC(0x01);
-		writeC(_reason.getCode());
-	}
-}
+/*
+ * 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.loginserver.network.serverpackets;
+
+/**
+ * Fromat: d
+ * d: the failure reason
+ */
+public final class LoginFail extends L2LoginServerPacket
+{
+	public static enum LoginFailReason
+	{
+		REASON_NO_MESSAGE											(0x00),
+		REASON_SYSTEM_ERROR_LOGIN_LATER								(0x01),
+		REASON_USER_OR_PASS_WRONG									(0x02),
+		REASON_ACCESS_FAILED_TRY_AGAIN_LATER						(0x04),
+		REASON_ACCOUNT_INFO_INCORRECT_CONTACT_SUPPORT				(0x05),
+		REASON_ACCOUNT_IN_USE										(0x07),
+		REASON_UNDER_18_YEARS_KR									(0x0C),
+		REASON_SERVER_OVERLOADED									(0x0F),
+		REASON_SERVER_MAINTENANCE									(0x10),
+		REASON_TEMP_PASS_EXPIRED									(0x11),
+		REASON_GAME_TIME_EXPIRED									(0x12),
+		REASON_NO_TIME_LEFT											(0x13),
+		REASON_SYSTEM_ERROR											(0x14),
+		REASON_ACCESS_FAILED										(0x15),
+		REASON_RESTRICTED_IP										(0x16),
+		REASON_WEEK_USAGE_FINISHED									(0x1E),
+		REASON_SECURITY_CARD_NUMBER_INVALID							(0x1F),
+		REASON_AGE_NOT_VERIFIED_CANT_LOG_BEETWEEN_10PM_6AM			(0x20),
+		REASON_SERVER_CANNOT_BE_ACCESSED_BY_YOUR_COUPON				(0x21),
+		REASON_DUAL_BOX												(0x23),
+		REASON_INACTIVE												(0x24),
+		REASON_USER_AGREEMENT_REJECTED_ON_WEBSITE					(0x25),
+		REASON_GUARDIAN_CONSENT_REQUIRED							(0x26),
+		REASON_USER_AGREEMENT_DECLINED_OR_WITHDRAWL_REQUEST			(0x27),
+		REASON_ACCOUNT_SUSPENDED_CALL								(0x28),
+		REASON_CHANGE_PASSWORD_AND_QUIZ_ON_WEBSITE					(0x29),
+		REASON_ALREADY_LOGGED_INTO_10_ACCOUNTS						(0x2A),
+		REASON_MASTER_ACCOUNT_RESTRICTED							(0x2B),
+		REASON_CERTIFICATION_FAILED									(0x2E),
+		REASON_TELEPHONE_CERTIFICATION_UNAVAILABLE					(0x2F),
+		REASON_TELEPHONE_SIGNALS_DELAYED							(0x30),
+		REASON_CERTIFICATION_FAILED_LINE_BUSY						(0x31),
+		REASON_CERTIFICATION_SERVICE_NUMBER_EXPIRED_OR_INCORRECT	(0x32),
+		REASON_CERTIFICATION_SERVICE_CURRENTLY_BEING_CHECKED		(0x33),
+		REASON_CERTIFICATION_SERVICE_CANT_BE_USED_HEAVY_VOLUME		(0x34),
+		REASON_CERTIFICATION_SERVICE_EXPIRED_GAMEPLAY_BLOCKED		(0x35),
+		REASON_CERTIFICATION_FAILED_3_TIMES_GAMEPLAY_BLOCKED_30_MIN	(0x36),
+		REASON_CERTIFICATION_DAILY_USE_EXCEEDED						(0x37),
+		REASON_CERTIFICATION_UNDERWAY_TRY_AGAIN_LATER				(0x38);
+		
+		private final int _code;
+		
+		LoginFailReason(int code)
+		{
+			_code = code;
+		}
+		
+		public final int getCode()
+		{
+			return _code;
+		}
+	}
+	
+	private LoginFailReason _reason;
+	
+	
+	public LoginFail(LoginFailReason reason)
+	{
+		_reason = reason;
+	}
+	
+	/**
+	 * @see org.mmocore.network.SendablePacket#write()
+	 */
+	@Override
+	protected void write()
+	{
+		writeC(0x01);
+		writeC(_reason.getCode());
+	}
+}

+ 57 - 57
L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/LoginOk.java

@@ -1,57 +1,57 @@
-/*
- * 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.loginserver.network.serverpackets;
-
-import com.l2jserver.loginserver.SessionKey;
-
-/**
- * Format: dddddddd
- * f: the session key
- * d: ?
- * d: ?
- * d: ?
- * d: ?
- * d: ?
- * d: ?
- * b: 16 bytes - unknown
- */
-public final class LoginOk extends L2LoginServerPacket
-{
-	private int _loginOk1, _loginOk2;
-	
-	public LoginOk(SessionKey sessionKey)
-	{
-		_loginOk1 = sessionKey.loginOkID1;
-		_loginOk2 = sessionKey.loginOkID2;
-	}
-	
-	/**
-	 * @see org.mmocore.network.SendablePacket#write()
-	 */
-	@Override
-	protected void write()
-	{
-		writeC(0x03);
-		writeD(_loginOk1);
-		writeD(_loginOk2);
-		writeD(0x00);
-		writeD(0x00);
-		writeD(0x000003ea);
-		writeD(0x00);
-		writeD(0x00);
-		writeD(0x00);
-		writeB(new byte[16]);
-	}
-}
+/*
+ * 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.loginserver.network.serverpackets;
+
+import com.l2jserver.loginserver.SessionKey;
+
+/**
+ * Format: dddddddd
+ * f: the session key
+ * d: ?
+ * d: ?
+ * d: ?
+ * d: ?
+ * d: ?
+ * d: ?
+ * b: 16 bytes - unknown
+ */
+public final class LoginOk extends L2LoginServerPacket
+{
+	private int _loginOk1, _loginOk2;
+	
+	public LoginOk(SessionKey sessionKey)
+	{
+		_loginOk1 = sessionKey.loginOkID1;
+		_loginOk2 = sessionKey.loginOkID2;
+	}
+	
+	/**
+	 * @see org.mmocore.network.SendablePacket#write()
+	 */
+	@Override
+	protected void write()
+	{
+		writeC(0x03);
+		writeD(_loginOk1);
+		writeD(_loginOk2);
+		writeD(0x00);
+		writeD(0x00);
+		writeD(0x000003ea);
+		writeD(0x00);
+		writeD(0x00);
+		writeD(0x00);
+		writeB(new byte[16]);
+	}
+}

+ 96 - 96
L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/PlayFail.java

@@ -1,96 +1,96 @@
-/*
- * 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.loginserver.network.serverpackets;
-
-/**
- * This class ...
- *
- * @version $Revision: 1.2.4.1 $ $Date: 2005/03/27 15:30:11 $
- */
-public final class PlayFail extends L2LoginServerPacket
-{
-	public static enum PlayFailReason
-	{
-		REASON_NO_MESSAGE											(0x00),
-		REASON_SYSTEM_ERROR_LOGIN_LATER								(0x01),
-		REASON_USER_OR_PASS_WRONG									(0x02),
-		REASON_ACCESS_FAILED_TRY_AGAIN_LATER						(0x04),
-		REASON_ACCOUNT_INFO_INCORRECT_CONTACT_SUPPORT				(0x05),
-		REASON_ACCOUNT_IN_USE										(0x07),
-		REASON_UNDER_18_YEARS_KR									(0x0C),
-		REASON_SERVER_OVERLOADED									(0x0F),
-		REASON_SERVER_MAINTENANCE									(0x10),
-		REASON_TEMP_PASS_EXPIRED									(0x11),
-		REASON_GAME_TIME_EXPIRED									(0x12),
-		REASON_NO_TIME_LEFT											(0x13),
-		REASON_SYSTEM_ERROR											(0x14),
-		REASON_ACCESS_FAILED										(0x15),
-		REASON_RESTRICTED_IP										(0x16),
-		REASON_WEEK_USAGE_FINISHED									(0x1E),
-		REASON_SECURITY_CARD_NUMBER_INVALID							(0x1F),
-		REASON_AGE_NOT_VERIFIED_CANT_LOG_BEETWEEN_10PM_6AM			(0x20),
-		REASON_SERVER_CANNOT_BE_ACCESSED_BY_YOUR_COUPON				(0x21),
-		REASON_DUAL_BOX												(0x23),
-		REASON_INACTIVE												(0x24),
-		REASON_USER_AGREEMENT_REJECTED_ON_WEBSITE					(0x25),
-		REASON_GUARDIAN_CONSENT_REQUIRED							(0x26),
-		REASON_USER_AGREEMENT_DECLINED_OR_WITHDRAWL_REQUEST			(0x27),
-		REASON_ACCOUNT_SUSPENDED_CALL								(0x28),
-		REASON_CHANGE_PASSWORD_AND_QUIZ_ON_WEBSITE					(0x29),
-		REASON_ALREADY_LOGGED_INTO_10_ACCOUNTS						(0x2A),
-		REASON_MASTER_ACCOUNT_RESTRICTED							(0x2B),
-		REASON_CERTIFICATION_FAILED									(0x2E),
-		REASON_TELEPHONE_CERTIFICATION_UNAVAILABLE					(0x2F),
-		REASON_TELEPHONE_SIGNALS_DELAYED							(0x30),
-		REASON_CERTIFICATION_FAILED_LINE_BUSY						(0x31),
-		REASON_CERTIFICATION_SERVICE_NUMBER_EXPIRED_OR_INCORRECT	(0x32),
-		REASON_CERTIFICATION_SERVICE_CURRENTLY_BEING_CHECKED		(0x33),
-		REASON_CERTIFICATION_SERVICE_CANT_BE_USED_HEAVY_VOLUME		(0x34),
-		REASON_CERTIFICATION_SERVICE_EXPIRED_GAMEPLAY_BLOCKED		(0x35),
-		REASON_CERTIFICATION_FAILED_3_TIMES_GAMEPLAY_BLOCKED_30_MIN	(0x36),
-		REASON_CERTIFICATION_DAILY_USE_EXCEEDED						(0x37),
-		REASON_CERTIFICATION_UNDERWAY_TRY_AGAIN_LATER				(0x38);
-		
-		private final int _code;
-		
-		PlayFailReason(int code)
-		{
-			_code = code;
-		}
-		
-		public final int getCode()
-		{
-			return _code;
-		}
-	}
-	
-	private final PlayFailReason _reason;
-	
-	
-	public PlayFail(PlayFailReason reason)
-	{
-		_reason = reason;
-	}
-	
-	/**
-	 * @see org.mmocore.network.SendablePacket#write()
-	 */
-	@Override
-	protected void write()
-	{
-		writeC(0x06);
-		writeC(_reason.getCode());
-	}
-}
+/*
+ * 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.loginserver.network.serverpackets;
+
+/**
+ * This class ...
+ *
+ * @version $Revision: 1.2.4.1 $ $Date: 2005/03/27 15:30:11 $
+ */
+public final class PlayFail extends L2LoginServerPacket
+{
+	public static enum PlayFailReason
+	{
+		REASON_NO_MESSAGE											(0x00),
+		REASON_SYSTEM_ERROR_LOGIN_LATER								(0x01),
+		REASON_USER_OR_PASS_WRONG									(0x02),
+		REASON_ACCESS_FAILED_TRY_AGAIN_LATER						(0x04),
+		REASON_ACCOUNT_INFO_INCORRECT_CONTACT_SUPPORT				(0x05),
+		REASON_ACCOUNT_IN_USE										(0x07),
+		REASON_UNDER_18_YEARS_KR									(0x0C),
+		REASON_SERVER_OVERLOADED									(0x0F),
+		REASON_SERVER_MAINTENANCE									(0x10),
+		REASON_TEMP_PASS_EXPIRED									(0x11),
+		REASON_GAME_TIME_EXPIRED									(0x12),
+		REASON_NO_TIME_LEFT											(0x13),
+		REASON_SYSTEM_ERROR											(0x14),
+		REASON_ACCESS_FAILED										(0x15),
+		REASON_RESTRICTED_IP										(0x16),
+		REASON_WEEK_USAGE_FINISHED									(0x1E),
+		REASON_SECURITY_CARD_NUMBER_INVALID							(0x1F),
+		REASON_AGE_NOT_VERIFIED_CANT_LOG_BEETWEEN_10PM_6AM			(0x20),
+		REASON_SERVER_CANNOT_BE_ACCESSED_BY_YOUR_COUPON				(0x21),
+		REASON_DUAL_BOX												(0x23),
+		REASON_INACTIVE												(0x24),
+		REASON_USER_AGREEMENT_REJECTED_ON_WEBSITE					(0x25),
+		REASON_GUARDIAN_CONSENT_REQUIRED							(0x26),
+		REASON_USER_AGREEMENT_DECLINED_OR_WITHDRAWL_REQUEST			(0x27),
+		REASON_ACCOUNT_SUSPENDED_CALL								(0x28),
+		REASON_CHANGE_PASSWORD_AND_QUIZ_ON_WEBSITE					(0x29),
+		REASON_ALREADY_LOGGED_INTO_10_ACCOUNTS						(0x2A),
+		REASON_MASTER_ACCOUNT_RESTRICTED							(0x2B),
+		REASON_CERTIFICATION_FAILED									(0x2E),
+		REASON_TELEPHONE_CERTIFICATION_UNAVAILABLE					(0x2F),
+		REASON_TELEPHONE_SIGNALS_DELAYED							(0x30),
+		REASON_CERTIFICATION_FAILED_LINE_BUSY						(0x31),
+		REASON_CERTIFICATION_SERVICE_NUMBER_EXPIRED_OR_INCORRECT	(0x32),
+		REASON_CERTIFICATION_SERVICE_CURRENTLY_BEING_CHECKED		(0x33),
+		REASON_CERTIFICATION_SERVICE_CANT_BE_USED_HEAVY_VOLUME		(0x34),
+		REASON_CERTIFICATION_SERVICE_EXPIRED_GAMEPLAY_BLOCKED		(0x35),
+		REASON_CERTIFICATION_FAILED_3_TIMES_GAMEPLAY_BLOCKED_30_MIN	(0x36),
+		REASON_CERTIFICATION_DAILY_USE_EXCEEDED						(0x37),
+		REASON_CERTIFICATION_UNDERWAY_TRY_AGAIN_LATER				(0x38);
+		
+		private final int _code;
+		
+		PlayFailReason(int code)
+		{
+			_code = code;
+		}
+		
+		public final int getCode()
+		{
+			return _code;
+		}
+	}
+	
+	private final PlayFailReason _reason;
+	
+	
+	public PlayFail(PlayFailReason reason)
+	{
+		_reason = reason;
+	}
+	
+	/**
+	 * @see org.mmocore.network.SendablePacket#write()
+	 */
+	@Override
+	protected void write()
+	{
+		writeC(0x06);
+		writeC(_reason.getCode());
+	}
+}

+ 42 - 42
L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/PlayOk.java

@@ -1,42 +1,42 @@
-/*
- * 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.loginserver.network.serverpackets;
-
-import com.l2jserver.loginserver.SessionKey;
-
-/**
- *
- */
-public final class PlayOk extends L2LoginServerPacket
-{
-	private int _playOk1, _playOk2;
-	
-	public PlayOk(SessionKey sessionKey)
-	{
-		_playOk1 = sessionKey.playOkID1;
-		_playOk2 = sessionKey.playOkID2;
-	}
-	
-	/**
-	 * @see org.mmocore.network.SendablePacket#write()
-	 */
-	@Override
-	protected void write()
-	{
-		writeC(0x07);
-		writeD(_playOk1);
-		writeD(_playOk2);
-	}
-}
+/*
+ * 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.loginserver.network.serverpackets;
+
+import com.l2jserver.loginserver.SessionKey;
+
+/**
+ *
+ */
+public final class PlayOk extends L2LoginServerPacket
+{
+	private int _playOk1, _playOk2;
+	
+	public PlayOk(SessionKey sessionKey)
+	{
+		_playOk1 = sessionKey.playOkID1;
+		_playOk2 = sessionKey.playOkID2;
+	}
+	
+	/**
+	 * @see org.mmocore.network.SendablePacket#write()
+	 */
+	@Override
+	protected void write()
+	{
+		writeC(0x07);
+		writeD(_playOk1);
+		writeD(_playOk2);
+	}
+}

+ 163 - 163
L2J_Server_BETA/java/com/l2jserver/loginserver/network/serverpackets/ServerList.java

@@ -1,163 +1,163 @@
-/*
- * 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.loginserver.network.serverpackets;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import com.l2jserver.loginserver.GameServerTable;
-import com.l2jserver.loginserver.GameServerTable.GameServerInfo;
-import com.l2jserver.loginserver.network.L2LoginClient;
-import com.l2jserver.loginserver.network.gameserverpackets.ServerStatus;
-
-/**
- * ServerList
- * Format: cc [cddcchhcdc]
- *
- * c: server list size (number of servers)
- * c: ?
- * [ (repeat for each servers)
- * c: server id (ignored by client?)
- * d: server ip
- * d: server port
- * c: age limit (used by client?)
- * c: pvp or not (used by client?)
- * h: current number of players
- * h: max number of players
- * c: 0 if server is down
- * d: 2nd bit: clock
- *    3rd bit: wont dsiplay server name
- *    4th bit: test server (used by client?)
- * c: 0 if you dont want to display brackets in front of sever name
- * ]
- *
- * Server will be considered as Good when the number of  online players
- * is less than half the maximum. as Normal between half and 4/5
- * and Full when there's more than 4/5 of the maximum number of players
- */
-public final class ServerList extends L2LoginServerPacket
-{
-	private static final Logger _log = Logger.getLogger(ServerList.class.getName());
-	
-	private List<ServerData> _servers;
-	private int _lastServer;
-	private Map<Integer, Integer> _charsOnServers;
-	private Map<Integer, long[]> _charsToDelete;
-	
-	class ServerData
-	{
-		protected byte[] _ip;
-		protected int _port;
-		protected int _ageLimit;
-		protected boolean _pvp;
-		protected int _currentPlayers;
-		protected int _maxPlayers;
-		protected boolean _brackets;
-		protected boolean _clock;
-		protected int _status;
-		protected int _serverId;
-		protected int _serverType;
-		
-		ServerData(L2LoginClient client, GameServerInfo gsi)
-		{
-			try
-			{
-				_ip = InetAddress.getByName(gsi.getServerAddress(client.getConnection().getInetAddress())).getAddress();
-			}
-			catch (UnknownHostException e)
-			{
-				_log.warning(getClass().getSimpleName() + ": " + e.getMessage());
-				_ip = new byte[4];
-				_ip[0] = 127;
-				_ip[1] = 0;
-				_ip[2] = 0;
-				_ip[3] = 1;
-			}
-			
-			_port = gsi.getPort();
-			_pvp = gsi.isPvp();
-			_serverType = gsi.getServerType();
-			_currentPlayers = gsi.getCurrentPlayerCount();
-			_maxPlayers = gsi.getMaxPlayers();
-			_ageLimit = 0;
-			_brackets = gsi.isShowingBrackets();
-			// If server GM-only - show status only to GMs
-			_status = gsi.getStatus() != ServerStatus.STATUS_GM_ONLY ? gsi.getStatus() : client.getAccessLevel() > 0 ? gsi.getStatus() : ServerStatus.STATUS_DOWN;
-			_serverId = gsi.getId();
-		}
-	}
-	
-	public ServerList(L2LoginClient client)
-	{
-		_servers = new ArrayList<ServerData>(GameServerTable.getInstance().getRegisteredGameServers().size());
-		_lastServer = client.getLastServer();
-		for (GameServerInfo gsi : GameServerTable.getInstance().getRegisteredGameServers().values())
-			_servers.add(new ServerData(client, gsi));
-		_charsOnServers = client.getCharsOnServ();
-		_charsToDelete = client.getCharsWaitingDelOnServ();
-	}
-	
-	@Override
-	public void write()
-	{
-		writeC(0x04);
-		writeC(_servers.size());
-		writeC(_lastServer);
-		for (ServerData server : _servers)
-		{
-			writeC(server._serverId); // server id
-			
-			writeC(server._ip[0] & 0xff);
-			writeC(server._ip[1] & 0xff);
-			writeC(server._ip[2] & 0xff);
-			writeC(server._ip[3] & 0xff);
-			
-			writeD(server._port);
-			writeC(server._ageLimit); // Age Limit 0, 15, 18
-			writeC(server._pvp ? 0x01 : 0x00);
-			writeH(server._currentPlayers);
-			writeH(server._maxPlayers);
-			writeC(server._status == ServerStatus.STATUS_DOWN ? 0x00 : 0x01);
-			writeD(server._serverType); // 1: Normal, 2: Relax, 4: Public Test, 8: No Label, 16: Character Creation Restricted, 32: Event, 64: Free
-			writeC(server._brackets ? 0x01 : 0x00);
-		}
-		writeH(0x00); // unknown
-		if (_charsOnServers != null)
-		{
-			writeC(_charsOnServers.size());
-			for (int servId : _charsOnServers.keySet())
-			{
-				writeC(servId);
-				writeC(_charsOnServers.get(servId));
-				if (_charsToDelete == null || !_charsToDelete.containsKey(servId))
-					writeC(0x00);
-				else
-				{
-					writeC(_charsToDelete.get(servId).length);
-					for (long deleteTime : _charsToDelete.get(servId))
-					{
-						writeD((int)((deleteTime-System.currentTimeMillis())/1000));
-					}
-				}
-			}
-		}
-		else
-			writeC(0x00);
-	}
-}
+/*
+ * 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.loginserver.network.serverpackets;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import com.l2jserver.loginserver.GameServerTable;
+import com.l2jserver.loginserver.GameServerTable.GameServerInfo;
+import com.l2jserver.loginserver.network.L2LoginClient;
+import com.l2jserver.loginserver.network.gameserverpackets.ServerStatus;
+
+/**
+ * ServerList
+ * Format: cc [cddcchhcdc]
+ *
+ * c: server list size (number of servers)
+ * c: ?
+ * [ (repeat for each servers)
+ * c: server id (ignored by client?)
+ * d: server ip
+ * d: server port
+ * c: age limit (used by client?)
+ * c: pvp or not (used by client?)
+ * h: current number of players
+ * h: max number of players
+ * c: 0 if server is down
+ * d: 2nd bit: clock
+ *    3rd bit: wont dsiplay server name
+ *    4th bit: test server (used by client?)
+ * c: 0 if you dont want to display brackets in front of sever name
+ * ]
+ *
+ * Server will be considered as Good when the number of  online players
+ * is less than half the maximum. as Normal between half and 4/5
+ * and Full when there's more than 4/5 of the maximum number of players
+ */
+public final class ServerList extends L2LoginServerPacket
+{
+	private static final Logger _log = Logger.getLogger(ServerList.class.getName());
+	
+	private List<ServerData> _servers;
+	private int _lastServer;
+	private Map<Integer, Integer> _charsOnServers;
+	private Map<Integer, long[]> _charsToDelete;
+	
+	class ServerData
+	{
+		protected byte[] _ip;
+		protected int _port;
+		protected int _ageLimit;
+		protected boolean _pvp;
+		protected int _currentPlayers;
+		protected int _maxPlayers;
+		protected boolean _brackets;
+		protected boolean _clock;
+		protected int _status;
+		protected int _serverId;
+		protected int _serverType;
+		
+		ServerData(L2LoginClient client, GameServerInfo gsi)
+		{
+			try
+			{
+				_ip = InetAddress.getByName(gsi.getServerAddress(client.getConnection().getInetAddress())).getAddress();
+			}
+			catch (UnknownHostException e)
+			{
+				_log.warning(getClass().getSimpleName() + ": " + e.getMessage());
+				_ip = new byte[4];
+				_ip[0] = 127;
+				_ip[1] = 0;
+				_ip[2] = 0;
+				_ip[3] = 1;
+			}
+			
+			_port = gsi.getPort();
+			_pvp = gsi.isPvp();
+			_serverType = gsi.getServerType();
+			_currentPlayers = gsi.getCurrentPlayerCount();
+			_maxPlayers = gsi.getMaxPlayers();
+			_ageLimit = 0;
+			_brackets = gsi.isShowingBrackets();
+			// If server GM-only - show status only to GMs
+			_status = gsi.getStatus() != ServerStatus.STATUS_GM_ONLY ? gsi.getStatus() : client.getAccessLevel() > 0 ? gsi.getStatus() : ServerStatus.STATUS_DOWN;
+			_serverId = gsi.getId();
+		}
+	}
+	
+	public ServerList(L2LoginClient client)
+	{
+		_servers = new ArrayList<ServerData>(GameServerTable.getInstance().getRegisteredGameServers().size());
+		_lastServer = client.getLastServer();
+		for (GameServerInfo gsi : GameServerTable.getInstance().getRegisteredGameServers().values())
+			_servers.add(new ServerData(client, gsi));
+		_charsOnServers = client.getCharsOnServ();
+		_charsToDelete = client.getCharsWaitingDelOnServ();
+	}
+	
+	@Override
+	public void write()
+	{
+		writeC(0x04);
+		writeC(_servers.size());
+		writeC(_lastServer);
+		for (ServerData server : _servers)
+		{
+			writeC(server._serverId); // server id
+			
+			writeC(server._ip[0] & 0xff);
+			writeC(server._ip[1] & 0xff);
+			writeC(server._ip[2] & 0xff);
+			writeC(server._ip[3] & 0xff);
+			
+			writeD(server._port);
+			writeC(server._ageLimit); // Age Limit 0, 15, 18
+			writeC(server._pvp ? 0x01 : 0x00);
+			writeH(server._currentPlayers);
+			writeH(server._maxPlayers);
+			writeC(server._status == ServerStatus.STATUS_DOWN ? 0x00 : 0x01);
+			writeD(server._serverType); // 1: Normal, 2: Relax, 4: Public Test, 8: No Label, 16: Character Creation Restricted, 32: Event, 64: Free
+			writeC(server._brackets ? 0x01 : 0x00);
+		}
+		writeH(0x00); // unknown
+		if (_charsOnServers != null)
+		{
+			writeC(_charsOnServers.size());
+			for (int servId : _charsOnServers.keySet())
+			{
+				writeC(servId);
+				writeC(_charsOnServers.get(servId));
+				if (_charsToDelete == null || !_charsToDelete.containsKey(servId))
+					writeC(0x00);
+				else
+				{
+					writeC(_charsToDelete.get(servId).length);
+					for (long deleteTime : _charsToDelete.get(servId))
+					{
+						writeD((int)((deleteTime-System.currentTimeMillis())/1000));
+					}
+				}
+			}
+		}
+		else
+			writeC(0x00);
+	}
+}

+ 419 - 419
L2J_Server_BETA/java/com/l2jserver/tools/gsregistering/GUserInterface.java

@@ -1,419 +1,419 @@
-package com.l2jserver.tools.gsregistering;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.sql.SQLException;
-import java.util.ResourceBundle;
-
-import javax.swing.BoxLayout;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JLayeredPane;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
-import javax.swing.JOptionPane;
-import javax.swing.JProgressBar;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.SwingUtilities;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableCellRenderer;
-import javax.swing.table.TableColumn;
-import javax.swing.table.TableColumnModel;
-
-import com.l2jserver.loginserver.GameServerTable;
-import com.l2jserver.tools.images.ImagesTable;
-
-/**
- * @author KenM
- */
-public class GUserInterface extends BaseGameServerRegister implements ActionListener
-{
-	private final JFrame _frame;
-	private JTableModel _dtm;
-	private JProgressBar _progressBar;
-	
-	public JTable _gsTable;
-	
-	public GUserInterface(ResourceBundle bundle)
-	{
-		super(bundle);
-		
-		_frame = new JFrame();
-		getFrame().setTitle(getBundle().getString("toolName"));
-		getFrame().setSize(600, 400);
-		getFrame().setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-		getFrame().setLayout(new GridBagLayout());
-		GridBagConstraints cons = new GridBagConstraints();
-		
-		JFrame.setDefaultLookAndFeelDecorated(true);
-		getFrame().setIconImage(ImagesTable.getImage("l2j.png").getImage());
-		
-		JMenuBar menubar = new JMenuBar();
-		getFrame().setJMenuBar(menubar);
-		
-		JMenu fileMenu = new JMenu(getBundle().getString("fileMenu"));
-		
-		JMenuItem exitItem = new JMenuItem(getBundle().getString("exitItem"));
-		exitItem.addActionListener(this);
-		exitItem.setActionCommand("exit");
-		
-		fileMenu.add(exitItem);
-		
-		JMenu helpMenu = new JMenu(getBundle().getString("helpMenu"));
-		
-		JMenuItem aboutItem = new JMenuItem(getBundle().getString("aboutItem"));
-		aboutItem.addActionListener(this);
-		aboutItem.setActionCommand("about");
-		
-		helpMenu.add(aboutItem);
-		
-		menubar.add(fileMenu);
-		menubar.add(helpMenu);
-		
-		JButton btnRegister = new JButton(getBundle().getString("btnRegister"), ImagesTable.getImage("add.png"));
-		btnRegister.addActionListener(this);
-		btnRegister.setActionCommand("register");
-		getFrame().add(btnRegister, cons);
-		
-		cons.gridx = 1;
-		cons.anchor = GridBagConstraints.LINE_END;
-		JButton btnRemoveAll = new JButton(getBundle().getString("btnRemoveAll"), ImagesTable.getImage("cross.png"));
-		btnRemoveAll.addActionListener(this);
-		btnRemoveAll.setActionCommand("removeAll");
-		getFrame().add(btnRemoveAll, cons);
-		
-		String name = getBundle().getString("gsName");
-		String action = getBundle().getString("gsAction");
-		
-		_dtm = new JTableModel(new Object[] { "ID", name, action });
-		_gsTable = new JTable(_dtm);
-		_gsTable.addMouseListener(new JTableButtonMouseListener(_gsTable));
-		
-		_gsTable.getColumnModel().getColumn(0).setMaxWidth(30);
-		
-		TableColumn actionCollumn = _gsTable.getColumnModel().getColumn(2);
-		actionCollumn.setCellRenderer(new ButtonCellRenderer());
-		
-		cons.fill = GridBagConstraints.BOTH;
-		cons.gridx = 0;
-		cons.gridy = 1;
-		cons.weighty = 1.0;
-		cons.weightx = 1.0;
-		cons.gridwidth = 2;
-		JLayeredPane layer = new JLayeredPane();
-		layer.setLayout(new BoxLayout(layer, BoxLayout.PAGE_AXIS));
-		layer.add(new JScrollPane(_gsTable), 0);
-		_progressBar = new JProgressBar();
-		_progressBar.setIndeterminate(true);
-		_progressBar.setVisible(false);
-		layer.add(_progressBar, BorderLayout.CENTER, 1);
-		//layer.setV
-		getFrame().add(layer, cons);
-		
-		
-		// maximize, doesn't seem really needed
-		//getFrame().setExtendedState(JFrame.MAXIMIZED_BOTH);
-		/*
-		// Work-around JVM maximize issue on linux
-		String osName = System.getProperty("os.name");
-		if (osName.equals("Linux"))
-		{
-		   Toolkit toolkit = Toolkit.getDefaultToolkit();
-		   Dimension screenSize = toolkit.getScreenSize();
-		   getFrame().setSize(screenSize);
-		}
-		 */
-		this.refreshAsync();
-	}
-	
-	public void refreshAsync()
-	{
-		Runnable r = new Runnable()
-		{
-			@Override
-			public void run()
-			{
-				GUserInterface.this.refreshServers();
-			}
-		};
-		Thread t = new Thread(r, "LoaderThread");
-		t.start();
-	}
-	
-	@Override
-	public void load()
-	{
-		
-		SwingUtilities.invokeLater
-		(
-				new Runnable()
-				{
-					@Override
-					public void run()
-					{
-						_progressBar.setVisible(true);
-					}
-				}
-		);
-		
-		super.load();
-		
-		SwingUtilities.invokeLater
-		(
-				new Runnable()
-				{
-					@Override
-					public void run()
-					{
-						_progressBar.setVisible(false);
-					}
-				}
-		);
-	}
-	
-	/**
-	 * @see com.l2jserver.tools.gsregistering.BaseGameServerRegister#showError(String, Throwable)
-	 */
-	@Override
-	public void showError(String msg, Throwable t)
-	{
-		String title;
-		if (this.getBundle() != null)
-		{
-			title = this.getBundle().getString("error");
-			msg += '\n'+this.getBundle().getString("reason")+' '+t.getLocalizedMessage();
-		}
-		else
-		{
-			title = "Error";
-			msg += "\nCause: "+t.getLocalizedMessage();
-		}
-		JOptionPane.showMessageDialog(this.getFrame(), msg, title, JOptionPane.ERROR_MESSAGE);
-	}
-	
-	protected void refreshServers()
-	{
-		if (!this.isLoaded())
-		{
-			this.load();
-		}
-		
-		// load succeeded?
-		if (this.isLoaded())
-		{
-			SwingUtilities.invokeLater
-			(
-					new Runnable()
-					{
-						@Override
-						public void run()
-						{
-							int size = GameServerTable.getInstance().getServerNames().size();
-							if (size == 0)
-							{
-								String title = getBundle().getString("error");
-								String msg = getBundle().getString("noServerNames");
-								JOptionPane.showMessageDialog(getFrame(), msg, title, JOptionPane.ERROR_MESSAGE);
-								System.exit(1);
-							}
-							// reset
-							_dtm.setRowCount(0);
-							
-							for (final int id : GameServerTable.getInstance().getRegisteredGameServers().keySet())
-							{
-								String name = GameServerTable.getInstance().getServerNameById(id);
-								JButton button = new JButton(getBundle().getString("btnRemove"), ImagesTable.getImage("cross.png"));
-								button.addActionListener
-								(
-										new ActionListener()
-										{
-											@Override
-											public void actionPerformed(ActionEvent e)
-											{
-												String sid = String.valueOf(id);
-												String sname = GameServerTable.getInstance().getServerNameById(id);
-												
-												int choice = JOptionPane.showConfirmDialog(getFrame(), getBundle().getString("confirmRemoveText").replace("%d", sid).replace("%s",sname), getBundle().getString("confirmRemoveTitle"), JOptionPane.YES_NO_OPTION);
-												if (choice == JOptionPane.YES_OPTION)
-												{
-													try
-													{
-														BaseGameServerRegister.unregisterGameServer(id);
-														GUserInterface.this.refreshAsync();
-													}
-													catch (SQLException e1)
-													{
-														GUserInterface.this.showError(getBundle().getString("errorUnregister"), e1);
-													}
-												}
-											}
-										}
-								);
-								_dtm.addRow(new Object[] { id, name, button });
-							}
-						}
-					}
-			);
-		}
-	}
-	
-	@Override
-	public void actionPerformed(ActionEvent e)
-	{
-		String cmd = e.getActionCommand();
-		
-		if (cmd.equals("register"))
-		{
-			RegisterDialog rd = new RegisterDialog(this);
-			rd.setVisible(true);
-		}
-		else if (cmd.equals("exit"))
-		{
-			System.exit(0);
-		}
-		else if (cmd.equals("about"))
-		{
-			JOptionPane.showMessageDialog(getFrame(), getBundle().getString("credits") + "\nhttp://www.l2jserver.com\n\n"+getBundle().getString("icons")+"\n\n"+getBundle().getString("language")+'\n'+getBundle().getString("translation"), getBundle().getString("aboutItem"), JOptionPane.INFORMATION_MESSAGE, ImagesTable.getImage("l2jserverlogo.png"));
-		}
-		else if (cmd.equals("removeAll"))
-		{
-			int choice = JOptionPane.showConfirmDialog(getFrame(), getBundle().getString("confirmRemoveAllText"), getBundle().getString("confirmRemoveTitle"), JOptionPane.YES_NO_OPTION);
-			if (choice == JOptionPane.YES_OPTION)
-			{
-				try
-				{
-					BaseGameServerRegister.unregisterAllGameServers();
-					this.refreshAsync();
-				}
-				catch (SQLException e1)
-				{
-					GUserInterface.this.showError(getBundle().getString("errorUnregister"), e1);
-				}
-			}
-		}
-	}
-	
-	/**
-	 * @return Returns the frame.
-	 */
-	public JFrame getFrame()
-	{
-		return _frame;
-	}
-	
-	private class ButtonCellRenderer implements TableCellRenderer
-	{
-		@Override
-		public Component getTableCellRendererComponent(JTable table,
-				Object value, boolean isSelected, boolean hasFocus, int row,
-				int column)
-		{
-			return (Component) value;
-		}
-	}
-	
-	/**
-	 * Forward mouse-events from table to buttons inside.
-	 * Buttons animate properly.
-	 *
-	 * @author  KenM
-	 */
-	private class JTableButtonMouseListener implements MouseListener
-	{
-		private final JTable _table;
-		
-		public JTableButtonMouseListener(JTable table)
-		{
-			_table = table;
-		}
-		
-		private void forwardEvent(MouseEvent e)
-		{
-			TableColumnModel columnModel = _table.getColumnModel();
-			int column = columnModel.getColumnIndexAtX(e.getX());
-			int row    = e.getY() / _table.getRowHeight();
-			Object value;
-			
-			if (row >= _table.getRowCount() || row < 0 || column >= _table.getColumnCount() || column < 0)
-			{
-				return;
-			}
-			
-			value = _table.getValueAt(row, column);
-			
-			if (value instanceof JButton)
-			{
-				final JButton b = (JButton) value;
-				if (e.getID() == MouseEvent.MOUSE_PRESSED)
-				{
-					b.getModel().setPressed(true);
-					b.getModel().setArmed(true);
-					_table.repaint();
-				}
-				else if (e.getID() == MouseEvent.MOUSE_RELEASED)
-				{
-					b.doClick();
-				}
-			}
-		}
-		
-		@Override
-		public void mouseEntered(MouseEvent e)
-		{
-			forwardEvent(e);
-		}
-		
-		@Override
-		public void mouseExited(MouseEvent e)
-		{
-			forwardEvent(e);
-		}
-		
-		@Override
-		public void mousePressed(MouseEvent e)
-		{
-			forwardEvent(e);
-		}
-		
-		@Override
-		public void mouseClicked(MouseEvent e)
-		{
-			forwardEvent(e);
-		}
-		
-		@Override
-		public void mouseReleased(MouseEvent e)
-		{
-			forwardEvent(e);
-		}
-	}
-	
-	@SuppressWarnings("serial")
-	private class JTableModel extends DefaultTableModel
-	{
-		public JTableModel(Object[] columnNames)
-		{
-			super(columnNames, 0);
-		}
-		
-		@Override
-		public boolean isCellEditable(int row, int column)
-		{
-			return false;
-		}
-		
-		@Override
-		public Class<?> getColumnClass(int column)
-		{
-			return getValueAt(0, column).getClass();
-		}
-	}
-}
+package com.l2jserver.tools.gsregistering;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.sql.SQLException;
+import java.util.ResourceBundle;
+
+import javax.swing.BoxLayout;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLayeredPane;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JProgressBar;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.SwingUtilities;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumn;
+import javax.swing.table.TableColumnModel;
+
+import com.l2jserver.loginserver.GameServerTable;
+import com.l2jserver.tools.images.ImagesTable;
+
+/**
+ * @author KenM
+ */
+public class GUserInterface extends BaseGameServerRegister implements ActionListener
+{
+	private final JFrame _frame;
+	private JTableModel _dtm;
+	private JProgressBar _progressBar;
+	
+	public JTable _gsTable;
+	
+	public GUserInterface(ResourceBundle bundle)
+	{
+		super(bundle);
+		
+		_frame = new JFrame();
+		getFrame().setTitle(getBundle().getString("toolName"));
+		getFrame().setSize(600, 400);
+		getFrame().setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+		getFrame().setLayout(new GridBagLayout());
+		GridBagConstraints cons = new GridBagConstraints();
+		
+		JFrame.setDefaultLookAndFeelDecorated(true);
+		getFrame().setIconImage(ImagesTable.getImage("l2j.png").getImage());
+		
+		JMenuBar menubar = new JMenuBar();
+		getFrame().setJMenuBar(menubar);
+		
+		JMenu fileMenu = new JMenu(getBundle().getString("fileMenu"));
+		
+		JMenuItem exitItem = new JMenuItem(getBundle().getString("exitItem"));
+		exitItem.addActionListener(this);
+		exitItem.setActionCommand("exit");
+		
+		fileMenu.add(exitItem);
+		
+		JMenu helpMenu = new JMenu(getBundle().getString("helpMenu"));
+		
+		JMenuItem aboutItem = new JMenuItem(getBundle().getString("aboutItem"));
+		aboutItem.addActionListener(this);
+		aboutItem.setActionCommand("about");
+		
+		helpMenu.add(aboutItem);
+		
+		menubar.add(fileMenu);
+		menubar.add(helpMenu);
+		
+		JButton btnRegister = new JButton(getBundle().getString("btnRegister"), ImagesTable.getImage("add.png"));
+		btnRegister.addActionListener(this);
+		btnRegister.setActionCommand("register");
+		getFrame().add(btnRegister, cons);
+		
+		cons.gridx = 1;
+		cons.anchor = GridBagConstraints.LINE_END;
+		JButton btnRemoveAll = new JButton(getBundle().getString("btnRemoveAll"), ImagesTable.getImage("cross.png"));
+		btnRemoveAll.addActionListener(this);
+		btnRemoveAll.setActionCommand("removeAll");
+		getFrame().add(btnRemoveAll, cons);
+		
+		String name = getBundle().getString("gsName");
+		String action = getBundle().getString("gsAction");
+		
+		_dtm = new JTableModel(new Object[] { "ID", name, action });
+		_gsTable = new JTable(_dtm);
+		_gsTable.addMouseListener(new JTableButtonMouseListener(_gsTable));
+		
+		_gsTable.getColumnModel().getColumn(0).setMaxWidth(30);
+		
+		TableColumn actionCollumn = _gsTable.getColumnModel().getColumn(2);
+		actionCollumn.setCellRenderer(new ButtonCellRenderer());
+		
+		cons.fill = GridBagConstraints.BOTH;
+		cons.gridx = 0;
+		cons.gridy = 1;
+		cons.weighty = 1.0;
+		cons.weightx = 1.0;
+		cons.gridwidth = 2;
+		JLayeredPane layer = new JLayeredPane();
+		layer.setLayout(new BoxLayout(layer, BoxLayout.PAGE_AXIS));
+		layer.add(new JScrollPane(_gsTable), 0);
+		_progressBar = new JProgressBar();
+		_progressBar.setIndeterminate(true);
+		_progressBar.setVisible(false);
+		layer.add(_progressBar, BorderLayout.CENTER, 1);
+		//layer.setV
+		getFrame().add(layer, cons);
+		
+		
+		// maximize, doesn't seem really needed
+		//getFrame().setExtendedState(JFrame.MAXIMIZED_BOTH);
+		/*
+		// Work-around JVM maximize issue on linux
+		String osName = System.getProperty("os.name");
+		if (osName.equals("Linux"))
+		{
+		   Toolkit toolkit = Toolkit.getDefaultToolkit();
+		   Dimension screenSize = toolkit.getScreenSize();
+		   getFrame().setSize(screenSize);
+		}
+		 */
+		this.refreshAsync();
+	}
+	
+	public void refreshAsync()
+	{
+		Runnable r = new Runnable()
+		{
+			@Override
+			public void run()
+			{
+				GUserInterface.this.refreshServers();
+			}
+		};
+		Thread t = new Thread(r, "LoaderThread");
+		t.start();
+	}
+	
+	@Override
+	public void load()
+	{
+		
+		SwingUtilities.invokeLater
+		(
+				new Runnable()
+				{
+					@Override
+					public void run()
+					{
+						_progressBar.setVisible(true);
+					}
+				}
+		);
+		
+		super.load();
+		
+		SwingUtilities.invokeLater
+		(
+				new Runnable()
+				{
+					@Override
+					public void run()
+					{
+						_progressBar.setVisible(false);
+					}
+				}
+		);
+	}
+	
+	/**
+	 * @see com.l2jserver.tools.gsregistering.BaseGameServerRegister#showError(String, Throwable)
+	 */
+	@Override
+	public void showError(String msg, Throwable t)
+	{
+		String title;
+		if (this.getBundle() != null)
+		{
+			title = this.getBundle().getString("error");
+			msg += '\n'+this.getBundle().getString("reason")+' '+t.getLocalizedMessage();
+		}
+		else
+		{
+			title = "Error";
+			msg += "\nCause: "+t.getLocalizedMessage();
+		}
+		JOptionPane.showMessageDialog(this.getFrame(), msg, title, JOptionPane.ERROR_MESSAGE);
+	}
+	
+	protected void refreshServers()
+	{
+		if (!this.isLoaded())
+		{
+			this.load();
+		}
+		
+		// load succeeded?
+		if (this.isLoaded())
+		{
+			SwingUtilities.invokeLater
+			(
+					new Runnable()
+					{
+						@Override
+						public void run()
+						{
+							int size = GameServerTable.getInstance().getServerNames().size();
+							if (size == 0)
+							{
+								String title = getBundle().getString("error");
+								String msg = getBundle().getString("noServerNames");
+								JOptionPane.showMessageDialog(getFrame(), msg, title, JOptionPane.ERROR_MESSAGE);
+								System.exit(1);
+							}
+							// reset
+							_dtm.setRowCount(0);
+							
+							for (final int id : GameServerTable.getInstance().getRegisteredGameServers().keySet())
+							{
+								String name = GameServerTable.getInstance().getServerNameById(id);
+								JButton button = new JButton(getBundle().getString("btnRemove"), ImagesTable.getImage("cross.png"));
+								button.addActionListener
+								(
+										new ActionListener()
+										{
+											@Override
+											public void actionPerformed(ActionEvent e)
+											{
+												String sid = String.valueOf(id);
+												String sname = GameServerTable.getInstance().getServerNameById(id);
+												
+												int choice = JOptionPane.showConfirmDialog(getFrame(), getBundle().getString("confirmRemoveText").replace("%d", sid).replace("%s",sname), getBundle().getString("confirmRemoveTitle"), JOptionPane.YES_NO_OPTION);
+												if (choice == JOptionPane.YES_OPTION)
+												{
+													try
+													{
+														BaseGameServerRegister.unregisterGameServer(id);
+														GUserInterface.this.refreshAsync();
+													}
+													catch (SQLException e1)
+													{
+														GUserInterface.this.showError(getBundle().getString("errorUnregister"), e1);
+													}
+												}
+											}
+										}
+								);
+								_dtm.addRow(new Object[] { id, name, button });
+							}
+						}
+					}
+			);
+		}
+	}
+	
+	@Override
+	public void actionPerformed(ActionEvent e)
+	{
+		String cmd = e.getActionCommand();
+		
+		if (cmd.equals("register"))
+		{
+			RegisterDialog rd = new RegisterDialog(this);
+			rd.setVisible(true);
+		}
+		else if (cmd.equals("exit"))
+		{
+			System.exit(0);
+		}
+		else if (cmd.equals("about"))
+		{
+			JOptionPane.showMessageDialog(getFrame(), getBundle().getString("credits") + "\nhttp://www.l2jserver.com\n\n"+getBundle().getString("icons")+"\n\n"+getBundle().getString("language")+'\n'+getBundle().getString("translation"), getBundle().getString("aboutItem"), JOptionPane.INFORMATION_MESSAGE, ImagesTable.getImage("l2jserverlogo.png"));
+		}
+		else if (cmd.equals("removeAll"))
+		{
+			int choice = JOptionPane.showConfirmDialog(getFrame(), getBundle().getString("confirmRemoveAllText"), getBundle().getString("confirmRemoveTitle"), JOptionPane.YES_NO_OPTION);
+			if (choice == JOptionPane.YES_OPTION)
+			{
+				try
+				{
+					BaseGameServerRegister.unregisterAllGameServers();
+					this.refreshAsync();
+				}
+				catch (SQLException e1)
+				{
+					GUserInterface.this.showError(getBundle().getString("errorUnregister"), e1);
+				}
+			}
+		}
+	}
+	
+	/**
+	 * @return Returns the frame.
+	 */
+	public JFrame getFrame()
+	{
+		return _frame;
+	}
+	
+	private class ButtonCellRenderer implements TableCellRenderer
+	{
+		@Override
+		public Component getTableCellRendererComponent(JTable table,
+				Object value, boolean isSelected, boolean hasFocus, int row,
+				int column)
+		{
+			return (Component) value;
+		}
+	}
+	
+	/**
+	 * Forward mouse-events from table to buttons inside.
+	 * Buttons animate properly.
+	 *
+	 * @author  KenM
+	 */
+	private class JTableButtonMouseListener implements MouseListener
+	{
+		private final JTable _table;
+		
+		public JTableButtonMouseListener(JTable table)
+		{
+			_table = table;
+		}
+		
+		private void forwardEvent(MouseEvent e)
+		{
+			TableColumnModel columnModel = _table.getColumnModel();
+			int column = columnModel.getColumnIndexAtX(e.getX());
+			int row    = e.getY() / _table.getRowHeight();
+			Object value;
+			
+			if (row >= _table.getRowCount() || row < 0 || column >= _table.getColumnCount() || column < 0)
+			{
+				return;
+			}
+			
+			value = _table.getValueAt(row, column);
+			
+			if (value instanceof JButton)
+			{
+				final JButton b = (JButton) value;
+				if (e.getID() == MouseEvent.MOUSE_PRESSED)
+				{
+					b.getModel().setPressed(true);
+					b.getModel().setArmed(true);
+					_table.repaint();
+				}
+				else if (e.getID() == MouseEvent.MOUSE_RELEASED)
+				{
+					b.doClick();
+				}
+			}
+		}
+		
+		@Override
+		public void mouseEntered(MouseEvent e)
+		{
+			forwardEvent(e);
+		}
+		
+		@Override
+		public void mouseExited(MouseEvent e)
+		{
+			forwardEvent(e);
+		}
+		
+		@Override
+		public void mousePressed(MouseEvent e)
+		{
+			forwardEvent(e);
+		}
+		
+		@Override
+		public void mouseClicked(MouseEvent e)
+		{
+			forwardEvent(e);
+		}
+		
+		@Override
+		public void mouseReleased(MouseEvent e)
+		{
+			forwardEvent(e);
+		}
+	}
+	
+	@SuppressWarnings("serial")
+	private class JTableModel extends DefaultTableModel
+	{
+		public JTableModel(Object[] columnNames)
+		{
+			super(columnNames, 0);
+		}
+		
+		@Override
+		public boolean isCellEditable(int row, int column)
+		{
+			return false;
+		}
+		
+		@Override
+		public Class<?> getColumnClass(int column)
+		{
+			return getValueAt(0, column).getClass();
+		}
+	}
+}