2
0
Эх сурвалжийг харах

Populating the unstable branch

DrLecter 14 жил өмнө
parent
commit
6edc1266a1
100 өөрчлөгдсөн 0 нэмэгдсэн , 12420 устгасан
  1. 0 9
      L2J_CommunityServer/.classpath
  2. 0 21
      L2J_CommunityServer/.gcjbuilder
  3. 0 17
      L2J_CommunityServer/.project
  4. 0 321
      L2J_CommunityServer/.settings/org.eclipse.jdt.core.prefs
  5. 0 53
      L2J_CommunityServer/.settings/org.eclipse.jdt.ui.prefs
  6. 0 674
      L2J_CommunityServer/LICENSE.txt
  7. 0 110
      L2J_CommunityServer/build.xml
  8. 0 6
      L2J_CommunityServer/dist/startCommunityServer.bat
  9. 0 2
      L2J_CommunityServer/dist/startCommunityServer.sh
  10. 0 120
      L2J_CommunityServer/java/com/l2jserver/communityserver/Config.java
  11. 0 166
      L2J_CommunityServer/java/com/l2jserver/communityserver/GameServerRegistrationTable.java
  12. 0 117
      L2J_CommunityServer/java/com/l2jserver/communityserver/L2CommunityServer.java
  13. 0 170
      L2J_CommunityServer/java/com/l2jserver/communityserver/L2DatabaseFactory.java
  14. 0 393
      L2J_CommunityServer/java/com/l2jserver/communityserver/Shutdown.java
  15. 0 286
      L2J_CommunityServer/java/com/l2jserver/communityserver/cache/HtmCache.java
  16. 0 130
      L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/CommunityBoard.java
  17. 0 465
      L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/CommunityBoardManager.java
  18. 0 38
      L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/AdminBoard.java
  19. 0 379
      L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/ClanBoard.java
  20. 0 421
      L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/ClanPostBoard.java
  21. 0 43
      L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/ErrorBoard.java
  22. 0 118
      L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/FriendBoard.java
  23. 0 297
      L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/MailBoard.java
  24. 0 200
      L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/MemoBoard.java
  25. 0 107
      L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/RegionBoard.java
  26. 0 58
      L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/TopBoard.java
  27. 0 150
      L2J_CommunityServer/java/com/l2jserver/communityserver/model/Comment.java
  28. 0 278
      L2J_CommunityServer/java/com/l2jserver/communityserver/model/Forum.java
  29. 0 64
      L2J_CommunityServer/java/com/l2jserver/communityserver/model/L2Castle.java
  30. 0 173
      L2J_CommunityServer/java/com/l2jserver/communityserver/model/L2Clan.java
  31. 0 156
      L2J_CommunityServer/java/com/l2jserver/communityserver/model/L2Player.java
  32. 0 391
      L2J_CommunityServer/java/com/l2jserver/communityserver/model/Post.java
  33. 0 335
      L2J_CommunityServer/java/com/l2jserver/communityserver/model/Topic.java
  34. 0 45
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/GameServerListener.java
  35. 0 352
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/GameServerThread.java
  36. 0 49
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/GameServerThreadPool.java
  37. 0 71
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/netcon/BaseReadPacket.java
  38. 0 81
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/netcon/BaseWritePacket.java
  39. 0 193
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/netcon/NetConnection.java
  40. 0 105
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/netcon/NetConnectionConfig.java
  41. 0 183
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/netcon/NetConnectionListener.java
  42. 0 475
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/netcon/crypt/BlowfishEngine.java
  43. 0 211
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/netcon/crypt/NewCrypt.java
  44. 0 71
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/readpackets/BlowFishKey.java
  45. 0 43
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/readpackets/GameServerAuth.java
  46. 0 38
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/readpackets/RequestShowCommunityBoard.java
  47. 0 43
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/readpackets/RequestWriteCommunityBoard.java
  48. 0 199
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/readpackets/WorldInfo.java
  49. 0 33
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/writepackets/AuthResponse.java
  50. 0 35
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/writepackets/CommunityServerFail.java
  51. 0 32
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/writepackets/InitCS.java
  52. 0 44
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/writepackets/PlayerSendMessage.java
  53. 0 171
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/writepackets/PlayerShowBoard.java
  54. 0 60
      L2J_CommunityServer/java/com/l2jserver/communityserver/network/writepackets/RequestWorldInfo.java
  55. 0 83
      L2J_CommunityServer/java/com/l2jserver/communityserver/threading/ThreadPoolManager.java
  56. 0 73
      L2J_CommunityServer/java/com/l2jserver/communityserver/util/Rnd.java
  57. 0 37
      L2J_CommunityServer/java/com/l2jserver/communityserver/util/buffer/AbstractBufferedByteReader.java
  58. 0 49
      L2J_CommunityServer/java/com/l2jserver/communityserver/util/buffer/AbstractBufferedByteWriter.java
  59. 0 98
      L2J_CommunityServer/java/com/l2jserver/communityserver/util/buffer/BufferedByteReader.java
  60. 0 128
      L2J_CommunityServer/java/com/l2jserver/communityserver/util/buffer/BufferedByteWriter.java
  61. 0 141
      L2J_CommunityServer/java/com/l2jserver/communityserver/util/buffer/SynchronizedBufferedByteReader.java
  62. 0 141
      L2J_CommunityServer/java/com/l2jserver/communityserver/util/buffer/SynchronizedBufferedByteWriter.java
  63. 0 30
      L2J_CommunityServer/java/com/l2jserver/log/AuditFilter.java
  64. 0 53
      L2J_CommunityServer/java/com/l2jserver/log/AuditFormatter.java
  65. 0 67
      L2J_CommunityServer/java/com/l2jserver/log/ConsoleLogFormatter.java
  66. 0 26
      L2J_CommunityServer/java/com/l2jserver/log/ErrorFilter.java
  67. 0 26
      L2J_CommunityServer/java/com/l2jserver/log/ErrorLogHandler.java
  68. 0 58
      L2J_CommunityServer/java/com/l2jserver/log/FileLogFormatter.java
  69. 0 25
      L2J_CommunityServer/java/config/General.properties
  70. 0 70
      L2J_CommunityServer/java/config/communityserver.properties
  71. 0 15
      L2J_CommunityServer/java/config/telnet.properties
  72. 0 7
      L2J_CommunityServer/java/console.cfg
  73. 0 53
      L2J_CommunityServer/java/log.cfg
  74. 0 38
      L2J_CommunityServer/launcher/Community.launch
  75. BIN
      L2J_CommunityServer/lib/c3p0-0.9.2-pre1.jar
  76. 0 502
      L2J_CommunityServer/lib/c3p0_LICENSE.txt
  77. BIN
      L2J_CommunityServer/lib/javolution-5.5.1.jar
  78. 0 27
      L2J_CommunityServer/lib/javolution_LICENSE.txt
  79. BIN
      L2J_CommunityServer/lib/mchange-commons-0.2.jar
  80. BIN
      L2J_CommunityServer/lib/mysql-connector-java-5.1.15-bin.jar
  81. 0 43
      L2J_CommunityServer/lib/mysql-connector-java_LICENSE.txt
  82. 0 7
      MMOCore/.classpath
  83. 0 17
      MMOCore/.project
  84. 0 281
      MMOCore/.settings/org.eclipse.jdt.core.prefs
  85. 0 9
      MMOCore/.settings/org.eclipse.jdt.ui.prefs
  86. 0 6
      MMOCore/.settings/org.eclipse.wst.validation.prefs
  87. 0 79
      MMOCore/build.xml
  88. BIN
      MMOCore/lib/javolution.jar
  89. 0 36
      MMOCore/src/org/mmocore/network/AbstractPacket.java
  90. 0 29
      MMOCore/src/org/mmocore/network/IAcceptFilter.java
  91. 0 27
      MMOCore/src/org/mmocore/network/IClientFactory.java
  92. 0 27
      MMOCore/src/org/mmocore/network/IMMOExecutor.java
  93. 0 29
      MMOCore/src/org/mmocore/network/IPacketHandler.java
  94. 0 47
      MMOCore/src/org/mmocore/network/MMOClient.java
  95. 0 270
      MMOCore/src/org/mmocore/network/MMOConnection.java
  96. 0 104
      MMOCore/src/org/mmocore/network/NioNetStackList.java
  97. 0 41
      MMOCore/src/org/mmocore/network/NioNetStringBuffer.java
  98. 0 99
      MMOCore/src/org/mmocore/network/ReceivablePacket.java
  99. 0 61
      MMOCore/src/org/mmocore/network/SelectorConfig.java
  100. 0 659
      MMOCore/src/org/mmocore/network/SelectorThread.java

+ 0 - 9
L2J_CommunityServer/.classpath

@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="src" path="java"/>
-	<classpathentry kind="lib" path="lib/c3p0-0.9.2-pre1.jar"/>
-	<classpathentry kind="lib" path="lib/mchange-commons-0.2.jar" />
-	<classpathentry kind="lib" path="lib/javolution-5.5.1.jar"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>

+ 0 - 21
L2J_CommunityServer/.gcjbuilder

@@ -1,21 +0,0 @@
-<gcjbuilder>
-  <projectType>0</projectType>
-  <buildType>0</buildType>
-  <mainClass></mainClass>
-  <classpathCompile>0</classpathCompile>
-  <classpathDll></classpathDll>
-  <classpathJars/>
-  <resources/>
-  <optLevel>0</optLevel>
-  <optFlags></optFlags>
-  <debugLevel>2</debugLevel>
-  <debugFlags></debugFlags>
-  <gcjMisc></gcjMisc>
-  <linkLib/>
-  <linkObj/>
-  <linkPath/>
-  <linkMisc></linkMisc>
-  <buildFolder>debug</buildFolder>
-  <buildFile>L2jCommunityServer</buildFile>
-  <buildCommand>make</buildCommand>
-</gcjbuilder>

+ 0 - 17
L2J_CommunityServer/.project

@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>L2J_CommunityServer</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>

+ 0 - 321
L2J_CommunityServer/.settings/org.eclipse.jdt.core.prefs

@@ -1,321 +0,0 @@
-#Sun Jul 04 01:12:28 CEST 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=true
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=80
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=tab
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true

+ 0 - 53
L2J_CommunityServer/.settings/org.eclipse.jdt.ui.prefs

@@ -1,53 +0,0 @@
-#Mon Dec 01 17:56:42 CET 2008
-cleanup.add_default_serial_version_id=false
-cleanup.add_generated_serial_version_id=true
-cleanup.add_missing_annotations=true
-cleanup.add_missing_deprecated_annotations=true
-cleanup.add_missing_nls_tags=false
-cleanup.add_missing_override_annotations=true
-cleanup.add_serial_version_id=false
-cleanup.always_use_blocks=false
-cleanup.always_use_parentheses_in_expressions=false
-cleanup.always_use_this_for_non_static_field_access=false
-cleanup.always_use_this_for_non_static_method_access=false
-cleanup.convert_to_enhanced_for_loop=false
-cleanup.format_source_code=true
-cleanup.make_local_variable_final=true
-cleanup.make_parameters_final=false
-cleanup.make_private_fields_final=true
-cleanup.make_variable_declarations_final=false
-cleanup.never_use_blocks=true
-cleanup.never_use_parentheses_in_expressions=true
-cleanup.organize_imports=true
-cleanup.qualify_static_field_accesses_with_declaring_class=false
-cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-cleanup.qualify_static_member_accesses_with_declaring_class=true
-cleanup.qualify_static_method_accesses_with_declaring_class=false
-cleanup.remove_private_constructors=true
-cleanup.remove_trailing_whitespaces=true
-cleanup.remove_trailing_whitespaces_all=false
-cleanup.remove_trailing_whitespaces_ignore_empty=true
-cleanup.remove_unnecessary_casts=true
-cleanup.remove_unnecessary_nls_tags=true
-cleanup.remove_unused_imports=true
-cleanup.remove_unused_local_variables=false
-cleanup.remove_unused_private_fields=true
-cleanup.remove_unused_private_members=false
-cleanup.remove_unused_private_methods=true
-cleanup.remove_unused_private_types=true
-cleanup.sort_members=true
-cleanup.sort_members_all=false
-cleanup.use_blocks=false
-cleanup.use_blocks_only_for_return_and_throw=false
-cleanup.use_parentheses_in_expressions=false
-cleanup.use_this_for_non_static_field_access=false
-cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-cleanup.use_this_for_non_static_method_access=false
-cleanup.use_this_for_non_static_method_access_only_if_necessary=true
-cleanup_profile=_Forsaiken
-cleanup_settings_version=2
-eclipse.preferences.version=1
-formatter_profile=_Forsaiken
-formatter_settings_version=11
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>

+ 0 - 674
L2J_CommunityServer/LICENSE.txt

@@ -1,674 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, 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
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If 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 convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU 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
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state 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 program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.

+ 0 - 110
L2J_CommunityServer/build.xml

@@ -1,110 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="L2J_CommunityServer" default="dist" basedir=".">
-    <property name="src" location="java"/>
-    <property name="lib" location="lib"/>
-    <property name="build" location="build"/>
-    <property name="build.classes" location="${build}/classes"/>
-    <property name="build.dist" location="${build}/dist"/>
-	<property name="build.dist.community" location="${build.dist}/community"/>
-    <property name="build.dist.libs" location="${build.dist}/libs"/>
-    <property name="build.dist.doc" location="${build.dist}/doc"/>
-    
-    <path id="classpath">
-        <fileset dir="${lib}">
-            <include name="c3p0-0.9.2-pre1.jar"/>
-        	<include name="javolution-5.5.1.jar"/>
-        </fileset>
-    </path>
-    
-	<target name="verifyRequirements">
-		<available classname="javax.script.ScriptContext" property="JDK6.present"/>
-		<fail unless="JDK6.present" message="JDK 6 or greater is required."/>
-	</target>
-	
-    <target name="init" depends="clean, verifyRequirements">
-        <mkdir dir="${build}"/>
-        <mkdir dir="${build.classes}"/>
-        <mkdir dir="${build.dist}" />
-    	<mkdir dir="${build.dist.community}" />
-    </target>
-    
-    
-    <target name="compile" depends="init">
-        <javac destdir="${build.classes}"
-               optimize="on"
-               debug="on"
-               source="1.6"
-               target="1.6"
-               nowarn="off">
-            <src path="${src}"/>
-            <classpath refid="classpath"/>   
-        </javac>
-    </target>
-    
-    
-    <target name="jar" depends="compile">
-        <jar destfile="${build}/l2jcommunity.jar">
-            <fileset dir="${build.classes}"/>
-        </jar>
-        
-    	<copy todir="${build.dist.community}">
-            <fileset dir="${build}">
-                <include name="l2jcommunity.jar"/>
-			</fileset>
-        </copy>
-	</target>
- 
-    <target name="dist" depends="jar">	
-    	<copy todir="${build.dist.community}">
-            <fileset dir="${src}">
-                <include name="log.cfg"/>
-                <include name="console.cfg"/>
-			</fileset>
-        </copy>
-    	
-	   	<copy todir="${build.dist.libs}">
-			<fileset dir="${src}/../lib">
-				<include name="*.jar"/>
-			</fileset>
-		</copy>
-    	
-        <copy todir="${build.dist.doc}">
-            <fileset dir="${basedir}">
-                <include name="changes.txt"/>
-                <include name="LICENSE.txt"/>
-                <include name="README.txt"/>
-            </fileset>
-        </copy>
-    	
-	   	<copy todir="${build.dist.doc}">
-			<fileset dir="${src}/../lib">
-				<include name="*LICENSE*"/>
-			</fileset>
-		</copy>
-        
-        <copy todir="${build.dist.community}">
-            <fileset dir="dist">
-                <include name="startCommunityServer.*"/>
-            </fileset>
-        </copy>
-    	
-		<fixcrlf srcdir="${build.dist.community}" eol="lf" eof="remove" includes="**/*.sh"/>
-		<fixcrlf srcdir="${build.dist.community}" eol="crlf" eof="remove" includes="**/*.bat"/>
-        
-        <mkdir dir="${build.dist.community}/log"/>
-        <mkdir dir="${build.dist.community}/config"/>
-    	
-    	<copy todir="${build.dist.community}/config">
-			<fileset dir="java/config">
-				<include name="*.properties"/>
-			</fileset>
-        </copy>
-
-        <zip destfile="${build}/L2J_CommunityServer.zip"
-             basedir="${build.dist}" />
-    </target>
-    
-    <target name="clean">
-    	<delete dir="${build}"/>
-    </target>
-</project>

+ 0 - 6
L2J_CommunityServer/dist/startCommunityServer.bat

@@ -1,6 +0,0 @@
-@echo off
-title Community Server Console
-echo Starting L2J Community Server.
-echo.
-java -Xms128m -Xmx128m -cp ./../libs/*;l2jcommunity.jar com.l2jserver.communityserver.L2CommunityServer
-pause

+ 0 - 2
L2J_CommunityServer/dist/startCommunityServer.sh

@@ -1,2 +0,0 @@
-#!/bin/sh
-java -Xms128m -Xmx128m -cp ./../libs/*:l2jcommunity.jar com.l2jserver.communityserver.L2CommunityServer > log/stdout.log 2>&1

+ 0 - 120
L2J_CommunityServer/java/com/l2jserver/communityserver/Config.java

@@ -1,120 +0,0 @@
-/*
- * 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.communityserver;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.Properties;
-import java.util.logging.Logger;
-
-/**
- * @author Forsaiken
- */
-
-public final class Config
-{
-	protected static final Logger _log = Logger.getLogger(Config.class.getName());
-
-	/** Properties file for community server configurations */
-	public static final String  CONFIGURATION_FILE								= "./config/communityserver.properties";
-	/** Properties file for server function configurations */
-	public static final String  GENERAL_FILE									= "./config/General.properties";
-
-	/** ************************************************** **/
-	/** Server Settings -Begin                             **/
-	/** ************************************************** **/
-	/** Driver to access to database */
-	public static String	DATABASE_DRIVER;
-	/** Path to access to database */
-	public static String	DATABASE_URL;
-	/** Database login */
-	public static String	DATABASE_LOGIN;
-	/** Database password */
-	public static String	DATABASE_PASSWORD;
-	/** Maximum number of connections to the database */
-	public static int		DATABASE_MAX_CONNECTIONS;
-	/** Datapack root directory */
-	public static File		DATAPACK_ROOT;
-	/** Accept alternate ID for server ? */
-	public static boolean	ACCEPT_ALTERNATE_ID;
-	/** ID for request to the server */
-	public static int		REQUEST_ID;
-
-	/** ************************************************** **/
-	/** Server Settings -End                           **/
-	/** ************************************************** **/
-
-	/** Game Server login port */
-	public static int        GAME_SERVER_LOGIN_PORT;
-	/** Game Server login Host */
-	public static String     GAME_SERVER_LOGIN_HOST;
-
-	/** Accept new game server ? */
-	public static boolean ACCEPT_NEW_GAMESERVER;
-
-	public static boolean FLOOD_PROTECTION;
-	public static int     FAST_CONNECTION_LIMIT;
-	public static int     NORMAL_CONNECTION_TIME;
-	public static int     FAST_CONNECTION_TIME;
-	public static int     MAX_CONNECTION_PER_IP;
-
-	/** General settings */
-	public static int     MIN_PLAYER_LVL_FOR_FORUM;
-	public static int     MIN_CLAN_LVL_FOR_FORUM;
-	public static long    MAIL_AUTO_DELETION_TIME;
-
-	public static int	  GENERAL_THREAD_CORE_SIZE;
-
-	public static final void load()
-	{
-		try
-		{
-			Properties serverSettings			= new Properties();
-			InputStream is						= new FileInputStream(new File(CONFIGURATION_FILE));
-			serverSettings.load(is);
-			is.close();
-
-			GAME_SERVER_LOGIN_HOST				= serverSettings.getProperty("CSHostname","*");
-			GAME_SERVER_LOGIN_PORT				= Integer.parseInt(serverSettings.getProperty("CSPort","9013"));
-
-			ACCEPT_NEW_GAMESERVER				= Boolean.parseBoolean(serverSettings.getProperty("AcceptNewGameServer", "True"));
-			REQUEST_ID							= Integer.parseInt(serverSettings.getProperty("RequestServerID", "0"));
-			ACCEPT_ALTERNATE_ID					= Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID", "True"));
-			DATAPACK_ROOT						= new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile();
-
-			DATABASE_DRIVER						= serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
-			DATABASE_URL						= serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jcb");
-			DATABASE_LOGIN						= serverSettings.getProperty("Login", "root");
-			DATABASE_PASSWORD					= serverSettings.getProperty("Password", "");
-			DATABASE_MAX_CONNECTIONS			= Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
-			GENERAL_THREAD_CORE_SIZE			= Integer.parseInt(serverSettings.getProperty("ThreadPoolSize", "1"));
-
-			Properties generalSettings			= new Properties();
-			is									= new FileInputStream(new File(GENERAL_FILE));
-			generalSettings.load(is);
-			is.close();
-
-			MIN_PLAYER_LVL_FOR_FORUM			= Integer.parseInt(generalSettings.getProperty("MinPlayerLvLForForum", "1"));
-			MIN_CLAN_LVL_FOR_FORUM				= Integer.parseInt(generalSettings.getProperty("MinClanLvLForForum", "2"));
-			MAIL_AUTO_DELETION_TIME				= Long.parseLong(generalSettings.getProperty("MailAutoDeletionTime", "90")) * 86400000;
-
-		}
-		catch (Exception e)
-		{
-
-		}
-	}
-}

+ 0 - 166
L2J_CommunityServer/java/com/l2jserver/communityserver/GameServerRegistrationTable.java

@@ -1,166 +0,0 @@
-/*
- * 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.communityserver;
-
-import java.math.BigInteger;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
-import java.security.spec.RSAKeyGenParameterSpec;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.Arrays;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import javolution.util.FastMap;
-import com.l2jserver.communityserver.util.Rnd;
-
-public final class GameServerRegistrationTable
-{
-	private static Logger _log = Logger.getLogger(GameServerRegistrationTable.class.getName());
-	private static final int KEYS_SIZE = 10;
-	
-	private static GameServerRegistrationTable _instance;
-	
-	public static GameServerRegistrationTable getInstance()
-	{
-		if (_instance == null)
-			_instance = new GameServerRegistrationTable();
-		return _instance;
-	}
-	
-	private final Map<byte[], Boolean> _registeredGameServers;
-	private final KeyPair[] _keyPairs;
-	
-	public GameServerRegistrationTable()
-	{
-		_registeredGameServers = loadRegisteredGameServers();
-		_log.info("Loaded "+_registeredGameServers.size()+" registered GameServers");
-		
-		_keyPairs = loadRSAKeys();
-		_log.info("Cached "+_keyPairs.length+" RSA keys for GameServer communication.");
-	}
-	
-	private final KeyPair[] loadRSAKeys()
-	{
-		final KeyPair[] keyPairs = new KeyPair[KEYS_SIZE];
-		
-		try
-		{
-			final KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
-			final RSAKeyGenParameterSpec spec = new RSAKeyGenParameterSpec(512, RSAKeyGenParameterSpec.F4);
-			keyGen.initialize(spec);
-			
-			for (int i = 0; i < KEYS_SIZE; i++)
-			{
-				keyPairs[i] = keyGen.genKeyPair();
-			}
-		}
-		catch (Exception e)
-		{
-			
-		}
-		
-		return keyPairs;
-	}
-	
-	private final Map<byte[], Boolean> loadRegisteredGameServers()
-	{
-		final Map<byte[], Boolean> registeredGameServers = new FastMap<byte[], Boolean>();
-		
-		Connection con = null;
-		PreparedStatement statement = null;
-		ResultSet rset = null;
-		
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			statement = con.prepareStatement("SELECT hex_id FROM registered_gameservers");
-			rset = statement.executeQuery();
-			
-			while (rset.next())
-			{
-				// for (byte b : stringToHex(rset.getString("hex_id")))
-				registeredGameServers.put(stringToHex(rset.getString("hex_id")), false);
-			}
-			
-		}
-		catch (SQLException e)
-		{
-			
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-				statement.close();
-				rset.close();
-			}
-			catch (Exception e)
-			{
-				
-			}
-		}
-		
-		return registeredGameServers;
-	}
-	
-	private final byte[] stringToHex(final String string)
-	{
-		return new BigInteger(string, 16).toByteArray();
-	}
-	
-	public final KeyPair getRandomKeyPair()
-	{
-		return _keyPairs[Rnd.get(_keyPairs.length)];
-	}
-	
-	public final boolean isHexIdOk(final byte[] hexId)
-	{
-		for (final byte[] hex : _registeredGameServers.keySet())
-		{
-			if (Arrays.equals(hex, hexId))
-				return true;
-		}
-		
-		return false;
-	}
-	
-	public final boolean isHexIdInUse(final byte[] hexId)
-	{
-		for (Map.Entry<byte[], Boolean> entry : _registeredGameServers.entrySet())
-		{
-			if (entry.getValue() && Arrays.equals(entry.getKey(), hexId))
-				return true;
-		}
-		
-		return false;
-	}
-	
-	public final void setHexIdInUse(final byte[] hexId)
-	{
-		for (Map.Entry<byte[], Boolean> entry : _registeredGameServers.entrySet())
-		{
-			if (Arrays.equals(entry.getKey(), hexId))
-			{
-				entry.setValue(false);
-				return;
-			}
-		}
-	}
-}

+ 0 - 117
L2J_CommunityServer/java/com/l2jserver/communityserver/L2CommunityServer.java

@@ -1,117 +0,0 @@
-/*
- * 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.communityserver;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.sql.SQLException;
-import java.util.logging.LogManager;
-import java.util.logging.Logger;
-
-import com.l2jserver.communityserver.cache.HtmCache;
-import com.l2jserver.communityserver.network.GameServerListener;
-import com.l2jserver.communityserver.network.netcon.NetConnectionConfig;
-import com.l2jserver.communityserver.threading.ThreadPoolManager;
-import com.l2jserver.communityserver.Shutdown;
-
-public final class L2CommunityServer
-{
-	private static final Logger _log = Logger.getLogger(L2CommunityServer.class.getName());
-	
-	private static L2CommunityServer _instance;
-	
-	public static final L2CommunityServer getInstance()
-	{
-		return _instance;
-	}
-	
-	public static final void main(final String[] args)
-	{
-		_instance = new L2CommunityServer();
-	}
-	
-	private GameServerListener _listener;
-	private final Shutdown _shutdownHandler;
-	
-	public L2CommunityServer()
-	{
-		final String LOG_FOLDER = "log";
-		final String LOG_NAME   = "./log.cfg";
-		
-		File logFolder = new File(Config.DATAPACK_ROOT, LOG_FOLDER);
-		logFolder.mkdir();
-		
-		InputStream is = null;
-		try
-		{
-			is = new FileInputStream(new File(LOG_NAME));
-			LogManager.getLogManager().readConfiguration(is);
-			is.close();
-		}
-		catch (IOException e)
-		{
-			e.printStackTrace();
-		}
-		finally
-		{
-			try
-			{
-				if (is != null)
-				{
-					is.close();
-				}
-			}
-			catch (IOException e)
-			{
-				e.printStackTrace();
-			}
-		}
-		
-		Config.load();
-		
-		_shutdownHandler = Shutdown.getInstance();
-		Runtime.getRuntime().addShutdownHook(_shutdownHandler);
-		ThreadPoolManager.init();
-		
-		GameServerRegistrationTable.getInstance();
-		
-		try
-		{
-			L2DatabaseFactory.getInstance();
-		}
-		catch (SQLException e)
-		{
-			_log.severe("FATAL: Failed initializing database. Reason: "+e.getMessage());
-			System.exit(1);
-		}
-		
-		// load htm cache
-		HtmCache.getInstance();
-		try
-		{
-			_listener = new GameServerListener(new NetConnectionConfig(Config.CONFIGURATION_FILE));
-			_listener.start();
-			_log.info("Listening for GameServers on " + Config.GAME_SERVER_LOGIN_HOST + ":" + Config.GAME_SERVER_LOGIN_PORT);
-		}
-		catch (Exception e)
-		{
-			_log.severe("FATAL: Failed to start the Game Server Listener. Reason: " + e.getMessage());
-			e.printStackTrace();
-			System.exit(1);
-		}
-	}
-}

+ 0 - 170
L2J_CommunityServer/java/com/l2jserver/communityserver/L2DatabaseFactory.java

@@ -1,170 +0,0 @@
-/*
- * 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.communityserver;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import com.mchange.v2.c3p0.ComboPooledDataSource;
-
-public class L2DatabaseFactory
-{
-    static Logger _log = Logger.getLogger(L2DatabaseFactory.class.getName());
-
-    public static enum ProviderType
-    {
-        MySql,
-        MsSql
-    }
-    
-    private static L2DatabaseFactory _instance;
-    private final ProviderType _providerType;
-	private final ComboPooledDataSource _source;
-	
-	public L2DatabaseFactory() throws SQLException
-	{
-		try
-		{
-			if (Config.DATABASE_MAX_CONNECTIONS < 2)
-            {
-                Config.DATABASE_MAX_CONNECTIONS = 2;
-                _log.warning("at least " + Config.DATABASE_MAX_CONNECTIONS + " db connections are required.");
-            }
-			
-			_source = new ComboPooledDataSource();
-			_source.setAutoCommitOnClose(true);
-			_source.setInitialPoolSize(10);
-			_source.setMinPoolSize(10);
-			_source.setMaxPoolSize(Config.DATABASE_MAX_CONNECTIONS);
-			_source.setAcquireRetryAttempts(0);
-			_source.setAcquireRetryDelay(500);
-			_source.setCheckoutTimeout(0);
-			_source.setAcquireIncrement(5);
-			_source.setAutomaticTestTable("connection_test_table");
-			_source.setTestConnectionOnCheckin(false);
-			_source.setIdleConnectionTestPeriod(3600);
-			_source.setMaxIdleTime(0);
-			_source.setMaxStatementsPerConnection(100);
-			_source.setBreakAfterAcquireFailure(false);
-			_source.setDriverClass(Config.DATABASE_DRIVER);
-			_source.setJdbcUrl(Config.DATABASE_URL);
-			_source.setUser(Config.DATABASE_LOGIN);
-			_source.setPassword(Config.DATABASE_PASSWORD);
-			_source.getConnection().close();
-			
-			if (Config.DATABASE_DRIVER.toLowerCase().contains("microsoft"))
-                _providerType = ProviderType.MsSql;
-            else
-                _providerType = ProviderType.MySql;
-		}
-		catch (SQLException x)
-		{
-			_log.fine("Database Connection FAILED");
-			throw x;
-		}
-		catch (Exception e)
-		{
-			_log.fine("Database Connection FAILED");
-			throw new SQLException("could not init DB connection: " + e);
-		}
-	}
-	
-    public final String prepQuerySelect(String[] fields, String tableName, String whereClause, boolean returnOnlyTopRecord)
-    {
-        String msSqlTop1 = "";
-        String mySqlTop1 = "";
-        if (returnOnlyTopRecord)
-        {
-            if (getProviderType() == ProviderType.MsSql) msSqlTop1 = " Top 1 ";
-            if (getProviderType() == ProviderType.MySql) mySqlTop1 = " Limit 1 ";
-        }
-        String query = "SELECT " + msSqlTop1 + safetyString(fields) + " FROM " + tableName + " WHERE " + whereClause + mySqlTop1;
-        return query;
-    }
-
-    public final void shutdown()
-    {
-        try
-        {
-            _source.close();
-        }
-        catch (Exception e)
-        {
-        	_log.log(Level.INFO, "", e);
-        }
-    }
-
-    public final String safetyString(String[] whatToCheck)
-    {
-        String braceLeft = "`";
-        String braceRight = "`";
-        if (getProviderType() == ProviderType.MsSql)
-        {
-            braceLeft = "[";
-            braceRight = "]";
-        }
-
-        String result = "";
-        for (String word : whatToCheck)
-        {
-            if (result != "")
-            	result += ", ";
-            result += braceLeft + word + braceRight;
-        }
-        return result;
-    }
-    
-	public static final L2DatabaseFactory getInstance() throws SQLException
-	{
-		if (_instance == null)
-			_instance = new L2DatabaseFactory();
-		
-		return _instance;
-	}
-
-	public final Connection getConnection()
-	{
-		Connection con = null;
-		while (con == null)
-		{
-			try
-			{
-				con = _source.getConnection();
-			}
-			catch (SQLException e)
-			{
-				_log.warning("L2DatabaseFactory: getConnection() failed, trying again "+e);
-			}
-		}
-		return con;
-	}
-
-	public final int getBusyConnectionCount() throws SQLException
-	{
-	    return _source.getNumBusyConnectionsDefaultUser();
-	}
-
-	public final int getIdleConnectionCount() throws SQLException
-	{
-	    return _source.getNumIdleConnectionsDefaultUser();
-	}
-
-    public final ProviderType getProviderType()
-    {
-    	return _providerType;
-    }
-}

+ 0 - 393
L2J_CommunityServer/java/com/l2jserver/communityserver/Shutdown.java

@@ -1,393 +0,0 @@
-/*
- * 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.communityserver;
-
-import java.util.logging.Logger;
-
-import com.l2jserver.communityserver.L2DatabaseFactory;
-import com.l2jserver.communityserver.model.L2Player;
-
-/**
- *
- * This class provides the functions for shutting down and restarting the server
- * It closes all open clientconnections and saves all data.
- *
- * @version $Revision: 1.2.4.5 $ $Date: 2005/03/27 15:29:09 $
- */
-public class Shutdown extends Thread
-{
-	private static Logger _log = Logger.getLogger(Shutdown.class.getName());
-	private static Shutdown _instance;
-	private static Shutdown _counterInstance = null;
-	
-	private int _secondsShut;
-	private int _shutdownMode;
-	public static final int SIGTERM = 0;
-	public static final int GM_SHUTDOWN = 1;
-	public static final int GM_RESTART = 2;
-	public static final int ABORT = 3;
-	private static final String[] MODE_TEXT =
-	{
-		"SIGTERM", "shutting down", "restarting", "aborting"
-	};
-	
-	/**
-	 * This function starts a shutdown countdown from Telnet (Copied from Function startShutdown())
-	 *
-	 * @param ip            IP Which Issued shutdown command
-	 * @param seconds       seconds untill shutdown
-	 * @param restart       true if the server will restart after shutdown
-	 */
-	
-	public void startTelnetShutdown(String IP, int seconds, boolean restart)
-	{
-		_log.warning("IP: " + IP + " issued shutdown command. " + MODE_TEXT[_shutdownMode] + " in " + seconds + " seconds!");
-		//_an.announceToAll("Server is " + _modeText[shutdownMode] + " in "+seconds+ " seconds!");
-		
-		if (restart)
-		{
-			_shutdownMode = GM_RESTART;
-		}
-		else
-		{
-			_shutdownMode = GM_SHUTDOWN;
-		}
-		
-		if (_shutdownMode > 0)
-		{
-			switch (seconds)
-			{
-				case 540:
-				case 480:
-				case 420:
-				case 360:
-				case 300:
-				case 240:
-				case 180:
-				case 120:
-				case 60:
-				case 30:
-				case 10:
-				case 5:
-				case 4:
-				case 3:
-				case 2:
-				case 1:
-					break;
-				default:
-			}
-		}
-		
-		if (_counterInstance != null)
-		{
-			_counterInstance._abort();
-		}
-		_counterInstance = new Shutdown(seconds, restart);
-		_counterInstance.start();
-	}
-	
-	/**
-	 * This function aborts a running countdown
-	 *
-	 * @param IP            IP Which Issued shutdown command
-	 */
-	public void telnetAbort(String IP)
-	{
-		_log.warning("IP: " + IP + " issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
-		
-		if (_counterInstance != null)
-		{
-			_counterInstance._abort();
-		}
-	}
-	
-	/**
-	 * Default constucter is only used internal to create the shutdown-hook instance
-	 *
-	 */
-	public Shutdown()
-	{
-		_secondsShut = -1;
-		_shutdownMode = SIGTERM;
-	}
-	
-	/**
-	 * This creates a countdown instance of Shutdown.
-	 *
-	 * @param seconds	how many seconds until shutdown
-	 * @param restart	true is the server shall restart after shutdown
-	 *
-	 */
-	public Shutdown(int seconds, boolean restart)
-	{
-		if (seconds < 0)
-		{
-			seconds = 0;
-		}
-		_secondsShut = seconds;
-		if (restart)
-		{
-			_shutdownMode = GM_RESTART;
-		}
-		else
-		{
-			_shutdownMode = GM_SHUTDOWN;
-		}
-	}
-	
-	/**
-	 * get the shutdown-hook instance
-	 * the shutdown-hook instance is created by the first call of this function,
-	 * but it has to be registrered externaly.
-	 *
-	 * @return	instance of Shutdown, to be used as shutdown hook
-	 */
-	public static Shutdown getInstance()
-	{
-		if (_instance == null)
-		{
-			_instance = new Shutdown();
-		}
-		return _instance;
-	}
-	
-	/**
-	 * this function is called, when a new thread starts
-	 *
-	 * if this thread is the thread of getInstance, then this is the shutdown hook
-	 * and we save all data and disconnect all clients.
-	 *
-	 * after this thread ends, the server will completely exit
-	 *
-	 * if this is not the thread of getInstance, then this is a countdown thread.
-	 * we start the countdown, and when we finished it, and it was not aborted,
-	 * we tell the shutdown-hook why we call exit, and then call exit
-	 *
-	 * when the exit status of the server is 1, startServer.sh / startServer.bat
-	 * will restart the server.
-	 *
-	 */
-	@Override
-	public void run()
-	{
-		if (this == _instance)
-		{
-			// last byebye, save all data and quit this server
-			// logging doesnt work here :(
-			saveData();
-			
-			try
-			{
-				// LoginServerThread.getInstance().interrupt();
-			}
-			catch (Throwable t)
-			{
-				// ignore
-			}
-			
-			// saveData sends messages to exit players, so sgutdown selector after it
-			try
-			{
-				//GameServer.gameServer.getSelectorThread().shutdown();
-				//GameServer.gameServer.getSelectorThread().setDaemon(true);
-			}
-			catch (Throwable t)
-			{
-				// ignore
-			}
-			
-			// commit data, last chance
-			try
-			{
-				L2DatabaseFactory.getInstance().shutdown();
-			}
-			catch (Throwable t)
-			{
-				
-			}
-			
-			// server will quit, when this function ends.
-			if (_instance._shutdownMode == GM_RESTART)
-			{
-				Runtime.getRuntime().halt(2);
-			}
-			else
-			{
-				Runtime.getRuntime().halt(0);
-			}
-		}
-		else
-		{
-			// gm shutdown: send warnings and then call exit to start shutdown sequence
-			countdown();
-			// last point where logging is operational :(
-			_log.warning("GM shutdown countdown is over. " + MODE_TEXT[_shutdownMode] + " NOW!");
-			switch (_shutdownMode)
-			{
-				case GM_SHUTDOWN:
-					_instance.setMode(GM_SHUTDOWN);
-					System.exit(0);
-					break;
-				case GM_RESTART:
-					_instance.setMode(GM_RESTART);
-					System.exit(2);
-					break;
-			}
-		}
-	}
-	
-	/**
-	 * This functions starts a shutdown countdown
-	 *
-	 * @param activeChar	GM who issued the shutdown command
-	 * @param seconds		seconds until shutdown
-	 * @param restart		true if the server will restart after shutdown
-	 */
-	public void startShutdown(L2Player activeChar, int seconds, boolean restart)
-	{
-		_log.warning("GM: " + activeChar.getName() + "(" + activeChar.getObjId() + ") issued shutdown command. " + MODE_TEXT[_shutdownMode] + " in " + seconds + " seconds!");	
-		if (restart)
-		{
-			_shutdownMode = GM_RESTART;
-		}
-		else
-		{
-			_shutdownMode = GM_SHUTDOWN;
-		}
-		
-		if (_shutdownMode > 0)
-		{
-			switch (seconds)
-			{
-				case 540:
-				case 480:
-				case 420:
-				case 360:
-				case 300:
-				case 240:
-				case 180:
-				case 120:
-				case 60:
-				case 30:
-				case 10:
-				case 5:
-				case 4:
-				case 3:
-				case 2:
-				case 1:
-					break;
-				default:
-			}
-		}
-		
-		if (_counterInstance != null)
-		{
-			_counterInstance.abort(activeChar);
-		}
-		
-		//		 the main instance should only run for shutdown hook, so we start a new instance
-		_counterInstance = new Shutdown(seconds, restart);
-		_counterInstance.start();
-	}
-	
-	/**
-	 * This function aborts a running countdown
-	 *
-	 * @param activeChar	GM who issued the abort command
-	 */
-	public void abort(L2Player activeChar)
-	{
-		_log.warning("GM: " + activeChar.getName() + "(" + activeChar.getObjId() + ") issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
-		if (_counterInstance != null)
-		{
-			_counterInstance._abort();
-		}
-	}
-	
-	/**
-	 * set the shutdown mode
-	 * @param mode	what mode shall be set
-	 */
-	private void setMode(int mode)
-	{
-		_shutdownMode = mode;
-	}
-	
-	/**
-	 * set shutdown mode to ABORT
-	 *
-	 */
-	private void _abort()
-	{
-		_shutdownMode = ABORT;
-	}
-	
-	/**
-	 * this counts the countdown and reports it to all players
-	 * countdown is aborted if mode changes to ABORT
-	 */
-	private void countdown()
-	{
-		
-		try
-		{
-			while (_secondsShut > 0)
-			{
-				_secondsShut--;
-				
-				int delay = 1000; //milliseconds
-				Thread.sleep(delay);
-				
-				if (_shutdownMode == ABORT)
-					break;
-			}
-		}
-		catch (InterruptedException e)
-		{
-			//this will never happen
-		}
-	}
-	
-	/**
-	 * this sends a last byebye, disconnects all players and saves data
-	 *
-	 */
-	private void saveData()
-	{
-		switch (_shutdownMode)
-		{
-			case SIGTERM:
-				System.err.println("SIGTERM received. Shutting down NOW!");
-				break;
-			case GM_SHUTDOWN:
-				System.err.println("GM shutdown received. Shutting down NOW!");
-				break;
-			case GM_RESTART:
-				System.err.println("GM restart received. Restarting NOW!");
-				break;
-			
-		}
-		
-		try
-		{
-			int delay = 5000;
-			Thread.sleep(delay);
-		}
-		catch (InterruptedException e)
-		{
-			//never happens :p
-		}
-	}
-}

+ 0 - 286
L2J_CommunityServer/java/com/l2jserver/communityserver/cache/HtmCache.java

@@ -1,286 +0,0 @@
-/*
- * 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.communityserver.cache;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileFilter;
-import java.io.FileInputStream;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-import javolution.util.FastMap;
-import com.l2jserver.communityserver.Config;
-
-/**
- * @author Layane
- *
- */
-public class HtmCache
-{
-	private static Logger _log = Logger.getLogger(HtmCache.class.getName());
-	private static HtmCache _instance;
-	
-	private FastMap<Integer, String> _cache;
-	private FastMap<Integer, String> _serverTopDir;
-	
-	private int _loadedFiles;
-	private long _bytesBuffLen;
-	
-	public static HtmCache getInstance()
-	{
-		if (_instance == null)
-			_instance = new HtmCache();
-		
-		return _instance;
-	}
-	
-	public HtmCache()
-	{
-		_cache = new FastMap<Integer, String>();
-		_serverTopDir = new FastMap<Integer, String>();
-		loadTopDirs();
-		reload();
-	}
-	
-	public void loadTopDirs()
-	{
-		try
-		{
-			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-			factory.setValidating(false);
-			factory.setIgnoringComments(true);
-			
-			File file = new File(Config.DATAPACK_ROOT + "/data/top/servertopdir.xml");
-			if (!file.exists())
-			{
-				_log.info("The servertopdir.xml file is missing.");
-				return;
-			}
-			
-			Document doc = factory.newDocumentBuilder().parse(file);
-			
-			for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
-			{
-				if ("servers_list".equalsIgnoreCase(n.getNodeName()))
-				{
-					for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
-					{
-						if ("server".equalsIgnoreCase(d.getNodeName()))
-						{
-							NamedNodeMap attrs = d.getAttributes();
-							int sqlDPId = Integer.parseInt(attrs.getNamedItem("sqlDPId").getNodeValue());
-							String dir = attrs.getNamedItem("dir").getNodeValue();
-							_serverTopDir.put(sqlDPId, dir);
-						}
-					}
-				}
-			}
-		}
-		catch (Exception e)
-		{
-			_log.log(Level.SEVERE, "Error parsing servertopdir.xml.", e);
-			return;
-		}
-	}
-	
-	public void reload()
-	{
-		reload(Config.DATAPACK_ROOT);
-	}
-	
-	public void reload(File f)
-	{
-/*		if (!Config.LAZY_CACHE)
-		{
-			_log.info("Html cache start...");
-			parseDir(f);
-			_log.info("Cache[HTML]: " + String.format("%.3f", getMemoryUsage()) + " megabytes on " + getLoadedFiles() + " files loaded");
-		}
-		else
-		{*/
-			_cache.clear();
-			_loadedFiles = 0;
-			_bytesBuffLen = 0;
-			_log.info("Cache[HTML]: Running lazy cache");
-		//}
-	}
-	
-	public void reloadPath(File f)
-	{
-		parseDir(f);
-		_log.info("Cache[HTML]: Reloaded specified path.");
-	}
-	
-	public double getMemoryUsage()
-	{
-		return ((float) _bytesBuffLen / 1048576);
-	}
-	
-	public static String getRelativePath(File base, File file)
-	{
-		return file.toURI().getPath().substring(base.toURI().getPath().length());
-	}
-	
-	public int getLoadedFiles()
-	{
-		return _loadedFiles;
-	}
-	
-	class HtmFilter implements FileFilter
-	{
-		public boolean accept(File file)
-		{
-			if (!file.isDirectory())
-			{
-				return (file.getName().endsWith(".htm") || file.getName().endsWith(".html"));
-			}
-			return true;
-		}
-	}
-	
-	private void parseDir(File dir)
-	{
-		FileFilter filter = new HtmFilter();
-		File[] files = dir.listFiles(filter);
-		
-		for (File file : files)
-		{
-			if (!file.isDirectory())
-				loadFile(file);
-			else
-				parseDir(file);
-		}
-	}
-	
-	public String loadFile(File file)
-	{
-		HtmFilter filter = new HtmFilter();
-		
-		if (file.exists() && filter.accept(file) && !file.isDirectory())
-		{
-			String content;
-			FileInputStream fis = null;
-			
-			try
-			{
-				fis = new FileInputStream(file);
-				BufferedInputStream bis = new BufferedInputStream(fis);
-				int bytes = bis.available();
-				byte[] raw = new byte[bytes];
-				
-				bis.read(raw);
-				content = new String(raw, "UTF-8");
-				content = content.replaceAll("\r\n", "\n");
-				
-				String relpath = getRelativePath(Config.DATAPACK_ROOT, file);
-				int hashcode = relpath.hashCode();
-				
-				String oldContent = _cache.get(hashcode);
-				
-				if (oldContent == null)
-				{
-					_bytesBuffLen += bytes;
-					_loadedFiles++;
-				}
-				else
-				{
-					_bytesBuffLen = _bytesBuffLen - oldContent.length() + bytes;
-				}
-				
-				_cache.put(hashcode, content);
-				
-				return content;
-			}
-			catch (Exception e)
-			{
-				_log.warning("problem with htm file " + e);
-			}
-			finally
-			{
-				try
-				{
-					fis.close();
-				}
-				catch (Exception e1)
-				{
-				}
-			}
-		}
-		
-		return null;
-	}
-	
-	public String getHtmForce(String path)
-	{
-		String content = getHtm(path);
-		
-		if (content == null)
-		{
-			content = "<html><body>My text is missing:<br>" + path + "</body></html>";
-			_log.warning("Cache[HTML]: Missing HTML page: " + path);
-		}
-		
-		return content;
-	}
-	
-	public String getHtm(String path)
-	{
-		String content = _cache.get(path.hashCode());
-		
-		if (content == null)
-			content = loadFile(new File(Config.DATAPACK_ROOT, path));
-
-		return content;
-	}
-
-	public String getHtm(final int sqlDPId, String file)
-	{
-		String path = "data/top/" + _serverTopDir.get(sqlDPId) + "/" + file;
-		String content = _cache.get(path.hashCode());
-		
-		if (content == null)
-			content = loadFile(new File(Config.DATAPACK_ROOT, path));
-
-		return content;
-	}
-
-	public boolean contains(String path)
-	{
-		return _cache.containsKey(path.hashCode());
-	}
-	
-	/**
-	 * Check if an HTM exists and can be loaded
-	 * @param
-	 * path The path to the HTM
-	 * */
-	public boolean isLoadable(String path)
-	{
-		File file = new File(path);
-		HtmFilter filter = new HtmFilter();
-		
-		if (file.exists() && filter.accept(file) && !file.isDirectory())
-			return true;
-		
-		return false;
-	}
-}

+ 0 - 130
L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/CommunityBoard.java

@@ -1,130 +0,0 @@
-/*
- * 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.communityserver.communityboard;
-
-import java.util.logging.Logger;
-
-import javolution.util.FastList;
-import com.l2jserver.communityserver.network.writepackets.PlayerShowBoard;
-
-public abstract class CommunityBoard
-{
-	private final CommunityBoardManager _mgr;
-	private static Logger _log = Logger.getLogger(CommunityBoard.class.getName());
-	
-	protected CommunityBoard(final CommunityBoardManager mgr)
-	{
-		_mgr = mgr;
-	}
-	
-	protected final CommunityBoardManager getCommunityBoardManager()
-	{
-		return _mgr;
-	}
-
-	protected final void sendWrite(final int playerObjId, final String html, String string, String string2, String string3)
-	{
-		try
-		{
-			string = edtiSavedTxT(string);
-			string2 = edtiSavedTxT(string2);
-			string3 = edtiSavedTxT(string3);
-			_mgr.sendPacket(new PlayerShowBoard(playerObjId, html));
-			FastList<String> arg = new FastList<String>();
-			arg.add("0");
-			arg.add("0");
-			arg.add("0");
-			arg.add("0");
-			arg.add("0");
-			arg.add("0");
-			arg.add(_mgr.getPlayer(playerObjId).getName());
-			arg.add(Integer.toString(playerObjId));
-			arg.add(_mgr.getPlayer(playerObjId).getAccountName());
-			arg.add("9");
-			arg.add(string3);
-			arg.add(string2);
-			arg.add(string);
-			arg.add(string3);
-			arg.add(string3);
-			arg.add("0");
-			arg.add("0");
-			_mgr.sendPacket(new PlayerShowBoard(playerObjId, arg));
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-		}
-	}
-
-	protected final void send(final int playerObjId, final String text)
-	{
-		try
-		{
-			if (text.length() <= 4096)
-			{
-				_mgr.sendPacket(new PlayerShowBoard(playerObjId, text, (byte)0));
-				_mgr.sendPacket(new PlayerShowBoard(playerObjId, null, (byte)1));
-				_mgr.sendPacket(new PlayerShowBoard(playerObjId, null, (byte)2));
-			}
-			else if (text.length() <= 8192)
-			{
-				_mgr.sendPacket(new PlayerShowBoard(playerObjId, text.substring(0, 4096), (byte)0));
-				_mgr.sendPacket(new PlayerShowBoard(playerObjId, text.substring(4096), (byte)1));
-				_mgr.sendPacket(new PlayerShowBoard(playerObjId, null, (byte)2));
-			}
-			else if (text.length() <= 12288)
-			{
-				_mgr.sendPacket(new PlayerShowBoard(playerObjId, text.substring(0, 4096), (byte)0));
-				_mgr.sendPacket(new PlayerShowBoard(playerObjId, text.substring(4096, 8192), (byte)1));
-				_mgr.sendPacket(new PlayerShowBoard(playerObjId, text.substring(8192), (byte)2));
-			}
-			else
-			{
-				_log.warning("Text is too big!");
-			}
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	protected String edtiPlayerTxT(String txt)
-	{
-		if (txt == null)
-			return ""; 
-		txt = txt.replace(">", "&gt;");
-		txt = txt.replace("<", "&lt;");
-		txt = txt.replace("\n", "<br1>");
-		txt = txt.replace("$", "\\$");
-		return txt;
-	}
-
-	protected String edtiSavedTxT(String txt)
-	{
-		if (txt == null)
-			return "";
-		txt = txt.replace("&gt;", ">");
-		txt = txt.replace("&lt;", "<");
-		txt = txt.replace("<br1>", "\n");
-		txt = txt.replace("\\$", "$");
-		return txt;
-	}
-
-	public abstract void parseCmd(final int playerObjId, final String cmd);
-	
-	public abstract void parseWrite(final int playerObjId, String ar1, String ar2, String ar3, String ar4, String ar5);
-
-}

+ 0 - 465
L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/CommunityBoardManager.java

@@ -1,465 +0,0 @@
-/*
- * 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.communityserver.communityboard;
-
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.Collection;
-import java.util.logging.Logger;
-
-import javolution.util.FastMap;
-import com.l2jserver.communityserver.Config;
-import com.l2jserver.communityserver.L2DatabaseFactory;
-import com.l2jserver.communityserver.communityboard.boards.ClanBoard;
-import com.l2jserver.communityserver.communityboard.boards.ErrorBoard;
-import com.l2jserver.communityserver.communityboard.boards.FriendBoard;
-import com.l2jserver.communityserver.communityboard.boards.MailBoard;
-import com.l2jserver.communityserver.communityboard.boards.MemoBoard;
-import com.l2jserver.communityserver.communityboard.boards.RegionBoard;
-import com.l2jserver.communityserver.communityboard.boards.TopBoard;
-import com.l2jserver.communityserver.communityboard.boards.ClanPostBoard;
-import com.l2jserver.communityserver.model.Forum;
-import com.l2jserver.communityserver.model.L2Castle;
-import com.l2jserver.communityserver.model.L2Player;
-import com.l2jserver.communityserver.model.L2Clan;
-import com.l2jserver.communityserver.network.GameServerThread;
-import com.l2jserver.communityserver.network.netcon.BaseWritePacket;
-import com.l2jserver.communityserver.network.writepackets.RequestWorldInfo;
-
-public final class CommunityBoardManager
-{
-	private static Logger _log = Logger.getLogger(CommunityBoardManager.class.getName());
-	private static FastMap<Integer, CommunityBoardManager> _instances;
-	
-	public static CommunityBoardManager getInstance(final int sqlDPId)
-	{
-		if (_instances == null)
-			_instances = new FastMap<Integer, CommunityBoardManager>();
-		
-		CommunityBoardManager mgr = _instances.get(sqlDPId);
-		
-		if (mgr == null)
-		{
-			mgr = new CommunityBoardManager(sqlDPId);
-			_instances.put(sqlDPId, mgr);
-		}
-		
-		return mgr;
-	}
-	
-	private FastMap<Integer, Forum> _forumRoot;
-	private FastMap<Integer, L2Player> _players;
-	private FastMap<Integer, L2Clan> _clans;
-	private FastMap<Integer, L2Castle> _castles;
-	private final FastMap<String, CommunityBoard> _boards;
-	private final int _sqlDPId;
-	private GameServerThread _gst;
-	private int _lastForumId = 1;
-	private boolean _isLoaded = false;
-	
-	private CommunityBoardManager(final int sqlDPId)
-	{
-		_sqlDPId = sqlDPId;
-		
-		_boards = new FastMap<String, CommunityBoard>();
-		_boards.put("_bbsloc", new RegionBoard(this));
-		_boards.put("_bbsfriend", new FriendBoard(this));
-		_boards.put("_bbsclan", new ClanBoard(this));
-		_boards.put("_bbscpost", new ClanPostBoard(this));
-		_boards.put("_bbsmail", new MailBoard(this));
-		_boards.put("_bbsmemo", new MemoBoard(this));
-		_boards.put("_bbshome", new TopBoard(this));
-		_boards.put("_bbserror", new ErrorBoard(this));
-		_forumRoot = new FastMap<Integer, Forum>();
-		_players = new FastMap<Integer, L2Player>();
-		_clans = new FastMap<Integer, L2Clan>();
-		_castles = new FastMap<Integer, L2Castle>();
-	}
-	
-	private void loadDataBase()
-	{
-		java.sql.Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("SELECT forum_id, forum_type, forum_owner_id FROM forums WHERE serverId=?");
-			statement.setInt(1, _sqlDPId);
-			ResultSet result = statement.executeQuery();
-			while (result.next())
-			{
-				Forum f = new Forum(_sqlDPId, Integer.parseInt(result.getString("forum_id")));
-				int type = result.getInt("forum_type");
-				if (type == Forum.CLAN)
-				{
-					if (getClan(result.getInt("forum_owner_id")) == null)
-					{
-						// delete this forum
-					}
-					else
-					{
-						getClan(result.getInt("forum_owner_id")).setForum(f);
-						_forumRoot.put(Integer.parseInt(result.getString("forum_id")), f);
-					}
-				}
-				else if (type == Forum.PLAYER)
-				{
-					if (getPlayer(result.getInt("forum_owner_id")) == null)
-					{
-						// delete this forum
-					}
-					else
-					{
-						getPlayer(result.getInt("forum_owner_id")).setForum(f);
-						_forumRoot.put(Integer.parseInt(result.getString("forum_id")), f);
-					}
-				}
-				if (f.getID() > _lastForumId)
-					_lastForumId = f.getID();
-			}
-			result.close();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			// _log.warning("data error on Forum (root): " + e);
-			e.printStackTrace();
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("SELECT introduction,clanId FROM clan_introductions WHERE serverId=?");
-			statement.setInt(1, _sqlDPId);
-			ResultSet result = statement.executeQuery();
-			while (result.next())
-				getClan(result.getInt("clanId")).setIntroduction(result.getString("introduction"));
-			result.close();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			// _log.warning("data error on Forum (root): " + e);
-			e.printStackTrace();
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-		int requestedClanNotices = 0;
-		try
-		{
-			for(L2Clan c : _clans.values())
-			{
-				if (c == null)
-					continue;
-				if (_players.containsKey(c.getLordObjId()) && _players.get(c.getLordObjId()).isOnline())
-				{
-					getGST().sendPacket(new RequestWorldInfo(RequestWorldInfo.CLAN_NOTICE_DATA,c.getClanId(), "", false));
-					requestedClanNotices++;	
-				}
-			}
-			_log.info("Requesting " + requestedClanNotices + " clan notices from GS.");
-		}
-		catch (Exception e)
-		{
-			_log.warning("Data error on Notice Load: " + e);
-			// e.printStackTrace();
-		}
-
-	}
-	
-	private int getNewForumId()
-	{
-		return ++_lastForumId;
-	}
-	
-	public void clean()
-	{
-		_forumRoot.clear();
-		_players.clear();
-		_clans.clear();
-		_lastForumId = 0;
-	}
-	
-	public void addPlayer(L2Player player)
-	{
-		if (!_players.containsKey(player.getObjId()))
-			_players.put(player.getObjId(), player);
-	}
-	
-	public void updatePlayer(int playerObjId, String name, String accountName, int playerLevel, int accessLevel, int playerClanId, boolean isOnline, int[] friendIDs)
-	{
-		if (_players.containsKey(playerObjId))
-		{
-			L2Player player = _players.get(playerObjId);
-			if (player.getName() != name)
-				player.setName(name);
-			if (player.getLevel() != playerLevel)
-				player.setLevel(playerLevel);
-			if (player.getAccessLevel() != accessLevel)
-				player.setAccessLevel(accessLevel);
-			if (player.getClanId() != playerClanId)
-				player.setClanId(playerClanId);
-			if (player.isOnline() != isOnline)
-				player.setIsOnline(isOnline);
-			player.removeAllFriends();
-			for(int i : friendIDs)
-			{
-				player.addFriend(i);
-			}			
-		}
-		else
-		{
-			L2Player player = new L2Player(playerObjId, name, accountName, playerLevel, accessLevel, playerClanId, isOnline);
-			for(int i : friendIDs)
-			{
-				player.addFriend(i);
-			}
-			_players.put(playerObjId, player);
-			_log.info("New player is successfully created with " + player.getName() + " name.");
-		}
-	}
-	
-	public L2Player getPlayer(int playerObjId)
-	{
-		if (!_players.containsKey(playerObjId))
-			return null;
-		return _players.get(playerObjId);
-	}
-	
-	public L2Player getPlayerByName(String playerName)
-	{
-		for (L2Player p : _players.values())
-			if (p.getName().equalsIgnoreCase(playerName.toLowerCase()))
-				return p;
-		return null;
-	}
-
-	public Collection<L2Player> getPlayerList()
-	{
-		return _players.values();
-	}
-	
-	public Forum getPlayerForum(int playerObjId)
-	{
-		if (!_players.containsKey(playerObjId))
-			return null;
-		L2Player p = _players.get(playerObjId);
-		Forum ret = p.getForum();
-		if (ret == null && p.getLevel() >= Config.MIN_PLAYER_LVL_FOR_FORUM)
-		{
-			ret = new Forum(_sqlDPId, getNewForumId(), p.getName(), Forum.PLAYER, p.getObjId());
-			p.setForum(ret);
-		}
-		return ret;
-	}
-	
-	public void addClan(L2Clan clan)
-	{
-		if (!_clans.containsKey(clan.getClanId()))
-			_clans.put(clan.getClanId(), clan);
-	}
-	
-	public void updateClan(int clanId, String clanName, int level, int lordObjId, String lordName, int members, String allyName, int[] alliance, boolean isNoticeEnabled)
-	{
-		if (_clans.containsKey(clanId))
-		{
-			L2Clan clan = _clans.get(clanId);
-			if (clan.getName() != clanName)
-				clan.setName(clanName);
-			if (clan.getClanLevel() != level)
-				clan.setLevel(level);
-			if (clan.getLordObjId() != lordObjId)
-			{
-				clan.setLordObjId(lordObjId);
-				clan.setLordName(lordName);
-			}
-			if (clan.getLordName() != lordName)
-				clan.setLordName(lordName);
-			if (clan.getMembersCount() != members)
-				clan.setMembersCount(members);
-			if (clan.getAllianceName() != allyName)
-				clan.setAllianceName(allyName);
-			clan.setAllianceClanIdList(alliance);
-			if (clan.isNoticeEnabled() != isNoticeEnabled)
-				clan.setNoticeEnabled(isNoticeEnabled);
-		}
-		else
-		{
-			L2Clan clan = new L2Clan(clanId, clanName, level, lordObjId, lordName, members, allyName, alliance, isNoticeEnabled);
-			_clans.put(clan.getClanId(), clan);
-			_log.info("New clan is successfully created with " + clan.getName() + " name.");
-		}
-	}
-	
-	public L2Clan getClan(int clanId)
-	{
-		if (!_clans.containsKey(clanId))
-			return null;
-		return _clans.get(clanId);
-	}
-	
-	public L2Clan getPlayersClan(int playerObjId)
-	{
-		if (!_players.containsKey(playerObjId))
-			return null;
-		int clanId = _players.get(playerObjId).getClanId();
-		if (!_clans.containsKey(clanId))
-			return null;
-		return _clans.get(clanId);
-	}
-
-	public Collection<L2Clan> getClanList()
-	{
-		return _clans.values();
-	}
-	
-	public Forum getClanForum(int clanId)
-	{
-		if (!_clans.containsKey(clanId))
-			return null;
-		L2Clan c = _clans.get(clanId);
-		Forum ret = c.getForum();
-		if (ret == null && c.getClanLevel() >= Config.MIN_CLAN_LVL_FOR_FORUM)
-		{
-			ret = new Forum(_sqlDPId, getNewForumId(), c.getName(), Forum.CLAN, c.getClanId());
-			c.setForum(ret);
-		}
-		return ret;
-	}
-	
-	public void addCastle(L2Castle castle)
-	{
-		_castles.put(castle.getId(), castle);
-	}
-	
-	public L2Castle getCastle(int castleId)
-	{
-		return _castles.get(castleId);
-	}
-	
-	public Collection<L2Castle> getCastleList()
-	{
-		return _castles.values();
-	}
-
-	public boolean isLoaded()
-	{
-		return _isLoaded;
-	}
-	
-	public void setLoaded()
-	{
-		loadDataBase();
-		_isLoaded = true;
-	}
-		
-	public void storeClanIntro(int clanId, String intro)
-	{
-		java.sql.Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("INSERT INTO clan_introductions (serverId,clanId,introduction) values (?,?,?) ON DUPLICATE KEY UPDATE introduction = ?");
-			statement.setInt(1, _sqlDPId);
-			statement.setInt(2, clanId);
-			statement.setString(3, intro);
-			statement.setString(4, intro);
-			statement.execute();
-			statement.close();
-			
-		}
-		catch (Exception e)
-		{
-			_log.warning("error while saving new Topic to db " + e);
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-	}
-	
-	public final void parseCmd(final int playerObjId, final String cmd)
-	{
-		String board = cmd.split(";")[0];
-		try
-		{
-			if (_boards.containsKey(board))
-				_boards.get(board).parseCmd(playerObjId, cmd);
-			else
-				_boards.get("_bbserror").parseCmd(playerObjId, "noBoard;" + cmd);
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	public final void parseWrite(final int playerObjId, final String url, final String arg1, final String arg2, final String arg3, final String arg4, final String arg5)
-	{
-		try
-		{
-			if (_boards.containsKey(url))
-				_boards.get(url).parseWrite(playerObjId, arg1, arg2, arg3, arg4, arg5);
-			else
-				_boards.get("_bbserror").parseCmd(playerObjId, "noBoard;" + url);
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	public final int getSQLDPId()
-	{
-		return _sqlDPId;
-	}
-	
-	protected final void sendPacket(final BaseWritePacket packet)
-	{
-		_gst.sendPacket(packet);
-	}
-	
-	public final void setGST(final GameServerThread gst)
-	{
-		_gst = gst;
-	}
-	
-	public final GameServerThread getGST()
-	{
-		return _gst;
-	}
-}

+ 0 - 38
L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/AdminBoard.java

@@ -1,38 +0,0 @@
-/*
- * 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.communityserver.communityboard.boards;
-
-import com.l2jserver.communityserver.communityboard.CommunityBoard;
-import com.l2jserver.communityserver.communityboard.CommunityBoardManager;
-
-public class AdminBoard extends CommunityBoard
-{
-	public AdminBoard(final CommunityBoardManager mgr)
-	{
-		super(mgr);
-	}
-	
-	@Override
-	public final void parseCmd(final int playerObjId, final String cmd)
-	{
-
-	}
-	
-	@Override
-	public final void parseWrite(final int playerObjId, final String ar1, final String ar2, final String ar3, final String ar4, final String ar5)
-	{
-		
-	}
-}

+ 0 - 379
L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/ClanBoard.java

@@ -1,379 +0,0 @@
-/*
- * 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.communityserver.communityboard.boards;
-
-import java.text.DateFormat;
-import java.util.Date;
-import java.util.logging.Logger;
-
-import javolution.text.TextBuilder;
-
-import com.l2jserver.communityserver.Config;
-import com.l2jserver.communityserver.cache.HtmCache;
-import com.l2jserver.communityserver.communityboard.CommunityBoard;
-import com.l2jserver.communityserver.communityboard.CommunityBoardManager;
-import com.l2jserver.communityserver.model.Forum;
-import com.l2jserver.communityserver.model.L2Clan;
-import com.l2jserver.communityserver.model.L2Player;
-import com.l2jserver.communityserver.model.Post;
-import com.l2jserver.communityserver.model.Topic;
-import com.l2jserver.communityserver.model.Topic.ConstructorType;
-import com.l2jserver.communityserver.network.writepackets.PlayerSendMessage;
-import com.l2jserver.communityserver.network.writepackets.RequestWorldInfo;
-
-public final class ClanBoard extends CommunityBoard
-{
-	private static Logger _log = Logger.getLogger(ClanBoard.class.getName());
-	public ClanBoard(final CommunityBoardManager mgr)
-	{
-		super(mgr);
-	}
-	
-	@Override
-	public void parseCmd(final int playerObjId, final String cmd)
-	{
-		if (cmd.equals("_bbsclan") || cmd.equals("_bbsclan;clan;0"))
-			showMainPage(playerObjId, 1);
-		else if (cmd.split(";")[1].equalsIgnoreCase("list"))
-			showMainPage(playerObjId, Integer.valueOf(cmd.split(";")[2]));
-		else if (cmd.split(";")[1].equalsIgnoreCase("clan"))
-		{
-			if (super.getCommunityBoardManager().getClan(Integer.valueOf(cmd.split(";")[2])).getClanLevel() < Config.MIN_CLAN_LVL_FOR_FORUM)
-			{
-				if (Config.MIN_CLAN_LVL_FOR_FORUM == 2)
-					super.getCommunityBoardManager().getGST().sendPacket(new PlayerSendMessage(playerObjId,PlayerSendMessage.NO_CB_IN_MY_CLAN,""));
-				else
-				{
-					String message = "There are no communities in my clan. Clan communities are allowed for clans with skill levels of " + Config.MIN_CLAN_LVL_FOR_FORUM + " and higher.";
-					super.getCommunityBoardManager().getGST().sendPacket(new PlayerSendMessage(playerObjId,PlayerSendMessage.TEXT_MESSAGE,message));
-				}
-				return;
-			}
-			showClanPage(playerObjId, Integer.valueOf(cmd.split(";")[2]));
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("notice"))
-		{
-			if (cmd.split(";").length == 3)
-			{
-				boolean val = cmd.split(";")[2].equalsIgnoreCase("true");
-				super.getCommunityBoardManager().getPlayersClan(playerObjId).setNoticeEnabled(val);
-				super.getCommunityBoardManager().getGST().sendPacket(new RequestWorldInfo(RequestWorldInfo.CLAN_NOTICE_FLAG,super.getCommunityBoardManager().getPlayer(playerObjId).getClanId(),null,val));
-			}
-			showNoticePage(playerObjId);	
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("management"))
-		{
-			if (super.getCommunityBoardManager().getPlayersClan(playerObjId).getLordObjId() != playerObjId)
-				super.getCommunityBoardManager().getGST().sendPacket(new PlayerSendMessage(playerObjId,PlayerSendMessage.ONLY_THE_CLAN_LEADER_IS_ENABLED,""));
-			else
-				showClanManagementPage(playerObjId, Integer.valueOf(cmd.split(";")[2]));
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("mail"))
-			showClanMailPage(playerObjId, Integer.valueOf(cmd.split(";")[2]));
-		else if (cmd.split(";")[1].equalsIgnoreCase("permission"))
-		{
-			int topicId = (cmd.split(";")[2].equalsIgnoreCase("cbb") ? Topic.BULLETIN:Topic.ANNOUNCE);
-			L2Player player = super.getCommunityBoardManager().getPlayer(playerObjId);
-			Forum clanForum = getCommunityBoardManager().getClanForum(player.getClanId());
-			int perNon = clanForum.gettopic(topicId).getPermissions();
-			int perMem = perNon % 10;
-			perNon = (perNon - perMem) / 10;
-			if (cmd.split(";")[3].equalsIgnoreCase("non"))
-				perNon = (perNon + 1) % 3;
-			else
-				perMem = (perMem + 1) % 3;
-			clanForum.gettopic(topicId).setPermissions(perNon * 10 + perMem);
-			showClanManagementPage(playerObjId, player.getClanId());
-		}
-		else
-			_log.info("Clan command missing: " + cmd.split(";")[1]);
-	}
-	
-	public final void showMainPage(final int playerObjId, int index)
-	{
-		L2Clan ownClan = super.getCommunityBoardManager().getPlayersClan(playerObjId);
-		String content = HtmCache.getInstance().getHtm("data/staticfiles/html/clanlist.htm");
-		if (ownClan != null)
-		{
-			content = content.replaceAll("%clanid%", String.valueOf(ownClan.getClanId()));
-			content = content.replaceAll("%clanhomename%", ownClan.getName());
-		}
-		else
-		{
-			content = content.replaceAll("%clanid%", "0");
-			content = content.replaceAll("%clanhomename%", "");			
-		}
-		
-		TextBuilder cList = new TextBuilder();
-		int i = 0;
-		for (L2Clan c: super.getCommunityBoardManager().getClanList())
-		{
-			if (c == null)
-				continue;
-			if (i > ((index - 1) * 10 + 9))
- 			{
- 				break;
- 			}
-			if (i++ >= ((index - 1) * 10))
- 			{
-				cList.append("<img src=\"L2UI.SquareBlank\" width=\"750\" height=\"3\">");
-				cList.append("<table border=0 cellspacing=0 cellpadding=0 width=610>");
-				cList.append("<tr> ");
-				cList.append("<td FIXWIDTH=5></td>");
-				cList.append("<td FIXWIDTH=240 align=center><a action=\"bypass _bbsclan;clan;" + c.getClanId() + "\">" + c.getName() + "</a></td>");
-				cList.append("<td FIXWIDTH=240 align=center>" + c.getLordName() + "</td>");
-				cList.append("<td FIXWIDTH=100 align=center>" + c.getClanLevel() + "</td>");
-				cList.append("<td FIXWIDTH=160 align=center>" + c.getMembersCount() + "</td>");
-				cList.append("<td FIXWIDTH=5></td>");
-				cList.append("</tr>");
-				cList.append("<tr><td height=5></td></tr>");
-				cList.append("</table>");
-				cList.append("<img src=\"L2UI.SquareBlank\" width=\"750\" height=\"3\">");
-				cList.append("<img src=\"L2UI.SquareGray\" width=\"750\" height=\"1\">");
- 			}
-		}
-		content = content.replaceAll("%clanlist%", cList.toString());
-		cList.clear();
- 		if (index == 1)
- 		{
-			cList.append("<td><button action=\"\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
- 		}
- 		else
- 		{
-			cList.append("<td><button action=\"bypass _bbsclan;list;" + (index - 1) + "\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
- 		}
-
- 		int nbp;
-		nbp = super.getCommunityBoardManager().getClanList().size() / 10;
-		if (nbp * 10 != super.getCommunityBoardManager().getClanList().size())
- 		{
- 			nbp++;
- 		}
-		for (i = 1; i <= nbp; i++)
- 		{
- 			if (i == index)
- 			{
-				cList.append("<td> " + i + " </td>");
- 			}
- 			else
- 			{
-				cList.append("<td><a action=\"bypass _bbsclan;list;" + i + "\"> " + i + " </a></td>");
- 			}
- 		}
- 		if (index == nbp)
- 		{
-			cList.append("<td><button action=\"\" back=\"l2ui_ch3.next1_down\" fore=\"l2ui_ch3.next1\" width=16 height=16 ></td>");
- 		}
- 		else
- 		{
-			cList.append("<td><button action=\"bypass _bbsclan;list;" + (index + 1) + "\" back=\"l2ui_ch3.next1_down\" fore=\"l2ui_ch3.next1\" width=16 height=16 ></td>");
- 		}
-		content = content.replaceAll("%clanlistlength%", cList.toString());
-
-		super.send(playerObjId, content);
-	}
-
-	public final String getAnnoTemplate(Post p, int clanId)
-	{
-		TextBuilder template = new TextBuilder();
-		template.append("<tr><td height=10></td></tr>");
-		template.append("<tr>");
-		template.append("<td fixWIDTH=100 align=center valign=top>[&\\$429;]</td>");
-		template.append("<td fixWIDTH=460 align=left valign=top><a action=\"bypass _bbscpost;read;announce;" + clanId + ";" + p.getID() + "\">" + p.getTypeName() + p.getTitle() + "</a></td>");
-		template.append("<td fixWIDTH=80 align=right valign=top>&\\$418; :</td>");
-		template.append("<td fixWIDTH=100 align=right valign=top>" + DateFormat.getInstance().format(new Date(p.getDate())) + "</td>");
-		template.append("<td FIXWIDTH=10></td>");
-		template.append("</tr>");
-		template.append("<tr><td height=2></td></tr>");
-		return template.toString();
-	}
-	
-	public final String getCbbTemplate(Post p, int clanId)
-	{
-		TextBuilder template = new TextBuilder();
-		template.append("<table border=0 cellspacing=0 cellpadding=0 width=750>");
-		template.append("<tr><td height=8></td></tr>");
-		template.append("<tr>");
-		template.append("<td FIXWIDTH=45 align=center>[New]</td>");
-		template.append("<td FIXWIDTH=400><a action=\"bypass _bbscpost;read;cbb;" + clanId + ";" + p.getID() + "\">" + p.getTypeName() + p.getTitle() + "</a></td>");
-		template.append("<td FIXWIDTH=100 align=center>" + super.getCommunityBoardManager().getPlayer(p.getOwnerId()).getName() + "</td>");
-		template.append("<td FIXWIDTH=100 align=center>" + DateFormat.getInstance().format(new Date(p.getDate())) + "</td>");
-		template.append("<td FIXWIDTH=100 align=center>" + p.getReadCount() + "</td>");
-		template.append("<td FIXWIDTH=5></td>");
-		template.append("</tr>");
-		template.append("</table>");
-		template.append("<img src=\"L2UI.squareblank\" width=\"1\" height=\"5\">");
-		template.append("<img src=\"L2UI.squaregray\" width=\"750\" height=\"1\">");
-		return template.toString();
-	}
-	
-	public final void showClanPage(final int playerObjId, int clanId)
-	{
-		L2Player player = super.getCommunityBoardManager().getPlayer(playerObjId);
-		L2Clan clan = super.getCommunityBoardManager().getClan(clanId);
-		String content;
-		if (player.getClanId() != clanId)
-			content = HtmCache.getInstance().getHtm("data/staticfiles/html/clanhome.htm");
-		else if (clan.getLordObjId() == playerObjId)
-			content = HtmCache.getInstance().getHtm("data/staticfiles/html/clanhome-leader.htm");
-		else
-			content = HtmCache.getInstance().getHtm("data/staticfiles/html/clanhome-member.htm");
-		
-		Forum clanForum = super.getCommunityBoardManager().getClanForum(clanId);
-		Post[] p = clanForum.gettopic(Topic.ANNOUNCE).getLastTwoPosts();
-		if (p[0] != null)
-		{
-			String cbb = getAnnoTemplate(p[0], clanId);
-			if (p[1] != null)
-				cbb += getAnnoTemplate(p[1], clanId);
-			content = content.replaceAll("%advert%", cbb);
-		}
-		else
-			content = content.replaceAll("%advert%", "");
-
-		p = clanForum.gettopic(Topic.BULLETIN).getLastTwoPosts();
-		if (p[0] != null)
-		{
-			String cbb = getCbbTemplate(p[0], clanId);
-			if (p[1] != null)
-				cbb += getCbbTemplate(p[1], clanId);
-			content = content.replaceAll("%clanbbs%", cbb);
-		}
-		else
-			content = content.replaceAll("%clanbbs%", "");
-		content = content.replaceAll("%clanIntro%", clan.getIndtroduction());
-		content = content.replaceAll("%clanid%", String.valueOf(clanId));
-		content = content.replaceAll("%clanName%", clan.getName());
-		content = content.replaceAll("%clanLvL%", String.valueOf(clan.getClanLevel()));
-		content = content.replaceAll("%clanMembers%", String.valueOf(clan.getMembersCount()));
-		content = content.replaceAll("%clanLeader%", clan.getLordName());
-		String ally = "";
-		for (int i : clan.getAllianceClanIdList())
-		{
-			if (ally == "")
-				ally += super.getCommunityBoardManager().getClan(i).getName();
-			else
-				ally += ", " + super.getCommunityBoardManager().getClan(i).getName();
-		}
-		content = content.replaceAll("%allyName%", ally);
-		
-		super.send(playerObjId, content);
-	}
-
-	public final void showClanManagementPage(final int playerObjId, int clanId)
-	{
-		L2Clan clan = super.getCommunityBoardManager().getPlayersClan(playerObjId);
-		if (clan.getClanId() != clanId)
-		{
-			return;
-		}
-		Forum clanForum = getCommunityBoardManager().getClanForum(clanId);
-		String content;
-		content = HtmCache.getInstance().getHtm("data/staticfiles/html/clanhome-management.htm");
-		
-		content = content.replaceAll("%clanid%", String.valueOf(clanId));
-		content = content.replaceAll("%clanName%", clan.getName());
-		String[] perString = {"No Access","Read Access","Write Access","No Access"};
-		int perNon = clanForum.gettopic(Topic.ANNOUNCE).getPermissions();
-		int perMem = perNon % 10;
-		perNon = (perNon - perMem) / 10;
-		content = content.replaceAll("%curAnnoNonPer%", perString[perNon]);
-		content = content.replaceAll("%curAnnoMemPer%", perString[perMem]);
-		content = content.replaceAll("%nextAnnoNonPer%", perString[perNon + 1]);
-		content = content.replaceAll("%nextAnnoMemPer%", perString[perMem + 1]);
-		perNon = clanForum.gettopic(Topic.BULLETIN).getPermissions();
-		perMem = perNon % 10;
-		perNon = (perNon - perMem) / 10;
-		content = content.replaceAll("%curBullNonPer%", perString[perNon]);
-		content = content.replaceAll("%curBullMemPer%", perString[perMem]);
-		content = content.replaceAll("%nextBullNonPer%", perString[perNon + 1]);
-		content = content.replaceAll("%nextBullMemPer%", perString[perMem + 1]);
-		super.sendWrite(playerObjId, content, clan.getIndtroduction(), "", "");
-	}
-
-	public final void showClanMailPage(final int playerObjId, int clanId)
-	{
-		L2Clan clan = super.getCommunityBoardManager().getPlayersClan(playerObjId);
-		if (clan.getClanId() != clanId)
-		{
-			return;
-		}
-		String content;
-		content = HtmCache.getInstance().getHtm("data/staticfiles/html/clanhome-mail.htm");
-		
-		content = content.replaceAll("%clanid%", String.valueOf(clanId));
-		content = content.replaceAll("%clanName%", clan.getName());
-		
-		super.send(playerObjId, content);
-	}
-	
-	public final void showNoticePage(final int playerObjId)
-	{
-		String content = HtmCache.getInstance().getHtm("data/staticfiles/html/clanhome-notice.htm");
-		L2Clan clan = super.getCommunityBoardManager().getPlayersClan(playerObjId);
-		content = content.replaceAll("%clanid%", String.valueOf(clan.getClanId()));
-		content = content.replaceAll("%enabled%", (clan.isNoticeEnabled() ? "True":"False"));
-		content = content.replaceAll("%flag%", (clan.isNoticeEnabled() ? "False":"True"));
-		super.sendWrite(playerObjId, content, clan.getNotice(), "", "");
-	}
-
-	@Override
-	public final void parseWrite(final int playerObjId, final String ar1, final String ar2, final String ar3, final String ar4, final String ar5)
-	{
-		if (ar1.equalsIgnoreCase("intro"))
-		{
-			L2Player player = super.getCommunityBoardManager().getPlayer(playerObjId);
-			if (Integer.valueOf(ar2) != player.getClanId())
-				return;
-			L2Clan clan = super.getCommunityBoardManager().getClan(player.getClanId());
-			String intro = super.edtiPlayerTxT(ar3);
-			clan.setIntroduction(intro);
-			super.getCommunityBoardManager().storeClanIntro(player.getClanId(), intro);
-			showClanManagementPage(playerObjId, Integer.valueOf(ar2));
-		}
-		else if (ar1.equalsIgnoreCase("notice"))
-		{
-			String notice = super.edtiPlayerTxT(ar3);
-			if (notice.length() > 4096)
-				notice = notice.substring(0, 4096);
-			L2Clan c = super.getCommunityBoardManager().getPlayersClan(playerObjId);
-			c.setNotice(notice);
-			super.getCommunityBoardManager().getGST().sendPacket(new RequestWorldInfo(RequestWorldInfo.CLAN_NOTICE_UPDATE,super.getCommunityBoardManager().getPlayer(playerObjId).getClanId(),notice,c.isNoticeEnabled()));
-			showNoticePage(playerObjId);	
-		}
-		else if (ar1.equalsIgnoreCase("mail"))
-		{
-			L2Clan sender = super.getCommunityBoardManager().getPlayersClan(playerObjId);
-			for (L2Player p: super.getCommunityBoardManager().getPlayerList())
-			{
-				if (p.getClanId() == sender.getClanId())
-				{
-					Forum receiverForum = getCommunityBoardManager().getPlayerForum(p.getObjId());
-					int postId = receiverForum.gettopic(Topic.INBOX).getNewPostId();
-					Post post = new Post(ConstructorType.CREATE, receiverForum.getSqlDPId(), postId, playerObjId, sender.getName(), System.currentTimeMillis(), Topic.INBOX, receiverForum.getID(), super.edtiPlayerTxT(ar4), super.edtiPlayerTxT(ar5), 0, 0);
-					receiverForum.gettopic(Topic.INBOX).addPost(post);
-					if (p.isOnline())
-					{
-						super.getCommunityBoardManager().getGST().sendPacket(new PlayerSendMessage(p.getObjId(),-1,""));
-						super.getCommunityBoardManager().getGST().sendPacket(new PlayerSendMessage(p.getObjId(),1233,""));
-					}
-				}
-			}
-			showClanPage(playerObjId, sender.getClanId());
-		}
-		else
-			_log.info("Memo Write command missing: " + ar1);	
-	}
-}

+ 0 - 421
L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/ClanPostBoard.java

@@ -1,421 +0,0 @@
-/*
- * 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.communityserver.communityboard.boards;
-
-import java.text.DateFormat;
-import java.util.Collection;
-import java.util.Date;
-import java.util.logging.Logger;
-
-import javolution.text.TextBuilder;
-import javolution.util.FastList;
-import com.l2jserver.communityserver.cache.HtmCache;
-import com.l2jserver.communityserver.communityboard.CommunityBoard;
-import com.l2jserver.communityserver.communityboard.CommunityBoardManager;
-import com.l2jserver.communityserver.model.Comment;
-import com.l2jserver.communityserver.model.Forum;
-import com.l2jserver.communityserver.model.Topic;
-import com.l2jserver.communityserver.model.Post;
-import com.l2jserver.communityserver.model.Topic.ConstructorType;
-import com.l2jserver.communityserver.network.writepackets.PlayerSendMessage;
-
-public final class ClanPostBoard extends CommunityBoard
-{
-	private static Logger _log = Logger.getLogger(ClanPostBoard.class.getName());
-	public ClanPostBoard(final CommunityBoardManager mgr)
-	{
-		super(mgr);
-	}
-	
-	@Override
-	public void parseCmd(final int playerObjId, final String cmd)
-	{
-		int clanId = Integer.valueOf(cmd.split(";")[3]);
-		Forum clanForum = getCommunityBoardManager().getClanForum(clanId);
-		int type;
-		if (cmd.split(";")[2].equalsIgnoreCase("announce"))
-			type = Topic.ANNOUNCE;
-		else if (cmd.split(";")[2].equalsIgnoreCase("cbb"))
-			type = Topic.BULLETIN;
-		else
-		{
-			_log.info("Clan Post Board command error: " + cmd);
-			return;
-		}
-		int perNon = clanForum.gettopic(type).getPermissions();
-		int perMem = perNon % 10;
-		perNon = (perNon - perMem) / 10;
-		boolean isPlayerMember = getCommunityBoardManager().getPlayer(playerObjId).getClanId() == clanId;
-		boolean isLeader = getCommunityBoardManager().getClan(clanId).getLordObjId() == playerObjId;
-		if (!isLeader && ((isPlayerMember && perMem == 0) || (!isPlayerMember && perNon == 0)))
-		{
-			// TODO: this way Clan Post Board command missing part could be missed
-			super.getCommunityBoardManager().getGST().sendPacket(new PlayerSendMessage(playerObjId,PlayerSendMessage.NO_READ_PERMISSION,""));
-			return;
-		}
-		
-		if (cmd.split(";")[1].equalsIgnoreCase("list"))
-		{
-			int index = 1;
-			if (cmd.split(";").length == 5)
-				index = Integer.valueOf(cmd.split(";")[4]);
-			showPage(playerObjId, clanForum, type, index);
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("read"))
-		{
-			Topic t = clanForum.gettopic(type);
-			Post p = t.getPost(Integer.valueOf(cmd.split(";")[4]));
-			if (p == null)
-				_log.info("Missing post: " + cmd);
-			else
-			{
-				if (cmd.split(";").length > 5)
-				{
-					_log.info("Index: " + cmd.split(";")[5] + ";" + cmd.split(";")[6]);
-					showPost(playerObjId, t, p, clanId, type, Integer.valueOf(cmd.split(";")[5]), Integer.valueOf(cmd.split(";")[6]));
-				}
-				else
-					showPost(playerObjId, t, p, clanId, type, 1, 1);
-			}
-		}
-		else if (!isLeader && ((isPlayerMember && perMem == 1) || (!isPlayerMember && perNon == 1)))
-		{
-			// TODO: this way Clan Post Board command missing part could be missed
-			super.getCommunityBoardManager().getGST().sendPacket(new PlayerSendMessage(playerObjId,PlayerSendMessage.NO_WRITE_PERMISSION,""));
-			return;
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("crea"))
-		{
-			showWrite(playerObjId, null, clanId, type);
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("del"))
-		{
-			clanForum.gettopic(type).rmPostByID(Integer.valueOf(cmd.split(";")[4]));
-			showPage(playerObjId, clanForum, type, 1);
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("delcom"))
-		{
-			Topic t = clanForum.gettopic(type);
-			Post p = t.getPost(Integer.valueOf(cmd.split(";")[4]));
-			p.rmCommentByID(Integer.valueOf(cmd.split(";")[5]));
-			showPost(playerObjId, t, p, clanId, type, 1, 1);
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("edit"))
-		{
-			Post p = clanForum.gettopic(type).getPost(Integer.valueOf(cmd.split(";")[4]));
-			showWrite(playerObjId, p, clanId, type);
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("reply"))
-		{
-			Post p = clanForum.gettopic(type).getPost(Integer.valueOf(cmd.split(";")[4]));
-			showReply(playerObjId, p, clanId, type);
-		}
-		else
-			_log.info("Clan Post Board command missing: " + cmd.split(";")[1]);
-	}
-	
-	private String replace(String txt, int type)
-	{
-		String content = txt;
-		switch (type)
-		{
-			case Topic.ANNOUNCE:
-				content = content.replaceAll("%link%", "<a action=\"bypass _bbscpost;list;announce;%clanid%\">Announcement</a>");
-				content = content.replaceAll("%type%", "announce");
-				content = content.replaceAll("%topicId%", String.valueOf(Topic.ANNOUNCE));
-				content = content.replaceAll("%combobox%", "Advertise;Miscellaneous");
-				break;
-			case Topic.BULLETIN:
-				content = content.replaceAll("%link%", "<a action=\"bypass _bbscpost;list;cbb;%clanid%\">Free Community</a>");
-				content = content.replaceAll("%type%", "cbb");
-				content = content.replaceAll("%topicId%", String.valueOf(Topic.BULLETIN));
-				content = content.replaceAll("%combobox%", "Information;Miscellaneous");
-				break;
-		}
-
-		return content;
-	}
-	
-	public final void showPage(final int playerObjId, Forum f, int type, int index)
-	{
-		String content = HtmCache.getInstance().getHtm("data/staticfiles/html/clanpost.htm");
-		if (f == null)
-		{
-			_log.info("Forum is NULL!!!");
-			super.send(playerObjId, content);
-			return;
-		}
-		
-		Topic t = f.gettopic(type);
-		TextBuilder mList = new TextBuilder();
-		int i = 0;
-		for (Post p : t.getAllPosts())
-		{
-			if (i > ((index - 1) * 10 + 9))
- 			{
- 				break;
- 			}
-			if (i++ >= ((index - 1) * 10))
- 			{
-				mList.append("<img src=\"L2UI.SquareBlank\" width=\"750\" height=\"3\">");
-				mList.append("<table border=0 cellspacing=0 cellpadding=0 width=750>");
-				mList.append("<tr> ");
-				mList.append("<td FIXWIDTH=5></td>");
-				mList.append("<td FIXWIDTH=80 align=center>" + p.getID() + "</td>");
-				mList.append("<td FIXWIDTH=340><a action=\"bypass _bbscpost;read;%type%;" + f.getOwner() + ";" + p.getID() + "\">" + p.getTypeName() + p.getTitle() + "</a></td>");
-				mList.append("<td FIXWIDTH=120 align=center>" + getCommunityBoardManager().getPlayer(p.getOwnerId()).getName() + "</td>");
-				mList.append("<td FIXWIDTH=120 align=center>" + DateFormat.getInstance().format(new Date(p.getDate())) + "</td>");
-				mList.append("<td FIXWIDTH=80 align=center>" + p.getReadCount() + "</td>");
-				mList.append("<td FIXWIDTH=5></td>");
-				mList.append("</tr>");
-				mList.append("<tr><td height=5></td></tr>");
-				mList.append("</table>");
-				mList.append("<img src=\"L2UI.SquareBlank\" width=\"750\" height=\"3\">");
-				mList.append("<img src=\"L2UI.SquareGray\" width=\"750\" height=\"1\">");
- 			}
-		}
-		content = content.replaceAll("%postList%", mList.toString());
-		mList.clear();
- 		if (index == 1)
- 		{
-			mList.append("<td><button action=\"\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
- 		}
- 		else
- 		{
-			mList.append("<td><button action=\"bypass _bbscpost;list;%type%;%clanid%;" + (index - 1) + "\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
- 		}
-
- 		int nbp;
-		nbp = t.getAllPosts().size() / 10;
-		if (nbp * 10 != t.getAllPosts().size())
- 		{
- 			nbp++;
- 		}
-		for (i = 1; i <= nbp; i++)
- 		{
- 			if (i == index)
- 			{
-				mList.append("<td> " + i + " </td>");
- 			}
- 			else
- 			{
-				mList.append("<td><a action=\"bypass _bbscpost;list;%type%;%clanid%;" + i + "\"> " + i + " </a></td>");
- 			}
- 		}
- 		if (index == nbp)
- 		{
-			mList.append("<td><button action=\"\" back=\"l2ui_ch3.next1_down\" fore=\"l2ui_ch3.next1\" width=16 height=16 ></td>");
- 		}
- 		else
- 		{
-			mList.append("<td><button action=\"bypass _bbscpost;list;%type%;%clanid%;" + (index + 1) + "\" back=\"l2ui_ch3.next1_down\" fore=\"l2ui_ch3.next1\" width=16 height=16 ></td>");
- 		}
-		content = content.replaceAll("%postListLength%", mList.toString());
-		content = replace(content, type);
-		content = content.replaceAll("%clanid%", String.valueOf(f.getOwner()));
-
-		super.send(playerObjId, content);
-	}
-	
-	public final void showWrite(final int playerObjId, Post p, int clanId, int type)
-	{
-		String title = " ";
-		String message = " ";
-		String content = HtmCache.getInstance().getHtm("data/staticfiles/html/clanpost-write.htm");
-		content = replace(content, type);
-		content = content.replaceAll("%clanid%", String.valueOf(clanId));
-		if (p == null)
-		{
-			content = content.replaceAll("%job%", "new");
-			content = content.replaceAll("%postId%", "-1");
-		}
-		else
-		{
-			content = content.replaceAll("%job%", "edit");
-			content = content.replaceAll("%postId%", String.valueOf(p.getID()));
-			title = p.getTitle();
-			message = p.getText();
-		}
-		
-		super.sendWrite(playerObjId, content, message, title, title);
-	}
-
-	public final void showReply(final int playerObjId, Post p, int clanId, int type)
-	{
-		if (p == null)
-		{
-			showWrite(playerObjId, p, clanId, type);
-			return;
-		}
-		String title = " ";
-		String message = " ";
-		String content = HtmCache.getInstance().getHtm("data/staticfiles/html/clanpost-write.htm");
-		content = replace(content, type);
-		content = content.replaceAll("%clanid%", String.valueOf(clanId));
-		content = content.replaceAll("%job%", "reply");
-		content = content.replaceAll("%postId%", String.valueOf(p.getID()));
-		
-		super.sendWrite(playerObjId, content, message, title, " ");
-	}
-	
-	public final void showPost(final int playerObjId, Topic t, Post p, int clanId, int type, int indexR, int indexC)
-	{
-		p.increaseReadCount();
-		String content = HtmCache.getInstance().getHtm("data/staticfiles/html/clanpost-show.htm");
-		content = content.replaceAll("%postTitle%", p.getTitle());
-		content = content.replaceAll("%postId%", String.valueOf(p.getID()));
-		Post parent = p;
-		if (p.getParentId() != -1)
-		{
-			content = content.replaceAll("%postParentId%", String.valueOf(p.getParentId()));
-			parent = t.getPost(p.getParentId());
-		}
-		else
-			content = content.replaceAll("%postParentId%", String.valueOf(p.getID()));
-		content = content.replaceAll("%postOwnerName%", getCommunityBoardManager().getPlayer(p.getOwnerId()).getName());
-		content = content.replaceAll("%postReadCount%", String.valueOf(p.getReadCount()));
-		content = content.replaceAll("%postDate%", DateFormat.getInstance().format(new Date(p.getDate())));
-		content = content.replaceAll("%mes%", p.getText());
-		
-		// reply list
-		TextBuilder mList = new TextBuilder();
-		int i = 1;
-		FastList<Post> childrenList = t.getChildrenPosts(parent); 
-		for (Post child : childrenList)
-		{
-			if (i++ == indexR)
-			{
-				mList.append("<table border=0 cellspacing=5 cellpadding=0 WIDTH=750>");
-				mList.append("<tr>");
-				mList.append("<td WIDTH=60 align=center>" + child.getID() + "</td>");
-				if (child != p)
-					mList.append("<td width=415><a action=\"bypass _bbscpost;read;%type%;" + clanId + ";" + child.getID() + "\">" + child.getTypeName() + child.getTitle() + "</a></td>");
-				else
-					mList.append("<td width=415>" + child.getTypeName() + child.getTitle() + "</td>");
-				mList.append("<td WIDTH=130 align=center>" + getCommunityBoardManager().getPlayer(child.getOwnerId()).getName() + "</td>");
-				mList.append("<td WIDTH=80 align=center>" + DateFormat.getInstance().format(new Date(child.getDate())) + "</td>");
-				mList.append("<td WIDTH=65 align=center>" + child.getReadCount() + "</td>");
-				mList.append("</tr>");
-				mList.append("</table>");
-			}
-		}
-		content = content.replaceAll("%replyList%", mList.toString());
-		if (indexR == 1)
-			content = content.replaceAll("%prevReply%", "[Previous Reply]");
-		else
-			content = content.replaceAll("%prevReply%", "<a action=\"bypass _bbscpost;read;%type%;" + clanId + ";" + p.getID() + ";" + (indexR - 1) + ";" + indexC + "\">[Previous Reply]</a>");
-		content = content.replaceAll("%replyCount%", indexR + "/" + childrenList.size());
-		if (indexR == childrenList.size())
-			content = content.replaceAll("%nextReply%", "[Next Reply]");
-		else
-			content = content.replaceAll("%nextReply%", "<a action=\"bypass _bbscpost;read;%type%;" + clanId + ";" + p.getID() + ";" + (indexR + 1) + ";" + indexC + "\">[Next Reply]</a>");
-		
-		// comment list
-		mList.clear();
-		i = 1;
-		Collection<Comment> commentsList = p.getAllComments();
-		int csize = commentsList.size(); 
-		if (csize == 0)
-			csize = 1;
-		else
-			for (Comment c : commentsList)
-			{
-				if (i++ == indexC)
-				{
-					mList.append("<tr><td><img src=\"L2UI.squaregray\" width=\"750\" height=\"1\"></td></tr>");
-					mList.append("<tr><td>");
-					mList.append("<table>");
-					mList.append("<tr>");
-					mList.append("<td WIDTH=100 valign=top>" + getCommunityBoardManager().getPlayer(c.getOwnerId()).getName() + "</td>");
-					mList.append("<td width=10 valign=top><img src=\"L2UI.squaregray\" width=\"5\" height=\"28\"></td>");
-					mList.append("<td FIXWIDTH=560 valign=top><font color=\"AAAAAA\">" + c.getText() + "</font></td>");
-					mList.append("<td WIDTH=20 valign=top><a action=\"bypass _bbscpost;delcom;%type%;" + clanId + ";" + p.getID() + ";" + c.getID() + "\">&\\$425;</a></td>");
-					mList.append("<td WIDTH=60 valign=top>" + DateFormat.getInstance().format(new Date(c.getDate())) + "</td>");
-					mList.append("</tr>");
-					mList.append("</table>");
-					mList.append("</td></tr>");
-				}
-			}
-		content = content.replaceAll("%commentList%", mList.toString());
-		if (indexC == 1)
-			content = content.replaceAll("%prevCom%", "[Previous Comment]");
-		else
-			content = content.replaceAll("%prevCom%", "<a action=\"bypass _bbscpost;read;%type%;" + clanId + ";" + p.getID() + ";" + indexR + ";" + (indexC - 1) + "\">[Previous Comment]</a>");
-		content = content.replaceAll("%comCount%", indexC + "/" + csize);
-		if (indexC == csize)
-			content = content.replaceAll("%nextCom%", "[Next Comment]");
-		else
-			content = content.replaceAll("%nextCom%", "<a action=\"bypass _bbscpost;read;%type%;" + clanId + ";" + p.getID() + ";" + indexR + ";" + (indexC + 1) + "\">[Next Comment]</a>");
-
-		content = replace(content, type);
-		content = content.replaceAll("%clanid%", String.valueOf(clanId));
-		super.send(playerObjId, content);
-	}
-	
-	@Override
-	public final void parseWrite(final int playerObjId, final String ar1, final String ar2, final String ar3, final String ar4, final String ar5)
-	{
-		int clanId = Integer.valueOf(ar2.split(";")[0]);
-		int topicId = Integer.valueOf(ar2.split(";")[1]);
-		int postId = Integer.valueOf(ar2.split(";")[2]);
-		Forum clanForum = getCommunityBoardManager().getClanForum(clanId);
-		int perNon = clanForum.gettopic(topicId).getPermissions();
-		int perMem = perNon % 10;
-		perNon = (perNon - perMem) / 10;
-		boolean isPlayerMember = getCommunityBoardManager().getPlayer(playerObjId).getClanId() == clanId; 
-		boolean isLeader = getCommunityBoardManager().getClan(clanId).getLordObjId() == playerObjId;
-		if (!isLeader && ((isPlayerMember && perMem != 2) || (!isPlayerMember && perNon != 2)))
-		{
-			super.getCommunityBoardManager().getGST().sendPacket(new PlayerSendMessage(playerObjId,PlayerSendMessage.NO_WRITE_PERMISSION,""));
-			return;
-		}
-
-		int type = Post.ADVERTISE;
-		if (ar5.equalsIgnoreCase("Information"))
-			type = Post.INFORMATION;
-		else if (ar5.equalsIgnoreCase("Miscellaneous"))
-			type = Post.MISCELLANEOUS;
-
-		if (ar1.equalsIgnoreCase("new"))
-		{
-			postId = clanForum.gettopic(topicId).getNewPostId();
-			Post p = new Post(ConstructorType.CREATE, clanForum.getSqlDPId(), postId, playerObjId, "", System.currentTimeMillis(), topicId, clanForum.getID(), super.edtiPlayerTxT(ar3), super.edtiPlayerTxT(ar4), type, 0);
-			clanForum.gettopic(topicId).addPost(p);
-		}
-		else if (ar1.equalsIgnoreCase("reply"))
-		{
-			int parentId = postId;
-			postId = clanForum.gettopic(topicId).getNewPostId();
-			Post p = new Post(ConstructorType.CREATE, clanForum.getSqlDPId(), postId, playerObjId, "", parentId, System.currentTimeMillis(), topicId, clanForum.getID(), super.edtiPlayerTxT(ar3), super.edtiPlayerTxT(ar4), type, 0);
-			clanForum.gettopic(topicId).addPost(p);
-		}
-		else if (ar1.equalsIgnoreCase("edit"))
-		{
-			clanForum.gettopic(topicId).getPost(postId).updatePost(super.edtiPlayerTxT(ar3), super.edtiPlayerTxT(ar4), type);
-		}
-		else if (ar1.equalsIgnoreCase("com"))
-		{
-			Post p = clanForum.gettopic(topicId).getPost(postId);
-			int comId = p.getNewCommentId();
-			Comment c = new Comment(ConstructorType.CREATE, clanForum.getSqlDPId(), comId, playerObjId, System.currentTimeMillis(), postId, topicId, clanForum.getID(), super.edtiPlayerTxT(ar3));
-			p.addComment(c);
-			showPost(playerObjId, clanForum.gettopic(topicId), p, clanId, topicId, 1, 1);
-			return;
-		}
-		else
-			_log.info("Clan Post Write command missing: " + ar1);
-		showPage(playerObjId, clanForum, topicId, 1);
-	}
-}

+ 0 - 43
L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/ErrorBoard.java

@@ -1,43 +0,0 @@
-/*
- * 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.communityserver.communityboard.boards;
-
-import com.l2jserver.communityserver.communityboard.CommunityBoard;
-import com.l2jserver.communityserver.communityboard.CommunityBoardManager;
-
-public class ErrorBoard extends CommunityBoard
-{
-	public ErrorBoard(final CommunityBoardManager mgr)
-	{
-		super(mgr);
-	}
-	
-	@Override
-	public final void parseCmd(final int playerObjId, final String cmd)
-	{
-		String error = "unknown error";
-		if (cmd.startsWith("noBoard"))
-			error = "unknown Board: " + cmd.split(";")[1];
-		String content = "<html><body><br><br><center>Community Board: " + error + " </center></body></html>";
-		
-		super.send(playerObjId, content);
-	}
-	
-	@Override
-	public final void parseWrite(final int playerObjId, final String ar1, final String ar2, final String ar3, final String ar4, final String ar5)
-	{
-		
-	}
-}

+ 0 - 118
L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/FriendBoard.java

@@ -1,118 +0,0 @@
-/*
- * 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.communityserver.communityboard.boards;
-
-import java.util.logging.Logger;
-
-import javolution.text.TextBuilder;
-import com.l2jserver.communityserver.cache.HtmCache;
-import com.l2jserver.communityserver.communityboard.CommunityBoard;
-import com.l2jserver.communityserver.communityboard.CommunityBoardManager;
-import com.l2jserver.communityserver.model.L2Player;
-
-public final class FriendBoard extends CommunityBoard
-{
-	private static Logger _log = Logger.getLogger(FriendBoard.class.getName());
-	public FriendBoard(final CommunityBoardManager mgr)
-	{
-		super(mgr);
-	}
-	
-	@Override
-	public void parseCmd(final int playerObjId, final String cmd)
-	{
-		if (cmd.equals("_bbsfriend"))
-			showMainPage(playerObjId, false);
-		else if (cmd.split(";")[1].equalsIgnoreCase("mail"))
-		{
-			showMailWrite(playerObjId);
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("select"))
-		{
-			L2Player player = super.getCommunityBoardManager().getPlayer(playerObjId);
-			Integer friendId = Integer.valueOf(cmd.split(";")[2]);
-			if (!player.getSelectedFriendsList().contains(friendId))
-				player.selectFriend(friendId);
-			showMainPage(playerObjId, false);
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("deselect"))
-		{
-			L2Player player = super.getCommunityBoardManager().getPlayer(playerObjId);
-			player.deSelectFriend(Integer.valueOf(cmd.split(";")[2]));
-			showMainPage(playerObjId, false);
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("delconfirm"))
-		{
-			showMainPage(playerObjId, true);
-		}
-		else
-			_log.info("Friend command missing: " + cmd.split(";")[1]);
-	}
-	
-	public final void showMainPage(final int playerObjId, boolean delMsg)
-	{
-		String content = HtmCache.getInstance().getHtm("data/staticfiles/html/friend.htm");
-		TextBuilder fList = new TextBuilder();
-		L2Player player = super.getCommunityBoardManager().getPlayer(playerObjId);
-		for (int f:player.getFriendList())
-		{
-			L2Player friend = super.getCommunityBoardManager().getPlayer(f);
-			fList.append("<a action=\"bypass _bbsfriend;select;" + friend.getObjId() + "\">" + friend.getName() + "</a> (" + (friend.isOnline() ? "On":"Off") + ") &nbsp;");
-		}
-		content = content.replaceAll("%friendslist%", fList.toString());
-		fList.clear();
-		for (int f:player.getSelectedFriendsList())
-		{
-			L2Player friend = super.getCommunityBoardManager().getPlayer(f);
-			fList.append("<a action=\"bypass _bbsfriend;deselect;" + friend.getObjId() + "\">" + friend.getName() + "</a>;");
-		}
-		content = content.replaceAll("%selectedFriendsList%", fList.toString());
-		if (delMsg)
-			content = content.replaceAll("%deleteMSG%", "<br>\nAre you sure you want to delete all messages from your Friends List? <button value = \"OK\" action=\"bypass _bssfriend;delall\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\">");
-		else
-			content = content.replaceAll("%deleteMSG%", "");
-		super.send(playerObjId, content);
-	}
-	
-	public final void showMailWrite(final int playerObjId)
-	{
-		String title = " ";
-		String message = " ";
-		String content = HtmCache.getInstance().getHtm("data/staticfiles/html/mail-write.htm");
-		content = content.replaceAll("%maillink%", "<a action=\"bypass _bbsfriend\">&\\$904;</a> > &\\$915;");
-
-		content = content.replaceAll("%playerObjId%", String.valueOf(playerObjId));
-		content = content.replaceAll("%postId%", "-1");
-		
-		String toList = "";
-		L2Player player = super.getCommunityBoardManager().getPlayer(playerObjId);
-		for (int f:player.getSelectedFriendsList())
-		{
-			if (toList.equals(""))
-				toList += super.getCommunityBoardManager().getPlayer(f).getName();
-			else
-				toList += (";" + super.getCommunityBoardManager().getPlayer(f).getName());
-		}
-
-		super.sendWrite(playerObjId, content, message, title, toList);
-
-	}
-
-	@Override
-	public final void parseWrite(final int playerObjId, final String ar1, final String ar2, final String ar3, final String ar4, final String ar5)
-	{
-		
-	}
-}

+ 0 - 297
L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/MailBoard.java

@@ -1,297 +0,0 @@
-/*
- * 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.communityserver.communityboard.boards;
-
-import java.text.DateFormat;
-import java.util.Date;
-import java.util.logging.Logger;
-
-import javolution.text.TextBuilder;
-import com.l2jserver.communityserver.Config;
-import com.l2jserver.communityserver.cache.HtmCache;
-import com.l2jserver.communityserver.communityboard.CommunityBoard;
-import com.l2jserver.communityserver.communityboard.CommunityBoardManager;
-import com.l2jserver.communityserver.model.Forum;
-import com.l2jserver.communityserver.model.L2Player;
-import com.l2jserver.communityserver.model.Topic;
-import com.l2jserver.communityserver.model.Post;
-import com.l2jserver.communityserver.model.Topic.ConstructorType;
-import com.l2jserver.communityserver.network.writepackets.PlayerSendMessage;
-
-public final class MailBoard extends CommunityBoard
-{
-	private static Logger _log = Logger.getLogger(MailBoard.class.getName());
-	public MailBoard(final CommunityBoardManager mgr)
-	{
-		super(mgr);
-	}
-	
-	@Override
-	public void parseCmd(final int playerObjId, final String cmd)
-	{
-		Forum playerForum = getCommunityBoardManager().getPlayerForum(playerObjId);
-		if (playerForum == null)
-		{
-			String content = HtmCache.getInstance().getHtm("data/staticfiles/html/nopage.htm");
-			super.send(playerObjId, content);
-		}
-		if (cmd.equals("_bbsmail"))
-			showPage(playerObjId, playerForum, Topic.INBOX, 1);
-		else if (cmd.split(";")[1].equalsIgnoreCase("sent"))
-			showPage(playerObjId, playerForum, Topic.OUTBOX, 1);
-		else if (cmd.split(";")[1].equalsIgnoreCase("archive"))
-			showPage(playerObjId, playerForum, Topic.ARCHIVE, 1);
-		else if (cmd.split(";")[1].equalsIgnoreCase("tarchive"))
-			showPage(playerObjId, playerForum, Topic.TEMP_ARCHIVE, 1);
-		else if (cmd.split(";")[1].equalsIgnoreCase("crea"))
-			showWrite(playerObjId, null, 0);
-		else if (cmd.split(";")[1].equalsIgnoreCase("reply"))
-		{
-			Topic t = playerForum.gettopic(Integer.valueOf(cmd.split(";")[2]));
-			Post p = t.getPost(Integer.valueOf(cmd.split(";")[3]));
-			showWrite(playerObjId, p, 1);
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("forward"))
-		{
-			Topic t = playerForum.gettopic(Integer.valueOf(cmd.split(";")[2]));
-			Post p = t.getPost(Integer.valueOf(cmd.split(";")[3]));
-			showWrite(playerObjId, p, 2);
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("store"))
-		{
-			Topic t = playerForum.gettopic(Integer.valueOf(cmd.split(";")[2]));
-			Post p = t.getPost(Integer.valueOf(cmd.split(";")[3]));
-			t.rmPostByID(p.getID());
-			int postId = playerForum.gettopic(Topic.OUTBOX).getNewPostId();
-			p.setTopic(Topic.ARCHIVE, postId);
-			playerForum.gettopic(Topic.ARCHIVE).addPost(p);
-			showPage(playerObjId, playerForum, Topic.INBOX, 1);
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("del"))
-		{
-			playerForum.gettopic(Integer.valueOf(cmd.split(";")[2])).rmPostByID(Integer.valueOf(cmd.split(";")[3]));
-			showPage(playerObjId, playerForum, Topic.INBOX, 1);
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("read"))
-		{
-			Topic t = playerForum.gettopic(Integer.valueOf(cmd.split(";")[2]));
-			Post p = t.getPost(Integer.valueOf(cmd.split(";")[3]));
-			showMail(playerObjId, playerForum, t, p);
-		}
-		else
-			_log.info("Mail command missing: " + cmd.split(";")[1]);
-	}
-	
-	public final void showPage(final int playerObjId, Forum f, int topicType, int index)
-	{
-		String content = HtmCache.getInstance().getHtm("data/staticfiles/html/mail.htm");
-		switch (topicType)
-		{
-			case Topic.INBOX:
-				content = content.replaceAll("%maillink%", "<a action=\"bypass _bbsmail\">Inbox</a>");
-				content = content.replaceAll("%authrecive%", "Author");
-				break;
-			case Topic.OUTBOX:
-				content = content.replaceAll("%maillink%", "<a action=\"bypass _bbsmail;sent\">Sent Box</a>");
-				content = content.replaceAll("%authrecive%", "Recipient");
-				break;
-			case Topic.ARCHIVE:
-				content = content.replaceAll("%maillink%", "<a action=\"bypass _bbsmail;archive\">Mail Archive</a>");
-				content = content.replaceAll("%authrecive%", "Author");
-				break;
-			case Topic.TEMP_ARCHIVE:
-				content = content.replaceAll("%maillink%", "<a action=\"bypass _bbsmail;tarchive\">Temporary Mail Archive</a>");
-				content = content.replaceAll("%authrecive%", "Recipient");
-				break;
-		}
-		content = content.replaceAll("%inbox%", String.valueOf(f.gettopic(Topic.INBOX).getAllPosts().size()));
-		content = content.replaceAll("%outbox%", String.valueOf(f.gettopic(Topic.OUTBOX).getAllPosts().size()));
-		content = content.replaceAll("%archive%", String.valueOf(f.gettopic(Topic.ARCHIVE).getAllPosts().size()));
-		content = content.replaceAll("%tarchive%", String.valueOf(f.gettopic(Topic.TEMP_ARCHIVE).getAllPosts().size()));
-		
-		Topic t = f.gettopic(topicType);
-		TextBuilder mList = new TextBuilder();
-		int i = 0;
-		for (Post p : t.getAllPosts())
-		{
-			if (i > ((index - 1) * 10 + 9))
- 			{
- 				break;
- 			}
-			if (i++ >= ((index - 1) * 10))
- 			{
-				mList.append("<table border=0 cellspacing=0 cellpadding=5 width=755>");
-				mList.append("<tr> ");
-				mList.append("<td FIXWIDTH=5 align=center></td>");
-				mList.append("<td FIXWIDTH=150 align=center>" + getCommunityBoardManager().getPlayer(p.getOwnerId()).getName() + "</td>");
-				mList.append("<td FIXWIDTH=440><a action=\"bypass _bbsmail;read;" + t.getID() + ";" + p.getID() + "\">" + p.getTitle() + "</a></td>");
-				mList.append("<td FIXWIDTH=150>" + DateFormat.getInstance().format(new Date(p.getDate())) + "</td>");
-				mList.append("<td FIXWIDTH=5 align=center></td>");
-				mList.append("</tr>");
-				mList.append("</table>");
-				mList.append("<img src=\"L2UI.Squaregray\" width=\"755\" height=\"1\">");
- 			}
-		}
-		content = content.replaceAll("%maillist%", mList.toString());
-		mList.clear();
- 		if (index == 1)
- 		{
-			mList.append("<td><button action=\"\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
- 		}
- 		else
- 		{
-			mList.append("<td><button action=\"bypass _bbspost;list;" + (index - 1) + "\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
- 		}
-
- 		int nbp;
-		nbp = t.getAllPosts().size() / 10;
-		if (nbp * 10 != t.getAllPosts().size())
- 		{
- 			nbp++;
- 		}
-		for (i = 1; i <= nbp; i++)
- 		{
- 			if (i == index)
- 			{
-				mList.append("<td> " + i + " </td>");
- 			}
- 			else
- 			{
-				mList.append("<td><a action=\"bypass _bbspost;list;" + i + "\"> " + i + " </a></td>");
- 			}
- 		}
- 		if (index == nbp)
- 		{
-			mList.append("<td><button action=\"\" back=\"l2ui_ch3.next1_down\" fore=\"l2ui_ch3.next1\" width=16 height=16 ></td>");
- 		}
- 		else
- 		{
-			mList.append("<td><button action=\"bypass _bbspost;list;" + (index + 1) + "\" back=\"l2ui_ch3.next1_down\" fore=\"l2ui_ch3.next1\" width=16 height=16 ></td>");
- 		}
-		content = content.replaceAll("%maillistlength%", mList.toString());
-		super.send(playerObjId, content);
-	}
-	
-	public final void showMail(final int playerObjId, Forum f, Topic t, Post p)
-	{
-		String content = HtmCache.getInstance().getHtm("data/staticfiles/html/mail-show.htm");
-		switch (t.getID())
-		{
-			case Topic.INBOX:
-				content = content.replaceAll("%writer%", getCommunityBoardManager().getPlayer(p.getOwnerId()).getName());
-				content = content.replaceAll("%receiver%", p.getRecipientList());
-				content = content.replaceAll("%maillink%", "<a action=\"bypass _bbsmail\">Inbox</a>");
-				break;
-			case Topic.OUTBOX:
-				content = content.replaceAll("%maillink%", "<a action=\"bypass _bbsmail;sent\">Sent Box</a>");
-				content = content.replaceAll("%writer%", getCommunityBoardManager().getPlayer(playerObjId).getName());
-				content = content.replaceAll("%receiver%", p.getRecipientList());
-				break;
-			case Topic.ARCHIVE:
-				content = content.replaceAll("%maillink%", "<a action=\"bypass _bbsmail;archive\">Mail Archive</a>");
-				content = content.replaceAll("%writer%", getCommunityBoardManager().getPlayer(p.getOwnerId()).getName());
-				content = content.replaceAll("%receiver%", p.getRecipientList());
-				break;
-			case Topic.TEMP_ARCHIVE:
-				content = content.replaceAll("%maillink%", "<a action=\"bypass _bbsmail;tarchive\">Temporary Mail Archive</a>");
-				content = content.replaceAll("%writer%", getCommunityBoardManager().getPlayer(playerObjId).getName());
-				content = content.replaceAll("%receiver%", p.getRecipientList());
-				break;
-		}
-		content = content.replaceAll("%sentDate%", DateFormat.getInstance().format(new Date(p.getDate())));
-		content = content.replaceAll("%delDate%", DateFormat.getInstance().format(new Date(p.getDate() + Config.MAIL_AUTO_DELETION_TIME)));
-		content = content.replaceAll("%title%", p.getTitle());
-		content = content.replaceAll("%mes%", p.getText());
-		content = content.replaceAll("%topicId%", String.valueOf(t.getID()));
-		content = content.replaceAll("%postId%", String.valueOf(p.getID()));
-		p.increaseReadCount();
-		
-		super.send(playerObjId, content);
-	}
-	
-	public final void showWrite(final int playerObjId, Post p, int type)
-	{
-		String title = " ";
-		String message = " ";
-		String toList = " ";
-		String content = HtmCache.getInstance().getHtm("data/staticfiles/html/mail-write.htm");
-		content = content.replaceAll("%maillink%", "<a action=\"bypass _bbsmail\">Inbox</a>");
-
-		content = content.replaceAll("%playerObjId%", String.valueOf(playerObjId));
-		if (p == null)
-		{
-			content = content.replaceAll("%postId%", "-1");
-		}
-		else
-		{
-			content = content.replaceAll("%postId%", String.valueOf(p.getID()));
-			title = p.getTitle();
-			message = p.getText();
-			if (type == 1)
-				toList = p.getRecipientList();
-		}
-		
-		super.sendWrite(playerObjId, content, message, title, toList);
-
-	}
-	@Override
-	public final void parseWrite(final int playerObjId, final String ar1, final String ar2, final String ar3, final String ar4, final String ar5)
-	{
-		int postId = Integer.valueOf(ar2);
-		Forum senderForum = getCommunityBoardManager().getPlayerForum(playerObjId);
-		String[] recipients = ar3.split(";");
-		boolean isSended = false;
-		Post p = null;
-		for (String recipient : recipients)
-		{
-			L2Player receiver = getCommunityBoardManager().getPlayerByName(recipient);
-
-			if (ar1.equalsIgnoreCase("new"))
-			{
-				if  (receiver != null)
-				{
-					Forum receiverForum = getCommunityBoardManager().getPlayerForum(receiver.getObjId());
-					postId = receiverForum.gettopic(Topic.INBOX).getNewPostId();
-					p = new Post(ConstructorType.CREATE, receiverForum.getSqlDPId(), postId, playerObjId, ar3, System.currentTimeMillis(), Topic.INBOX, receiverForum.getID(), super.edtiPlayerTxT(ar4), super.edtiPlayerTxT(ar5), 0, 0);
-					receiverForum.gettopic(Topic.INBOX).addPost(p);
-					if (receiver.isOnline())
-					{
-						super.getCommunityBoardManager().getGST().sendPacket(new PlayerSendMessage(receiver.getObjId(),-1,""));
-						super.getCommunityBoardManager().getGST().sendPacket(new PlayerSendMessage(receiver.getObjId(),1233,""));
-					}
-					isSended = true;
-				}
-			}
-			else if (ar1.equalsIgnoreCase("store"))
-			{
-				postId = senderForum.gettopic(Topic.TEMP_ARCHIVE).getNewPostId();
-				p = new Post(ConstructorType.CREATE, senderForum.getSqlDPId(), postId, playerObjId, ar3, System.currentTimeMillis(), Topic.TEMP_ARCHIVE, senderForum.getID(), super.edtiPlayerTxT(ar4), super.edtiPlayerTxT(ar5), 0, 0);
-				senderForum.gettopic(Topic.TEMP_ARCHIVE).addPost(p);
-				super.getCommunityBoardManager().getGST().sendPacket(new PlayerSendMessage(playerObjId,1234,""));
-				showPage(playerObjId, senderForum, Topic.TEMP_ARCHIVE, 1);
-				return;
-			}
-			else
-				_log.info("Mail Write command missing: " + ar1);
-		}
-		if (isSended)
-		{
-			postId = senderForum.gettopic(Topic.OUTBOX).getNewPostId();
-			p = new Post(ConstructorType.CREATE, senderForum.getSqlDPId(), postId, playerObjId, ar3, System.currentTimeMillis(), Topic.OUTBOX, senderForum.getID(), super.edtiPlayerTxT(ar4), super.edtiPlayerTxT(ar5), 0, 0);
-			senderForum.gettopic(Topic.OUTBOX).addPost(p);
-		}
-		showPage(playerObjId, senderForum, Topic.INBOX, 1);
-	}
-}

+ 0 - 200
L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/MemoBoard.java

@@ -1,200 +0,0 @@
-/*
- * 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.communityserver.communityboard.boards;
-
-import java.text.DateFormat;
-import java.util.Date;
-import java.util.logging.Logger;
-
-import javolution.text.TextBuilder;
-import com.l2jserver.communityserver.cache.HtmCache;
-import com.l2jserver.communityserver.communityboard.CommunityBoard;
-import com.l2jserver.communityserver.communityboard.CommunityBoardManager;
-import com.l2jserver.communityserver.model.Forum;
-import com.l2jserver.communityserver.model.Topic;
-import com.l2jserver.communityserver.model.Post;
-import com.l2jserver.communityserver.model.Topic.ConstructorType;
-
-public final class MemoBoard extends CommunityBoard
-{
-	private static Logger _log = Logger.getLogger(MemoBoard.class.getName());
-	public MemoBoard(final CommunityBoardManager mgr)
-	{
-		super(mgr);
-	}
-	
-	@Override
-	public void parseCmd(final int playerObjId, final String cmd)
-	{
-		Forum playerForum = getCommunityBoardManager().getPlayerForum(playerObjId);
-		if (cmd.equals("_bbsmemo"))
-			showPage(playerObjId, playerForum, 1);
-		else if (cmd.split(";")[1].equalsIgnoreCase("crea"))
-			showWrite(playerObjId, null);
-		else if (cmd.split(";")[1].equalsIgnoreCase("list"))
-			showPage(playerObjId, playerForum, Integer.valueOf(cmd.split(";")[2]));
-		else if (cmd.split(";")[1].equalsIgnoreCase("read"))
-		{
-			Topic t = playerForum.gettopic(Topic.MEMO);
-			Post p = t.getPost(Integer.valueOf(cmd.split(";")[2]));
-			if (p == null)
-				_log.info("Memo read command: " + cmd.split(";")[2]);
-			else
-				showPost(playerObjId, p);
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("del"))
-		{
-			playerForum.gettopic(Topic.MEMO).rmPostByID(Integer.valueOf(cmd.split(";")[2]));
-			showPage(playerObjId, playerForum, 1);
-		}
-		else if (cmd.split(";")[1].equalsIgnoreCase("edit"))
-		{
-			Post p = playerForum.gettopic(Topic.MEMO).getPost(Integer.valueOf(cmd.split(";")[2]));
-			showWrite(playerObjId, p);
-		}
-		else
-			_log.info("Memo command missing: " + cmd.split(";")[1]);
-	}
-	
-	public final void showPage(final int playerObjId, Forum f, int index)
-	{
-		String content = HtmCache.getInstance().getHtm("data/staticfiles/html/memo.htm");
-		if (f == null)
-		{
-			_log.info("Forum is NULL!!!");
-			super.send(playerObjId, content);
-			return;
-		}
-		
-		Topic t = f.gettopic(Topic.MEMO);
-		
-		TextBuilder mList = new TextBuilder();
-		int i = 0;
-		for (Post p : t.getAllPosts())
-		{
-			if (i > ((index - 1) * 10 + 9))
- 			{
- 				break;
- 			}
-			if (i++ >= ((index - 1) * 10))
- 			{
-				mList.append("<img src=\"L2UI.SquareBlank\" width=\"750\" height=\"3\">");
-				mList.append("<table border=0 cellspacing=0 cellpadding=0 width=750>");
-				mList.append("<tr> ");
-				mList.append("<td FIXWIDTH=5></td>");
-				mList.append("<td FIXWIDTH=511><a action=\"bypass _bbsmemo;read;" + p.getID() + "\">" + p.getTitle() + "</a></td>");
-				mList.append("<td FIXWIDTH=148 align=center></td>");
-				mList.append("<td FIXWIDTH=86 align=center>" + DateFormat.getInstance().format(new Date(p.getDate())) + "</td>");
-				mList.append("<td FIXWIDTH=5></td>");
-				mList.append("</tr>");
-				mList.append("<tr><td height=5></td></tr>");
-				mList.append("</table>");
-				mList.append("<img src=\"L2UI.SquareBlank\" width=\"750\" height=\"3\">");
-				mList.append("<img src=\"L2UI.SquareGray\" width=\"750\" height=\"1\">");				
- 			}
-		}
-		content = content.replaceAll("%memoList%", mList.toString());
-		mList.clear();
-		mList.clear();
- 		if (index == 1)
- 		{
-			mList.append("<td><button action=\"\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
- 		}
- 		else
- 		{
-			mList.append("<td><button action=\"bypass _bbsmemo;list;" + (index - 1) + "\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
- 		}
-
- 		int nbp;
-		nbp = t.getAllPosts().size() / 10;
-		if (nbp * 10 != t.getAllPosts().size())
- 		{
- 			nbp++;
- 		}
-		for (i = 1; i <= nbp; i++)
- 		{
- 			if (i == index)
- 			{
-				mList.append("<td> " + i + " </td>");
- 			}
- 			else
- 			{
-				mList.append("<td><a action=\"bypass _bbsmemo;list;" + i + "\"> " + i + " </a></td>");
- 			}
- 		}
- 		if (index == nbp)
- 		{
-			mList.append("<td><button action=\"\" back=\"l2ui_ch3.next1_down\" fore=\"l2ui_ch3.next1\" width=16 height=16 ></td>");
- 		}
- 		else
- 		{
-			mList.append("<td><button action=\"bypass _bbsmemo;list;" + (index + 1) + "\" back=\"l2ui_ch3.next1_down\" fore=\"l2ui_ch3.next1\" width=16 height=16 ></td>");
- 		}
-		content = content.replaceAll("%memoListLength%", mList.toString());
-
-		super.send(playerObjId, content);
-	}
-	
-	public final void showWrite(final int playerObjId, Post p)
-	{
-		String title = " ";
-		String message = " ";
-		String content = HtmCache.getInstance().getHtm("data/staticfiles/html/memo-write.htm");
-		content = content.replaceAll("%playerObjId%", String.valueOf(playerObjId));
-		if (p == null)
-			content = content.replaceAll("%job%", "new");
-		else
-		{
-			content = content.replaceAll("%job%", "edit");
-			content = content.replaceAll("%postId%", String.valueOf(p.getID()));
-			title = p.getTitle();
-			message = p.getText();
-		}
-		
-		super.sendWrite(playerObjId, content, message, title, title);
-	}
-	
-	public final void showPost(final int playerObjId, Post p)
-	{
-		p.increaseReadCount();
-		String content = HtmCache.getInstance().getHtm("data/staticfiles/html/memo-show.htm");
-		content = content.replaceAll("%memoName%", p.getTitle());
-		content = content.replaceAll("%postId%", String.valueOf(p.getID()));
-		content = content.replaceAll("%memoOwnerName%", getCommunityBoardManager().getPlayer(p.getOwnerId()).getName());
-		content = content.replaceAll("%postDate%", DateFormat.getInstance().format(new Date(p.getDate())));
-		content = content.replaceAll("%mes%", p.getText());
-		
-		super.send(playerObjId, content);
-	}
-	
-	@Override
-	public final void parseWrite(final int playerObjId, final String ar1, final String ar2, final String ar3, final String ar4, final String ar5)
-	{
-		Forum playerForum = getCommunityBoardManager().getPlayerForum(playerObjId);
-		if (ar1.equalsIgnoreCase("new"))
-		{
-			int postId = playerForum.gettopic(Topic.MEMO).getNewPostId();
-			Post p = new Post(ConstructorType.CREATE, playerForum.getSqlDPId(), postId, playerObjId, "", System.currentTimeMillis(), Topic.MEMO, playerForum.getID(), super.edtiPlayerTxT(ar3), super.edtiPlayerTxT(ar4), 0, 0);
-			playerForum.gettopic(Topic.MEMO).addPost(p);
-		}
-		else if (ar1.equalsIgnoreCase("edit"))
-		{
-			playerForum.gettopic(Topic.MEMO).getPost(Integer.valueOf(ar2)).updatePost(super.edtiPlayerTxT(ar3), super.edtiPlayerTxT(ar4));
-		}
-		else
-			_log.info("Memo Write command missing: " + ar1);
-		showPage(playerObjId, playerForum, 1);
-	}
-}

+ 0 - 107
L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/RegionBoard.java

@@ -1,107 +0,0 @@
-/*
- * 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.communityserver.communityboard.boards;
-
-import java.text.DateFormat;
-import java.util.Date;
-
-import javolution.text.TextBuilder;
-import com.l2jserver.communityserver.cache.HtmCache;
-import com.l2jserver.communityserver.communityboard.CommunityBoard;
-import com.l2jserver.communityserver.communityboard.CommunityBoardManager;
-import com.l2jserver.communityserver.model.L2Castle;
-import com.l2jserver.communityserver.model.L2Clan;
-
-public final class RegionBoard extends CommunityBoard
-{
-	public RegionBoard(final CommunityBoardManager mgr)
-	{
-		super(mgr);
-	}
-	
-	@Override
-	public void parseCmd(final int playerObjId, final String cmd)
-	{
-		// this board is disabled on retail, and its not fully implemented here, so for now it is disabled
-		super.send(playerObjId, "");
-		/*if (cmd.equals("_bbsloc"))
-			showMainPage(playerObjId);
-		else
-			showCastlePage(playerObjId, super.getCommunityBoardManager().getCastle(Integer.valueOf(cmd.split(";")[1])));*/
-	}
-	
-	public final void showMainPage(final int playerObjId)
-	{
-		String content = HtmCache.getInstance().getHtm("data/staticfiles/html/castlelist.htm");
-		TextBuilder cList = new TextBuilder();
-		for (L2Castle c : super.getCommunityBoardManager().getCastleList())
-		{
-			L2Clan cl = super.getCommunityBoardManager().getClan(c.getOwnerId());
-			String cName = "NPC Clan";
-			String aName = "";
-			if (cl != null)
-			{
-				cName = cl.getName();
-				aName = cl.getAllianceName();
-			}
-			cList.append("<table border=0 cellspacing=0 cellpadding=5 width=750>");
-			cList.append("<tr>");
-			cList.append("<td FIXWIDTH=5></td>");
-			cList.append("<td FIXWIDTH=150><a action=\"bypass _bbsloc;" + c.getId() + "\">&^" + c.getId() + ";</a></td>");
-			cList.append("<td FIXWIDTH=155>" + cName + "</td>");
-			cList.append("<td FIXWIDTH=155>" + aName + "</td>");
-			cList.append("<td FIXWIDTH=140 align=center>" + c.getTax() + "</td>");
-			cList.append("<td FIXWIDTH=140 align=center>" + c.getTax() + "</td>");
-			cList.append("<td FIXWIDTH=5></td>");
-			cList.append("</tr>");
-			cList.append("</table>");
-			cList.append("<img src=\"L2UI.Squaregray\" width=\"740\" height=\"1\">");
-		}
-		content = content.replaceAll("%castleList%", cList.toString());
-		super.send(playerObjId, content);
-	}
-	
-	public final void showCastlePage(final int playerObjId, L2Castle castle)
-	{
-		String content = HtmCache.getInstance().getHtm("data/staticfiles/html/castle.htm");
-		L2Clan cl = super.getCommunityBoardManager().getClan(castle.getOwnerId());
-		content = content.replaceAll("%castleId%", String.valueOf(castle.getId()));
-		content = content.replaceAll("%siegeDate%", DateFormat.getInstance().format(new Date(castle.getSiegeDate())));
-		content = content.replaceAll("%tax%", String.valueOf(castle.getTax()));
-		int clanId = 0;
-		String clanName = "NPC Clan";
-		String clanLord = "NPC";
-		String clanAlly = "none";
-		if (cl != null)
-		{
-			clanId = cl.getClanId();
-			clanName = cl.getName();
-			clanLord = cl.getLordName();
-			clanAlly = cl.getAllianceName();
-		}
-		content = content.replaceAll("%clanid%", String.valueOf(clanId));
-		content = content.replaceAll("%lord%", clanLord);
-		content = content.replaceAll("%clanName%", clanName);
-		content = content.replaceAll("%allyName%", clanAlly);
-		
-		super.send(playerObjId, content);
-	}
-
-	@Override
-	public final void parseWrite(final int playerObjId, final String ar1, final String ar2, final String ar3, final String ar4, final String ar5)
-	{
-		
-	}
-}

+ 0 - 58
L2J_CommunityServer/java/com/l2jserver/communityserver/communityboard/boards/TopBoard.java

@@ -1,58 +0,0 @@
-/*
- * 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.communityserver.communityboard.boards;
-
-import java.util.StringTokenizer;
-
-import com.l2jserver.communityserver.cache.HtmCache;
-import com.l2jserver.communityserver.communityboard.CommunityBoard;
-import com.l2jserver.communityserver.communityboard.CommunityBoardManager;
-
-public class TopBoard extends CommunityBoard
-{
-	public TopBoard(final CommunityBoardManager mgr)
-	{
-		super(mgr);
-	}
-	
-	@Override
-	public final void parseCmd(final int playerObjId, final String cmd)
-	{
-		String file = "";
-		String content = "";
-		if (cmd.equalsIgnoreCase("_bbshome"))
-			file = "index.htm";
-		else if (cmd.startsWith("_bbshome;"))
-		{
-			StringTokenizer st = new StringTokenizer(cmd, ";");
-			st.nextToken();
-			file = st.nextToken();
-		}
-		if (file.isEmpty())
-			content = "<html><body><br><br><center>Error: no file name </center></body></html>";
-		else
-			content = HtmCache.getInstance().getHtm(this.getCommunityBoardManager().getSQLDPId(),"html/" + file);
-		if (content == null)
-			content = "<html><body><br><br><center>404 :File Not foud: '" + file + "' </center></body></html>";
-		
-		super.send(playerObjId, content);
-	}
-	
-	@Override
-	public final void parseWrite(final int playerObjId, final String ar1, final String ar2, final String ar3, final String ar4, final String ar5)
-	{
-		
-	}
-}

+ 0 - 150
L2J_CommunityServer/java/com/l2jserver/communityserver/model/Comment.java

@@ -1,150 +0,0 @@
-/*
- * 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.communityserver.model;
-
-
-import java.sql.PreparedStatement;
-import java.util.logging.Logger;
-
-import com.l2jserver.communityserver.L2DatabaseFactory;
-import com.l2jserver.communityserver.model.Topic.ConstructorType;
-
-public class Comment
-{
-	private static Logger _log = Logger.getLogger(Comment.class.getName());
-	
-	private final int _sqlDPId;
-	private int _commentId;
-	private int _commentOwnerId;
-	private long _commentDate;
-	private int _commentPostId;
-	private int _commentTopicId;
-	private int _commentForumId;
-	private String _commentTxt;
-	
-	/**
-	 * @param restore
-	 * @param t
-	 */
-	//public enum ConstructorType {REPLY, CREATE };
-	public Comment(ConstructorType ct, final int sqlDPId, int commentId, int commentOwnerID, long date, int pid, int tid,int commentForumID, String txt)
-	{
-		_sqlDPId = sqlDPId;
-		_commentId = commentId;
-		_commentOwnerId = commentOwnerID;
-		_commentDate = date;
-		_commentPostId = pid;
-		_commentTopicId = tid;
-		_commentForumId = commentForumID;
-		_commentTxt = txt;
-		if (ct == ConstructorType.CREATE)
-		{
-			insertindb();
-		}
-	}
-
-	public void insertindb()
-	{
-		java.sql.Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("INSERT INTO comments (serverId, comment_id,comment_ownerid,comment_date,comment_post_id,comment_topic_id,comment_forum_id,comment_txt) values (?,?,?,?,?,?,?,?)");
-			statement.setInt(1, _sqlDPId);
-			statement.setInt(2, _commentId);
-			statement.setInt(3, _commentOwnerId);
-			statement.setLong(4, _commentDate);
-			statement.setInt(5, _commentPostId);
-			statement.setInt(6, _commentTopicId);
-			statement.setInt(7, _commentForumId);
-			statement.setString(8, _commentTxt);
-			statement.execute();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			_log.warning("error while saving new Post to db " + e);
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-
-	}
-
-	public void deleteme()
-	{
-		java.sql.Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("DELETE FROM comments WHERE serverId=? AND comment_forum_id=? AND comment_topic_id=? AND comment_Post_id=? AND comment_id=?");
-			statement.setInt(1, _sqlDPId);
-			statement.setInt(2, _commentForumId);
-			statement.setInt(3, _commentTopicId);
-			statement.setInt(4, _commentPostId);
-			statement.setInt(5, _commentId);
-			statement.execute();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-	}
-
-	/**
-	 *
-	 */
-	/**
-	 * @return
-	 */
-	public int getID()
-	{
-		return _commentId;
-	}
-
-	public String getText()
-	{
-		return _commentTxt;
-	}
-	
-	public int getOwnerId()
-	{
-		return _commentOwnerId;
-	}
-	
-	public Long getDate()
-	{
-		return _commentDate;
-	}
-
-}

+ 0 - 278
L2J_CommunityServer/java/com/l2jserver/communityserver/model/Forum.java

@@ -1,278 +0,0 @@
-/*
- * 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.communityserver.model;
-
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import javolution.util.FastMap;
-import com.l2jserver.communityserver.L2DatabaseFactory;
-import com.l2jserver.communityserver.model.Topic.ConstructorType;
-
-public class Forum
-{
-	//type
-	public static final int ROOT = 0;
-	public static final int NORMAL = 1;
-	public static final int CLAN = 2;
-	public static final int PLAYER = 3;
-	
-	private static Logger _log = Logger.getLogger(Forum.class.getName());
-	private Map<Integer, Topic> _topic;
-	private int _forumId;
-	private final int _sqlDPId;
-	private String _forumName;
-	private int _forumType;
-	private int _ownerID;
-	private boolean _loaded = false;
-	
-	/**
-	 * @param i
-	 */
-	public Forum(final int sqlDPId, int Forumid)
-	{
-		_sqlDPId = sqlDPId;
-		_forumId = Forumid;
-		_topic = new FastMap<Integer, Topic>();
-	}
-	
-	/**
-	 * @param name
-	 * @param parent
-	 * @param type
-	 * @param perm
-	 */
-	public Forum(final int sqlDPId, int Forumid, String name, int type, int OwnerID)
-	{
-		_sqlDPId = sqlDPId;
-		_forumName = name;
-		_forumId = Forumid;
-		_forumType = type;
-		_ownerID = OwnerID;
-		_topic = new FastMap<Integer, Topic>();
-		_loaded = true;
-		insertindb();
-		if (type == Forum.PLAYER)
-		{
-			_topic.put(Topic.INBOX, new Topic(ConstructorType.CREATE, _sqlDPId, Topic.INBOX, Forumid, name, OwnerID, 0));
-			_topic.put(Topic.OUTBOX, new Topic(ConstructorType.CREATE, _sqlDPId, Topic.OUTBOX, Forumid, name, OwnerID, 0));
-			_topic.put(Topic.ARCHIVE, new Topic(ConstructorType.CREATE, _sqlDPId, Topic.ARCHIVE, Forumid, name, OwnerID, 0));
-			_topic.put(Topic.TEMP_ARCHIVE, new Topic(ConstructorType.CREATE, _sqlDPId, Topic.TEMP_ARCHIVE, Forumid, name, OwnerID, 0));
-			_topic.put(Topic.MEMO, new Topic(ConstructorType.CREATE, _sqlDPId, Topic.MEMO, Forumid, name, OwnerID, 0));
-		}
-		else if (type == Forum.CLAN)
-		{
-			_topic.put(Topic.ANNOUNCE, new Topic(ConstructorType.CREATE, _sqlDPId, Topic.ANNOUNCE, Forumid, name, OwnerID, 0));
-			_topic.put(Topic.BULLETIN, new Topic(ConstructorType.CREATE, _sqlDPId, Topic.BULLETIN, Forumid, name, OwnerID, 0));
-		}
-	}
-	
-	/**
-	 *
-	 */
-	private void load()
-	{
-		java.sql.Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("SELECT * FROM forums WHERE serverId=? AND forum_id=?");
-			statement.setInt(1, _sqlDPId);
-			statement.setInt(2, _forumId);
-			ResultSet result = statement.executeQuery();
-			
-			if (result.next())
-			{
-				_forumName = result.getString("forum_name");
-				_forumType = Integer.parseInt(result.getString("forum_type"));
-				_ownerID = Integer.parseInt(result.getString("forum_owner_id"));
-			}
-			result.close();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			_log.warning("data error on Forum " + _forumId + " : " + e);
-			e.printStackTrace();
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("SELECT * FROM topics WHERE serverId=? AND topic_forum_id=? ORDER BY topic_id DESC");
-			statement.setInt(1, _sqlDPId);
-			statement.setInt(2, _forumId);
-			ResultSet result = statement.executeQuery();
-			while (result.next())
-			{
-				Topic t = new Topic(Topic.ConstructorType.RESTORE, _sqlDPId, Integer.parseInt(result.getString("topic_id")), Integer.parseInt(result.getString("topic_forum_id")), result.getString("topic_name"), Integer.parseInt(result.getString("topic_ownerid")), Integer.parseInt(result.getString("topic_permissions")));
-				_topic.put(t.getID(), t);
-			}
-			result.close();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			_log.warning("data error on Forum " + _forumId + " : " + e);
-			e.printStackTrace();
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-	}
-	
-	public int getTopicSize()
-	{
-		if (_loaded == false)
-		{
-			load();
-			_loaded = true;
-		}
-		return _topic.size();
-	}
-	
-	public Topic gettopic(int j)
-	{
-		if (_loaded == false)
-		{
-			load();
-			_loaded = true;
-		}
-		return _topic.get(j);
-	}
-	
-	public void addtopic(Topic t)
-	{
-		if (_loaded == false)
-		{
-			load();
-			_loaded = true;
-		}
-		_topic.put(t.getID(), t);
-	}
-	
-	/**
-	* @return
-	*/
-	public int getID()
-	{
-		return _forumId;
-	}
-	
-	public int getOwner()
-	{
-		return _ownerID;
-	}
-	
-	public String getName()
-	{
-		if (_loaded == false)
-		{
-			load();
-			_loaded = true;
-		}
-		return _forumName;
-	}
-	
-	public int getType()
-	{
-		if (_loaded == false)
-		{
-			load();
-			_loaded = true;
-		}
-		return _forumType;
-	}
-	
-	/**
-	 * @param id
-	 */
-	public void rmTopicByID(int id)
-	{
-		_topic.remove(id);
-		
-	}
-	
-	public final int getSqlDPId()
-	{
-		return _sqlDPId;
-	}
-	
-	/**
-	 *
-	 */
-	public void insertindb()
-	{
-		java.sql.Connection con = null;
-		try
-		{
-			// TODO: needs to be changed
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("INSERT INTO forums (serverId,forum_id,forum_name,forum_type,forum_owner_id) values (?,?,?,?,?)");
-			statement.setInt(1, _sqlDPId);
-			statement.setInt(2, _forumId);
-			statement.setString(3, _forumName);
-			statement.setInt(4, _forumType);
-			statement.setInt(5, _ownerID);
-			statement.execute();
-			statement.close();
-			
-		}
-		catch (Exception e)
-		{
-			_log.warning("error while saving new Forum to db " + e);
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-	}
-	
-	/**
-	 *
-	 */
-	public void vload()
-	{
-		if (_loaded == false)
-		{
-			load();
-			_loaded = true;
-		}
-	}
-}

+ 0 - 64
L2J_CommunityServer/java/com/l2jserver/communityserver/model/L2Castle.java

@@ -1,64 +0,0 @@
-/*
- * 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.communityserver.model;
-
-/**
- * This class describes a castle instance
- *
- */
-public class L2Castle
-{
-	private int _castleId;
-	private String _name;
-	private int _ownerId;
-	private int _tax;
-	private long _siegeDate;
-
-	
-	public L2Castle(int castleId, String name, int ownerId, int tax, long siegeDate)
-	{
-		_castleId = castleId;
-		_name = name;
-		_ownerId = ownerId;
-		_tax = tax;
-		_siegeDate = siegeDate;
-	}
-	
-	public int getId()
-	{
-		return _castleId;
-	}
-	
-	public String getName()
-	{
-		return _name;
-	}
-	
-	public int getOwnerId()
-	{
-		return _ownerId;
-	}
-	
-	public long getSiegeDate()
-	{
-		return _siegeDate;
-	}
-	
-	public int getTax()
-	{
-		return _tax;
-	}
-}
-

+ 0 - 173
L2J_CommunityServer/java/com/l2jserver/communityserver/model/L2Clan.java

@@ -1,173 +0,0 @@
-/*
- * 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.communityserver.model;
-
-/**
- * This class describes a clan instance
- *
- */
-public class L2Clan
-{
-	private int _clanId;
-	private String _name;
-	private int _level;
-	private int _lordObjId;
-	private String _lordName;
-	private int _members;
-	private String _allianceName;
-	private int[] _allianceClanIdList;
-	private boolean _noticeEnabled;
-	private Forum _forum;
-	private String _introduction;
-	private String _notice;
-	private boolean _isNoticeLoaded = false;
-	
-	public L2Clan(int clanId, String name, int level, int lordObjId, String lordName, int members, String allianceName, int[] allianceClanIdList, boolean noticeEnabled)
-	{
-		_clanId = clanId;
-		_name = name;
-		_lordName = lordName;
-		_level = level;
-		_lordObjId = lordObjId;
-		_members = members;
-		_allianceName = allianceName;
-		_allianceClanIdList = allianceClanIdList;
-		_noticeEnabled = noticeEnabled;
-		_forum = null;
-		_introduction = "";
-	}
-	
-	public int getClanId()
-	{
-		return _clanId;
-	}
-	
-	public void setName(String val)
-	{
-		_name = val;
-	}
-
-	public String getName()
-	{
-		return _name;
-	}
-	
-	public void setLordName(String val)
-	{
-		_lordName = val;
-	}
-
-	public String getLordName()
-	{
-		return _lordName;
-	}
-	
-	// do not use this from here!!!
-	public Forum getForum()
-	{
-		return _forum;
-	}
-	
-	public void setLevel(int val)
-	{
-		_level = val;
-	}
-
-	public int getClanLevel()
-	{
-		return _level;
-	}
-	
-	public void setMembersCount(int val)
-	{
-		_members = val;
-	}
-
-	public int getMembersCount()
-	{
-		return _members;
-	}
-	
-	public void setLordObjId(int val)
-	{
-		_lordObjId = val;
-	}
-
-	public int getLordObjId()
-	{
-		return _lordObjId;
-	}
-
-	public void setAllianceName(String val)
-	{
-		_allianceName = val;
-	}
-
-	public String getAllianceName()
-	{
-		return _allianceName;
-	}
-
-	public void setAllianceClanIdList(int[] val)
-	{
-		_allianceClanIdList = val;
-	}
-
-	public int[] getAllianceClanIdList()
-	{
-		return _allianceClanIdList;
-	}
-	
-	public void setForum(Forum f)
-	{
-		_forum = f;
-	}
-	
-	public String getIndtroduction()
-	{
-		return _introduction;
-	}
-	
-	public void setIntroduction(String val)
-	{
-		_introduction = val;
-	}
-	
-	public boolean isNoticeEnabled()
-	{
-		return _noticeEnabled;
-	}
-	
-	public void setNoticeEnabled(boolean val)
-	{
-		_noticeEnabled = val;
-	}
-	
-	public boolean isNoticeLoaded()
-	{
-		return _isNoticeLoaded;
-	}
-	
-	public void setNotice(String val)
-	{
-		_isNoticeLoaded = true;
-		_notice = val;
-	}
-	
-	public String getNotice()
-	{
-		return _notice;
-	}
-}

+ 0 - 156
L2J_CommunityServer/java/com/l2jserver/communityserver/model/L2Player.java

@@ -1,156 +0,0 @@
-/*
- * 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.communityserver.model;
-
-import javolution.util.FastList;
-
-/**
- * This class describes a player instance
- *
- */
-public class L2Player
-{
-	private int _objId;
-	private String _name;
-	private String _accountName;
-	private int _level;
-	private int _accessLevel;
-	private int _clanId;
-	private boolean _isOnline;
-	private FastList<Integer> _friends;
-	private FastList<Integer> _selectedFriends;
-	private Forum _forum;
-	
-	public L2Player(int objId, String name, String accountName, int level, int accessLevel, int clanId, boolean isOnline)
-	{
-		_objId = objId;
-		_name = name;
-		_accountName = accountName;
-		_level = level;
-		_accessLevel = accessLevel;
-		_clanId = clanId;
-		_isOnline = isOnline;
-		_forum = null;
-		_friends = new FastList<Integer>();
-		_selectedFriends = new FastList<Integer>();
-	}
-	
-	public int getObjId()
-	{
-		return _objId;
-	}
-	
-	public void setName(String val)
-	{
-		_name = val;
-	}
-
-	public String getName()
-	{
-		return _name;
-	}
-	
-	public String getAccountName()
-	{
-		return _accountName;
-	}
-
-	// do not use this from here!!!
-	public Forum getForum()
-	{
-		return _forum;
-	}
-	
-	public void setLevel(int val)
-	{
-		_level = val;
-	}
-
-	public int getLevel()
-	{
-		return _level;
-	}
-	
-	public void setAccessLevel(int val)
-	{
-		_accessLevel = val;
-	}
-
-	public int getAccessLevel()
-	{
-		return _accessLevel;
-	}
-
-	public void setClanId(int val)
-	{
-		_clanId = val;
-	}
-
-	public int getClanId()
-	{
-		return _clanId;
-	}
-
-	public boolean isOnline()
-	{
-		return _isOnline;
-	}
-	
-	public void setIsOnline(boolean val)
-	{
-		_isOnline = val;
-	}
-	
-	public void setForum(Forum f)
-	{
-		_forum = f;
-	}
-	
-	public void addFriend(Integer friendId)
-	{
-		_friends.add(friendId);
-	}
-	
-	public void removeFriend(Integer friendId)
-	{
-		_friends.remove(friendId);
-	}
-	
-	public void removeAllFriends()
-	{
-		_friends.clear();
-	}
-
-	public FastList<Integer> getFriendList()
-	{
-		return _friends;
-	}
-
-	public void selectFriend(Integer friendId)
-	{
-		_selectedFriends.add(friendId);
-	}
-	
-	public void deSelectFriend(Integer friendId)
-	{
-		_selectedFriends.remove(friendId);
-	}
-	
-	public FastList<Integer> getSelectedFriendsList()
-	{
-		return _selectedFriends;
-	}
-}
-

+ 0 - 391
L2J_CommunityServer/java/com/l2jserver/communityserver/model/Post.java

@@ -1,391 +0,0 @@
-/*
- * 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.communityserver.model;
-
-
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.Collection;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import javolution.util.FastMap;
-
-import com.l2jserver.communityserver.L2DatabaseFactory;
-import com.l2jserver.communityserver.model.Topic.ConstructorType;
-
-public class Post
-{
-	private static Logger _log = Logger.getLogger(Post.class.getName());
-	// type
-	public static final int ADVERTISE = 0;
-	public static final int MISCELLANEOUS = 1;
-	public static final int INFORMATION = 2;
-	
-	private final int _sqlDPId;
-	private int _postId;
-	private int _postOwnerId;
-	private String _postRecipientList;
-	private int _postParentId;
-	private long _postDate;
-	private int _postTopicId;
-	private int _postForumId;
-	private String _postTitle;
-	private String _postTxt;
-	private int _postType;
-	private int _lastCommentId;
-	private Map<Integer, Comment> _comments;
-	private int _readCount;
-	
-	/**
-	 * @param restore
-	 * @param t
-	 */
-	//public enum ConstructorType {REPLY, CREATE };
-	public Post(ConstructorType ct, final int sqlDPId, int postId, int postOwnerID,String recipentList,long date,int tid,int postForumID, String title, String txt, int type, int readCount)
-	{
-		_sqlDPId = sqlDPId;
-		_postId = postId;
-		_postOwnerId = postOwnerID;
-		_postRecipientList = recipentList;
-		_postDate = date;
-		_postTopicId = tid;
-		_postForumId = postForumID;
-		_postTitle = title;
-		_postTxt = txt;
-		_postType = type;
-		_postParentId = -1;
-		_comments = new FastMap<Integer, Comment>();
-		_readCount = readCount;
-		if (ct == ConstructorType.CREATE)
-		{
-			insertindb();
-		}
-		else
-		{
-			loadComments();
-		}
-	}
-
-	public Post(ConstructorType ct, final int sqlDPId, int postId, int postOwnerID, String recipentList,int postParentId, long date, int tid, int postForumID, String title, String txt, int type, int readCount)
-	{
-		_sqlDPId = sqlDPId;
-		_postId = postId;
-		_postOwnerId = postOwnerID;
-		_postRecipientList = recipentList;
-		_postDate = date;
-		_postTopicId = tid;
-		_postForumId = postForumID;
-		_postTitle = title;
-		_postTxt = txt;
-		_postType = type;
-		_postParentId = postParentId;
-		_comments = new FastMap<Integer, Comment>();
-		_readCount = readCount;
-		if (ct == ConstructorType.CREATE)
-		{
-			insertindb();
-		}
-		else
-		{
-			loadComments();
-		}
-	}
-
-	private void loadComments()
-	{
-		java.sql.Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("SELECT * FROM comments WHERE serverId=? AND comment_forum_id=? AND comment_topic_id=? AND comment_post_id=?");
-			statement.setInt(1, _sqlDPId);
-			statement.setInt(2, _postForumId);
-			statement.setInt(3, _postTopicId);
-			statement.setInt(4, _postId);
-			ResultSet result = statement.executeQuery();
-			
-			while (result.next())
-			{
-				int commentId = Integer.parseInt(result.getString("comment_id"));
-				int commentOwner = Integer.parseInt(result.getString("comment_ownerid"));
-				long date = Long.parseLong(result.getString("comment_date"));
-				String text = result.getString("comment_txt");
-				Comment c = new Comment(ConstructorType.RESTORE, _sqlDPId, commentId, commentOwner, date, _postId, _postTopicId, _postForumId, text);
-				_comments.put(commentId, c);
-				if (commentId > _lastCommentId)
-					_lastCommentId = commentId;
-			}
-			result.close();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			_log.warning("data error on Forum " + _postForumId + " : " + e);
-			e.printStackTrace();
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-	}
-	
-	public int getNewCommentId()
-	{
-		return ++_lastCommentId;
-	}
-
-	public void insertindb()
-	{
-		java.sql.Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("INSERT INTO posts (serverId, post_id,post_ownerid,post_recipient_list,post_date,post_topic_id,post_forum_id,post_txt,post_title,post_type,post_parent_id,post_read_count) values (?,?,?,?,?,?,?,?,?,?,?,?)");
-			statement.setInt(1, _sqlDPId);
-			statement.setInt(2, _postId);
-			statement.setInt(3, _postOwnerId);
-			statement.setString(4, _postRecipientList);
-			statement.setLong(5, _postDate);
-			statement.setInt(6, _postTopicId);
-			statement.setInt(7, _postForumId);
-			statement.setString(8, _postTxt);
-			statement.setString(9, _postTitle);
-			statement.setInt(10, _postType);
-			statement.setInt(11, _postParentId);
-			statement.setInt(12, _readCount);
-			statement.execute();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			_log.warning("error while saving new Post to db " + e);
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-
-	}
-
-	public void deleteme()
-	{
-		for (Comment c: _comments.values())
-			c.deleteme();
-		_comments.clear();
-		java.sql.Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("DELETE FROM posts WHERE serverId=? AND post_forum_id=? AND post_topic_id=? AND post_id=?");
-			statement.setInt(1, _sqlDPId);
-			statement.setInt(2, _postForumId);
-			statement.setInt(3, _postTopicId);
-			statement.setInt(4, _postId);
-			statement.execute();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-	}
-
-	/**
-	 * @param i
-	 */
-	private void updatePost()
-	{
-		java.sql.Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("UPDATE posts SET post_txt=?,post_title=?,post_recipient_list=?,post_read_count=? WHERE serverId=? AND post_id=? AND post_topic_id=? AND post_forum_id=?");
-			statement.setString(1, _postTxt);
-			statement.setString(2, _postTitle);
-			statement.setString(3, _postRecipientList);
-			statement.setInt(4, _readCount);
-			statement.setInt(5, _sqlDPId);
-			statement.setInt(6, _postId);
-			statement.setInt(7, _postTopicId);
-			statement.setInt(8, _postForumId);
-			
-			statement.execute();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			_log.warning("error while saving new Post to db " + e);
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-
-	}
-
-	public void clearComments()
-	{
-		_comments.clear();
-	}
-	
-	public int getCommentsSize()
-	{
-		return _comments.size();
-	}
-	
-	public Comment getComment(int j)
-	{
-		return _comments.get(j);
-	}
-	
-	public void addComment(Comment c)
-	{
-		_comments.put(c.getID(), c);
-	}
-	
-	public void rmCommentByID(int id)
-	{
-		_comments.get(id).deleteme();
-		_comments.remove(id);
-	}
-	
-	public Collection<Comment> getAllComments()
-	{
-		return _comments.values();
-	}
-
-	/**
-	 *
-	 */
-	/**
-	 * @return
-	 */
-	public int getID()
-	{
-		return _postId;
-	}
-
-	public String getText()
-	{
-		return _postTxt;
-	}
-	
-	public int getOwnerId()
-	{
-		return _postOwnerId;
-	}
-	
-	public int getParentId()
-	{
-		return _postParentId;
-	}
-	
-	public void updatePost(String newTitle, String newTxt)
-	{
-		_postTitle = newTitle;
-		_postTxt = newTxt;
-		updatePost();
-	}
-
-	public void updatePost(String newTitle, String newTxt, int type)
-	{
-		_postTitle = newTitle;
-		_postTxt = newTxt;
-		_postType = type;
-		updatePost();
-	}
-	
-	public void setTopic(int newTopicId, int newPostId)
-	{
-		_postTopicId = newTopicId;
-		_postId = newPostId;
-		insertindb();
-	}
-	
-	public String getRecipientList()
-	{
-		return _postRecipientList;
-	}
-
-	public String getTitle()
-	{
-		return _postTitle;
-	}
-
-	public Long getDate()
-	{
-		return _postDate;
-	}
-
-	public int getType()
-	{
-		return _postType;
-	}
-
-	public String getTypeName()
-	{
-		switch(_postType)
-		{
-			case ADVERTISE:
-				return "[Advertise]";
-			case MISCELLANEOUS:
-				return "[Miscellaneous]";
-			case INFORMATION:
-				return "[Information]";
-		}
-		return "";
-	}
-	
-	public int getReadCount()
-	{
-		return _readCount;
-	}
-	
-	public void increaseReadCount()
-	{
-		_readCount++;
-		updatePost();
-	}
-
-}

+ 0 - 335
L2J_CommunityServer/java/com/l2jserver/communityserver/model/Topic.java

@@ -1,335 +0,0 @@
-/*
- * 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.communityserver.model;
-
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.Collection;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
-import com.l2jserver.communityserver.L2DatabaseFactory;
-
-public class Topic
-{
-	
-	private static Logger _log = Logger.getLogger(Topic.class.getName());
-	// type
-	public static final int SERVER = 0;
-	public static final int INBOX = 1;
-	public static final int OUTBOX = 2;
-	public static final int ARCHIVE = 3;
-	public static final int TEMP_ARCHIVE = 4;
-	public static final int MEMO = 5;
-	public static final int ANNOUNCE = 6;
-	public static final int BULLETIN = 7;
-	
-	//perm
-	public static final int NONE = 0;
-	public static final int ALL = 1;
-	public static final int READ = 2;
-
-	private int _id; // same as type
-	private int _forumId;
-	private final int _sqlDPId;
-	private String _topicName;
-	private int _ownerId;
-	private int _lastPostId;
-	private int _permissions;
-	private Map<Integer, Post> _posts;
-	
-	/**
-	 * @param restaure
-	 * @param i
-	 * @param j
-	 * @param string
-	 * @param k
-	 * @param string2
-	 * @param l
-	 * @param m
-	 * @param n
-	 */
-	public Topic(ConstructorType ct, final int sqlDPId, int id, int fid, String name, int oid, int per)
-	{
-		_sqlDPId = sqlDPId;
-		_id = id;
-		_forumId = fid;
-		_topicName = name;
-		_ownerId = oid;
-		_lastPostId = 0;
-		_permissions = per;
-		_posts = new FastMap<Integer, Post>();
-		
-		if (ct == ConstructorType.CREATE)
-		{
-			insertindb();
-		}
-		else
-		{
-			loadPosts();
-		}
-	}
-	
-	private void loadPosts()
-	{
-		java.sql.Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("SELECT * FROM posts WHERE serverId=? AND post_forum_id=? AND post_topic_id=?");
-			statement.setInt(1, _sqlDPId);
-			statement.setInt(2, _forumId);
-			statement.setInt(3, _id);
-			ResultSet result = statement.executeQuery();
-			
-			while (result.next())
-			{
-				int postId = Integer.parseInt(result.getString("post_id"));
-				int postOwner = Integer.parseInt(result.getString("post_ownerid"));
-				String recipientList = result.getString("post_recipient_list");
-				long date = Long.parseLong(result.getString("post_date"));
-				String title = result.getString("post_title");
-				String text = result.getString("post_txt");
-				int type = Integer.parseInt(result.getString("post_type"));
-				int parentId = Integer.parseInt(result.getString("post_parent_id"));
-				int readCount = Integer.parseInt(result.getString("post_read_count"));
-				Post p = new Post(ConstructorType.RESTORE, _sqlDPId, postId, postOwner, recipientList, parentId, date, _id, _forumId, title, text, type, readCount);
-				_posts.put(postId, p);
-				if (postId > _lastPostId)
-					_lastPostId = postId;
-			}
-			result.close();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			_log.warning("data error on Forum " + _forumId + " : " + e);
-			e.printStackTrace();
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-	}
-
-	public int getNewPostId()
-	{
-		return ++_lastPostId;
-	}
-	
-	/**
-	 *
-	 */
-	public void insertindb()
-	{
-		java.sql.Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("INSERT INTO topics (serverId,topic_id,topic_forum_id,topic_name,topic_ownerid,topic_permissions) values (?,?,?,?,?,?)");
-			statement.setInt(1, _sqlDPId);
-			statement.setInt(2, _id);
-			statement.setInt(3, _forumId);
-			statement.setString(4, _topicName);
-			statement.setInt(5, _ownerId);
-			statement.setInt(6, _permissions);
-			statement.execute();
-			statement.close();
-			
-		}
-		catch (Exception e)
-		{
-			_log.warning("error while saving new Topic to db " + e);
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-		
-	}
-	
-	public enum ConstructorType
-	{
-		RESTORE,
-		CREATE
-	}
-
-	public void clearPosts()
-	{
-		_posts.clear();
-	}
-	
-	public int getPostsSize()
-	{
-		return _posts.size();
-	}
-	
-	public Post getPost(int j)
-	{
-		return _posts.get(j);
-	}
-	
-	public void addPost(Post p)
-	{
-		_posts.put(p.getID(), p);
-	}
-	
-	public void rmPostByID(int id)
-	{
-		_posts.get(id).deleteme();
-		_posts.remove(id);
-	}
-	
-	public Collection<Post> getAllPosts()
-	{
-		return _posts.values();
-	}
-	
-	public Post[] getLastTwoPosts()
-	{
-		// if the Topic type is Announce then only Advertise Posts count
-		Post[] ret = new Post[2];
-		for (Post p: _posts.values())
-		{
-			if (_id == ANNOUNCE && p.getType() != Post.ADVERTISE)
-				continue;
-			if (ret[0] == null || ret[0].getDate() < p.getDate())
-			{
-				ret[1] = ret[0];
-				ret[0] = p;
-			}
-		}
-		return ret;
-	}
-	
-	public FastList<Post> getChildrenPosts(Post parent)
-	{
-		FastList<Post> ret = new FastList<Post>();
-		if (parent == null)
-			return ret;
-		// parent post always the first
-		ret.add(parent);
-		for (Post p: _posts.values())
-			if (p.getParentId() == parent.getID())
-				ret.add(p);
-
-		return ret;
-	}
-
-	/**
-	 * @return
-	 */
-	public int getID()
-	{
-		return _id;
-	}
-	
-	public int getForumID()
-	{
-		return _forumId;
-	}
-	
-	/**
-	 * @return
-	 */
-	public String getName()
-	{
-		// TODO Auto-generated method stub
-		return _topicName;
-	}
-	
-	/**
-	 *
-	 */
-	public void deleteme(Forum f)
-	{
-		f.rmTopicByID(getID());
-		java.sql.Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("DELETE FROM topics WHERE topic_id=? AND topic_forum_id=?");
-			statement.setInt(1, getID());
-			statement.setInt(2, f.getID());
-			statement.execute();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-	}
-	
-	public int getPermissions()
-	{
-		return _permissions;
-	}
-	
-	public void setPermissions(int val)
-	{
-		_permissions = val;
-		java.sql.Connection con = null;
-		try
-		{
-			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("UPDATE topics SET topic_permissions=? WHERE serverId=? AND topic_id=? AND topic_forum_id=?");
-			statement.setInt(1, _permissions);
-			statement.setInt(2, _sqlDPId);
-			statement.setInt(3, _id);
-			statement.setInt(4, _forumId);
-			statement.execute();
-			statement.close();
-		}
-		catch (Exception e)
-		{
-			_log.warning("error while saving new permissions to db " + e);
-		}
-		finally
-		{
-			try
-			{
-				con.close();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-	}
-}

+ 0 - 45
L2J_CommunityServer/java/com/l2jserver/communityserver/network/GameServerListener.java

@@ -1,45 +0,0 @@
-/*
- * 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.communityserver.network;
-
-import java.io.IOException;
-import java.net.Socket;
-import java.util.List;
-
-import javolution.util.FastList;
-import com.l2jserver.communityserver.network.netcon.NetConnectionConfig;
-import com.l2jserver.communityserver.network.netcon.NetConnectionListener;
-
-public final class GameServerListener extends NetConnectionListener
-{
-	private static List<GameServerThread> _gameServers = new FastList<GameServerThread>();
-
-	public GameServerListener(final NetConnectionConfig config) throws IOException
-	{
-		super(config);
-		setName(getClass().getSimpleName());
-	}
-	
-	@Override
-	protected final void buildTCPNetConnection(final NetConnectionConfig config, final Socket remoteConnection) throws IOException
-	{
-		final GameServerThread gst = new GameServerThread(config);
-		
-		gst.connect(remoteConnection);
-		gst.start();
-		
-		_gameServers.add(gst);
-	}
-}

+ 0 - 352
L2J_CommunityServer/java/com/l2jserver/communityserver/network/GameServerThread.java

@@ -1,352 +0,0 @@
-/*
- * 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.communityserver.network;
-
-import java.io.IOException;
-import java.net.SocketException;
-import java.security.KeyPair;
-import java.security.interfaces.RSAPrivateKey;
-import java.security.interfaces.RSAPublicKey;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import com.l2jserver.communityserver.GameServerRegistrationTable;
-import com.l2jserver.communityserver.communityboard.CommunityBoardManager;
-import com.l2jserver.communityserver.network.netcon.BaseReadPacket;
-import com.l2jserver.communityserver.network.netcon.BaseWritePacket;
-import com.l2jserver.communityserver.network.netcon.NetConnection;
-import com.l2jserver.communityserver.network.netcon.NetConnectionConfig;
-import com.l2jserver.communityserver.network.readpackets.BlowFishKey;
-import com.l2jserver.communityserver.network.readpackets.GameServerAuth;
-import com.l2jserver.communityserver.network.readpackets.WorldInfo;
-import com.l2jserver.communityserver.network.readpackets.RequestShowCommunityBoard;
-import com.l2jserver.communityserver.network.readpackets.RequestWriteCommunityBoard;
-import com.l2jserver.communityserver.network.writepackets.AuthResponse;
-import com.l2jserver.communityserver.network.writepackets.CommunityServerFail;
-import com.l2jserver.communityserver.network.writepackets.InitCS;
-import com.l2jserver.communityserver.network.writepackets.RequestWorldInfo;
-import com.l2jserver.communityserver.threading.ThreadPoolManager;
-
-/**
- * @author Forsaiken
- */
-
-public class GameServerThread extends NetConnection
-{
-	protected static final Logger _log = Logger.getLogger(GameServerThread.class.getName());
-	
-	private final RSAPublicKey _publicKey;
-	private final RSAPrivateKey _privateKey;
-	
-	private CommunityBoardManager _communityBoardManager;
-	private boolean _isAuthed;
-	private loadingData _loadingTask;
-	
-	public GameServerThread(final NetConnectionConfig config) throws IOException
-	{
-		super(config);
-		setName(getClass().getSimpleName()+"-"+getId());
-		final KeyPair pair = GameServerRegistrationTable.getInstance().getRandomKeyPair();
-		_privateKey = (RSAPrivateKey)pair.getPrivate();
-		_publicKey = (RSAPublicKey)pair.getPublic();
-	}
-	
-	@Override
-	public final void run()
-	{
-		int packetType1 = 0xFF;
-		int packetType2 = 0xFF;
-		
-		byte[] data = null;
-		BaseReadPacket packet = null;
-		
-		try
-		{
-			sendPacket(new InitCS(_publicKey.getModulus().toByteArray()));
-			
-			while (true)
-			{
-				data = super.read();
-				packetType1 = data[0] & 0xFF;
-				packetType2 = data[1] & 0xFF;
-				
-				// _log.log(Level.INFO, "Received packet: 0x" + Integer.toHexString(packetType1) + "-0x" + Integer.toHexString(packetType2));
-				
-				switch (packetType1)
-				{
-					case 0x00:
-					{
-						switch (packetType2)
-						{
-							case 0x00:
-								packet = new BlowFishKey(data, _privateKey, this);
-								break;
-							
-							case 0x01:
-								packet = new GameServerAuth(data, this);
-								break;
-						}
-						break;
-					}
-					
-					case 0x01:
-					{
-						if (!_isAuthed)
-						{
-							forceClose(new CommunityServerFail(CommunityServerFail.NOT_AUTHED));
-							return;
-						}
-						
-						if (_loadingTask != null)
-							_loadingTask.addPacket();
-						packet = new WorldInfo(data, this, packetType2);
-						/*
-						switch (packetType2)
-						{
-							case 0x00:
-								packet = new WorldInfo(data, this, packetType2);
-								break;
-
-							case 0x01:
-								packet = new WorldInfo(data, this, 1);
-								break;
-								
-							case 0x02:
-								packet = new WorldInfo(data, this, 2);
-								break;
-								
-							case 0x03:
-								packet = new PlayerUpdate(data, this);
-								break;
-								
-							case 0x04:
-								// clan update
-								break;
-								
-							case 0x05:
-								// clan created
-								break;
-								
-							case 0x06:
-								// clan deleted
-								break;
-						}*/
-						break;
-					}
-					
-					case 0x02:
-					{
-						if (!_isAuthed)
-						{
-							forceClose(new CommunityServerFail(CommunityServerFail.NOT_AUTHED));
-							return;
-						}
-						
-						switch (packetType2)
-						{
-							case 0x00:
-								packet = new RequestShowCommunityBoard(data, this);
-								break;
-							case 0x01:
-								packet = new RequestWriteCommunityBoard(data, this);
-								break;
-						}
-						
-						break;
-					}
-				}
-				
-				if (packet != null)
-					ThreadPoolManager.execute(packet);
-				else
-					throw new IOException("Invalid packet!");
-			}
-		}
-		catch (SocketException se)
-		{
-			forceClose(null);
-		}
-		catch (IOException e)
-		{
-			_log.log(Level.INFO, "Connection lost!");
-			
-			e.printStackTrace();
-			
-			forceClose(new CommunityServerFail(CommunityServerFail.NOT_AUTHED));
-		}
-	}
-	
-	public final CommunityBoardManager getCommunityBoardManager()
-	{
-		return _communityBoardManager;
-	}
-	
-	private final void setCommunityBoardManager(final CommunityBoardManager communityBoardManager)
-	{
-		if (_communityBoardManager != null)
-			_communityBoardManager.setGST(null);
-		
-		_communityBoardManager = communityBoardManager;
-		
-		if (_communityBoardManager != null)
-			_communityBoardManager.setGST(this);
-	}
-	
-	public final void sendPacket(final BaseWritePacket packet)
-	{
-		try
-		{
-			super.write(packet);
-		}
-		catch (IOException e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	public final void forceClose(final BaseWritePacket packet)
-	{
-		try
-		{
-			super.close(packet);
-		}
-		catch (IOException e)
-		{
-			_log.finer("GameServerThread: Failed disconnecting server, server already disconnected.");
-		}
-		finally
-		{
-			setCommunityBoardManager(null);
-		}
-	}
-	
-	public final void onGameServerAuth(final byte[] hexId, final int sqlDPId)
-	{
-		if (!GameServerRegistrationTable.getInstance().isHexIdOk(hexId))
-		{
-			_log.log(Level.INFO, "Invalid HexId. Closing connection...");
-			forceClose(null);
-			return;
-		}
-		else if (GameServerRegistrationTable.getInstance().isHexIdInUse(hexId))
-		{
-			_log.log(Level.INFO, "HexId allready in use. Closing connection...");
-			forceClose(null);
-			return;
-		}
-		
-		final CommunityBoardManager communityBoardManager = CommunityBoardManager.getInstance(sqlDPId);
-		if (communityBoardManager.getGST() != null)
-		{
-			try
-			{
-				if (communityBoardManager.getGST().isConnected())
-				{
-					_log.log(Level.INFO, "SQLDPId allready in use. Closing connection...");
-					forceClose(null);
-					return;
-				}
-			}
-			catch (IOException e)
-			{
-				_log.log(Level.INFO, "Exception. Closing connection...", e);
-				e.printStackTrace();
-				forceClose(null);
-				return;
-			}
-		}
-		
-		GameServerRegistrationTable.getInstance().setHexIdInUse(hexId);
-		setCommunityBoardManager(communityBoardManager);
-		_isAuthed = true;
-		
-		_log.log(Level.INFO, "GameServer connected!");
-		if (communityBoardManager.isLoaded())
-		{
-			sendPacket(new AuthResponse(AuthResponse.AUTHED));
-		}
-		else
-		{
-			communityBoardManager.clean();
-			_log.log(Level.INFO, "Transfering needed data for CommunityServer!");
-			_loadingTask = new loadingData(this);
-			new Thread(_loadingTask).start();
-			sendPacket(new RequestWorldInfo(RequestWorldInfo.SERVER_LOAD, 0, null, false));
-		}
-	}
-	
-	public void addNeededPacket(int val)
-	{
-		if (_loadingTask != null)
-		{
-			_loadingTask.sendedPacket(val);
-		}
-	}
-
-	private final class loadingData implements Runnable
-	{
-		private  GameServerThread _gst;
-		private int _incomePacket;
-		private int _neededPacket;
-		
-		private loadingData(GameServerThread gst)
-		{
-			_gst = gst;
-			_neededPacket = -1;
-			_incomePacket = 0;
-		}
-
-		public final void run()
-		{
-			try
-			{
-				int i = 0;
-				while ((_neededPacket == -1 || _incomePacket < _neededPacket) && i++ < 15)
-				{
-					currentThread();
-					Thread.sleep(1000);
-				}
-			}
-			catch (InterruptedException e)
-			{
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-			}
-			if (_neededPacket == -1)
-				_gst.forceClose(null);
-			else if (_incomePacket != _neededPacket)
-				_gst.forceClose(null);
-			else
-			{
-				_log.info("CB successfully get " + _gst.getCommunityBoardManager().getPlayerList().size() + " player(s) data.");
-				_log.info("CB successfully get " + _gst.getCommunityBoardManager().getClanList().size() + " clan(s) data.");
-				_log.info("CB successfully get " + _gst.getCommunityBoardManager().getCastleList().size() + " castle(s) data.");
-				_gst.getCommunityBoardManager().setLoaded();
-				_gst.sendPacket(new AuthResponse(AuthResponse.AUTHED));
-			}
-			_loadingTask = null;
-		}
-		
-		public void addPacket()
-		{
-			_incomePacket++;
-		}
-		
-		public void sendedPacket(int val)
-		{
-			_neededPacket = val;
-		}
-	}
-}

+ 0 - 49
L2J_CommunityServer/java/com/l2jserver/communityserver/network/GameServerThreadPool.java

@@ -1,49 +0,0 @@
-/*
- * 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.communityserver.network;
-
-import javolution.util.FastMap;
-
-public final class GameServerThreadPool
-{
-	private static GameServerThreadPool _instance;
-	
-	public static final GameServerThreadPool getInstance()
-	{
-		if (_instance == null)
-			_instance = new GameServerThreadPool();
-		return _instance;
-	}
-	
-	private final FastMap<Integer, GameServerThread> _gameServerThreads;
-	
-	private GameServerThreadPool()
-	{
-		_gameServerThreads = new FastMap<Integer, GameServerThread>();
-	}
-	
-	public final void addGameServerThread(final int serverId, final GameServerThread gst)
-	{
-		synchronized (_gameServerThreads)
-		{
-			_gameServerThreads.put(serverId, gst);
-		}
-	}
-	
-	public final GameServerThread getGameServerThread(final int serverId)
-	{
-		return _gameServerThreads.get(serverId);
-	}
-}

+ 0 - 71
L2J_CommunityServer/java/com/l2jserver/communityserver/network/netcon/BaseReadPacket.java

@@ -1,71 +0,0 @@
-/*
- * 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.communityserver.network.netcon;
-
-import com.l2jserver.communityserver.util.buffer.AbstractBufferedByteReader;
-import com.l2jserver.communityserver.util.buffer.BufferedByteReader;
-
-public abstract class BaseReadPacket implements Runnable
-{
-	private final AbstractBufferedByteReader _buf;
-	
-	protected BaseReadPacket(final byte[] data)
-	{
-		_buf = new BufferedByteReader(data);
-		_buf.readH();
-	}
-	
-	/** BYTE */
-	protected final int readC()
-	{
-		return _buf.readC();
-	}
-	
-	/** CHAR */
-	protected final int readH()
-	{
-		return _buf.readH();
-	}
-	
-	/** INTEGER */
-	protected final int readD()
-	{
-		return _buf.readD();
-	}
-	
-	/** DOUBLE */
-	protected final double readF()
-	{
-		return _buf.readF();
-	}
-	
-	/** LONG */
-	protected final long readQ()
-	{
-		return _buf.readQ();
-	}
-	
-	/** BYTE ARRAY */
-	protected final byte[] readB(final int length)
-	{
-		return _buf.readB(length);
-	}
-	
-	/** STRING */
-	protected final String readS()
-	{
-		return _buf.readS();
-	}
-}

+ 0 - 81
L2J_CommunityServer/java/com/l2jserver/communityserver/network/netcon/BaseWritePacket.java

@@ -1,81 +0,0 @@
-/*
- * 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.communityserver.network.netcon;
-
-import java.io.IOException;
-
-import com.l2jserver.communityserver.util.buffer.AbstractBufferedByteWriter;
-import com.l2jserver.communityserver.util.buffer.BufferedByteWriter;
-
-public abstract class BaseWritePacket
-{
-	private final AbstractBufferedByteWriter _buf;
-	
-	protected BaseWritePacket()
-	{
-		_buf = new BufferedByteWriter();
-	}
-	
-	protected final void writeC(final int value)
-	{
-		_buf.writeC(value);
-	}
-	
-	protected final void writeH(final int value)
-	{
-		_buf.writeH(value);
-	}
-	
-	protected final void writeD(final int value)
-	{
-		_buf.writeD(value);
-	}
-	
-	protected final void writeF(final double value)
-	{
-		_buf.writeF(value);
-	}
-	
-	protected final void writeQ(final long value)
-	{
-		_buf.writeQ(value);
-	}
-	
-	protected final void writeS(final String text)
-	{
-		_buf.writeS(text);
-	}
-	
-	protected final void writeB(final byte[] array)
-	{
-		_buf.writeB(array);
-	}
-	
-	public final byte[] getContent() throws IOException
-	{
-		writeD(0x00);
-		
-		int padding = _buf.length() % 8;
-		if (padding != 0)
-		{
-			for (int i = padding; i < 8; i++)
-			{
-				writeC(0x00);
-			}
-		}
-		
-		return _buf.toByteArray();
-	}
-}

+ 0 - 193
L2J_CommunityServer/java/com/l2jserver/communityserver/network/netcon/NetConnection.java

@@ -1,193 +0,0 @@
-/*
- * 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.communityserver.network.netcon;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.IOException;
-import java.net.Socket;
-import java.net.UnknownHostException;
-
-import com.l2jserver.communityserver.network.netcon.crypt.NewCrypt;
-
-/**
- * @author Forsaiken
- */
-public abstract class NetConnection extends Thread
-{
-	private static final NewCrypt INITIAL_CRYPT = new NewCrypt("_;v.]05-31!|+-%xT!^[$\00");
-	
-	private final NetConnectionConfig _config;
-	
-	/* TCP */
-	private Socket _tcpCon;
-	private BufferedInputStream _tcpIn;
-	private BufferedOutputStream _tcpOut;
-	
-	/* CRYPT */
-	private NewCrypt _crypt;
-	
-	protected NetConnection(NetConnectionConfig config)
-	{
-		_config = config;
-	}
-	
-	public final void connect(final String address, final int port) throws UnknownHostException, IOException
-	{
-		connect(new Socket(address, port));
-	}
-	
-	public final void connect(final Socket remoteConnection) throws IOException
-	{
-		if (isConnected())
-			throw new IOException("TCP Connect: Allready connected.");
-		
-		_crypt = INITIAL_CRYPT;
-		
-		_tcpCon = remoteConnection;
-		_tcpOut = new BufferedOutputStream(_tcpCon.getOutputStream(), _config.TCP_SEND_BUFFER_SIZE);
-		_tcpIn = new BufferedInputStream(_tcpCon.getInputStream(), _config.TCP_RECEIVE_BUFFER_SIZE);
-	}
-	
-	public final boolean isConnected() throws IOException
-	{
-		return _tcpCon != null && _tcpCon.isConnected();
-	}
-	
-	public final int getConnectionPort() throws IOException
-	{
-		if (!isConnected())
-			throw new IOException("TCP: Not connected.");
-		
-		return _tcpCon.getPort();
-	}
-	
-	public final String getConnectionAddress() throws IOException
-	{
-		if (!isConnected())
-			throw new IOException("TCP: Not connected.");
-			
-		return _tcpCon.getInetAddress().getHostAddress();
-	}
-	
-	protected final byte[] read() throws IOException
-	{
-		if (_tcpCon == null)
-			throw new IOException("TCP Read: Not initialized.");
-		
-		if (_tcpCon.isClosed())
-			throw new IOException("TCP Read: Connection closed.");
-		
-		final int lengthLo = _tcpIn.read();
-		final int lengthHi = _tcpIn.read();
-		final int length = lengthHi * 256 + lengthLo;
-		
-		if (lengthHi < 0)
-			throw new IOException("TCP Read: Failed reading.");
-		
-		final byte[] data = new byte[length - 2];
-		
-		int receivedBytes = 0;
-		int newBytes = 0;
-		int left = length - 2;
-		while ((newBytes != -1) && (receivedBytes < length - 2))
-		{
-			if (receivedBytes == 0)
-				newBytes = this._tcpIn.read(data, 0, left);
-			else
-				newBytes = this._tcpIn.read(data, receivedBytes, left);
-			receivedBytes += newBytes;
-			left -= newBytes;
-		}
-		
-		if (receivedBytes != length - 2)
-			throw new IOException("TCP Read: Incomplete Packet recived.");
-		
-		return decrypt(data);
-	}
-	
-	protected final void write(final BaseWritePacket packet) throws IOException
-	{
-		if (_tcpCon == null)
-			throw new IOException("TCP Write: Not initialized.");
-		
-		if (_tcpCon.isClosed())
-			throw new IOException("TCP Write: Connection closed.");
-		
-		final byte[] data = crypt(packet.getContent());
-		final int len = data.length + 2;
-		
-		synchronized (_tcpOut)
-		{
-			_tcpOut.write(len & 0xFF);
-			_tcpOut.write(len >> 8 & 0xFF);
-			_tcpOut.write(data);
-			_tcpOut.flush();
-		}
-	}
-	
-	protected final void close(final BaseWritePacket packet) throws IOException
-	{
-		try
-		{
-			if (packet != null)
-				write(packet);
-		}
-		finally
-		{
-			if (_tcpIn != null)
-			{
-				_tcpIn.close();
-				_tcpIn = null;
-			}
-			
-			if (_tcpOut != null)
-			{
-				_tcpOut.close();
-				_tcpOut = null;
-			}
-			
-			if (_tcpCon != null)
-			{
-				_tcpCon.close();
-				_tcpCon = null;
-			}
-		}
-	}
-	
-	public final void setCrypt(final NewCrypt crypt)
-	{
-		_crypt = crypt;
-	}
-	
-	private final byte[] decrypt(byte[] data) throws IOException
-	{
-		data = _crypt.decrypt(data);
-		
-		if (!NewCrypt.verifyChecksum(data))
-			throw new IOException("CRYPT: Incorrect packet checksum.");
-		
-		return data;
-	}
-	
-	private final byte[] crypt(final byte[] data) throws IOException
-	{
-		NewCrypt.appendChecksum(data);
-		
-		return _crypt.crypt(data);
-	}
-	
-	public abstract void run();
-}

+ 0 - 105
L2J_CommunityServer/java/com/l2jserver/communityserver/network/netcon/NetConnectionConfig.java

@@ -1,105 +0,0 @@
-/*
- * 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.communityserver.network.netcon;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.Properties;
-
-public final class NetConnectionConfig
-{
-	public NetConnectionConfig (final String configFilePath) throws Exception
-	{
-		final Properties settings				= new Properties();
-		final InputStream is					= new FileInputStream(new File(configFilePath));
-		settings.load(is);
-        is.close();
-        
-        INITIAL_CRYPT							= settings.getProperty("InitialCrypt", "_;v.]05-31!|+-%xT!^[$\00");
-        
-        TCP_EXTERNAL_HOST_ADDRESS				= settings.getProperty("ExternalHostAddress", "*");
-        TCP_EXTERNAL_PORT						= Integer.parseInt(settings.getProperty("ExternalPort", "0"));
-        TCP_CONNECTION_QUEUE					= Integer.parseInt(settings.getProperty("ConnectionQueue", "50"));
-        
-        TCP_FLOOD_PROTECTION_ENABLED			= Boolean.parseBoolean(settings.getProperty("FloodProtectionEnabled", "False"));
-        TCP_FAST_CONNECTION_LIMIT				= Integer.parseInt(settings.getProperty("FastConnectionLimit", "15"));
-        TCP_FAST_CONNECTION_TIME				= Integer.parseInt(settings.getProperty("FastConnectionTime", "350"));
-        TCP_NORMAL_CONNECTION_TIME				= Integer.parseInt(settings.getProperty("NormalConnectionTime", "700"));
-        TCP_MAX_CONNECTION_PER_IP				= Integer.parseInt(settings.getProperty("MaxConnectionperIP", "50"));
-        TCP_IP_BANN_ENABLED						= Boolean.parseBoolean(settings.getProperty("IPBannEnabled", "False"));
-        TCP_IP_BANN_LIST						= settings.getProperty("IPBannList", "").split(":");
-        
-        TCP_SEND_BUFFER_SIZE					= Integer.parseInt(settings.getProperty("SendBufferSize", "8192"));
-        TCP_RECEIVE_BUFFER_SIZE					= Integer.parseInt(settings.getProperty("ReceiveBufferSize", "8192"));
-        
-        if (TCP_SEND_BUFFER_SIZE < 1024)
-			throw new IllegalArgumentException("Init: TCP_SEND_BUFFER_SIZE < 1024");
-		
-		if (TCP_RECEIVE_BUFFER_SIZE < 1024)
-			throw new IllegalArgumentException("Init: TCP_RECEIVE_BUFFER_SIZE < 2048");
-	}
-	
-	
-	/**
-	 * ##################################################
-	 * Crypt
-	 * ##################################################
-	 */
-	
-	public final String INITIAL_CRYPT;
-	
-	
-	/**
-	 * ##################################################
-	 * TCP Server start
-	 * ##################################################
-	 */
-	
-	/** TCP external host address default '*' */
-	public final String TCP_EXTERNAL_HOST_ADDRESS;
-	/** TCP external port default 0 */
-	public final int TCP_EXTERNAL_PORT;
-	/** TCP external port default 50 */
-	public final int TCP_CONNECTION_QUEUE;
-	
-	/** TCP FloodProtection default false */
-	public final boolean TCP_FLOOD_PROTECTION_ENABLED;
-	/** TCP Fast connection limit default 15 */
-	public final int TCP_FAST_CONNECTION_LIMIT;
-	/** TCP Fast connection time default 350 */
-	public final int TCP_FAST_CONNECTION_TIME;
-	/** TCP Normal connection time default 700 */
-	public final int TCP_NORMAL_CONNECTION_TIME;
-	/** TCP Max connection per IP 50 */
-	public final int TCP_MAX_CONNECTION_PER_IP;
-	
-	/** TCP IP ban default false*/
-	public final boolean TCP_IP_BANN_ENABLED;
-	/** TCP IP ban list default empty*/
-	public final String[] TCP_IP_BANN_LIST;
-	
-	
-	/**
-	 * ##################################################
-	 * TCP Client start
-	 * ##################################################
-	 */
-	
-	/** TCP send buffer size default 8192 */
-	public final int TCP_SEND_BUFFER_SIZE;
-	/** TCP receive buffer size default 8192 */
-	public final int TCP_RECEIVE_BUFFER_SIZE;
-}

+ 0 - 183
L2J_CommunityServer/java/com/l2jserver/communityserver/network/netcon/NetConnectionListener.java

@@ -1,183 +0,0 @@
-/*
- * 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.communityserver.network.netcon;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * @author Forsaiken
- */
-public abstract class NetConnectionListener extends Thread
-{
-	private static final Logger _log = Logger.getLogger(NetConnectionListener.class.getName());
-	
-	private final NetConnectionConfig _config;
-	private final ServerSocket _serverSocket;
-	private final Map<String, ForeignConnection> _floodProtection;
-	private final List<String> _ipBanns;
-	
-	protected NetConnectionListener(final NetConnectionConfig config) throws IOException
-	{
-		_config = config;
-		
-		if (_config.TCP_IP_BANN_ENABLED)
-		{
-			_ipBanns = new ArrayList<String>();
-			for (final String ip : _config.TCP_IP_BANN_LIST)
-				_ipBanns.add(ip);
-		}
-		else
-			_ipBanns = null;
-		
-		if (_config.TCP_FLOOD_PROTECTION_ENABLED)
-			_floodProtection = new HashMap<String, ForeignConnection>();
-		else
-			_floodProtection = null;
-		
-		if (_config.TCP_EXTERNAL_HOST_ADDRESS.equals("*"))
-		{
-			_serverSocket = new ServerSocket(_config.TCP_EXTERNAL_PORT, _config.TCP_CONNECTION_QUEUE);
-		}
-		else
-		{
-			_serverSocket = new ServerSocket(_config.TCP_EXTERNAL_PORT, _config.TCP_CONNECTION_QUEUE, InetAddress.getByName(_config.TCP_EXTERNAL_HOST_ADDRESS));
-		}
-	}
-	
-	@Override
-	public final void run()
-	{
-		Socket connection = null;
-		
-		while (true)
-		{
-			try
-			{
-				connection = _serverSocket.accept();
-				final String connectionAddress = connection.getInetAddress().getHostAddress();
-				
-				_log.log(Level.INFO, "Received connection: " + connectionAddress);
-				
-				if (_config.TCP_IP_BANN_ENABLED && _ipBanns.contains(connectionAddress))
-					throw new IOException("IP: " + connectionAddress + " is on TCP_IP_BANN_LIST. Closing connection...");
-				
-				if (_config.TCP_FLOOD_PROTECTION_ENABLED)
-				{
-					ForeignConnection fConnection = _floodProtection.get(connectionAddress);
-					
-					if (fConnection != null)
-					{
-						fConnection.connectionNumber += 1;
-						if ((fConnection.connectionNumber > _config.TCP_FAST_CONNECTION_LIMIT
-								&& (System.currentTimeMillis() - fConnection.lastConnection) < _config.TCP_NORMAL_CONNECTION_TIME)
-								|| (System.currentTimeMillis() - fConnection.lastConnection) < _config.TCP_FAST_CONNECTION_TIME
-								|| fConnection.connectionNumber > _config.TCP_MAX_CONNECTION_PER_IP)
-						{
-							fConnection.lastConnection = System.currentTimeMillis();
-							fConnection.connectionNumber -= 1;
-							fConnection.isFlooding = true;
-							
-							throw new IOException("IP: " + connectionAddress + " is marked as Flooding. Closing connection...");
-						}
-						
-						fConnection.lastConnection = System.currentTimeMillis();
-						
-						if (fConnection.isFlooding)
-							fConnection.isFlooding = false;
-						
-						_log.log(Level.FINE, "IP: " + connectionAddress + " is no longer marked as Flooding.");
-					}
-					else
-					{
-						fConnection = new ForeignConnection(System.currentTimeMillis());
-						_floodProtection.put(connectionAddress, fConnection);
-					}
-				}
-				
-				buildTCPNetConnection(_config, connection);
-			}
-			catch (IOException e)
-			{
-				_log.log(Level.WARNING, "", e);
-				
-				if (connection != null)
-				{
-					try
-					{
-						connection.close();
-					}
-					catch (IOException e1)
-					{
-						_log.log(Level.WARNING, "Failed closing connection.", e1);
-					}
-				}
-				
-				try
-				{
-					if (isInterrupted())
-						close();
-				}
-				catch (IOException e1)
-				{
-					_log.log(Level.WARNING, "Failed closing listener.", e1);
-				}
-			}
-		}
-	}
-	
-	public final void close() throws IOException
-	{
-		_serverSocket.close();
-	}
-	
-	public final void removeTCPNetConnection(final NetConnection connection) throws IOException
-	{
-		if (!_config.TCP_FLOOD_PROTECTION_ENABLED)
-			return;
-		
-		final String connectionAddress = connection.getConnectionAddress();
-		final ForeignConnection fConnection = _floodProtection.get(connectionAddress);
-		if (fConnection != null)
-		{
-			fConnection.connectionNumber -= 1;
-			if (fConnection.connectionNumber == 0)
-				_floodProtection.remove(connectionAddress);
-		}
-	}
-	
-	protected abstract void buildTCPNetConnection(final NetConnectionConfig config, final Socket remoteConnection) throws IOException;
-	
-	private final class ForeignConnection
-	{
-		private int connectionNumber;
-		private long lastConnection;
-		private boolean isFlooding = false;
-		
-		private ForeignConnection(final long time)
-		{
-			lastConnection = time;
-			connectionNumber = 1;
-		}
-	}
-}

+ 0 - 475
L2J_CommunityServer/java/com/l2jserver/communityserver/network/netcon/crypt/BlowfishEngine.java

@@ -1,475 +0,0 @@
-/*
- * 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.communityserver.network.netcon.crypt;
-
-import java.io.IOException;
-
-/**
- * This file is based on the Blowfish Engine that is part of
- * the BouncyCastle JCE
- *
- * Copyright (c) 2000 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
- * and associated documentation files (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge, publish, distribute,
- * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all copies
- * or substantial portions of the Software.
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
- * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-public class BlowfishEngine
-{
-    private final static int[] KP = {0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, 0xA4093822,
-                                     0x299F31D0, 0x082EFA98, 0xEC4E6C89, 0x452821E6, 0x38D01377,
-                                     0xBE5466CF, 0x34E90C6C, 0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5,
-                                     0xB5470917, 0x9216D5D9, 0x8979FB1B};
-    private final static int[] KS0 = {0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7, 0xB8E1AFED,
-                                      0x6A267E96, 0xBA7C9045, 0xF12C7F99, 0x24A19947, 0xB3916CF7,
-                                      0x0801F2E2, 0x858EFC16, 0x636920D8, 0x71574E69, 0xA458FEA3,
-                                      0xF4933D7E, 0x0D95748F, 0x728EB658, 0x718BCD58, 0x82154AEE,
-                                      0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013, 0xC5D1B023,
-                                      0x286085F0, 0xCA417918, 0xB8DB38EF, 0x8E79DCB0, 0x603A180E,
-                                      0x6C9E0E8B, 0xB01E8A3E, 0xD71577C1, 0xBD314B27, 0x78AF2FDA,
-                                      0x55605C60, 0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440,
-                                      0x55CA396A, 0x2AAB10B6, 0xB4CC5C34, 0x1141E8CE, 0xA15486AF,
-                                      0x7C72E993, 0xB3EE1411, 0x636FBC2A, 0x2BA9C55D, 0x741831F6,
-                                      0xCE5C3E16, 0x9B87931E, 0xAFD6BA33, 0x6C24CF5C, 0x7A325381,
-                                      0x28958677, 0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193,
-                                      0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032, 0xEF845D5D,
-                                      0xE98575B1, 0xDC262302, 0xEB651B88, 0x23893E81, 0xD396ACC5,
-                                      0x0F6D6FF3, 0x83F44239, 0x2E0B4482, 0xA4842004, 0x69C8F04A,
-                                      0x9E1F9B5E, 0x21C66842, 0xF6E96C9A, 0x670C9C61, 0xABD388F0,
-                                      0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3, 0x6EEF0B6C,
-                                      0x137A3BE4, 0xBA3BF050, 0x7EFB2A98, 0xA1F1651D, 0x39AF0176,
-                                      0x66CA593E, 0x82430E88, 0x8CEE8619, 0x456F9FB4, 0x7D84A5C3,
-                                      0x3B8B5EBE, 0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6,
-                                      0x4ED3AA62, 0x363F7706, 0x1BFEDF72, 0x429B023D, 0x37D0D724,
-                                      0xD00A1248, 0xDB0FEAD3, 0x49F1C09B, 0x075372C9, 0x80991B7B,
-                                      0x25D479D8, 0xF6E8DEF7, 0xE3FE501A, 0xB6794C3B, 0x976CE0BD,
-                                      0x04C006BA, 0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463,
-                                      0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F, 0x6DFC511F,
-                                      0x9B30952C, 0xCC814544, 0xAF5EBD09, 0xBEE3D004, 0xDE334AFD,
-                                      0x660F2807, 0x192E4BB3, 0xC0CBA857, 0x45C8740F, 0xD20B5F39,
-                                      0xB9D3FBDB, 0x5579C0BD, 0x1A60320A, 0xD6A100C6, 0x402C7279,
-                                      0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8, 0x3C7516DF,
-                                      0xFD616B15, 0x2F501EC8, 0xAD0552AB, 0x323DB5FA, 0xFD238760,
-                                      0x53317B48, 0x3E00DF82, 0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E,
-                                      0xDF1769DB, 0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573,
-                                      0x695B27B0, 0xBBCA58C8, 0xE1FFA35D, 0xB8F011A0, 0x10FA3D98,
-                                      0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B, 0x9A53E479, 0xB6F84565,
-                                      0xD28E49BC, 0x4BFB9790, 0xE1DDF2DA, 0xA4CB7E33, 0x62FB1341,
-                                      0xCEE4C6E8, 0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4,
-                                      0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0, 0xD08ED1D0,
-                                      0xAFC725E0, 0x8E3C5B2F, 0x8E7594B7, 0x8FF6E2FB, 0xF2122B64,
-                                      0x8888B812, 0x900DF01C, 0x4FAD5EA0, 0x688FC31C, 0xD1CFF191,
-                                      0xB3A8C1AD, 0x2F2F2218, 0xBE0E1777, 0xEA752DFE, 0x8B021FA1,
-                                      0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299, 0xB4A84FE0,
-                                      0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9, 0x165FA266, 0x80957705,
-                                      0x93CC7314, 0x211A1477, 0xE6AD2065, 0x77B5FA86, 0xC75442F5,
-                                      0xFB9D35CF, 0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49,
-                                      0x00250E2D, 0x2071B35E, 0x226800BB, 0x57B8E0AF, 0x2464369B,
-                                      0xF009B91E, 0x5563911D, 0x59DFA6AA, 0x78C14389, 0xD95A537F,
-                                      0x207D5BA2, 0x02E5B9C5, 0x83260376, 0x6295CFA9, 0x11C81968,
-                                      0x4E734A41, 0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915,
-                                      0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400, 0x08BA6FB5,
-                                      0x571BE91F, 0xF296EC6B, 0x2A0DD915, 0xB6636521, 0xE7B9F9B6,
-                                      0xFF34052E, 0xC5855664, 0x53B02D5D, 0xA99F8FA1, 0x08BA4799,
-                                      0x6E85076A};
-    private final static int[] KS1 = {0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623, 0xAD6EA6B0,
-                                      0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266, 0xECAA8C71, 0x699A17FF,
-                                      0x5664526C, 0xC2B19EE1, 0x193602A5, 0x75094C29, 0xA0591340,
-                                      0xE4183A3E, 0x3F54989A, 0x5B429D65, 0x6B8FE4D6, 0x99F73FD6,
-                                      0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1, 0x4CDD2086,
-                                      0x8470EB26, 0x6382E9C6, 0x021ECC5E, 0x09686B3F, 0x3EBAEFC9,
-                                      0x3C971814, 0x6B6A70A1, 0x687F3584, 0x52A0E286, 0xB79C5305,
-                                      0xAA500737, 0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8,
-                                      0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF, 0xAE0CF51A,
-                                      0x3CB574B2, 0x25837A58, 0xDC0921BD, 0xD19113F9, 0x7CA92FF6,
-                                      0x94324773, 0x22F54701, 0x3AE5E581, 0x37C2DADC, 0xC8B57634,
-                                      0x9AF3DDA7, 0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41,
-                                      0xE238CD99, 0x3BEA0E2F, 0x3280BBA1, 0x183EB331, 0x4E548B38,
-                                      0x4F6DB908, 0x6F420D03, 0xF60A04BF, 0x2CB81290, 0x24977C79,
-                                      0x5679B072, 0xBCAF89AF, 0xDE9A771F, 0xD9930810, 0xB38BAE12,
-                                      0xDCCF3F2E, 0x5512721F, 0x2E6B7124, 0x501ADDE6, 0x9F84CD87,
-                                      0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C, 0xEC7AEC3A,
-                                      0xDB851DFA, 0x63094366, 0xC464C3D2, 0xEF1C1847, 0x3215D908,
-                                      0xDD433B37, 0x24C2BA16, 0x12A14D43, 0x2A65C451, 0x50940002,
-                                      0x133AE4DD, 0x71DFF89E, 0x10314E55, 0x81AC77D6, 0x5F11199B,
-                                      0x043556F1, 0xD7A3C76B, 0x3C11183B, 0x5924A509, 0xF28FE6ED,
-                                      0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E, 0x86E34570, 0xEAE96FB1,
-                                      0x860E5E0A, 0x5A3E2AB3, 0x771FE71C, 0x4E3D06FA, 0x2965DCB9,
-                                      0x99E71D0F, 0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A,
-                                      0xC6150EBA, 0x94E2EA78, 0xA5FC3C53, 0x1E0A2DF4, 0xF2F74EA7,
-                                      0x361D2B3D, 0x1939260F, 0x19C27960, 0x5223A708, 0xF71312B6,
-                                      0xEBADFE6E, 0xEAC31F66, 0xE3BC4595, 0xA67BC883, 0xB17F37D1,
-                                      0x018CFF28, 0xC332DDEF, 0xBE6C5AA5, 0x65582185, 0x68AB9802,
-                                      0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84, 0x1521B628,
-                                      0x29076170, 0xECDD4775, 0x619F1510, 0x13CCA830, 0xEB61BD96,
-                                      0x0334FE1E, 0xAA0363CF, 0xB5735C90, 0x4C70A239, 0xD59E9E0B,
-                                      0xCBAADE14, 0xEECC86BC, 0x60622CA7, 0x9CAB5CAB, 0xB2F3846E,
-                                      0x648B1EAF, 0x19BDF0CA, 0xA02369B9, 0x655ABB50, 0x40685A32,
-                                      0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7, 0x9B540B19, 0x875FA099,
-                                      0x95F7997E, 0x623D7DA8, 0xF837889A, 0x97E32D77, 0x11ED935F,
-                                      0x16681281, 0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99,
-                                      0x57F584A5, 0x1B227263, 0x9B83C3FF, 0x1AC24696, 0xCDB30AEB,
-                                      0x532E3054, 0x8FD948E4, 0x6DBC3128, 0x58EBF2EF, 0x34C6FFEA,
-                                      0xFE28ED61, 0xEE7C3C73, 0x5D4A14D9, 0xE864B7E3, 0x42105D14,
-                                      0x203E13E0, 0x45EEE2B6, 0xA3AAABEA, 0xDB6C4F15, 0xFACB4FD0,
-                                      0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105, 0xD81E799E,
-                                      0x86854DC7, 0xE44B476A, 0x3D816250, 0xCF62A1F2, 0x5B8D2646,
-                                      0xFC8883A0, 0xC1C7B6A3, 0x7F1524C3, 0x69CB7492, 0x47848A0B,
-                                      0x5692B285, 0x095BBF00, 0xAD19489D, 0x1462B174, 0x23820E00,
-                                      0x58428D2A, 0x0C55F5EA, 0x1DADF43E, 0x233F7061, 0x3372F092,
-                                      0x8D937E41, 0xD65FECF1, 0x6C223BDB, 0x7CDE3759, 0xCBEE7460,
-                                      0x4085F2A7, 0xCE77326E, 0xA6078084, 0x19F8509E, 0xE8EFD855,
-                                      0x61D99735, 0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC,
-                                      0x9E447A2E, 0xC3453484, 0xFDD56705, 0x0E1E9EC9, 0xDB73DBD3,
-                                      0x105588CD, 0x675FDA79, 0xE3674340, 0xC5C43465, 0x713E38D8,
-                                      0x3D28F89E, 0xF16DFF20, 0x153E21E7, 0x8FB03D4A, 0xE6E39F2B,
-                                      0xDB83ADF7};
-    private final static int[] KS2 = {0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934, 0x411520F7,
-                                      0x7602D4F7, 0xBCF46B2E, 0xD4A20068, 0xD4082471, 0x3320F46A,
-                                      0x43B7D4B7, 0x500061AF, 0x1E39F62E, 0x97244546, 0x14214F74,
-                                      0xBF8B8840, 0x4D95FC1D, 0x96B591AF, 0x70F4DDD3, 0x66A02F45,
-                                      0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504, 0x96EB27B3,
-                                      0x55FD3941, 0xDA2547E6, 0xABCA0A9A, 0x28507825, 0x530429F4,
-                                      0x0A2C86DA, 0xE9B66DFB, 0x68DC1462, 0xD7486900, 0x680EC0A4,
-                                      0x27A18DEE, 0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6,
-                                      0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42, 0x20FE9E35,
-                                      0xD9F385B9, 0xEE39D7AB, 0x3B124E8B, 0x1DC9FAF7, 0x4B6D1856,
-                                      0x26A36631, 0xEAE397B2, 0x3A6EFA74, 0xDD5B4332, 0x6841E7F7,
-                                      0xCA7820FB, 0xFB0AF54E, 0xD8FEB397, 0x454056AC, 0xBA489527,
-                                      0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B, 0x55A867BC,
-                                      0xA1159A58, 0xCCA92963, 0x99E1DB33, 0xA62A4A56, 0x3F3125F9,
-                                      0x5EF47E1C, 0x9029317C, 0xFDF8E802, 0x04272F70, 0x80BB155C,
-                                      0x05282CE3, 0x95C11548, 0xE4C66D22, 0x48C1133F, 0xC70F86DC,
-                                      0x07F9C9EE, 0x41041F0F, 0x404779A4, 0x5D886E17, 0x325F51EB,
-                                      0xD59BC0D1, 0xF2BCC18F, 0x41113564, 0x257B7834, 0x602A9C60,
-                                      0xDFF8E8A3, 0x1F636C1B, 0x0E12B4C2, 0x02E1329E, 0xAF664FD1,
-                                      0xCAD18115, 0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922,
-                                      0x85B2A20E, 0xE6BA0D99, 0xDE720C8C, 0x2DA2F728, 0xD0127845,
-                                      0x95B794FD, 0x647D0862, 0xE7CCF5F0, 0x5449A36F, 0x877D48FA,
-                                      0xC39DFD27, 0xF33E8D1E, 0x0A476341, 0x992EFF74, 0x3A6F6EAB,
-                                      0xF4F8FD37, 0xA812DC60, 0xA1EBDDF8, 0x991BE14C, 0xDB6E6B0D,
-                                      0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804, 0xF1290DC7,
-                                      0xCC00FFA3, 0xB5390F92, 0x690FED0B, 0x667B9FFB, 0xCEDB7D9C,
-                                      0xA091CF0B, 0xD9155EA3, 0xBB132F88, 0x515BAD24, 0x7B9479BF,
-                                      0x763BD6EB, 0x37392EB3, 0xCC115979, 0x8026E297, 0xF42E312D,
-                                      0x6842ADA7, 0xC66A2B3B, 0x12754CCC, 0x782EF11C, 0x6A124237,
-                                      0xB79251E7, 0x06A1BBE6, 0x4BFB6350, 0x1A6B1018, 0x11CAEDFA,
-                                      0x3D25BDD8, 0xE2E1C3C9, 0x44421659, 0x0A121386, 0xD90CEC6E,
-                                      0xD5ABEA2A, 0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE,
-                                      0x9DBC8057, 0xF0F7C086, 0x60787BF8, 0x6003604D, 0xD1FD8346,
-                                      0xF6381FB0, 0x7745AE04, 0xD736FCCC, 0x83426B33, 0xF01EAB71,
-                                      0xB0804187, 0x3C005E5F, 0x77A057BE, 0xBDE8AE24, 0x55464299,
-                                      0xBF582E61, 0x4E58F48F, 0xF2DDFDA2, 0xF474EF38, 0x8789BDC2,
-                                      0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9, 0x7AEB2661,
-                                      0x8B1DDF84, 0x846A0E79, 0x915F95E2, 0x466E598E, 0x20B45770,
-                                      0x8CD55591, 0xC902DE4C, 0xB90BACE1, 0xBB8205D0, 0x11A86248,
-                                      0x7574A99E, 0xB77F19B6, 0xE0A9DC09, 0x662D09A1, 0xC4324633,
-                                      0xE85A1F02, 0x09F0BE8C, 0x4A99A025, 0x1D6EFE10, 0x1AB93D1D,
-                                      0x0BA5A4DF, 0xA186F20F, 0x2868F169, 0xDCB7DA83, 0x573906FE,
-                                      0xA1E2CE9B, 0x4FCD7F52, 0x50115E01, 0xA70683FA, 0xA002B5C4,
-                                      0x0DE6D027, 0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5,
-                                      0xF0177A28, 0xC0F586E0, 0x006058AA, 0x30DC7D62, 0x11E69ED7,
-                                      0x2338EA63, 0x53C2DD94, 0xC2C21634, 0xBBCBEE56, 0x90BCB6DE,
-                                      0xEBFC7DA1, 0xCE591D76, 0x6F05E409, 0x4B7C0188, 0x39720A3D,
-                                      0x7C927C24, 0x86E3725F, 0x724D9DB9, 0x1AC15BB4, 0xD39EB8FC,
-                                      0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4, 0x1E50EF5E,
-                                      0xB161E6F8, 0xA28514D9, 0x6C51133C, 0x6FD5C7E7, 0x56E14EC4,
-                                      0x362ABFCE, 0xDDC6C837, 0xD79A3234, 0x92638212, 0x670EFA8E,
-                                      0x406000E0};
-    private final static int[] KS3 = {0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B, 0x5CB0679E,
-                                      0x4FA33742, 0xD3822740, 0x99BC9BBE, 0xD5118E9D, 0xBF0F7315,
-                                      0xD62D1C7E, 0xC700C47B, 0xB78C1B6B, 0x21A19045, 0xB26EB1BE,
-                                      0x6A366EB4, 0x5748AB2F, 0xBC946E79, 0xC6A376D2, 0x6549C2C8,
-                                      0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6, 0x2939BBDB,
-                                      0xA9BA4650, 0xAC9526E8, 0xBE5EE304, 0xA1FAD5F0, 0x6A2D519A,
-                                      0x63EF8CE2, 0x9A86EE22, 0xC089C2B8, 0x43242EF6, 0xA51E03AA,
-                                      0x9CF2D0A4, 0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6,
-                                      0x2826A2F9, 0xA73A3AE1, 0x4BA99586, 0xEF5562E9, 0xC72FEFD3,
-                                      0xF752F7DA, 0x3F046F69, 0x77FA0A59, 0x80E4A915, 0x87B08601,
-                                      0x9B09E6AD, 0x3B3EE593, 0xE990FD5A, 0x9E34D797, 0x2CF0B7D9,
-                                      0x022B8B51, 0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28,
-                                      0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C, 0xE029AC71,
-                                      0xE019A5E6, 0x47B0ACFD, 0xED93FA9B, 0xE8D3C48D, 0x283B57CC,
-                                      0xF8D56629, 0x79132E28, 0x785F0191, 0xED756055, 0xF7960E44,
-                                      0xE3D35E8C, 0x15056DD4, 0x88F46DBA, 0x03A16125, 0x0564F0BD,
-                                      0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A, 0x1B3F6D9B,
-                                      0x1E6321F5, 0xF59C66FB, 0x26DCF319, 0x7533D928, 0xB155FDF5,
-                                      0x03563482, 0x8ABA3CBB, 0x28517711, 0xC20AD9F8, 0xABCC5167,
-                                      0xCCAD925F, 0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991,
-                                      0xEA7A90C2, 0xFB3E7BCE, 0x5121CE64, 0x774FBE32, 0xA8B6E37E,
-                                      0xC3293D46, 0x48DE5369, 0x6413E680, 0xA2AE0810, 0xDD6DB224,
-                                      0x69852DFD, 0x09072166, 0xB39A460A, 0x6445C0DD, 0x586CDECF,
-                                      0x1C20C8AE, 0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB,
-                                      0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5, 0x72EACEA8,
-                                      0xFA6484BB, 0x8D6612AE, 0xBF3C6F47, 0xD29BE463, 0x542F5D9E,
-                                      0xAEC2771B, 0xF64E6370, 0x740E0D8D, 0xE75B1357, 0xF8721671,
-                                      0xAF537D5D, 0x4040CB08, 0x4EB4E2CC, 0x34D2466A, 0x0115AF84,
-                                      0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048, 0x6F3F3B82,
-                                      0x3520AB82, 0x011A1D4B, 0x277227F8, 0x611560B1, 0xE7933FDC,
-                                      0xBB3A792B, 0x344525BD, 0xA08839E1, 0x51CE794B, 0x2F32C9B7,
-                                      0xA01FBAC9, 0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7,
-                                      0x1A908749, 0xD44FBD9A, 0xD0DADECB, 0xD50ADA38, 0x0339C32A,
-                                      0xC6913667, 0x8DF9317C, 0xE0B12B4F, 0xF79E59B7, 0x43F5BB3A,
-                                      0xF2D519FF, 0x27D9459C, 0xBF97222C, 0x15E6FC2A, 0x0F91FC71,
-                                      0x9B941525, 0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1,
-                                      0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442, 0xE0EC6E0E,
-                                      0x1698DB3B, 0x4C98A0BE, 0x3278E964, 0x9F1F9532, 0xE0D392DF,
-                                      0xD3A0342B, 0x8971F21E, 0x1B0A7441, 0x4BA3348C, 0xC5BE7120,
-                                      0xC37632D8, 0xDF359F8D, 0x9B992F2E, 0xE60B6F47, 0x0FE3F11D,
-                                      0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F, 0x1618B166,
-                                      0xFD2C1D05, 0x848FD2C5, 0xF6FB2299, 0xF523F357, 0xA6327623,
-                                      0x93A83531, 0x56CCCD02, 0xACF08162, 0x5A75EBB5, 0x6E163697,
-                                      0x88D273CC, 0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614,
-                                      0xE6C6C7BD, 0x327A140A, 0x45E1D006, 0xC3F27B9A, 0xC9AA53FD,
-                                      0x62A80F00, 0xBB25BFE2, 0x35BDD2F6, 0x71126905, 0xB2040222,
-                                      0xB6CBCF7C, 0xCD769C2B, 0x53113EC0, 0x1640E3D3, 0x38ABBD60,
-                                      0x2547ADF0, 0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060,
-                                      0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E, 0x1948C25C,
-                                      0x02FB8A8C, 0x01C36AE4, 0xD6EBE1F9, 0x90D4F869, 0xA65CDEA0,
-                                      0x3F09252D, 0xC208E69F, 0xB74E6132, 0xCE77E25B, 0x578FDFE3,
-                                      0x3AC372E6};
-    //====================================
-    // Useful constants
-    //====================================
-    private static final int ROUNDS = 16;
-    private static final int BLOCK_SIZE = 8; // bytes = 64 bits
-    private static final int SBOX_SK = 256;
-    private static final int P_SZ = ROUNDS + 2;
-    private final int[] S0, S1, S2, S3; // the s-boxes
-    private final int[] P; // the p-array
-    private boolean encrypting = false;
-    private byte[] workingKey = null;
-
-    public BlowfishEngine()
-    {
-        S0 = new int[SBOX_SK];
-        S1 = new int[SBOX_SK];
-        S2 = new int[SBOX_SK];
-        S3 = new int[SBOX_SK];
-        P = new int[P_SZ];
-    }
-
-    /**
-     * initialise a Blowfish cipher.
-     *
-     * @param encryption
-     *            whether or not we are for encryption.
-     * @param key
-     *            the key used to set up the cipher.
-     * @exception IllegalArgumentException
-     *                if the params argument is inappropriate.
-     */
-    public void init(boolean pEncrypting, byte[] key)
-    {
-        encrypting = pEncrypting;
-        workingKey = key;
-        setKey(workingKey);
-        return;
-    }
-
-    public String getAlgorithmName()
-    {
-        return "Blowfish";
-    }
-
-    public final int processBlock(byte[] in, int inOff, byte[] out, int outOff) throws IOException
-    {
-        if (workingKey == null)
-        {
-            throw new IllegalStateException("Blowfish not initialised");
-        }
-        if ((inOff + BLOCK_SIZE) > in.length)
-        {
-            throw new IOException("input buffer too short");
-        }
-        if ((outOff + BLOCK_SIZE) > out.length)
-        {
-            throw new IOException("output buffer too short");
-        }
-        if (encrypting)
-        {
-            encryptBlock(in, inOff, out, outOff);
-        }
-        else
-        {
-            decryptBlock(in, inOff, out, outOff);
-        }
-        return BLOCK_SIZE;
-    }
-
-    public void reset()
-    {
-    }
-
-    public int getBlockSize()
-    {
-        return BLOCK_SIZE;
-    }
-
-    //==================================
-    // Private Implementation
-    //==================================
-    private int func(int x)
-    {
-        return (((S0[(x >>> 24)] + S1[(x >>> 16) & 0xff]) ^ S2[(x >>> 8) & 0xff]) + S3[x & 0xff]);
-    }
-
-    /**
-     * apply the encryption cycle to each value pair in the table.
-     */
-    private void processTable(int xl, int xr, int[] table)
-    {
-        int size = table.length;
-        for (int s = 0; s < size; s += 2)
-        {
-            xl ^= P[0];
-            for (int i = 1; i < ROUNDS; i += 2)
-            {
-                xr ^= func(xl) ^ P[i];
-                xl ^= func(xr) ^ P[i + 1];
-            }
-            xr ^= P[ROUNDS + 1];
-            table[s] = xr;
-            table[s + 1] = xl;
-            xr = xl; // end of cycle swap
-            xl = table[s];
-        }
-    }
-
-    private void setKey(byte[] key)
-    {
-        /*
-         * - comments are from _Applied Crypto_, Schneier, p338 please be
-         * careful comparing the two, AC numbers the arrays from 1, the
-         * enclosed code from 0.
-         *
-         * (1) Initialise the S-boxes and the P-array, with a fixed string This
-         * string contains the hexadecimal digits of pi (3.141...)
-         */
-        System.arraycopy(KS0, 0, S0, 0, SBOX_SK);
-        System.arraycopy(KS1, 0, S1, 0, SBOX_SK);
-        System.arraycopy(KS2, 0, S2, 0, SBOX_SK);
-        System.arraycopy(KS3, 0, S3, 0, SBOX_SK);
-        System.arraycopy(KP, 0, P, 0, P_SZ);
-        /*
-         * (2) Now, XOR P[0] with the first 32 bits of the key, XOR P[1] with
-         * the second 32-bits of the key, and so on for all bits of the key (up
-         * to P[17]). Repeatedly cycle through the key bits until the entire
-         * P-array has been XOR-ed with the key bits
-         */
-        int keyLength = key.length;
-        int keyIndex = 0;
-        for (int i = 0; i < P_SZ; i++)
-        {
-            // get the 32 bits of the key, in 4 * 8 bit chunks
-            int data = 0x0000000;
-            for (int j = 0; j < 4; j++)
-            {
-                // create a 32 bit block
-                data = (data << 8) | (key[keyIndex++] & 0xff);
-                // wrap when we get to the end of the key
-                if (keyIndex >= keyLength)
-                {
-                    keyIndex = 0;
-                }
-            }
-            // XOR the newly created 32 bit chunk onto the P-array
-            P[i] ^= data;
-        }
-        /*
-         * (3) Encrypt the all-zero string with the Blowfish algorithm, using
-         * the subkeys described in (1) and (2)
-         *
-         * (4) Replace P1 and P2 with the output of step (3)
-         *
-         * (5) Encrypt the output of step(3) using the Blowfish algorithm, with
-         * the modified subkeys.
-         *
-         * (6) Replace P3 and P4 with the output of step (5)
-         *
-         * (7) Continue the process, replacing all elements of the P-array and
-         * then all four S-boxes in order, with the output of the continuously
-         * changing Blowfish algorithm
-         */
-        processTable(0, 0, P);
-        processTable(P[P_SZ - 2], P[P_SZ - 1], S0);
-        processTable(S0[SBOX_SK - 2], S0[SBOX_SK - 1], S1);
-        processTable(S1[SBOX_SK - 2], S1[SBOX_SK - 1], S2);
-        processTable(S2[SBOX_SK - 2], S2[SBOX_SK - 1], S3);
-    }
-
-    /**
-     * Encrypt the given input starting at the given offset and place the
-     * result in the provided buffer starting at the given offset. The input
-     * will be an exact multiple of our blocksize.
-     */
-    private void encryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)
-    {
-        int xl = bytesTo32bits(src, srcIndex);
-        int xr = bytesTo32bits(src, srcIndex + 4);
-        xl ^= P[0];
-        for (int i = 1; i < ROUNDS; i += 2)
-        {
-            xr ^= func(xl) ^ P[i];
-            xl ^= func(xr) ^ P[i + 1];
-        }
-        xr ^= P[ROUNDS + 1];
-        bits32ToBytes(xr, dst, dstIndex);
-        bits32ToBytes(xl, dst, dstIndex + 4);
-    }
-
-    /**
-     * Decrypt the given input starting at the given offset and place the
-     * result in the provided buffer starting at the given offset. The input
-     * will be an exact multiple of our blocksize.
-     */
-    private void decryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)
-    {
-        int xl = bytesTo32bits(src, srcIndex);
-        int xr = bytesTo32bits(src, srcIndex + 4);
-        xl ^= P[ROUNDS + 1];
-        for (int i = ROUNDS; i > 0; i -= 2)
-        {
-            xr ^= func(xl) ^ P[i];
-            xl ^= func(xr) ^ P[i - 1];
-        }
-        xr ^= P[0];
-        bits32ToBytes(xr, dst, dstIndex);
-        bits32ToBytes(xl, dst, dstIndex + 4);
-    }
-
-    private int bytesTo32bits(byte[] b, int i)
-    {
-        return ((b[i + 3] & 0xff) << 24) | ((b[i + 2] & 0xff) << 16) | ((b[i + 1] & 0xff) << 8)
-            | ((b[i] & 0xff));
-    }
-
-    private void bits32ToBytes(int in, byte[] b, int offset)
-    {
-        b[offset] = (byte) in;
-        b[offset + 1] = (byte) (in >> 8);
-        b[offset + 2] = (byte) (in >> 16);
-        b[offset + 3] = (byte) (in >> 24);
-    }
-}

+ 0 - 211
L2J_CommunityServer/java/com/l2jserver/communityserver/network/netcon/crypt/NewCrypt.java

@@ -1,211 +0,0 @@
-/*
- * 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.communityserver.network.netcon.crypt;
-
-import java.io.IOException;
-import java.util.logging.Logger;
-
-public class NewCrypt
-{
-	protected static Logger _log = Logger.getLogger(NewCrypt.class.getName());
-	BlowfishEngine _crypt;
-	BlowfishEngine _decrypt;
-
-	public NewCrypt(final byte[] blowfishKey)
-	{
-		_crypt = new BlowfishEngine();
-		_crypt.init(true, blowfishKey);
-		_decrypt = new BlowfishEngine();
-		_decrypt.init(false, blowfishKey);
-	}
-
-	public NewCrypt(final String key)
-	{
-		this(key.getBytes());
-	}
-
-	public static final boolean verifyChecksum(byte[] raw)
-	{
-		return NewCrypt.verifyChecksum(raw, 0, raw.length);
-	}
-
-	public static final boolean verifyChecksum(byte[] raw, final int offset, final int size)
-	{
-		// check if size is multiple of 4 and if there is more then only the checksum
-		if ((size & 3) != 0 || size <= 4)
-		{
-			return false;
-		}
-
-		long chksum = 0;
-		int count = size-4;
-		long check = -1;
-		int i;
-
-		for (i = offset; i<count; i+=4)
-		{
-			check = raw[i] &0xff;
-			check |= raw[i+1] << 8 &0xff00;
-			check |= raw[i+2] << 0x10 &0xff0000;
-			check |= raw[i+3] << 0x18 &0xff000000;
-
-			chksum ^= check;
-		}
-
-		check = raw[i] &0xff;
-		check |= raw[i+1] << 8 &0xff00;
-		check |= raw[i+2] << 0x10 &0xff0000;
-		check |= raw[i+3] << 0x18 &0xff000000;
-
-		return check == chksum;
-	}
-
-	public static final void appendChecksum(byte[] raw)
-	{
-		NewCrypt.appendChecksum(raw, 0, raw.length);
-	}
-
-	public static final void appendChecksum(byte[] raw, final int offset, final int size)
-	{
-		long chksum = 0;
-		int count = size-4;
-		long ecx;
-		int i;
-
-		for (i = offset; i<count; i+=4)
-		{
-			ecx = raw[i] &0xff;
-			ecx |= raw[i+1] << 8 &0xff00;
-			ecx |= raw[i+2] << 0x10 &0xff0000;
-			ecx |= raw[i+3] << 0x18 &0xff000000;
-
-			chksum ^= ecx;
-		}
-
-		ecx = raw[i] &0xff;
-		ecx |= raw[i+1] << 8 &0xff00;
-		ecx |= raw[i+2] << 0x10 &0xff0000;
-		ecx |= raw[i+3] << 0x18 &0xff000000;
-
-		raw[i] = (byte) (chksum &0xff);
-		raw[i+1] = (byte) (chksum >>0x08 &0xff);
-		raw[i+2] = (byte) (chksum >>0x10 &0xff);
-		raw[i+3] = (byte) (chksum >>0x18 &0xff);
-	}
-
-	/**
-	 * Packet is first XOR encoded with <code>key</code>
-	 * Then, the last 4 bytes are overwritten with the the XOR "key".
-	 * Thus this assume that there is enough room for the key to fit without overwriting data.
-	 * @param raw The raw bytes to be encrypted
-	 * @param key The 4 bytes (int) XOR key
-	 */
-	public static final void encXORPass(byte[] raw, int key)
-	{
-		NewCrypt.encXORPass(raw, 0, raw.length, key);
-	}
-
-	/**
-	 * Packet is first XOR encoded with <code>key</code>
-	 * Then, the last 4 bytes are overwritten with the the XOR "key".
-	 * Thus this assume that there is enough room for the key to fit without overwriting data.
-	 * @param raw The raw bytes to be encrypted
-	 * @param offset The begining of the data to be encrypted
-	 * @param size Length of the data to be encrypted
-	 * @param key The 4 bytes (int) XOR key
-	 */
-	public static final void encXORPass(byte[] raw, final int offset, final int size, int key)
-	{
-		int stop = size-8;
-		int pos = 4 + offset;
-		int edx;
-		int ecx = key; // Initial xor key
-
-		while (pos < stop)
-		{
-			edx = (raw[pos] & 0xFF);
-			edx |= (raw[pos+1] & 0xFF) << 8;
-			edx |= (raw[pos+2] & 0xFF) << 16;
-			edx |=  (raw[pos+3] & 0xFF) << 24;
-
-			ecx += edx;
-
-			edx ^= ecx;
-
-			raw[pos++] = (byte) (edx & 0xFF);
-			raw[pos++] = (byte) (edx >> 8 & 0xFF);
-			raw[pos++] = (byte) (edx >> 16 & 0xFF);
-			raw[pos++] = (byte) (edx >> 24 & 0xFF);
-		}
-
-		raw[pos++] = (byte) (ecx & 0xFF);
-		raw[pos++] = (byte) (ecx >> 8 & 0xFF);
-		raw[pos++] = (byte) (ecx >> 16 & 0xFF);
-		raw[pos++] = (byte) (ecx >> 24 & 0xFF);
-	}
-
-
-	public final byte[] decrypt(byte[] raw) throws IOException
-	{
-		byte[] result = new byte[raw.length];
-		int count = raw.length /8;
-
-		for (int i=0; i<count;i++)
-		{
-			_decrypt.processBlock(raw,i*8,result,i*8);
-		}
-
-		return result;
-	}
-
-	public final void decrypt(byte[] raw, final int offset, final int size) throws IOException
-	{
-		byte[] result = new byte[size];
-		int count = size /8;
-
-		for (int i=0; i<count;i++)
-		{
-			_decrypt.processBlock(raw,offset + i*8,result,i*8);
-		}
-		
-		System.arraycopy(result, 0, raw, offset, size);
-	}
-
-	public final byte[] crypt(byte[] raw) throws IOException
-	{
-		int count = raw.length /8;
-		byte[] result = new byte[raw.length];
-
-		for (int i=0; i<count;i++)
-		{
-			_crypt.processBlock(raw,i*8,result,i*8);
-		}
-
-		return result;
-	}
-
-	public final void crypt(byte[] raw, final int offset, final int size) throws IOException
-	{
-		int count = size/8;
-		byte[] result = new byte[size];
-
-		for (int i=0; i<count;i++)
-		{
-			_crypt.processBlock(raw,offset + i*8,result,i*8);
-		}
-		
-		System.arraycopy(result, 0, raw, offset, size);
-	}
-}

+ 0 - 71
L2J_CommunityServer/java/com/l2jserver/communityserver/network/readpackets/BlowFishKey.java

@@ -1,71 +0,0 @@
-/*
- * 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.communityserver.network.readpackets;
-
-import java.security.GeneralSecurityException;
-import java.security.interfaces.RSAPrivateKey;
-
-import javax.crypto.Cipher;
-
-import com.l2jserver.communityserver.network.GameServerThread;
-import com.l2jserver.communityserver.network.netcon.BaseReadPacket;
-import com.l2jserver.communityserver.network.netcon.crypt.NewCrypt;
-
-/**
- * @author -Wooden-
- */
-
-public class BlowFishKey extends BaseReadPacket
-{
-	private final RSAPrivateKey _key;
-	private final GameServerThread _gst;
-	
-	public BlowFishKey(final byte[] data, final RSAPrivateKey key, final GameServerThread gst)
-	{
-		super(data);
-		_key = key;
-		_gst = gst;
-		
-		final int size = readD();
-		final byte[] tempKey = readB(size);
-		try
-		{
-			final Cipher rsaCipher = Cipher.getInstance("RSA/ECB/nopadding");
-	        rsaCipher.init(Cipher.DECRYPT_MODE, _key);
-	        final byte[] tempDecryptKey = rsaCipher.doFinal(tempKey);
-	        // there are nulls before the key we must remove them
-	        int i = 0;
-	        for (; i < tempDecryptKey.length; i++)
-	        {
-	        	if (tempDecryptKey[i] != 0)
-	        		break;
-	        }
-	        final byte key2[] = new byte[tempDecryptKey.length-i];
-	        System.arraycopy(tempDecryptKey, i, key2, 0, tempDecryptKey.length - i);
-	        
-	        _gst.setCrypt(new NewCrypt(key2));
-		}
-		catch (GeneralSecurityException e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	@Override
-	public final void run()
-	{
-		// nothing
-	}
-}

+ 0 - 43
L2J_CommunityServer/java/com/l2jserver/communityserver/network/readpackets/GameServerAuth.java

@@ -1,43 +0,0 @@
-/*
- * 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.communityserver.network.readpackets;
-
-import com.l2jserver.communityserver.network.GameServerThread;
-import com.l2jserver.communityserver.network.netcon.BaseReadPacket;
-
-/**
- * @author Forsaiken
- */
-
-public final class GameServerAuth extends BaseReadPacket
-{
-	private final GameServerThread _gst;
-	
-	public GameServerAuth(final byte[] data, final GameServerThread gst)
-	{
-		super(data);
-		_gst = gst;
-	}
-	
-	@Override
-	public final void run()
-	{
-		final int size = readD();
-		final byte[] hexId = readB(size);
-		final int sqlDPId = readD();
-		
-		_gst.onGameServerAuth(hexId, sqlDPId);
-	}
-}

+ 0 - 38
L2J_CommunityServer/java/com/l2jserver/communityserver/network/readpackets/RequestShowCommunityBoard.java

@@ -1,38 +0,0 @@
-/*
- * 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.communityserver.network.readpackets;
-
-import com.l2jserver.communityserver.network.GameServerThread;
-import com.l2jserver.communityserver.network.netcon.BaseReadPacket;
-
-public final class RequestShowCommunityBoard extends BaseReadPacket
-{
-	private final GameServerThread _gst;
-	
-	public RequestShowCommunityBoard(final byte[] data, final GameServerThread gst)
-	{
-		super(data);
-		_gst = gst;
-	}
-	
-	@Override
-	public final void run()
-	{
-		final int playerObjId = super.readD();
-		final String cmd = super.readS();
-		
-		_gst.getCommunityBoardManager().parseCmd(playerObjId, cmd);
-	}
-}

+ 0 - 43
L2J_CommunityServer/java/com/l2jserver/communityserver/network/readpackets/RequestWriteCommunityBoard.java

@@ -1,43 +0,0 @@
-/*
- * 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.communityserver.network.readpackets;
-
-import com.l2jserver.communityserver.network.GameServerThread;
-import com.l2jserver.communityserver.network.netcon.BaseReadPacket;
-
-public final class RequestWriteCommunityBoard extends BaseReadPacket
-{
-	private final GameServerThread _gst;
-	
-	public RequestWriteCommunityBoard(final byte[] data, final GameServerThread gst)
-	{
-		super(data);
-		_gst = gst;
-	}
-	
-	@Override
-	public final void run()
-	{
-		final int playerObjId = super.readD();
-		final String url = super.readS();
-		final String arg1 = super.readS();
-		final String arg2 = super.readS();
-		final String arg3 = super.readS();
-		final String arg4 = super.readS();
-		final String arg5 = super.readS();
-		
-		_gst.getCommunityBoardManager().parseWrite(playerObjId,url,arg1,arg2,arg3,arg4,arg5);
-	}
-}

+ 0 - 199
L2J_CommunityServer/java/com/l2jserver/communityserver/network/readpackets/WorldInfo.java

@@ -1,199 +0,0 @@
-/*
- * 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.communityserver.network.readpackets;
-
-//import java.util.logging.Logger;
-
-import com.l2jserver.communityserver.model.Forum;
-import com.l2jserver.communityserver.model.L2Castle;
-import com.l2jserver.communityserver.model.L2Player;
-import com.l2jserver.communityserver.model.L2Clan;
-import com.l2jserver.communityserver.model.Post;
-import com.l2jserver.communityserver.model.Topic;
-import com.l2jserver.communityserver.network.GameServerThread;
-import com.l2jserver.communityserver.network.netcon.BaseReadPacket;
-import com.l2jserver.communityserver.network.writepackets.PlayerSendMessage;
-import com.l2jserver.communityserver.network.writepackets.RequestWorldInfo;
-
-public final class WorldInfo extends BaseReadPacket
-{
-	// private static Logger _log = Logger.getLogger(WorldInfo.class.getName());
-	private final GameServerThread _gst;
-	private final int _type;
-	public final int INIT_PACKET = 0x00;
-	public final int PLAYER_PACKET = 0x01;
-	public final int CLAN_PACKET = 0x02;
-	public final int CLAN_NOTICE_PACKET = 0x03;
-	
-	public WorldInfo(final byte[] data, final GameServerThread gst, final int type)
-	{
-		super(data);
-		_gst = gst;
-		_type = type;
-	}
-	
-	@Override
-	public final void run()
-	{
-		switch (_type)
-		{
-			case INIT_PACKET:
-				// clan data
-				final int type = super.readD();
-				int i;
-				switch (type)
-				{
-					// information
-					case 0:
-						_gst.addNeededPacket(super.readD());
-						break;
-					// player
-					case 1:
-						final int playersCount = super.readD();
-						for (i = 0; i < playersCount;i++)
-						{
-							int playerObjId = super.readD();
-							String name = super.readS();
-							String accountName = super.readS();
-							int playerLevel = super.readD();
-							int playerClanId = super.readD();
-							int accessLevel = super.readD();
-							boolean isOnline = (super.readC() == 1 ? true : false);
-							L2Player newPlayer = new L2Player(playerObjId, name, accountName, playerLevel, accessLevel, playerClanId, isOnline);
-							int friendSize = super.readD();
-							for (int j = 0; j < friendSize; j++)
-							{
-								newPlayer.addFriend(super.readD());
-							}
-							_gst.getCommunityBoardManager().addPlayer(newPlayer);
-						}
-						break;
-					// clan
-					case 2:
-						final int clanCount = super.readD();
-						int clanId;
-						String clanName;
-						int level;
-						int lordObjId;
-						String lordName;
-						int members;
-						String allyName;
-						for (i = 0; i < clanCount;i++)
-						{
-							clanId = super.readD();
-							clanName = super.readS();
-							level = super.readD();
-							lordObjId = super.readD();
-							lordName = super.readS();
-							members = super.readD();
-							boolean isNoticeEnabled =(super.readC() == 1 ? true : false);
-							allyName = super.readS();
-							int allySize = super.readD();
-							int[] alliance = new int[allySize];
-							for (int j = 0; j < allySize; j++)
-							{
-								alliance[j] = super.readD();
-							}
-							_gst.getCommunityBoardManager().addClan(new L2Clan(clanId, clanName, level, lordObjId, lordName, members, allyName, alliance, isNoticeEnabled));
-						}
-						break;
-					// castle
-					case 3:
-						final int castleCount = super.readD();
-						for (i = 0; i < castleCount;i++)
-						{
-							int castleId = super.readD();
-							String castleName = super.readS();
-							int ownerId = super.readD();
-							int tax = super.readD();
-							long siegeDate = ((long)super.readD()) * 1000;
-							_gst.getCommunityBoardManager().addCastle(new L2Castle(castleId, castleName, ownerId, tax, siegeDate));
-						}
-						break;
-				}
-				break;
-			case PLAYER_PACKET:
-				final int isFull = super.readC();
-				switch (isFull)
-				{
-					// full player packet
-					case 0x00:
-						int playerObjId = super.readD();
-						String name = super.readS();
-						String accountName = super.readS();
-						int playerLevel = super.readD();
-						int playerClanId = super.readD();
-						int accessLevel = super.readD();
-						boolean isOnline = (super.readC() == 1 ? true : false);
-						int friendSize = super.readD();
-						int[] friendIDs = new int[friendSize];
-						for (int j = 0; j < friendSize; j++)
-						{
-							friendIDs[j] = super.readD();
-						}
-						_gst.getCommunityBoardManager().updatePlayer(playerObjId, name, accountName, playerLevel, accessLevel, playerClanId, isOnline, friendIDs);
-						break;
-					// status packet
-					case 0x01:
-						playerObjId = super.readD();
-						isOnline = (super.readC() == 1 ? true : false);
-						if (_gst.getCommunityBoardManager().getPlayer(playerObjId) == null)
-						{
-							_gst.getCommunityBoardManager().getGST().sendPacket(new RequestWorldInfo(RequestWorldInfo.PLAYER_DATA_UPDATE, playerObjId, null, false));
-							return;
-						}
-						L2Player player = _gst.getCommunityBoardManager().getPlayer(playerObjId);
-						L2Clan playersClan = _gst.getCommunityBoardManager().getClan(player.getClanId()); 
-						player.setIsOnline(isOnline);
-						if (isOnline)
-						{
-							Forum f = _gst.getCommunityBoardManager().getPlayerForum(playerObjId);
-							int unReaded = 0;
-							for (Post p : f.gettopic(Topic.INBOX).getAllPosts())
-								if (p.getReadCount() == 0)
-									unReaded++;
-							if (unReaded >= 1)
-								_gst.getCommunityBoardManager().getGST().sendPacket(new PlayerSendMessage(playerObjId,1227,String.valueOf(unReaded)));
-						}
-						if (playersClan != null && playersClan.getLordObjId() == playerObjId && !playersClan.isNoticeLoaded())
-							_gst.sendPacket(new RequestWorldInfo(RequestWorldInfo.CLAN_NOTICE_DATA, playersClan.getClanId(), "", false));
-						break;
-				}
-				break;
-			case CLAN_PACKET:
-				int clanId = super.readD();
-				String clanName = super.readS();
-				int level = super.readD();
-				int lordObjId = super.readD();
-				String lordName = super.readS();
-				int members = super.readD();
-				boolean isNoticeEnabled =(super.readC() == 1 ? true : false);
-				String allyName = super.readS();
-				int allySize = super.readD();
-				int[] alliance = new int[allySize];
-				for (int j = 0; j < allySize; j++)
-				{
-					alliance[j] = super.readD();
-				}
-				_gst.getCommunityBoardManager().updateClan(clanId, clanName, level, lordObjId, lordName, members, allyName, alliance, isNoticeEnabled);
-				break;
-			case CLAN_NOTICE_PACKET:
-				clanId = super.readD();
-				String notice = super.readS();
-				_gst.getCommunityBoardManager().getClan(clanId).setNotice(notice);
-				break;
-		}
-	}
-}

+ 0 - 33
L2J_CommunityServer/java/com/l2jserver/communityserver/network/writepackets/AuthResponse.java

@@ -1,33 +0,0 @@
-/*
- * 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.communityserver.network.writepackets;
-
-import com.l2jserver.communityserver.network.netcon.BaseWritePacket;
-
-public final class AuthResponse extends BaseWritePacket
-{
-	public static final byte AUTHED						= 0;
-	public static final byte REASON_WRONG_HEX_ID		= 1;
-	public static final byte REASON_HEX_ID_IN_USE		= 2;
-	public static final byte REASON_WRONG_SQL_DP_ID		= 3;
-	public static final byte REASON_SQL_DP_ID_IN_USE	= 4;
-	
-	public AuthResponse(final int status)
-	{
-		writeC(0x00);
-		writeC(0x01);
-		writeC(status);
-	}
-}

+ 0 - 35
L2J_CommunityServer/java/com/l2jserver/communityserver/network/writepackets/CommunityServerFail.java

@@ -1,35 +0,0 @@
-/*
- * 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.communityserver.network.writepackets;
-
-import com.l2jserver.communityserver.network.netcon.BaseWritePacket;
-
-public final class CommunityServerFail extends BaseWritePacket
-{
-	public static final byte REASON_IP_BANNED = 1;
-	public static final byte REASON_IP_RESERVED = 2;
-	public static final byte REASON_WRONG_HEXID = 3;
-	public static final byte REASON_ID_RESERVED = 4;
-	public static final byte REASON_NO_FREE_ID = 5;
-	public static final byte NOT_AUTHED = 6;
-	public static final byte REASON_ALREADY_LOGGED_IN = 7;
-	
-	public CommunityServerFail(final int reason)
-	{
-		writeC(0x00);
-		writeC(0x02);
-		writeC(reason);
-	}
-}

+ 0 - 32
L2J_CommunityServer/java/com/l2jserver/communityserver/network/writepackets/InitCS.java

@@ -1,32 +0,0 @@
-/*
- * 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.communityserver.network.writepackets;
-
-import com.l2jserver.communityserver.network.netcon.BaseWritePacket;
-
-/**
- * @author Forsaiken
- */
-
-public final class InitCS extends BaseWritePacket
-{
-	public InitCS(final byte[] publicKey)
-    {
-    	writeC(0x00);
-    	writeC(0x00);
-    	writeD(publicKey.length);
-    	writeB(publicKey);
-    }
-}

+ 0 - 44
L2J_CommunityServer/java/com/l2jserver/communityserver/network/writepackets/PlayerSendMessage.java

@@ -1,44 +0,0 @@
-/*
- * 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.communityserver.network.writepackets;
-
-import com.l2jserver.communityserver.network.netcon.BaseWritePacket;
-
-public final class PlayerSendMessage extends BaseWritePacket
-{
-	public static final int TEXT_MESSAGE						= 0;
-	public static final int ONLY_THE_CLAN_LEADER_IS_ENABLED		= 236;
-	public static final int NO_CB_IN_MY_CLAN					= 1050;
-	public static final int NO_READ_PERMISSION					= 1070;
-	public static final int NO_WRITE_PERMISSION					= 1071;
-	public PlayerSendMessage(final int playerObjId, final int type, String message)
-	{
-		writeC(0x02);
-		writeC(0x01);
-		writeD(playerObjId);
-		writeD(type);
-		switch (type)
-		{
-			case TEXT_MESSAGE:
-			case 1228:
-			case 1370:
-				writeS(message);
-				break;
-			case 1227:
-				writeD(Integer.valueOf(message));
-				break;
-		}
-	}
-}

+ 0 - 171
L2J_CommunityServer/java/com/l2jserver/communityserver/network/writepackets/PlayerShowBoard.java

@@ -1,171 +0,0 @@
-/*
- * 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.communityserver.network.writepackets;
-
-import java.io.UnsupportedEncodingException;
-
-import javolution.util.FastList;
-import com.l2jserver.communityserver.network.netcon.BaseWritePacket;
-
-public final class PlayerShowBoard extends BaseWritePacket
-{
-	private static final byte[] DEC_HEAD =
-	{
-		123,	// C 0x7B
-		1,		// C 0x01
-		98,0,121,0,112,0,97,0,115,0,115,0,32,0,95,0,98,0,98,0,115,0,104,0,111,0,109,0,101,0,0,0,						// S "bypass _bbshome"
-		98,0,121,0,112,0,97,0,115,0,115,0,32,0,95,0,98,0,98,0,115,0,103,0,101,0,116,0,102,0,97,0,118,0,0,0,				// S "bypass _bbsgetfav"
-		98,0,121,0,112,0,97,0,115,0,115,0,32,0,95,0,98,0,98,0,115,0,108,0,111,0,99,0,0,0,								// S "bypass _bbsloc"
-		98,0,121,0,112,0,97,0,115,0,115,0,32,0,95,0,98,0,98,0,115,0,99,0,108,0,97,0,110,0,0,0,							// S "bypass _bbsclan"
-		98,0,121,0,112,0,97,0,115,0,115,0,32,0,95,0,98,0,98,0,115,0,109,0,101,0,109,0,111,0,0,0,						// S "bypass _bbsmemo"
-		98,0,121,0,112,0,97,0,115,0,115,0,32,0,95,0,98,0,98,0,115,0,109,0,97,0,105,0,108,0,0,0,							// S "bypass _bbsmail"
-		98,0,121,0,112,0,97,0,115,0,115,0,32,0,95,0,98,0,98,0,115,0,102,0,114,0,105,0,101,0,110,0,100,0,115,0,0,0,		// S "bypass _bbsfriends"
-		98,0,121,0,112,0,97,0,115,0,115,0,32,0,95,0,98,0,98,0,115,0,95,0,97,0,100,0,100,0,95,0,102,0,97,0,118,0,0,0,	// S "bypass _bbs_add_fav"
-	};
-	
-	private static final byte[][] DEC_10X =
-	{
-		{49,0,48,0,49,0,8,0,0,0,0,0},	// "101"
-		{49,0,48,0,50,0,8,0,0,0,0,0},	// "102"
-		{49,0,48,0,51,0,8,0,0,0,0,0},	// "103"
-		{49,0,48,0,52,0,8,0,0,0,0,0}	// "104"
-	};
-	
-	private PlayerShowBoard(final int playerObjId)
-	{
-		writeC(0x02);
-		writeC(0x00);
-		writeD(playerObjId);
-	}
-	
-	/**
-	 * ID: 10X
-	 * @param playerObjId
-	 * @param html
-	 * @param id (101 = 0, 102 = 1, 103 = 2, 104 = 3)
-	 */
-	public PlayerShowBoard(final int playerObjId, final String html, final byte id)
-	{
-		this(playerObjId);
-		try
-		{
-			final byte[] data = getBytes10X(html, id);
-			writeD(DEC_HEAD.length + data.length); // write DEC_HEAD length + html length
-			writeB(DEC_HEAD); // write head
-			writeB(data); // write html
-		}
-		catch (UnsupportedEncodingException e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	/**
-	 * ID: 1001
-	 * @param playerObjId
-	 * @param html
-	 */
-	public PlayerShowBoard(final int playerObjId, final String html)
-	{
-		this(playerObjId);
-		try
-		{
-			final byte[] data = getBytes1001(html);
-			writeD(DEC_HEAD.length + data.length); // write DEC_HEAD length + html length
-			writeB(DEC_HEAD); // write head
-			writeB(data); // write html
-		}
-		catch (UnsupportedEncodingException e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	/**
-	 * ID: 1002
-	 * @param playerObjId
-	 * @param args (FastList<String>)
-	 */
-	public PlayerShowBoard(final int playerObjId, final FastList<String> args)
-	{
-		this(playerObjId);
-		try
-		{
-			final byte[] data = getBytes1002(args);
-			writeD(DEC_HEAD.length + data.length); // write DEC_HEAD length + args length
-			writeB(DEC_HEAD); // write head
-			writeB(data); // write args
-		}
-		catch (UnsupportedEncodingException e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	private final byte[] getBytes10X(final String html, final byte id) throws UnsupportedEncodingException
-	{
-	    if (html == null) return DEC_10X[id];
-	    final byte[] dataHtml = html.getBytes("UTF-16LE");
-        final byte[] data = new byte[12 + dataHtml.length];
-        data[0] = 49;
-        data[2] = 48;
-        data[4] = (byte)(49 + id);
-        data[6] = 8;
-        System.arraycopy(dataHtml, 0, data, 8, dataHtml.length);
-        return data;
-	}
-	
-	private final byte[] getBytes1001(final String html) throws UnsupportedEncodingException
-	{
-		final byte[] dataHtml = html.getBytes("UTF-16LE");
-        final byte[] data = new byte[14 + dataHtml.length];
-        data[0] = 49;
-        data[2] = 48;
-        data[4] = 48;
-        data[6] = 49;
-        data[8] = 8;
-        System.arraycopy(dataHtml, 0, data, 10, dataHtml.length);
-        return data;
-	}
-	
-	private final byte[] getBytes1002(final FastList<String> args) throws UnsupportedEncodingException
-	{
-		int len = 10;
-		for (final String arg : args)
-		{
-			len += (arg.length() + 4) * 2;
-		}
-		final byte data[] = new byte[len];
-		
-		data[0] = 49;
-		data[2] = 48;
-		data[4] = 48;
-		data[6] = 50;
-		data[8] = 8;
-		
-		int i = 10;
-		for (final String arg : args)
-		{
-			final byte[] dataHtml = arg.getBytes("UTF-16LE");
-			System.arraycopy(dataHtml, 0, data, i, dataHtml.length);
-			i += dataHtml.length;
-			data[i] = 0x20;
-			i+=2;
-			data[i] = 0x08;
-			i+=2;
-		}
-		return data;
-	}
-}

+ 0 - 60
L2J_CommunityServer/java/com/l2jserver/communityserver/network/writepackets/RequestWorldInfo.java

@@ -1,60 +0,0 @@
-/*
- * 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.communityserver.network.writepackets;
-
-import com.l2jserver.communityserver.network.netcon.BaseWritePacket;
-
-public final class RequestWorldInfo extends BaseWritePacket
-{
-	public static final byte SERVER_LOAD						= 0;
-	public static final byte PLAYER_DATA_UPDATE					= 1;
-	public static final byte CLAN_DATA_UPDATE					= 2;
-	public static final byte CLAN_NOTICE_UPDATE					= 3;
-	public static final byte CLAN_NOTICE_FLAG					= 4;
-	public static final byte CLAN_NOTICE_DATA					= 5;
-	public RequestWorldInfo(final int type, int intbuffer, String strbuffer, boolean boobuffer)
-	{
-		writeC(0x01);
-		switch (type)
-		{
-			case SERVER_LOAD:
-				writeC(0x00);
-				break;
-			case PLAYER_DATA_UPDATE:
-				writeC(0x01);
-				super.writeD(intbuffer);
-				break;
-			case CLAN_DATA_UPDATE:
-				writeC(0x02);
-				super.writeD(intbuffer);
-				break;
-			case CLAN_NOTICE_UPDATE:
-				writeC(0x03);
-				super.writeD(intbuffer);
-				super.writeS(strbuffer);
-				super.writeC((boobuffer ? 1:0));
-				break;
-			case CLAN_NOTICE_FLAG:
-				writeC(0x04);
-				super.writeD(intbuffer);
-				super.writeC((boobuffer ? 1:0));
-				break;
-			case CLAN_NOTICE_DATA:
-				writeC(0x05);
-				super.writeD(intbuffer);
-				break;
-		}
-	}
-}

+ 0 - 83
L2J_CommunityServer/java/com/l2jserver/communityserver/threading/ThreadPoolManager.java

@@ -1,83 +0,0 @@
-/*
- * 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.communityserver.threading;
-
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import com.l2jserver.communityserver.Config;
-
-/**
- * Simple wrapper class to run packets on a ThreadPoolExecutor.<br>
- * PriorityThreadFactory has been imported from L2J Server, coded by Wooden
- * 
- * @author DrHouse - L2JServer Team
- *
- */
-public class ThreadPoolManager
-{
-	private static ThreadPoolExecutor _mainPool;
-	
-	
-	public static synchronized final boolean init()
-	{
-		if (_mainPool != null)
-			return false;
-		
-		_mainPool = new ThreadPoolExecutor(Config.GENERAL_THREAD_CORE_SIZE, Config.GENERAL_THREAD_CORE_SIZE + 2, 5L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new PriorityThreadFactory("CommunityServer Executor pool", Thread.NORM_PRIORITY));
-		_mainPool.prestartAllCoreThreads();
-		return true;
-	}
-	
-	public final static void execute(Runnable task)
-	{
-		_mainPool.execute(task);
-	}
-	
-	private static class PriorityThreadFactory implements ThreadFactory
-	{
-		private int _prio;
-		private String _name;
-		private AtomicInteger _threadNumber = new AtomicInteger(1);
-		private ThreadGroup _group;
-		
-		public PriorityThreadFactory(String name, int prio)
-		{
-			_prio = prio;
-			_name = name;
-			_group = new ThreadGroup(_name);
-		}
-		
-		/* (non-Javadoc)
-		 * @see java.util.concurrent.ThreadFactory#newThread(java.lang.Runnable)
-		 */
-		public Thread newThread(Runnable r)
-		{
-			Thread t = new Thread(_group, r);
-			t.setName(_name + "-" + _threadNumber.getAndIncrement());
-			t.setPriority(_prio);
-			return t;
-		}
-		
-		@SuppressWarnings("unused")
-		public ThreadGroup getGroup()
-		{
-			return _group;
-		}
-	}
-}

+ 0 - 73
L2J_CommunityServer/java/com/l2jserver/communityserver/util/Rnd.java

@@ -1,73 +0,0 @@
-/*
- * 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.communityserver.util;
-
-import java.util.Random;
-
-public final class Rnd
-{
-	private static final Random rnd = new Random();
-	
-	public static final double get()	// get random number from 0 to 1
-	{
-        return rnd.nextDouble();
-	}
-	
-	/**
-	 * Gets a random number from 0(inclusive) to n(exclusive)
-	 *
-	 * @param n The superior limit (exclusive)
-	 * @return A number from 0 to n-1
-	 */
-    public static final int get(final int n) // get random number from 0 to n-1
-    {
-        return (int)(rnd.nextDouble() * n);
-    }
-    
-    public static final int get(int min, int max) // get random number from min to max (not max-1 !)
-    {
-        return min + (int)Math.floor(rnd.nextDouble() * (max - min + 1));
-    }
-    
-    public static final int nextInt(int n)
-    {
-        return (int)Math.floor(rnd.nextDouble() * n);
-    }
-
-    public static final int nextInt()
-    {
-        return rnd.nextInt();
-    }
-    
-    public static final double nextDouble()
-    {
-        return rnd.nextDouble();
-    }
-    
-    public static final double nextGaussian()
-    {
-        return rnd.nextGaussian();
-    }
-    
-    public static final boolean nextBoolean()
-    {
-        return rnd.nextBoolean();
-    }
-    
-    public static final void nextBytes(byte[] array)
-    {
-    	rnd.nextBytes(array);
-    }
-}

+ 0 - 37
L2J_CommunityServer/java/com/l2jserver/communityserver/util/buffer/AbstractBufferedByteReader.java

@@ -1,37 +0,0 @@
-/*
- * 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.communityserver.util.buffer;
-
-/**
- * @author Forsaiken
- */
-public abstract class AbstractBufferedByteReader
-{
-	protected final byte[] buf;
-	protected int rIndex;
-	
-	protected AbstractBufferedByteReader(final byte[] data)
-	{
-		buf = data;
-	}
-	
-	public abstract int readC();
-	public abstract int readH();
-	public abstract int readD();
-	public abstract double readF();
-	public abstract long readQ();
-	public abstract String readS();
-	public abstract byte[] readB(final int length);
-}

+ 0 - 49
L2J_CommunityServer/java/com/l2jserver/communityserver/util/buffer/AbstractBufferedByteWriter.java

@@ -1,49 +0,0 @@
-/*
- * 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.communityserver.util.buffer;
-
-import java.util.Arrays;
-
-/**
- * @author Forsaiken
- */
-public abstract class AbstractBufferedByteWriter
-{
-	protected byte[] buf;
-	protected int wIndex;
-	
-	protected AbstractBufferedByteWriter(final int size)
-	{
-		buf = new byte[size];
-	}
-	
-	public abstract void writeC(final int value);
-	public abstract void writeH(final int value);
-	public abstract void writeD(final int value);
-	public abstract void writeF(final double value);
-	public abstract void writeQ(final long value);
-	public abstract void writeS(final String text);
-	public abstract void writeB(final byte[] data);
-	
-	public final int length()
-	{
-		return wIndex;
-	}
-	
-	public final byte[] toByteArray()
-	{
-		return Arrays.copyOf(buf, wIndex);
-	}
-}

+ 0 - 98
L2J_CommunityServer/java/com/l2jserver/communityserver/util/buffer/BufferedByteReader.java

@@ -1,98 +0,0 @@
-/*
- * 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.communityserver.util.buffer;
-
-/**
- * @author Forsaiken
- */
-public final class BufferedByteReader extends AbstractBufferedByteReader
-{
-	public BufferedByteReader(final byte[] data)
-	{
-		super(data);
-	}
-	
-	@Override
-	public final int readC()
-	{
-		return buf[rIndex++] & 0x000000FF;
-	}
-	
-	@Override
-	public final int readH()
-	{
-		int result = buf[rIndex++] & 0x000000FF;
-		result |= buf[rIndex++] << 8 & 0x0000FF00;
-		return result;
-	}
-	
-	@Override
-	public final int readD()
-	{
-		int result = buf[rIndex++] & 0x000000FF;
-		result |= buf[rIndex++] << 8 & 0x0000FF00;
-		result |= buf[rIndex++] << 16 & 0x00FF0000;
-		result |= buf[rIndex++] << 24 & 0xFF000000;
-		return result;
-	}
-	
-	@Override
-	public final double readF()
-	{
-		long result = buf[rIndex++] & 0x00000000000000FF;
-		result |= buf[rIndex++] << 8 & 0x000000000000FF00;
-		result |= buf[rIndex++] << 16 & 0x0000000000FF0000;
-		result |= buf[rIndex++] << 24 & 0x00000000FF000000;
-		result |= buf[rIndex++] << 32 & 0x000000FF00000000L;
-		result |= buf[rIndex++] << 40 & 0x0000FF0000000000L;
-		result |= buf[rIndex++] << 48 & 0x00FF000000000000L;
-		result |= buf[rIndex++] << 56 & 0xFF00000000000000L;
-		return Double.longBitsToDouble(result);
-	}
-	
-	@Override
-	public final long readQ()
-	{
-		final int value1 = (buf[rIndex++] & 0x000000FF) | (buf[rIndex++] << 8 & 0x0000FF00) | (buf[rIndex++] << 16 & 0x00FF0000) | (buf[rIndex++] << 24 & 0xFF000000);
-		final int value2 = (buf[rIndex++] & 0x000000FF) | (buf[rIndex++] << 8 & 0x0000FF00) | (buf[rIndex++] << 16 & 0x00FF0000) | (buf[rIndex++] << 24 & 0xFF000000);
-		return (value1 & 0xFFFFFFFFL) | (value2 & 0xFFFFFFFFL) << 32;
-	}
-	
-	@Override
-	public final byte[] readB(final int length)
-	{
-		final byte[] result = new byte[length];
-		System.arraycopy(buf, rIndex, result, 0, length);
-		rIndex += length;
-		return result;
-	}
-	
-	@Override
-	public final String readS()
-	{
-		String result = null;
-		try
-		{
-			result = new String(buf, rIndex, buf.length - rIndex, "UTF-16LE");
-			result = result.substring(0, result.indexOf(0x00));
-			rIndex += result.length() * 2 + 2;
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-		}
-		return result;
-	}
-}

+ 0 - 128
L2J_CommunityServer/java/com/l2jserver/communityserver/util/buffer/BufferedByteWriter.java

@@ -1,128 +0,0 @@
-/*
- * 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.communityserver.util.buffer;
-
-import java.io.UnsupportedEncodingException;
-import java.util.Arrays;
-
-/**
- * @author Forsaiken
- */
-public final class BufferedByteWriter extends AbstractBufferedByteWriter
-{
-	public BufferedByteWriter()
-	{
-		super(32);
-	}
-	
-	public BufferedByteWriter(final int size)
-	{
-		super(size);
-	}
-	
-	@Override
-	public final void writeC(final int value)
-	{
-		expand(1);
-		buf[wIndex++] = (byte)(value & 0x000000FF);
-	}
-	
-	@Override
-	public final void writeH(final int value)
-	{
-		expand(2);
-		buf[wIndex++] = (byte)(value & 0x000000FF);
-		buf[wIndex++] = (byte)(value >> 8 & 0x000000FF);
-	}
-	
-	@Override
-	public final void writeD(final int value)
-	{
-		expand(4);
-		buf[wIndex++] = (byte)(value & 0x000000FF);
-		buf[wIndex++] = (byte)(value >> 8 & 0x000000FF);
-		buf[wIndex++] = (byte)(value >> 16 & 0x000000FF);
-		buf[wIndex++] = (byte)(value >> 24 & 0x000000FF);
-	}
-	
-	@Override
-	public final void writeF(final double value)
-	{
-		writeQ(Double.doubleToRawLongBits(value));
-	}
-	
-	@Override
-	public final void writeQ(final long value)
-	{
-		expand(8);
-		buf[wIndex++] = (byte)(value & 0x000000FF);
-		buf[wIndex++] = (byte)(value >> 8 & 0x000000FF);
-		buf[wIndex++] = (byte)(value >> 16 & 0x000000FF);
-		buf[wIndex++] = (byte)(value >> 24 & 0x000000FF);
-		buf[wIndex++] = (byte)(value >> 32 & 0x000000FF);
-		buf[wIndex++] = (byte)(value >> 40 & 0x000000FF);
-		buf[wIndex++] = (byte)(value >> 48 & 0x000000FF);
-		buf[wIndex++] = (byte)(value >> 56 & 0x000000FF);
-	}
-	
-	@Override
-	public final void writeS(final String text)
-	{
-		if (text != null)
-		{
-			try
-			{
-				final byte[] data = text.getBytes("UTF-16LE");
-				
-				expand(data.length + 2);
-				
-				System.arraycopy(data, 0, buf, wIndex, data.length);
-				
-				wIndex += data.length + 2;
-			}
-			catch (UnsupportedEncodingException e)
-			{
-				e.printStackTrace();
-			}
-		}
-		else
-		{
-			expand(2);
-			wIndex += 2;
-		}
-	}
-	
-	@Override
-	public final void writeB(final byte[] data)
-	{
-		try
-		{
-			expand(data.length);
-			System.arraycopy(data, 0, buf, wIndex, data.length);
-			wIndex += data.length;
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	private synchronized void expand(final int expand)
-	{
-		final int newSize = wIndex + expand;
-		if (newSize > buf.length)
-			buf = Arrays.copyOf(buf, Math.max(buf.length << 1, newSize));
-	}
-}

+ 0 - 141
L2J_CommunityServer/java/com/l2jserver/communityserver/util/buffer/SynchronizedBufferedByteReader.java

@@ -1,141 +0,0 @@
-/*
- * 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.communityserver.util.buffer;
-
-/**
- * @author Forsaiken
- */
-public final class SynchronizedBufferedByteReader extends AbstractBufferedByteReader
-{	
-	public SynchronizedBufferedByteReader(final byte[] data)
-	{
-		super(data);
-	}
-	
-	@Override
-	public final int readC()
-	{
-		int result;
-		
-		synchronized(buf)
-		{
-			result = buf[rIndex++] & 0x000000FF;
-		}
-		
-		return result;
-	}
-	
-	@Override
-	public final int readH()
-	{
-		int result;
-		
-		synchronized(buf)
-		{
-			result = buf[rIndex++] & 0x000000FF;
-			result |= buf[rIndex++] << 8 & 0x0000FF00;
-		}
-		
-		return result;
-	}
-	
-	@Override
-	public final int readD()
-	{
-		int result;
-		
-		synchronized(buf)
-		{
-			result = buf[rIndex++] & 0x000000FF;
-			result |= buf[rIndex++] << 8 & 0x0000FF00;
-			result |= buf[rIndex++] << 16 & 0x00FF0000;
-			result |= buf[rIndex++] << 24 & 0xFF000000;
-		}
-		
-		return result;
-	}
-	
-	@Override
-	public final double readF()
-	{
-		long result;
-		
-		synchronized(buf)
-		{
-			result = buf[rIndex++] & 0x00000000000000FF;
-			result |= buf[rIndex++] << 8 & 0x000000000000FF00;
-			result |= buf[rIndex++] << 16 & 0x0000000000FF0000;
-			result |= buf[rIndex++] << 24 & 0x00000000FF000000;
-			result |= buf[rIndex++] << 32 & 0x000000FF00000000L;
-			result |= buf[rIndex++] << 40 & 0x0000FF0000000000L;
-			result |= buf[rIndex++] << 48 & 0x00FF000000000000L;
-			result |= buf[rIndex++] << 56 & 0xFF00000000000000L;
-		}
-		
-		return Double.longBitsToDouble(result);
-	}
-	
-	@Override
-	public final long readQ()
-	{
-		int value1, value2;
-		
-		synchronized(buf)
-		{
-			value1 = (buf[rIndex++] & 0x000000FF) | (buf[rIndex++] << 8 & 0x0000FF00) | (buf[rIndex++] << 16 & 0x00FF0000) | (buf[rIndex++] << 24 & 0xFF000000);
-			value2 = (buf[rIndex++] & 0x000000FF) | (buf[rIndex++] << 8 & 0x0000FF00) | (buf[rIndex++] << 16 & 0x00FF0000) | (buf[rIndex++] << 24 & 0xFF000000);
-		}
-		
-		return (value1 & 0xFFFFFFFFL) | (value2 & 0xFFFFFFFFL) << 32;
-	}
-	
-	@Override
-	public final byte[] readB(final int length)
-	{
-		final byte[] result = new byte[length];
-		
-		synchronized(buf)
-		{
-			for (int i = 0; i < length; i++)
-			{
-				result[i] = buf[rIndex++];
-			}
-		}
-		
-		return result;
-	}
-	
-	@Override
-	public final String readS()
-	{
-		String result = null;
-		
-		try
-		{
-			synchronized(buf)
-			{
-				result = new String(buf, rIndex, buf.length - rIndex, "UTF-16LE");
-				result = result.substring(0, result.indexOf(0x00));
-				rIndex += result.length() * 2 + 2;
-			}
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-		}
-		
-		return result;
-	}
-}

+ 0 - 141
L2J_CommunityServer/java/com/l2jserver/communityserver/util/buffer/SynchronizedBufferedByteWriter.java

@@ -1,141 +0,0 @@
-/*
- * 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.communityserver.util.buffer;
-
-import java.util.Arrays;
-
-/**
- * @author Forsaiken
- */
-public final class SynchronizedBufferedByteWriter extends AbstractBufferedByteWriter
-{
-	public SynchronizedBufferedByteWriter()
-	{
-		super(32);
-	}
-	
-	public SynchronizedBufferedByteWriter(final int size)
-	{
-		super(size);
-	}
-	
-	@Override
-	public final void writeC(final int value)
-	{
-		synchronized(buf)
-		{
-			expand(1);
-			buf[wIndex++] = (byte)(value & 0x000000FF);
-		}
-	}
-	
-	@Override
-	public final void writeH(final int value)
-	{
-		synchronized(buf)
-		{
-			expand(2);
-			buf[wIndex++] = (byte)(value & 0x000000FF);
-			buf[wIndex++] = (byte)(value >> 8 & 0x000000FF);
-		}
-	}
-	
-	@Override
-	public final void writeD(final int value)
-	{
-		synchronized(buf)
-		{
-			expand(4);
-			buf[wIndex++] = (byte)(value & 0x000000FF);
-			buf[wIndex++] = (byte)(value >> 8 & 0x000000FF);
-			buf[wIndex++] = (byte)(value >> 16 & 0x000000FF);
-			buf[wIndex++] = (byte)(value >> 24 & 0x000000FF);
-		}
-	}
-	
-	@Override
-	public final void writeF(final double value)
-	{
-		writeQ(Double.doubleToRawLongBits(value));
-	}
-	
-	@Override
-	public final void writeQ(final long value)
-	{
-		synchronized(buf)
-		{
-			expand(8);
-			buf[wIndex++] = (byte)(value & 0x000000FF);
-			buf[wIndex++] = (byte)(value >> 8 & 0x000000FF);
-			buf[wIndex++] = (byte)(value >> 16 & 0x000000FF);
-			buf[wIndex++] = (byte)(value >> 24 & 0x000000FF);
-			buf[wIndex++] = (byte)(value >> 32 & 0x000000FF);
-			buf[wIndex++] = (byte)(value >> 40 & 0x000000FF);
-			buf[wIndex++] = (byte)(value >> 48 & 0x000000FF);
-			buf[wIndex++] = (byte)(value >> 56 & 0x000000FF);
-		}
-	}
-	
-	@Override
-	public final void writeS(final String text)
-	{
-		if (text != null)
-		{
-			synchronized(buf)
-			{
-				expand(text.length() + 2);
-				for (final char c : text.toCharArray())
-				{
-					buf[wIndex] = (byte)c;
-					wIndex += 2;
-				}
-				wIndex += 2;
-			}
-		}
-		else
-		{
-			synchronized(buf)
-			{
-				expand(2);
-				wIndex += 2;
-			}
-		}
-	}
-	
-	@Override
-	public final void writeB(final byte[] data)
-	{
-		try
-		{
-			synchronized(buf)
-			{
-				expand(data.length);
-				System.arraycopy(data, 0, buf, wIndex, data.length);
-				wIndex += data.length;
-			}
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	private synchronized void expand(final int expand)
-	{
-		final int newSize = wIndex + expand;
-		if (newSize > buf.length)
-			buf = Arrays.copyOf(buf, Math.max(buf.length << 1, newSize));
-	}
-}

+ 0 - 30
L2J_CommunityServer/java/com/l2jserver/log/AuditFilter.java

@@ -1,30 +0,0 @@
-/*
- * 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.log;
-
-import java.util.logging.Filter;
-import java.util.logging.LogRecord;
-
-/**
- * @author zabbix
- * Lets drink to code!
- */
-public class AuditFilter implements Filter
-{
-	public boolean isLoggable(LogRecord record)
-	{
-		return record.getLoggerName().equalsIgnoreCase("audit");
-	}
-}

+ 0 - 53
L2J_CommunityServer/java/com/l2jserver/log/AuditFormatter.java

@@ -1,53 +0,0 @@
-/*
- * 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.log;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.logging.Formatter;
-import java.util.logging.LogRecord;
-
-import javolution.text.TextBuilder;
-
-/**
- * @author zabbix
- * Lets drink to code!
- */
-public class AuditFormatter extends Formatter
-{
-	private static final String CRLF = "\r\n";
-	private SimpleDateFormat dateFmt = new SimpleDateFormat("dd MMM H:mm:ss");
-
-	@Override
-	public String format(LogRecord record)
-	{
-        TextBuilder output = new TextBuilder();
-		output.append('[');
-		output.append(dateFmt.format(new Date(record.getMillis())));
-		output.append(']');
-		output.append(' ');
-		output.append(record.getMessage());
-		for (Object p : record.getParameters())
-		{
-			if (p == null) continue;
-			output.append(',');
-			output.append(' ');
-			output.append(p.toString());
-		}
-		output.append(CRLF);
-
-		return output.toString();
-	}
-}

+ 0 - 67
L2J_CommunityServer/java/com/l2jserver/log/ConsoleLogFormatter.java

@@ -1,67 +0,0 @@
-/*
- * 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.log;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.logging.Formatter;
-import java.util.logging.LogRecord;
-import javolution.text.TextBuilder;
-
-/**
- * This class ...
- * 
- * @version $Revision: 1.1.4.2 $ $Date: 2005/03/27 15:30:08 $
- */
-public class ConsoleLogFormatter extends Formatter
-{
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.util.logging.Formatter#format(java.util.logging.LogRecord)
-	 */
-	private static final String CRLF = "\r\n";
-
-	private SimpleDateFormat dateFmt = new SimpleDateFormat("dd MMM H:mm:ss");
-
-	public String format(LogRecord record)
-	{
-		TextBuilder output = new TextBuilder();
-		output.append('[');
-		output.append(dateFmt.format(new Date(record.getMillis())));
-		output.append(']');
-		output.append(' ');
-		output.append(record.getMessage());
-		output.append(CRLF);
-		if (record.getThrown() != null)
-		{
-			try
-			{
-				StringWriter sw = new StringWriter();
-				PrintWriter pw = new PrintWriter(sw);
-				record.getThrown().printStackTrace(pw);
-				pw.close();
-				output.append(sw.toString());
-				output.append(CRLF);
-			}
-			catch (Exception ex)
-			{
-			}
-		}
-		return output.toString();
-	}
-}

+ 0 - 26
L2J_CommunityServer/java/com/l2jserver/log/ErrorFilter.java

@@ -1,26 +0,0 @@
-/*
- * 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.log;
-
-import java.util.logging.Filter;
-import java.util.logging.LogRecord;
-
-public class ErrorFilter implements Filter
-{
-	public boolean isLoggable(LogRecord record)
-	{
-		return record.getThrown() != null;
-	}
-}

+ 0 - 26
L2J_CommunityServer/java/com/l2jserver/log/ErrorLogHandler.java

@@ -1,26 +0,0 @@
-/*
- * 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.log;
-
-import java.io.IOException;
-import java.util.logging.FileHandler;
-
-public class ErrorLogHandler extends FileHandler
-{
-	public ErrorLogHandler() throws IOException, SecurityException
-	{
-		super();
-	}
-}

+ 0 - 58
L2J_CommunityServer/java/com/l2jserver/log/FileLogFormatter.java

@@ -1,58 +0,0 @@
-/*
- * 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.log;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.logging.Formatter;
-import java.util.logging.LogRecord;
-
-import javolution.text.TextBuilder;
-
-/**
- * This class ...
- *
- * @version $Revision: 1.1.4.1 $ $Date: 2005/03/27 15:30:08 $
- */
-
-public class FileLogFormatter extends Formatter
-{
-
-	/* (non-Javadoc)
-	 * @see java.util.logging.Formatter#format(java.util.logging.LogRecord)
-	 */
-	private static final String CRLF = "\r\n";
-	private static final String _ = "\t";
-	private SimpleDateFormat dateFmt = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss,SSS");
-
-	@Override
-	public String format(LogRecord record)
-	{
-        TextBuilder output = new TextBuilder();
-
-		return output
-		.append(dateFmt.format(new Date(record.getMillis())))
-		.append(_)
-		.append(record.getLevel().getName())
-		.append(_)
-		.append(record.getThreadID())
-		.append(_)
-		.append(record.getLoggerName())
-		.append(_)
-		.append(record.getMessage())
-		.append(CRLF)
-		.toString();
-	}
-}

+ 0 - 25
L2J_CommunityServer/java/config/General.properties

@@ -1,25 +0,0 @@
-#=========================================================================================================================
-#                                             General Server Settings
-#=========================================================================================================================
-# Purpose:
-#	This properties file is for the general settings of the server.
-# 
-# Note: 
-#	The defaults are set to retail, if you modify any of these settings your server will NOT be "retail-like".
-# 
-# Warning: 
-#	Please take extreme caution when changing anything. Also please understand what you change before you do so on
-# 	a live server.
-#=========================================================================================================================
-
-# Required Player level for Mail and Memo service
-#default: 1
-MinPlayerLvLForForum = 1
-
-# Required Clan level for Clan board
-# default: 2
-MinClanLvLForForum = 2
-
-# only visual now, not implemented!
-# default: 90 days
-MailAutoDeletionTime = 90

+ 0 - 70
L2J_CommunityServer/java/config/communityserver.properties

@@ -1,70 +0,0 @@
-# ================================================================
-# General server setting !!! REQUIRED to configure to everyone !!!
-# ================================================================
-
-# The address on which Community Board server will listen for GameServers, use * to bind on all available IPs
-# Default: *
-# CSHostname = *
-
-# The port on which Community Board server will listen for GameServers
-# Default: 9013 
-# CSPort = 9013
-
-# If set to true any GameServer can register on your login's free slots
-AcceptNewGameServer = False
-
-# Database info
-Driver = com.mysql.jdbc.Driver
-#Driver = org.hsqldb.jdbcDriver
-#Driver = com.microsoft.sqlserver.jdbc.SQLServerDriver
-URL = jdbc:mysql://localhost/l2jcb
-#URL = jdbc:hsqldb:hsql://localhost/l2jcb
-#URL = jdbc:sqlserver://localhost/database=l2jcb/user=sa/password=
-Login = root
-Password =
-MaximumDbConnections = 10
-
-# ================================================================
-# TCP Server start
-# ================================================================
-
-# ExternalHostAddress: Use * bind all available IPs
-# Default: *
-ExternalHostAddress = *
-# ExternalPort: Use 0 bind all available Ports
-# Default: 0
-ExternalPort = 9013
-# ConnectionQueue: Maximum connections.
-# Default: 50
-ConnectionQueue = 50
-
-# Default: False
-FloodProtectionEnabled = False
-# Default: 15
-FastConnectionLimit = 15
-# Default: 350
-FastConnectionTime = 350
-# Default: 700
-NormalConnectionTime = 700
-# Default: 50
-MaxConnectionperIP = 50
-# Default: False
-IPBannEnabled = False
-# Default:
-IPBannList =
-
-# ================================================================
-# TCP Client start
-# ================================================================
-# SendBufferSize: DO NOT TOUCH!
-# Default: 8192
-SendBufferSize = 8192
-# SendBufferSize: DO NOT TOUCH!
-# Default: 8192
-ReceiveBufferSize = 8192
-
-# ================================================================
-# Threading
-# ================================================================
-# Approximated number of working threads running simultaneously in the pool
-ThreadPoolSize = 1

+ 0 - 15
L2J_CommunityServer/java/config/telnet.properties

@@ -1,15 +0,0 @@
-#Telnet is disabled by default.
-EnableTelnet = false
-
-#This is the port telnet server will bind to
-StatusPort = 12345
-
-#If the following is not set, a random password is generated on server startup.
-#StatusPW = somePass
-
-#This list can contain IPs or Hosts of clients you wish to allow.
-#Hosts must be resolvable to an IP.
-#The format is as follows:
-#ListOfHosts = 0.0.0.0,host,0.0.0.1,host2,host3,host4,0.0.0.3
-#Make sure there are no spaces between hosts/ips
-ListOfHosts = 127.0.0.1,localhost

+ 0 - 7
L2J_CommunityServer/java/console.cfg

@@ -1,7 +0,0 @@
-# Default global logging level.
-# This specifies which kinds of events are logged across
-# all loggers.  For any given facility this global level
-# can be overriden by a facility specific level
-# Note that the ConsoleHandler also has a separate level
-# setting to limit messages printed to the console.
-.level=OFF

+ 0 - 53
L2J_CommunityServer/java/log.cfg

@@ -1,53 +0,0 @@
-############################################################
-#  	Global properties
-############################################################
-
-# "handlers" specifies a comma separated list of log Handler 
-# classes.  These handlers will be installed during VM startup.
-# Note that these classes must be on the system classpath.
-# By default we only configure a ConsoleHandler, which will only
-# show messages at the INFO and above levels.
-#handlers= java.util.logging.ConsoleHandler
-
-# To also add the FileHandler, use the following line instead.
-handlers = java.util.logging.FileHandler,java.util.logging.ConsoleHandler,\
-com.l2jserver.log.ErrorLogHandler
-
-
-# Default global logging level.
-# This specifies which kinds of events are logged across
-# all loggers.  For any given facility this global level
-# can be overriden by a facility specific level
-# Note that the ConsoleHandler also has a separate level
-# setting to limit messages printed to the console.
-.level= CONFIG
-
-############################################################
-# Handler specific properties.
-# Describes specific configuration info for Handlers.
-############################################################
-
-# default file output is in user's home directory.
-java.util.logging.FileHandler.pattern = log/java%u.log
-java.util.logging.FileHandler.limit = 500000
-java.util.logging.FileHandler.count = 5
-java.util.logging.FileHandler.formatter = com.l2jserver.log.FileLogFormatter
-java.util.logging.FileHandler.level = CONFIG
-
-# Limit the message that are printed on the console to INFO and above.
-java.util.logging.ConsoleHandler.level = FINER
-java.util.logging.ConsoleHandler.formatter = com.l2jserver.log.ConsoleLogFormatter
-
-# log errors (exceptions)
-com.l2jserver.ErrorLogHandler.pattern = log/error%u.log
-com.l2jserver.ErrorLogHandler.count = 5
-com.l2jserver.ErrorLogHandler.formatter = java.util.logging.SimpleFormatter
-com.l2jserver.ErrorLogHandler.filter = com.l2jserver.log.ErrorFilter
-com.l2jserver.ErrorLogHandler.level = CONFIG
-
-# audit
-com.l2jserver.AuditLogHandler.pattern = log/audit.log
-com.l2jserver.AuditLogHandler.formatter = com.l2jserver.log.AuditFormatter
-com.l2jserver.AuditLogHandler.filter = com.l2jserver.log.AuditFilter
-com.l2jserver.AuditLogHandler.append = true
-com.l2jserver.AuditLogHandler.level = INFO

+ 0 - 38
L2J_CommunityServer/launcher/Community.launch

@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/CommunityServer/java/com/l2jserver/communityserver/L2CommunityServer.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
-<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;sourceLookupDirector&gt;&#13;&#10;&lt;sourceContainers duplicates=&quot;false&quot;&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;folder nest=&amp;quot;false&amp;quot; path=&amp;quot;/CommunityServer/java&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.folder&quot;/&gt;&#13;&#10;&lt;/sourceContainers&gt;&#13;&#10;&lt;/sourceLookupDirector&gt;&#13;&#10;"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.debug.ui.target_debug_perspective" value="perspective_default"/>
-<stringAttribute key="org.eclipse.debug.ui.target_run_perspective" value="perspective_default"/>
-<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;CommunityServer&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#13;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;CommunityServer&quot;/&gt;&#13;&#10;&lt;/runtimeClasspathEntry&gt;&#13;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/CommunityServer/lib/c3p0-0.9.2-pre1.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/CommunityServer/lib/mchange-commons-0.2.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/CommunityServer/lib/javolution-5.5.1.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/CommunityServer/lib/mysql-connector-java-5.1.12-bin.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
-</listAttribute>
-<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.l2jserver.communityserver.L2CommunityServer"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="CommunityServer"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx128m"/>
-<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="D:/_l2j/community/"/>
-<booleanAttribute key="yk-capture-cpu-on-exit" value="false"/>
-<booleanAttribute key="yk-capture-memory-on-exit" value="false"/>
-<booleanAttribute key="yk-disable-alloc" value="false"/>
-<booleanAttribute key="yk-disable-counts" value="false"/>
-<booleanAttribute key="yk-launch-ui" value="true"/>
-<intAttribute key="yk-mem-threshold" value="0"/>
-<booleanAttribute key="yk-startup-with-object-allocations" value="false"/>
-</launchConfiguration>

BIN
L2J_CommunityServer/lib/c3p0-0.9.2-pre1.jar


+ 0 - 502
L2J_CommunityServer/lib/c3p0_LICENSE.txt

@@ -1,502 +0,0 @@
-		  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!

BIN
L2J_CommunityServer/lib/javolution-5.5.1.jar


+ 0 - 27
L2J_CommunityServer/lib/javolution_LICENSE.txt

@@ -1,27 +0,0 @@
-/*
- * Javolution - Java(tm) Solution for Real-Time and Embedded Systems
- * Copyright (c) 2005-2009, Javolution (http://javolution.org/)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */

BIN
L2J_CommunityServer/lib/mchange-commons-0.2.jar


BIN
L2J_CommunityServer/lib/mysql-connector-java-5.1.15-bin.jar


+ 0 - 43
L2J_CommunityServer/lib/mysql-connector-java_LICENSE.txt

@@ -1,43 +0,0 @@
-MySQL Connector/J @MYSQL_CJ_VERSION@ (formerly MM.MySQL)
-Sun Microsystem's JDBC Driver for MySQL
-Copyright 2003-2008 MySQL AB, 2008 Sun Microsystems
-
-CONTENTS
-
-* License
-* Documentation Location
-
-
-LICENSE
-
-MySQL Connector/J is licensed under the GPL or a commercial license
-from Sun Microsystems. 
-
-If you have licensed this product under the GPL, please see the COPYING
-file for more information. 
-
-There are special exceptions to the terms and conditions of the GPL 
-as it is applied to this software. View the full text of the 
-exception in file EXCEPTIONS-CONNECTOR-J in the directory of this 
-software distribution.
-
-If you have licensed this product under a commercial license from
-MySQL AB, please see the file "LICENSE.mysql" that comes with this 
-distribution for the terms of the license.
-
-If you need non-GPL licenses for commercial distribution please contact 
-me <mark@mysql.com> or <sales@mysql.com>.
-
-
-DOCUMENTATION LOCATION
- 
-The documentation formerly contained in this file has moved into the 
-'doc' directory, where it is available in HTML, PDF and plaintext
-forms.
-
-You may also find the latest copy of the documentation on the MySQL
-website at http://dev.mysql.com/doc/refman/5.0/en/connector-j.html
-
---
-This software is OSI Certified Open Source Software.
-OSI Certified is a certification mark of the Open Source Initiative.

+ 0 - 7
MMOCore/.classpath

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="lib" path="lib/javolution.jar"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>

+ 0 - 17
MMOCore/.project

@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>MMOCore</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>

+ 0 - 281
MMOCore/.settings/org.eclipse.jdt.core.prefs

@@ -1,281 +0,0 @@
-#Sat Sep 11 14:21:37 CEST 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.codeComplete.argumentPrefixes=
-org.eclipse.jdt.core.codeComplete.argumentSuffixes=
-org.eclipse.jdt.core.codeComplete.fieldPrefixes=
-org.eclipse.jdt.core.codeComplete.fieldSuffixes=
-org.eclipse.jdt.core.codeComplete.localPrefixes=
-org.eclipse.jdt.core.codeComplete.localSuffixes=
-org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
-org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=0
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=0
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=0
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=0
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=0
-org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
-org.eclipse.jdt.core.formatter.comment.format_block_comments=false
-org.eclipse.jdt.core.formatter.comment.format_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
-org.eclipse.jdt.core.formatter.comment.format_line_comments=false
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
-org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
-org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.join_lines_in_comments=true
-org.eclipse.jdt.core.formatter.join_wrapped_lines=true
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=true
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=300
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
-org.eclipse.jdt.core.formatter.tabulation.char=tab
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_on_off_tags=false
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
-org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 9
MMOCore/.settings/org.eclipse.jdt.ui.prefs


+ 0 - 6
MMOCore/.settings/org.eclipse.wst.validation.prefs

@@ -1,6 +0,0 @@
-#Tue Mar 13 21:21:27 BRT 2007
-DELEGATES_PREFERENCE=delegateValidatorListorg.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator\=org.eclipse.wst.wsdl.validation.internal.eclipse.Validator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator\=org.eclipse.wst.xsd.core.internal.validation.eclipse.Validator;
-USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;org.eclipse.wst.html.internal.validation.HTMLValidator;org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;
-USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;org.eclipse.wst.html.internal.validation.HTMLValidator;org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;
-USER_PREFERENCE=overrideGlobalPreferencesfalse
-eclipse.preferences.version=1

+ 0 - 79
MMOCore/build.xml

@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="MMOCore" default="dist" basedir=".">
-	<description>
-        MMOCore
-    </description>
-    
-    <property name="src" location="src"/>
-    <property name="lib" location="lib"/>
-    <property name="build" location="build"/>
-    <property name="build.classes" location="${build}/classes"/>
-    <property name="build.dist" location="${build}/dist"/>
-    
-    <path id="classpath">
-        <fileset dir="${lib}">
-            <include name="javolution.jar"/>
-        </fileset>
-    </path>
-    
-    <target name="init"
-    	depends="clean"
-    	description="Create the output directories.">
-        <mkdir dir="${build}"/>
-        <mkdir dir="${build.classes}"/>
-        <mkdir dir="${build.dist}" />
-    </target>
-    
-    <target name="compile"
-            depends="init"
-            description="Compile the source.">
-
-        <javac destdir="${build.classes}"
-               optimize="off"
-               debug="on"
-               source="1.5"
-               target="1.5"
-               nowarn="off">
-            <src path="${src}"/>
-            <classpath refid="classpath"/>   
-        </javac>
-    </target>
-    
-    <target name="jar"
-            depends="compile"
-            description="Create the jar file">
-
-        <jar destfile="${build}/mmocore.jar">
-            <fileset dir="${build.classes}"/>
-            <manifest>
-                <attribute name="Main-Class" value="com.l2jserver.mmocore.MMOCore"/>
-                <attribute name="Class-Path" value="javolution.jar"/>
-            </manifest>
-        </jar>
-        
-   		<copy todir="${build.dist}">
-			<fileset dir="${src}/../lib">
-				<include name="*.jar"/>
-			</fileset>
-		</copy>
-		
-		<copy todir="${build.dist}">
-			<fileset dir="${build}">
-				<include name="*.jar"/>
-			</fileset>
-		</copy>
-	</target>
-	
-	<target name="dist"
-		depends="jar"
-		description="Generates a happy zip with the MMOCore">
-        <zip destfile="${build}/mmocore.zip"
-             basedir="${build.dist}" />
-    </target>
-    
-    
-    <target name="clean"
-            description="Remove the output directories">
-        <delete dir="${build}"/>
-    </target>
-</project>

BIN
MMOCore/lib/javolution.jar


+ 0 - 36
MMOCore/src/org/mmocore/network/AbstractPacket.java

@@ -1,36 +0,0 @@
-/* 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 2, 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * http://www.gnu.org/copyleft/gpl.html
- */
-package org.mmocore.network;
-
-import java.nio.ByteBuffer;
-
-/**
- * @author KenM
- * 
- */
-public abstract class AbstractPacket<T extends MMOClient<?>>
-{
-	protected ByteBuffer _buf;
-	
-	T _client;
-	
-	public final T getClient()
-	{
-		return _client;
-	}
-}

+ 0 - 29
MMOCore/src/org/mmocore/network/IAcceptFilter.java

@@ -1,29 +0,0 @@
-/* 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 2, 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * http://www.gnu.org/copyleft/gpl.html
- */
-package org.mmocore.network;
-
-import java.nio.channels.SocketChannel;
-
-/**
- * @author KenM
- * 
- */
-public interface IAcceptFilter
-{
-	public boolean accept(SocketChannel sc);
-}

+ 0 - 27
MMOCore/src/org/mmocore/network/IClientFactory.java

@@ -1,27 +0,0 @@
-/* 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 2, 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * http://www.gnu.org/copyleft/gpl.html
- */
-package org.mmocore.network;
-
-/**
- * @author KenM
- * 
- */
-public interface IClientFactory<T extends MMOClient<?>>
-{
-	public T create(final MMOConnection<T> con);
-}

+ 0 - 27
MMOCore/src/org/mmocore/network/IMMOExecutor.java

@@ -1,27 +0,0 @@
-/* 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 2, 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * http://www.gnu.org/copyleft/gpl.html
- */
-package org.mmocore.network;
-
-/**
- * @author KenM
- * 
- */
-public interface IMMOExecutor<T extends MMOClient<?>>
-{
-	public void execute(ReceivablePacket<T> packet);
-}

+ 0 - 29
MMOCore/src/org/mmocore/network/IPacketHandler.java

@@ -1,29 +0,0 @@
-/* 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 2, 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * http://www.gnu.org/copyleft/gpl.html
- */
-package org.mmocore.network;
-
-import java.nio.ByteBuffer;
-
-/**
- * @author KenM
- * 
- */
-public interface IPacketHandler<T extends MMOClient<?>>
-{
-	public ReceivablePacket<T> handlePacket(ByteBuffer buf, T client);
-}

+ 0 - 47
MMOCore/src/org/mmocore/network/MMOClient.java

@@ -1,47 +0,0 @@
-/* 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 2, 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * http://www.gnu.org/copyleft/gpl.html
- */
-package org.mmocore.network;
-
-import java.nio.ByteBuffer;
-
-/**
- * @author KenM
- * 
- */
-public abstract class MMOClient<T extends MMOConnection<?>>
-{
-	private final T _con;
-	
-	public MMOClient(final T con)
-	{
-		_con = con;
-	}
-	
-	public T getConnection()
-	{
-		return _con;
-	}
-	
-	public abstract boolean decrypt(final ByteBuffer buf, final int size);
-	
-	public abstract boolean encrypt(final ByteBuffer buf, final int size);
-	
-	protected abstract void onDisconnection();
-	
-	protected abstract void onForcedDisconnection();
-}

+ 0 - 270
MMOCore/src/org/mmocore/network/MMOConnection.java

@@ -1,270 +0,0 @@
-/* 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 2, 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * http://www.gnu.org/copyleft/gpl.html
- */
-package org.mmocore.network;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.Socket;
-import java.nio.ByteBuffer;
-import java.nio.channels.CancelledKeyException;
-import java.nio.channels.ReadableByteChannel;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.WritableByteChannel;
-
-/**
- * @author KenM
- * 
- */
-public class MMOConnection<T extends MMOClient<?>>
-{
-	private final SelectorThread<T> _selectorThread;
-	
-	private final Socket _socket;
-	
-	private final InetAddress _address;
-	
-	private final ReadableByteChannel _readableByteChannel;
-	
-	private final WritableByteChannel _writableByteChannel;
-	
-	private final int _port;
-	
-	private final NioNetStackList<SendablePacket<T>> _sendQueue;
-	
-	private final SelectionKey _selectionKey;
-	
-	//private SendablePacket<T> _closePacket;
-	
-	private ByteBuffer _readBuffer;
-	
-	private ByteBuffer _primaryWriteBuffer;
-	
-	private ByteBuffer _secondaryWriteBuffer;
-	
-	private volatile boolean _pendingClose;
-	
-	private T _client;
-	
-	public MMOConnection(final SelectorThread<T> selectorThread, final Socket socket, final SelectionKey key)
-	{
-		_selectorThread = selectorThread;
-		_socket = socket;
-		_address = socket.getInetAddress();
-		_readableByteChannel = socket.getChannel();
-		_writableByteChannel = socket.getChannel();
-		_port = socket.getPort();
-		_selectionKey = key;
-		
-		_sendQueue = new NioNetStackList<SendablePacket<T>>();
-	}
-	
-	final void setClient(final T client)
-	{
-		_client = client;
-	}
-	
-	public final T getClient()
-	{
-		return _client;
-	}
-	
-	public final void sendPacket(final SendablePacket<T> sp)
-	{
-		sp._client = _client;
-		
-		if (_pendingClose)
-			return;
-		
-		synchronized (getSendQueue())
-		{
-			_sendQueue.addLast(sp);
-		}
-		
-		if (!_sendQueue.isEmpty())
-		{
-			try
-			{
-				_selectionKey.interestOps(_selectionKey.interestOps() | SelectionKey.OP_WRITE);
-			}
-			catch (CancelledKeyException e)
-			{
-				// ignore
-			}
-		}
-	}
-	
-	final SelectionKey getSelectionKey()
-	{
-		return _selectionKey;
-	}
-	
-	public final InetAddress getInetAddress()
-	{
-		return _address;
-	}
-	
-	public final int getPort()
-	{
-		return _port;
-	}
-	
-	final void close() throws IOException
-	{
-		_socket.close();
-	}
-	
-	final int read(final ByteBuffer buf) throws IOException
-	{
-		return _readableByteChannel.read(buf);
-	}
-	
-	final int write(final ByteBuffer buf) throws IOException
-	{
-		return _writableByteChannel.write(buf);
-	}
-	
-	final void createWriteBuffer(final ByteBuffer buf)
-	{
-		if (_primaryWriteBuffer == null)
-		{
-			_primaryWriteBuffer = _selectorThread.getPooledBuffer();
-			_primaryWriteBuffer.put(buf);
-		}
-		else
-		{
-			final ByteBuffer temp = _selectorThread.getPooledBuffer();
-			temp.put(buf);
-			
-			final int remaining = temp.remaining();
-			_primaryWriteBuffer.flip();
-			final int limit = _primaryWriteBuffer.limit();
-			
-			if (remaining >= _primaryWriteBuffer.remaining())
-			{
-				temp.put(_primaryWriteBuffer);
-				_selectorThread.recycleBuffer(_primaryWriteBuffer);
-				_primaryWriteBuffer = temp;
-			}
-			else
-			{
-				_primaryWriteBuffer.limit(remaining);
-				temp.put(_primaryWriteBuffer);
-				_primaryWriteBuffer.limit(limit);
-				_primaryWriteBuffer.compact();
-				_secondaryWriteBuffer = _primaryWriteBuffer;
-				_primaryWriteBuffer = temp;
-			}
-		}
-	}
-	
-	final boolean hasPendingWriteBuffer()
-	{
-		return _primaryWriteBuffer != null;
-	}
-	
-	final void movePendingWriteBufferTo(final ByteBuffer dest)
-	{
-		_primaryWriteBuffer.flip();
-		dest.put(_primaryWriteBuffer);
-		_selectorThread.recycleBuffer(_primaryWriteBuffer);
-		_primaryWriteBuffer = _secondaryWriteBuffer;
-		_secondaryWriteBuffer = null;
-	}
-	
-	final void setReadBuffer(final ByteBuffer buf)
-	{
-		_readBuffer = buf;
-	}
-	
-	final ByteBuffer getReadBuffer()
-	{
-		return _readBuffer;
-	}
-	
-	public final boolean isClosed()
-	{
-		return _pendingClose;
-	}
-	
-	final NioNetStackList<SendablePacket<T>> getSendQueue()
-	{
-		return _sendQueue;
-	}
-	
-	/*final SendablePacket<T> getClosePacket()
-	{
-	    return _closePacket;
-	}*/
-
-	@SuppressWarnings("unchecked")
-	public final void close(final SendablePacket<T> sp)
-	{
-		
-		close(new SendablePacket[] { sp });
-	}
-	
-	public final void close(final SendablePacket<T>[] closeList)
-	{
-		if (_pendingClose)
-			return;
-		
-		synchronized (getSendQueue())
-		{
-			if (!_pendingClose)
-			{
-				_pendingClose = true;
-				_sendQueue.clear();
-				for (SendablePacket<T> sp : closeList)
-					_sendQueue.addLast(sp);
-			}
-		}
-		
-		try
-		{
-			_selectionKey.interestOps(_selectionKey.interestOps() & ~SelectionKey.OP_WRITE);
-		}
-		catch (CancelledKeyException e)
-		{
-			// ignore
-		}
-		
-		//_closePacket = sp;
-		_selectorThread.closeConnection(this);
-	}
-	
-	final void releaseBuffers()
-	{
-		if (_primaryWriteBuffer != null)
-		{
-			_selectorThread.recycleBuffer(_primaryWriteBuffer);
-			_primaryWriteBuffer = null;
-			
-			if (_secondaryWriteBuffer != null)
-			{
-				_selectorThread.recycleBuffer(_secondaryWriteBuffer);
-				_secondaryWriteBuffer = null;
-			}
-		}
-		
-		if (_readBuffer != null)
-		{
-			_selectorThread.recycleBuffer(_readBuffer);
-			_readBuffer = null;
-		}
-	}
-}

+ 0 - 104
MMOCore/src/org/mmocore/network/NioNetStackList.java

@@ -1,104 +0,0 @@
-/* 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 2, 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * http://www.gnu.org/copyleft/gpl.html
- */
-package org.mmocore.network;
-
-/**
- * @author Forsaiken
- */
-public final class NioNetStackList<E>
-{
-	private final NioNetStackNode _start = new NioNetStackNode();
-	
-	private final NioNetStackNodeBuf _buf = new NioNetStackNodeBuf();
-	
-	private NioNetStackNode _end = new NioNetStackNode();
-	
-	public NioNetStackList()
-	{
-		clear();
-	}
-	
-	public final void addLast(final E elem)
-	{
-		final NioNetStackNode newEndNode = _buf.removeFirst();
-		_end._value = elem;
-		_end._next = newEndNode;
-		_end = newEndNode;
-	}
-	
-	public final E removeFirst()
-	{
-		final NioNetStackNode old = _start._next;
-		final E value = old._value;
-		_start._next = old._next;
-		_buf.addLast(old);
-		return value;
-	}
-	
-	public final boolean isEmpty()
-	{
-		return _start._next == _end;
-	}
-	
-	public final void clear()
-	{
-		_start._next = _end;
-	}
-	
-	private final class NioNetStackNode
-	{
-		private NioNetStackNode _next;
-		
-		private E _value;
-		
-		private NioNetStackNode()
-		{
-			
-		}
-	}
-	
-	private final class NioNetStackNodeBuf
-	{
-		private final NioNetStackNode _start = new NioNetStackNode();
-		
-		private NioNetStackNode _end = new NioNetStackNode();
-		
-		NioNetStackNodeBuf()
-		{
-			_start._next = _end;
-		}
-		
-		final void addLast(final NioNetStackNode node)
-		{
-			node._next = null;
-			node._value = null;
-			_end._next = node;
-			_end = node;
-		}
-		
-		final NioNetStackNode removeFirst()
-		{
-			if (_start._next == _end)
-				return new NioNetStackNode();
-			
-			final NioNetStackNode old = _start._next;
-			_start._next = old._next;
-			return old;
-		}
-	}
-}

+ 0 - 41
MMOCore/src/org/mmocore/network/NioNetStringBuffer.java

@@ -1,41 +0,0 @@
-package org.mmocore.network;
-
-import java.nio.BufferOverflowException;
-
-/**
- * @author Forsaiken
- */
-public final class NioNetStringBuffer
-{
-	private final char[] _buf;
-	
-	private final int _size;
-	
-	private int _len;
-	
-	public NioNetStringBuffer(final int size)
-	{
-		_buf = new char[size];
-		_size = size;
-		_len = 0;
-	}
-	
-	public final void clear()
-	{
-		_len = 0;
-	}
-	
-	public final void append(final char c)
-	{
-		if (_len < _size)
-			_buf[_len++] = c;
-		else
-			throw new BufferOverflowException();
-	}
-	
-	@Override
-	public final String toString()
-	{
-		return new String(_buf, 0, _len);
-	}
-}

+ 0 - 99
MMOCore/src/org/mmocore/network/ReceivablePacket.java

@@ -1,99 +0,0 @@
-/* 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 2, 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * http://www.gnu.org/copyleft/gpl.html
- */
-package org.mmocore.network;
-
-import java.nio.ByteBuffer;
-
-/**
- * @author KenM
- * 
- */
-public abstract class ReceivablePacket<T extends MMOClient<?>> extends AbstractPacket<T> implements Runnable
-{
-	NioNetStringBuffer _sbuf;
-	
-	protected ReceivablePacket()
-	{
-		
-	}
-	
-	protected abstract boolean read();
-	
-	public abstract void run();
-	
-	protected final void readB(final byte[] dst)
-	{
-		_buf.get(dst);
-	}
-	
-	protected final void readB(final byte[] dst, final int offset, final int len)
-	{
-		_buf.get(dst, offset, len);
-	}
-	
-	protected final int readC()
-	{
-		return _buf.get() & 0xFF;
-	}
-	
-	protected final int readH()
-	{
-		return _buf.getShort() & 0xFFFF;
-	}
-	
-	protected final int readD()
-	{
-		return _buf.getInt();
-	}
-	
-	protected final long readQ()
-	{
-		return _buf.getLong();
-	}
-	
-	protected final double readF()
-	{
-		return _buf.getDouble();
-	}
-	
-	protected final String readS()
-	{
-		_sbuf.clear();
-		
-		char ch;
-		while ((ch = _buf.getChar()) != 0)
-		{
-			_sbuf.append(ch);
-		}
-		
-		return _sbuf.toString();
-	}
-	
-	/**
-	 * packet forge purpose
-	 * @param data
-	 * @param client
-	 * @param sBuffer
-	 */
-	public void setBuffers(ByteBuffer data, T client, NioNetStringBuffer sBuffer)
-	{
-		_buf = data;
-		_client = client;
-		_sbuf = sBuffer;
-	}
-}

+ 0 - 61
MMOCore/src/org/mmocore/network/SelectorConfig.java

@@ -1,61 +0,0 @@
-/* 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 2, 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * http://www.gnu.org/copyleft/gpl.html
- */
-package org.mmocore.network;
-
-/**
- * @author KenM
- * 
- */
-public final class SelectorConfig
-{
-	public int READ_BUFFER_SIZE = 64 * 1024;
-	
-	public int WRITE_BUFFER_SIZE = 64 * 1024;
-	
-	public int HELPER_BUFFER_COUNT = 20;
-	
-	public int HELPER_BUFFER_SIZE = 64 * 1024;
-	
-	/**
-	 * Server will try to send MAX_SEND_PER_PASS packets per socket write call<br>
-	 * however it may send less if the write buffer was filled before achieving
-	 * this value.
-	 */
-	public int MAX_SEND_PER_PASS = 10;
-	
-	/**
-	 * Server will try to read MAX_READ_PER_PASS packets per socket read call<br>
-	 * however it may read less if the read buffer was empty before achieving
-	 * this value.
-	 */
-	public int MAX_READ_PER_PASS = 10;
-	
-	/**
-	 * Defines how much time (in milis) should the selector sleep, an higher
-	 * value increases throughput but also increases latency(to a max of the
-	 * sleep value itself).<BR>
-	 * Also an extremely high value(usually > 100) will decrease throughput due
-	 * to the server not doing enough sends per second (depends on max sends per
-	 * pass).<BR>
-	 * <BR>
-	 * Recommended values:<BR>
-	 * 1 for minimal latency.<BR>
-	 * 10-30 for an latency/troughput trade-off based on your needs.<BR>
-	 */
-	public int SLEEP_TIME = 10;
-}

+ 0 - 659
MMOCore/src/org/mmocore/network/SelectorThread.java

@@ -1,659 +0,0 @@
-/* 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 2, 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * http://www.gnu.org/copyleft/gpl.html
- */
-package org.mmocore.network;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.ServerSocket;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.Selector;
-import java.nio.channels.ServerSocketChannel;
-import java.nio.channels.SocketChannel;
-import java.util.Iterator;
-
-import javolution.util.FastList;
-
-/**
- * @author KenM<BR>
- *         Parts of design based on networkcore from WoodenGil
- */
-public final class SelectorThread<T extends MMOClient<?>> extends Thread
-{
-	// default BYTE_ORDER
-	private static final ByteOrder BYTE_ORDER = ByteOrder.LITTLE_ENDIAN;
-	// default HEADER_SIZE
-	private static final int HEADER_SIZE = 2;
-	// Selector
-	private final Selector _selector;
-	// Implementations
-	private final IPacketHandler<T> _packetHandler;
-	private final IMMOExecutor<T> _executor;
-	private final IClientFactory<T> _clientFactory;
-	private final IAcceptFilter _acceptFilter;
-	// Configurations
-	private final int HELPER_BUFFER_SIZE;
-	private final int HELPER_BUFFER_COUNT;
-	private final int MAX_SEND_PER_PASS;
-	private final int MAX_READ_PER_PASS;
-	private final long SLEEP_TIME;
-	// Main Buffers
-	private final ByteBuffer DIRECT_WRITE_BUFFER;
-	private final ByteBuffer WRITE_BUFFER;
-	private final ByteBuffer READ_BUFFER;
-	// String Buffer
-	private final NioNetStringBuffer STRING_BUFFER;
-	// ByteBuffers General Purpose Pool
-	private final FastList<ByteBuffer> _bufferPool;
-	// Pending Close
-	private final NioNetStackList<MMOConnection<T>> _pendingClose;
-	
-	private boolean _shutdown;
-	
-	public SelectorThread(final SelectorConfig sc, final IMMOExecutor<T> executor, final IPacketHandler<T> packetHandler, final IClientFactory<T> clientFactory, final IAcceptFilter acceptFilter) throws IOException
-	{
-		super.setName("SelectorThread-" + super.getId());
-		
-		HELPER_BUFFER_SIZE = sc.HELPER_BUFFER_SIZE;
-		HELPER_BUFFER_COUNT = sc.HELPER_BUFFER_COUNT;
-		MAX_SEND_PER_PASS = sc.MAX_SEND_PER_PASS;
-		MAX_READ_PER_PASS = sc.MAX_READ_PER_PASS;
-		
-		SLEEP_TIME = sc.SLEEP_TIME;
-		
-		DIRECT_WRITE_BUFFER = ByteBuffer.allocateDirect(sc.WRITE_BUFFER_SIZE).order(BYTE_ORDER);
-		WRITE_BUFFER = ByteBuffer.wrap(new byte[sc.WRITE_BUFFER_SIZE]).order(BYTE_ORDER);
-		READ_BUFFER = ByteBuffer.wrap(new byte[sc.READ_BUFFER_SIZE]).order(BYTE_ORDER);
-		
-		STRING_BUFFER = new NioNetStringBuffer(64 * 1024);
-		
-		_pendingClose = new NioNetStackList<MMOConnection<T>>();
-		_bufferPool = new FastList<ByteBuffer>();
-		
-		for (int i = 0; i < HELPER_BUFFER_COUNT; i++)
-		{
-			_bufferPool.addLast(ByteBuffer.wrap(new byte[HELPER_BUFFER_SIZE]).order(BYTE_ORDER));
-		}
-		
-		_acceptFilter = acceptFilter;
-		_packetHandler = packetHandler;
-		_clientFactory = clientFactory;
-		_executor = executor;
-		_selector = Selector.open();
-	}
-	
-	public final void openServerSocket(InetAddress address, int tcpPort) throws IOException
-	{
-		ServerSocketChannel selectable = ServerSocketChannel.open();
-		selectable.configureBlocking(false);
-		
-		ServerSocket ss = selectable.socket();
-		
-		if (address == null)
-			ss.bind(new InetSocketAddress(tcpPort));
-		else
-			ss.bind(new InetSocketAddress(address, tcpPort));
-		
-		selectable.register(_selector, SelectionKey.OP_ACCEPT);
-	}
-	
-	final ByteBuffer getPooledBuffer()
-	{
-		if (_bufferPool.isEmpty())
-			return ByteBuffer.wrap(new byte[HELPER_BUFFER_SIZE]).order(BYTE_ORDER);
-		
-		return _bufferPool.removeFirst();
-	}
-	
-	final void recycleBuffer(final ByteBuffer buf)
-	{
-		if (_bufferPool.size() < HELPER_BUFFER_COUNT)
-		{
-			buf.clear();
-			_bufferPool.addLast(buf);
-		}
-	}
-	
-	@SuppressWarnings("unchecked")
-	@Override
-	public final void run()
-	{
-		int selectedKeysCount = 0;
-		
-		SelectionKey key;
-		MMOConnection<T> con;
-		
-		Iterator<SelectionKey> selectedKeys;
-		
-		while (!_shutdown)
-		{
-			try
-			{
-				selectedKeysCount = _selector.selectNow();
-			}
-			catch (IOException e)
-			{
-				e.printStackTrace();
-			}
-			
-			if (selectedKeysCount > 0)
-			{
-				selectedKeys = _selector.selectedKeys().iterator();
-				
-				while (selectedKeys.hasNext())
-				{
-					key = selectedKeys.next();
-					selectedKeys.remove();
-					
-					con = (MMOConnection<T>) key.attachment();
-					
-					switch (key.readyOps())
-					{
-						case SelectionKey.OP_CONNECT:
-							finishConnection(key, con);
-							break;
-						case SelectionKey.OP_ACCEPT:
-							acceptConnection(key, con);
-							break;
-						case SelectionKey.OP_READ:
-							readPacket(key, con);
-							break;
-						case SelectionKey.OP_WRITE:
-							writePacket(key, con);
-							break;
-						case SelectionKey.OP_READ | SelectionKey.OP_WRITE:
-							writePacket(key, con);
-							if (key.isValid())
-								readPacket(key, con);
-							break;
-					}
-				}
-			}
-			
-			synchronized (_pendingClose)
-			{
-				while (!_pendingClose.isEmpty())
-				{
-					con = _pendingClose.removeFirst();
-					writeClosePacket(con);
-					closeConnectionImpl(con.getSelectionKey(), con);
-				}
-			}
-			
-			try
-			{
-				Thread.sleep(SLEEP_TIME);
-			}
-			catch (InterruptedException e)
-			{
-				e.printStackTrace();
-			}
-		}
-		closeSelectorThread();
-	}
-	
-	private final void finishConnection(final SelectionKey key, final MMOConnection<T> con)
-	{
-		try
-		{
-			((SocketChannel) key.channel()).finishConnect();
-		}
-		catch (IOException e)
-		{
-			con.getClient().onForcedDisconnection();
-			closeConnectionImpl(key, con);
-		}
-		
-		// key might have been invalidated on finishConnect()
-		if (key.isValid())
-		{
-			key.interestOps(key.interestOps() | SelectionKey.OP_READ);
-			key.interestOps(key.interestOps() & ~SelectionKey.OP_CONNECT);
-		}
-	}
-	
-	private final void acceptConnection(final SelectionKey key, MMOConnection<T> con)
-	{
-		ServerSocketChannel ssc = (ServerSocketChannel) key.channel();
-		SocketChannel sc;
-		
-		try
-		{
-			while ((sc = ssc.accept()) != null)
-			{
-				if (_acceptFilter == null || _acceptFilter.accept(sc))
-				{
-					sc.configureBlocking(false);
-					SelectionKey clientKey = sc.register(_selector, SelectionKey.OP_READ);
-					con = new MMOConnection<T>(this, sc.socket(), clientKey);
-					con.setClient(_clientFactory.create(con));
-					clientKey.attach(con);
-				}
-				else
-					sc.socket().close();
-			}
-		}
-		catch (IOException e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	private final void readPacket(final SelectionKey key, final MMOConnection<T> con)
-	{
-		if (!con.isClosed())
-		{
-			ByteBuffer buf;
-			if ((buf = con.getReadBuffer()) == null)
-			{
-				buf = READ_BUFFER;
-			}
-			
-			// if we try to to do a read with no space in the buffer it will
-			// read 0 bytes
-			// going into infinite loop
-			if (buf.position() == buf.limit())
-				System.exit(0);
-			
-			int result = -2;
-			
-			try
-			{
-				result = con.read(buf);
-			}
-			catch (IOException e)
-			{
-				// error handling goes bellow
-			}
-			
-			if (result > 0)
-			{
-				buf.flip();
-				
-				final T client = con.getClient();
-				
-				for (int i = 0; i < MAX_READ_PER_PASS; i++)
-				{
-					if (!tryReadPacket(key, client, buf, con))
-						return;
-				}
-				
-				// only reachable if MAX_READ_PER_PASS has been reached
-				// check if there are some more bytes in buffer
-				// and allocate/compact to prevent content lose.
-				if (buf.remaining() > 0)
-				{
-					// did we use the READ_BUFFER ?
-					if (buf == READ_BUFFER)
-						// move the pending byte to the connections READ_BUFFER
-						allocateReadBuffer(con);
-					else
-						// move the first byte to the beginning :)
-						buf.compact();
-				}
-			}
-			else
-			{
-				switch (result)
-				{
-					case 0:
-					case -1:
-						closeConnectionImpl(key, con);
-						break;
-					case -2:
-						con.getClient().onForcedDisconnection();
-						closeConnectionImpl(key, con);
-						break;
-				}
-			}
-		}
-	}
-	
-	private final boolean tryReadPacket(final SelectionKey key, final T client, final ByteBuffer buf, final MMOConnection<T> con)
-	{
-		switch (buf.remaining())
-		{
-			case 0:
-				// buffer is full
-				// nothing to read
-				return false;
-			case 1:
-				// we don`t have enough data for header so we need to read
-				key.interestOps(key.interestOps() | SelectionKey.OP_READ);
-				
-				// did we use the READ_BUFFER ?
-				if (buf == READ_BUFFER)
-					// move the pending byte to the connections READ_BUFFER
-					allocateReadBuffer(con);
-				else
-					// move the first byte to the beginning :)
-					buf.compact();
-				return false;
-			default:
-				// data size excluding header size :>
-				final int dataPending = (buf.getShort() & 0xFFFF) - HEADER_SIZE;
-				
-				// do we got enough bytes for the packet?
-				if (dataPending <= buf.remaining())
-				{
-					// avoid parsing dummy packets (packets without body)
-					if (dataPending > 0)
-					{
-						final int pos = buf.position();
-						parseClientPacket(pos, buf, dataPending, client);
-						buf.position(pos + dataPending);
-					}
-					
-					// if we are done with this buffer
-					if (!buf.hasRemaining())
-					{
-						if (buf != READ_BUFFER)
-						{
-							con.setReadBuffer(null);
-							recycleBuffer(buf);
-						}
-						else
-						{
-							READ_BUFFER.clear();
-						}
-						return false;
-					}
-					return true;
-				}
-				else
-				{
-					// we don`t have enough bytes for the dataPacket so we need
-					// to read
-					key.interestOps(key.interestOps() | SelectionKey.OP_READ);
-					
-					// did we use the READ_BUFFER ?
-					if (buf == READ_BUFFER)
-					{
-						// move it`s position
-						buf.position(buf.position() - HEADER_SIZE);
-						// move the pending byte to the connections READ_BUFFER
-						allocateReadBuffer(con);
-					}
-					else
-					{
-						buf.position(buf.position() - HEADER_SIZE);
-						buf.compact();
-					}
-					return false;
-				}
-		}
-	}
-	
-	private final void allocateReadBuffer(final MMOConnection<T> con)
-	{
-		con.setReadBuffer(getPooledBuffer().put(READ_BUFFER));
-		READ_BUFFER.clear();
-	}
-	
-	private final void parseClientPacket(final int pos, final ByteBuffer buf, final int dataSize, final T client)
-	{
-		final boolean ret = client.decrypt(buf, dataSize);
-		
-		if (ret && buf.hasRemaining())
-		{
-			// apply limit
-			final int limit = buf.limit();
-			buf.limit(pos + dataSize);
-			final ReceivablePacket<T> cp = _packetHandler.handlePacket(buf, client);
-			
-			if (cp != null)
-			{
-				cp._buf = buf;
-				cp._sbuf = STRING_BUFFER;
-				cp._client = client;
-				
-				if (cp.read())
-					_executor.execute(cp);
-				
-				cp._buf = null;
-				cp._sbuf = null;
-			}
-			buf.limit(limit);
-		}
-	}
-	
-	private final void writeClosePacket(final MMOConnection<T> con)
-	{
-		SendablePacket<T> sp;
-		synchronized (con.getSendQueue())
-		{
-			if (con.getSendQueue().isEmpty())
-				return;
-			
-			while ((sp = con.getSendQueue().removeFirst()) != null)
-			{
-				WRITE_BUFFER.clear();
-				
-				putPacketIntoWriteBuffer(con.getClient(), sp);
-				
-				WRITE_BUFFER.flip();
-				
-				try
-				{
-					con.write(WRITE_BUFFER);
-				}
-				catch (IOException e)
-				{
-					// error handling goes on the if bellow
-				}
-			}
-		}
-	}
-	
-	protected final void writePacket(final SelectionKey key, final MMOConnection<T> con)
-	{
-		if (!prepareWriteBuffer(con))
-		{
-			key.interestOps(key.interestOps() & ~SelectionKey.OP_WRITE);
-			return;
-		}
-		
-		DIRECT_WRITE_BUFFER.flip();
-		
-		final int size = DIRECT_WRITE_BUFFER.remaining();
-		
-		int result = -1;
-		
-		try
-		{
-			result = con.write(DIRECT_WRITE_BUFFER);
-		}
-		catch (IOException e)
-		{
-			// error handling goes on the if bellow
-		}
-		
-		// check if no error happened
-		if (result >= 0)
-		{
-			// check if we written everything
-			if (result == size)
-			{
-				// complete write
-				synchronized (con.getSendQueue())
-				{
-					if (con.getSendQueue().isEmpty() && !con.hasPendingWriteBuffer())
-					{
-						key.interestOps(key.interestOps() & ~SelectionKey.OP_WRITE);
-					}
-				}
-			}
-			else
-				// incomplete write
-				con.createWriteBuffer(DIRECT_WRITE_BUFFER);
-		}
-		else
-		{
-			con.getClient().onForcedDisconnection();
-			closeConnectionImpl(key, con);
-		}
-	}
-	
-	private final boolean prepareWriteBuffer(final MMOConnection<T> con)
-	{
-		boolean hasPending = false;
-		DIRECT_WRITE_BUFFER.clear();
-		
-		// if there is pending content add it
-		if (con.hasPendingWriteBuffer())
-		{
-			con.movePendingWriteBufferTo(DIRECT_WRITE_BUFFER);
-			hasPending = true;
-		}
-		
-		if (DIRECT_WRITE_BUFFER.remaining() > 1 && !con.hasPendingWriteBuffer())
-		{
-			final NioNetStackList<SendablePacket<T>> sendQueue = con.getSendQueue();
-			final T client = con.getClient();
-			SendablePacket<T> sp;
-			
-			for (int i = 0; i < MAX_SEND_PER_PASS; i++)
-			{
-				synchronized (con.getSendQueue())
-				{
-					if (sendQueue.isEmpty())
-						sp = null;
-					else
-						sp = sendQueue.removeFirst();
-				}
-				
-				if (sp == null)
-					break;
-				
-				hasPending = true;
-				
-				// put into WriteBuffer
-				putPacketIntoWriteBuffer(client, sp);
-				
-				WRITE_BUFFER.flip();
-				
-				if (DIRECT_WRITE_BUFFER.remaining() >= WRITE_BUFFER.limit())
-					DIRECT_WRITE_BUFFER.put(WRITE_BUFFER);
-				else
-				{
-					con.createWriteBuffer(WRITE_BUFFER);
-					break;
-				}
-			}
-		}
-		return hasPending;
-	}
-	
-	private final void putPacketIntoWriteBuffer(final T client, final SendablePacket<T> sp)
-	{
-		WRITE_BUFFER.clear();
-		
-		// reserve space for the size
-		final int headerPos = WRITE_BUFFER.position();
-		final int dataPos = headerPos + HEADER_SIZE;
-		WRITE_BUFFER.position(dataPos);
-		
-		// set the write buffer
-		sp._buf = WRITE_BUFFER;
-		// write content to buffer
-		sp.write();
-		// delete the write buffer
-		sp._buf = null;
-		
-		// size (inclusive header)
-		int dataSize = WRITE_BUFFER.position() - dataPos;
-		WRITE_BUFFER.position(dataPos);
-		client.encrypt(WRITE_BUFFER, dataSize);
-		
-		// recalculate size after encryption
-		dataSize = WRITE_BUFFER.position() - dataPos;
-		
-		WRITE_BUFFER.position(headerPos);
-		// write header
-		WRITE_BUFFER.putShort((short) (dataSize + HEADER_SIZE));
-		WRITE_BUFFER.position(dataPos + dataSize);
-	}
-	
-	final void closeConnection(final MMOConnection<T> con)
-	{
-		synchronized (_pendingClose)
-		{
-			_pendingClose.addLast(con);
-		}
-	}
-	
-	private final void closeConnectionImpl(final SelectionKey key, final MMOConnection<T> con)
-	{
-		try
-		{
-			// notify connection
-			con.getClient().onDisconnection();
-		}
-		finally
-		{
-			try
-			{
-				// close socket and the SocketChannel
-				con.close();
-			}
-			catch (IOException e)
-			{
-				// ignore, we are closing anyway
-			}
-			finally
-			{
-				con.releaseBuffers();
-				// clear attachment
-				key.attach(null);
-				// cancel key
-				key.cancel();
-			}
-		}
-	}
-	
-	public final void shutdown()
-	{
-		_shutdown = true;
-	}
-	
-	protected void closeSelectorThread()
-	{
-		for (final SelectionKey key : _selector.keys())
-		{
-			try
-			{
-				key.channel().close();
-			}
-			catch (IOException e)
-			{
-				// ignore
-			}
-		}
-		
-		try
-		{
-			_selector.close();
-		}
-		catch (IOException e)
-		{
-			// Ignore
-		}
-	}
-}

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно