Browse Source

Release 19

master
Defend 8 years ago
parent
commit
2036b6a645
  1. 899
      .idea/workspace (1).xml
  2. 167
      .idea/workspace.xml
  3. 1
      ctServer.iml
  4. BIN
      lib/javax.json.jar
  5. BIN
      out/production/ctServer/client.class
  6. BIN
      out/production/ctServer/console.class
  7. BIN
      out/production/ctServer/ctServer$ClientInfo.class
  8. BIN
      out/production/ctServer/ctServer.class
  9. 71
      src/client.java
  10. 47
      src/console.java
  11. 65
      src/ctServer.java
  12. 118
      src/socketInfo.java

899
.idea/workspace (1).xml

@ -0,0 +1,899 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="ef1cf760-9407-4380-a84e-9b438e35c16c" name="Default" comment="" />
<ignored path="ctServer.iws" />
<ignored path=".idea/workspace.xml" />
<ignored path="$PROJECT_DIR$/out/" />
<ignored path=".idea/dataSources.local.xml" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CoverageDataManager">
<SUITE FILE_PATH="coverage/ctServer$Unnamed.coverage" NAME="Unnamed Coverage Results" MODIFIED="1470865818918" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
</component>
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
<favorites_list name="ctServer" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="ctServer.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/ctServer.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="714">
<caret line="54" column="21" selection-start-line="54" selection-start-column="21" selection-end-line="54" selection-end-column="21" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="console.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/console.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="161">
<caret line="46" column="0" selection-start-line="46" selection-start-column="0" selection-end-line="46" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="client.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/client.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="195">
<caret line="62" column="50" selection-start-line="62" selection-start-column="50" selection-end-line="62" selection-end-column="50" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="package-info" />
<option value="Class" />
</list>
</option>
</component>
<component name="GradleLocalSettings">
<option name="externalProjectsViewState">
<projects_view />
</option>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/src/main.java" />
<option value="$PROJECT_DIR$/src/ctServer.java" />
<option value="$PROJECT_DIR$/src/console.java" />
<option value="$PROJECT_DIR$/src/client.java" />
</list>
</option>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="-8" />
<option name="y" value="-8" />
<option name="width" value="1296" />
<option name="height" value="1010" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scratches" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="ctServer" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="ctServer" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="ctServer" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="PackagesPane" />
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="settings.editor.selected.configurable" value="preferences.general" />
<property name="settings.editor.splitter.proportion" value="0.2" />
<property name="aspect.path.notification.shown" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="GenerateAntBuildDialog.enableUiFormCompile" value="true" />
<property name="GenerateAntBuildDialog.forceTargetJdk" value="true" />
<property name="GenerateAntBuildDialog.backupFiles" value="true" />
<property name="GenerateAntBuildDialog.outputFileNameProperty" value="ctserver" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
</component>
<component name="RunManager" selected="Application.Unnamed">
<configuration default="true" type="#com.intellij.j2meplugin.run.J2MEConfigurationType" factoryName="J2ME">
<module name="" />
<USER_OPTIONS />
<option name="TARGET_DEVICE_NAME" />
<option name="COMMAND_LINE_PARAMETERS" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="JAD_NAME" value="" />
<option name="IS_CLASSES" value="false" />
<option name="IS_OTA" value="false" />
<option name="INSTALL" />
<option name="REMOVE" />
<option name="RUN" />
<option name="TRANSIENT" />
<option name="FORCE" />
<option name="TO_START" />
<option name="SELECTION" value="0" />
<method />
</configuration>
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<method />
</configuration>
<configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application">
<module name="" />
<option name="DEPLOY" value="true" />
<option name="ARTIFACT_NAME" value="" />
<option name="PM_INSTALL_OPTIONS" value="" />
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
<option name="MODE" value="default_activity" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="PREFERRED_AVD" value="" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
<option name="FORCE_STOP_RUNNING_APP" value="true" />
<option name="DEBUGGER_TYPE" value="Java" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<Java />
<Profilers>
<option name="GAPID_DISABLE_PCS" value="false" />
</Profilers>
<option name="DEEP_LINK" value="" />
<option name="ACTIVITY_CLASS" value="" />
<method>
<option name="Make" enabled="true" />
<option name="Android.Gradle.BeforeRunTask" enabled="true" />
</method>
</configuration>
<configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
<module name="" />
<option name="TESTING_TYPE" value="0" />
<option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
<option name="METHOD_NAME" value="" />
<option name="CLASS_NAME" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="EXTRA_OPTIONS" value="" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="PREFERRED_AVD" value="" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
<option name="FORCE_STOP_RUNNING_APP" value="true" />
<option name="DEBUGGER_TYPE" value="Java" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<Java />
<Profilers>
<option name="GAPID_DISABLE_PCS" value="false" />
</Profilers>
<method>
<option name="Make" enabled="true" />
<option name="Android.Gradle.BeforeRunTask" enabled="true" />
</method>
</configuration>
<configuration default="true" type="AntRunConfiguration" factoryName="Ant Target">
<method />
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<module />
<method />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="ArquillianJUnit" factoryName="">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="arquillianRunConfiguration">
<value>
<option name="containerStateName" value="" />
</value>
</option>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="ArquillianTestNG" factoryName="">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="arquillianRunConfiguration">
<value>
<option name="containerStateName" value="" />
</value>
</option>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration default="true" type="Cold Fusion runner description" factoryName="Cold Fusion" custom_browser="" web_path="">
<method />
</configuration>
<configuration default="true" type="CucumberJavaRunConfigurationType" factoryName="Cucumber java">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="myFilePath" />
<option name="GLUE" />
<option name="myNameFilter" />
<option name="myGeneratedName" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="FlashRunConfigurationType" factoryName="Flash App">
<option name="BCName" value="" />
<option name="IOSSimulatorSdkPath" value="" />
<option name="adlOptions" value="" />
<option name="airProgramParameters" value="" />
<option name="appDescriptorForEmulator" value="Android" />
<option name="debugTransport" value="USB" />
<option name="debuggerSdkRaw" value="BC SDK" />
<option name="emulator" value="NexusOne" />
<option name="emulatorAdlOptions" value="" />
<option name="fastPackaging" value="true" />
<option name="fullScreenHeight" value="0" />
<option name="fullScreenWidth" value="0" />
<option name="launchUrl" value="false" />
<option name="launcherParameters">
<LauncherParameters>
<option name="browser" value="a7bb68e0-33c0-4d6f-a81a-aac1fdb870c8" />
<option name="launcherType" value="OSDefault" />
<option name="newPlayerInstance" value="false" />
<option name="playerPath" value="FlashPlayerDebugger.exe" />
</LauncherParameters>
</option>
<option name="mobileRunTarget" value="Emulator" />
<option name="moduleName" value="" />
<option name="overriddenMainClass" value="" />
<option name="overriddenOutputFileName" value="" />
<option name="overrideMainClass" value="false" />
<option name="runTrusted" value="true" />
<option name="screenDpi" value="0" />
<option name="screenHeight" value="0" />
<option name="screenWidth" value="0" />
<option name="url" value="http://" />
<option name="usbDebugPort" value="7936" />
<method />
</configuration>
<configuration default="true" type="FlexUnitRunConfigurationType" factoryName="FlexUnit" appDescriptorForEmulator="Android" class_name="" emulatorAdlOptions="" method_name="" package_name="" scope="Class">
<option name="BCName" value="" />
<option name="launcherParameters">
<LauncherParameters>
<option name="browser" value="a7bb68e0-33c0-4d6f-a81a-aac1fdb870c8" />
<option name="launcherType" value="OSDefault" />
<option name="newPlayerInstance" value="false" />
<option name="playerPath" value="FlashPlayerDebugger.exe" />
</LauncherParameters>
</option>
<option name="moduleName" value="" />
<option name="trusted" value="true" />
<method />
</configuration>
<configuration default="true" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list />
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<method />
</configuration>
<configuration default="true" type="GrailsRunConfigurationType" factoryName="Grails">
<setting name="vmparams" value="" />
<setting name="cmdLine" value="run-app" />
<setting name="passParentEnv" value="true" />
<setting name="launchBrowser" value="true" />
<setting name="depsClasspath" value="false" />
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<method />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="JUnitTestDiscovery" factoryName="JUnit Test Discovery" changeList="All">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="JarApplication" factoryName="JAR Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<envs />
<method />
</configuration>
<configuration default="true" type="Java Scratch" factoryName="Java Scratch">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="SCRATCH_FILE_ID" value="0" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
<method />
</configuration>
<configuration default="true" type="JetRunConfigurationType" factoryName="Kotlin">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="ctServer" />
<envs />
<method />
</configuration>
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType" factoryName="Kotlin script">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="filePath" />
<option name="vmParameters" />
<option name="alternativeJrePath" />
<option name="programParameters" />
<option name="passParentEnvs" value="true" />
<option name="workingDirectory" />
<option name="isAlternativeJrePathEnabled" value="false" />
<envs />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method />
</configuration>
<configuration default="true" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration default="true" type="TestNGTestDiscovery" factoryName="TestNG Test Discovery" changeList="All">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
<node-interpreter>project</node-interpreter>
<node-options />
<gulpfile />
<tasks />
<arguments />
<envs />
<method />
</configuration>
<configuration default="true" type="js.build_tools.npm" factoryName="npm">
<command value="run-script" />
<scripts />
<node-interpreter value="project" />
<envs />
<method />
</configuration>
<configuration default="true" type="osgi.bnd.run" factoryName="Run Launcher">
<method />
</configuration>
<configuration default="true" type="osgi.bnd.run" factoryName="Test Launcher (JUnit)">
<method />
</configuration>
<configuration default="false" name="Unnamed" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="ctServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="ctServer" />
<envs />
<method />
</configuration>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="Application.Unnamed" />
</list>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="ef1cf760-9407-4380-a84e-9b438e35c16c" name="Default" comment="" />
<created>1470646840402</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1470646840402</updated>
<workItem from="1470646845957" duration="30985000" />
<workItem from="1470739295224" duration="18435000" />
<workItem from="1470845742191" duration="18554000" />
<workItem from="1470936508138" duration="9814000" />
<workItem from="1470992276279" duration="9337000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="87125000" />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1296" height="1010" extended-state="6" />
<editor active="false" />
<layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3288889" sideWeight="0.4792111" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3876853" sideWeight="0.5444984" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.3876853" sideWeight="0.45550162" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32839224" sideWeight="0.4978678" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.1302589" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39935064" sideWeight="0.47708333" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Coverage" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32942432" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3294979" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<option name="time" value="33" />
</breakpoint-manager>
<watches-manager />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/ctServer.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/console.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1088">
<caret line="64" column="91" selection-start-line="64" selection-start-column="91" selection-end-line="64" selection-end-column="91" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/client.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="918">
<caret line="54" column="20" selection-start-line="54" selection-start-column="20" selection-end-line="54" selection-end-column="20" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ctServer.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="13" column="47" selection-start-line="13" selection-start-column="47" selection-end-line="13" selection-end-column="47" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/console.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="578">
<caret line="34" column="5" selection-start-line="34" selection-start-column="5" selection-end-line="34" selection-end-column="5" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/client.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://E:/ProfessionalPrograms/JDK8/src.zip!/java/lang/Thread.java" />
<entry file="file://$PROJECT_DIR$/src/ctServer.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/console.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1003">
<caret line="67" column="13" selection-start-line="67" selection-start-column="13" selection-end-line="67" selection-end-column="13" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/client.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1343">
<caret line="86" column="50" selection-start-line="86" selection-start-column="50" selection-end-line="86" selection-end-column="50" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://E:/ProfessionalPrograms/JDK8/src.zip!/java/lang/Thread.java" />
<entry file="file://$PROJECT_DIR$/src/ctServer.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="13" column="37" selection-start-line="13" selection-start-column="37" selection-end-line="13" selection-end-column="37" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/console.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1139">
<caret line="67" column="13" selection-start-line="67" selection-start-column="13" selection-end-line="67" selection-end-column="13" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/client.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="731">
<caret line="43" column="30" selection-start-line="43" selection-start-column="30" selection-end-line="43" selection-end-column="30" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://E:/ProfessionalPrograms/JDK8/src.zip!/java/lang/Thread.java" />
<entry file="file://$PROJECT_DIR$/ctServer.iml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.idea/copyright/profiles_settings.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/package-info.java" />
<entry file="jar://E:/ProfessionalPrograms/JDK8/src.zip!/java/lang/Thread.java" />
<entry file="file://$PROJECT_DIR$/ctserver.properties">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="jar://E:/ProfessionalPrograms/JDK8/src.zip!/java/util/ArrayList.java" />
<entry file="file://$PROJECT_DIR$/ctserver.xml" />
<entry file="file://$PROJECT_DIR$/module_ctserver.xml" />
<entry file="file://$PROJECT_DIR$/package-list" />
<entry file="jar://E:/ProfessionalPrograms/JDK8/src.zip!/java/net/SocketInputStream.java" />
<entry file="file://$PROJECT_DIR$/src/ctServer.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="714">
<caret line="54" column="21" selection-start-line="54" selection-start-column="21" selection-end-line="54" selection-end-column="21" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/client.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="195">
<caret line="62" column="50" selection-start-line="62" selection-start-column="50" selection-end-line="62" selection-end-column="50" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/console.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="161">
<caret line="46" column="0" selection-start-line="46" selection-start-column="0" selection-end-line="46" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

167
.idea/workspace.xml

@ -28,8 +28,8 @@
<file leaf-file-name="ctServer.java" pinned="false" current-in-tab="false"> <file leaf-file-name="ctServer.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/ctServer.java"> <entry file="file://$PROJECT_DIR$/src/ctServer.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51"> <state relative-caret-position="272">
<caret line="61" column="32" selection-start-line="61" selection-start-column="32" selection-end-line="61" selection-end-column="32" /> <caret line="40" column="25" selection-start-line="40" selection-start-column="25" selection-end-line="40" selection-end-column="25" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -37,11 +37,11 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="console.java" pinned="false" current-in-tab="false"> <file leaf-file-name="socketInfo.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/console.java"> <entry file="file://$PROJECT_DIR$/src/socketInfo.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="178"> <state relative-caret-position="-345">
<caret line="30" column="38" selection-start-line="30" selection-start-column="38" selection-end-line="30" selection-end-column="38" /> <caret line="70" column="0" selection-start-line="70" selection-start-column="0" selection-end-line="70" selection-end-column="0" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -52,8 +52,20 @@
<file leaf-file-name="client.java" pinned="false" current-in-tab="true"> <file leaf-file-name="client.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/client.java"> <entry file="file://$PROJECT_DIR$/src/client.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1309"> <state relative-caret-position="289">
<caret line="254" column="52" selection-start-line="254" selection-start-column="52" selection-end-line="254" selection-end-column="52" /> <caret line="246" column="11" selection-start-line="243" selection-start-column="2" selection-end-line="246" selection-end-column="11" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="console.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/console.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-906">
<caret line="6" column="31" selection-start-line="6" selection-start-column="31" selection-end-line="6" selection-end-column="31" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -81,7 +93,9 @@
<list> <list>
<option value="$PROJECT_DIR$/src/main.java" /> <option value="$PROJECT_DIR$/src/main.java" />
<option value="$PROJECT_DIR$/src/ctServer.java" /> <option value="$PROJECT_DIR$/src/ctServer.java" />
<option value="$PROJECT_DIR$/src/socketInfo.java" />
<option value="$PROJECT_DIR$/src/console.java" /> <option value="$PROJECT_DIR$/src/console.java" />
<option value="$PROJECT_DIR$/ctServer.iml" />
<option value="$PROJECT_DIR$/src/client.java" /> <option value="$PROJECT_DIR$/src/client.java" />
</list> </list>
</option> </option>
@ -95,8 +109,8 @@
<component name="ProjectFrameBounds"> <component name="ProjectFrameBounds">
<option name="x" value="-8" /> <option name="x" value="-8" />
<option name="y" value="-8" /> <option name="y" value="-8" />
<option name="width" value="1296" /> <option name="width" value="1936" />
<option name="height" value="1010" /> <option name="height" value="1066" />
</component> </component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false"> <component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" /> <OptionsSetting value="true" id="Add" />
@ -131,6 +145,34 @@
<option name="myItemId" value="ctServer" /> <option name="myItemId" value="ctServer" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="External Libraries" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ExternalLibrariesNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="ctServer" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="ctServer" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="ctServer" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="ctServer" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH> </PATH>
<PATH> <PATH>
<PATH_ELEMENT> <PATH_ELEMENT>
@ -141,6 +183,10 @@
<option name="myItemId" value="ctServer" /> <option name="myItemId" value="ctServer" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="lib" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH> </PATH>
</subPane> </subPane>
</pane> </pane>
@ -637,35 +683,45 @@
<workItem from="1470739295224" duration="18435000" /> <workItem from="1470739295224" duration="18435000" />
<workItem from="1470845742191" duration="18554000" /> <workItem from="1470845742191" duration="18554000" />
<workItem from="1470936508138" duration="9814000" /> <workItem from="1470936508138" duration="9814000" />
<workItem from="1470992276279" duration="16600000" /> <workItem from="1470992276279" duration="57325000" />
</task> </task>
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="94388000" /> <option name="totallyTimeSpent" value="135113000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="all">
<are-packages-shown value="true" />
<is-autoscroll-to-source value="true" />
</todo-panel>
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="-8" y="-8" width="1296" height="1010" extended-state="6" /> <frame x="-8" y="-8" width="1936" height="1066" extended-state="6" />
<editor active="false" /> <editor active="true" />
<layout> <layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3290461" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32839224" sideWeight="0.4792111" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3279743" sideWeight="0.4792111" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3876853" sideWeight="0.5444984" order="7" side_tool="true" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3876853" sideWeight="0.5444984" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.3876853" sideWeight="0.45550162" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.36441585" sideWeight="0.45550162" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32839224" sideWeight="0.4978678" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32839224" sideWeight="0.4978678" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.1302589" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.12846482" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3290461" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3990878" sideWeight="0.47708333" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39871383" sideWeight="0.47708333" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
@ -673,7 +729,6 @@
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Coverage" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32942432" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" /> <window_info id="Coverage" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32942432" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3294979" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
</layout> </layout>
</component> </component>
<component name="Vcs.Log.UiProperties"> <component name="Vcs.Log.UiProperties">
@ -691,13 +746,13 @@
<breakpoint-manager> <breakpoint-manager>
<breakpoints> <breakpoints>
<line-breakpoint enabled="true" type="java-line"> <line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/console.java</url> <url>file://$PROJECT_DIR$/src/client.java</url>
<line>48</line> <line>53</line>
<properties /> <properties />
<option name="timeStamp" value="36" /> <option name="timeStamp" value="41" />
</line-breakpoint> </line-breakpoint>
</breakpoints> </breakpoints>
<option name="time" value="37" /> <option name="time" value="42" />
</breakpoint-manager> </breakpoint-manager>
<watches-manager /> <watches-manager />
</component> </component>
@ -829,46 +884,74 @@
</provider> </provider>
</entry> </entry>
<entry file="jar://E:/ProfessionalPrograms/JDK8/src.zip!/java/lang/Thread.java" /> <entry file="jar://E:/ProfessionalPrograms/JDK8/src.zip!/java/lang/Thread.java" />
<entry file="file://$PROJECT_DIR$/ctServer.iml"> <entry file="file://$PROJECT_DIR$/.idea/copyright/profiles_settings.xml">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/.idea/copyright/profiles_settings.xml"> <entry file="file://$PROJECT_DIR$/src/package-info.java" />
<entry file="jar://E:/ProfessionalPrograms/JDK8/src.zip!/java/lang/Thread.java" />
<entry file="jar://E:/ProfessionalPrograms/JDK8/src.zip!/java/util/ArrayList.java" />
<entry file="file://$PROJECT_DIR$/ctserver.xml" />
<entry file="file://$PROJECT_DIR$/module_ctserver.xml" />
<entry file="file://$PROJECT_DIR$/package-list" />
<entry file="jar://E:/ProfessionalPrograms/JDK8/src.zip!/java/net/SocketInputStream.java" />
<entry file="jar://C:/Program Files/Java/jdk1.8.0_102/src.zip!/java/util/ArrayList.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="169">
<caret line="652" column="0" selection-start-line="652" selection-start-column="0" selection-end-line="652" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/socketInfo.java___jb_tmp___">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="jar://C:/Program Files/Java/jdk1.8.0_102/src.zip!/java/lang/Boolean.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="188">
<caret line="42" column="19" selection-start-line="42" selection-start-column="19" selection-end-line="42" selection-end-column="26" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/socketInfo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-345">
<caret line="70" column="0" selection-start-line="70" selection-start-column="0" selection-end-line="70" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/package-info.java" />
<entry file="jar://E:/ProfessionalPrograms/JDK8/src.zip!/java/lang/Thread.java" />
<entry file="file://$PROJECT_DIR$/ctserver.properties"> <entry file="file://$PROJECT_DIR$/ctserver.properties">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="jar://E:/ProfessionalPrograms/JDK8/src.zip!/java/util/ArrayList.java" /> <entry file="file://$PROJECT_DIR$/ctServer.iml">
<entry file="file://$PROJECT_DIR$/ctserver.xml" />
<entry file="file://$PROJECT_DIR$/module_ctserver.xml" />
<entry file="file://$PROJECT_DIR$/package-list" />
<entry file="jar://E:/ProfessionalPrograms/JDK8/src.zip!/java/net/SocketInputStream.java" />
<entry file="jar://C:/Program Files/Java/jdk1.8.0_102/src.zip!/java/util/ArrayList.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="169"> <state relative-caret-position="170">
<caret line="652" column="0" selection-start-line="652" selection-start-column="0" selection-end-line="652" selection-end-column="0" /> <caret line="10" column="12" selection-start-line="10" selection-start-column="12" selection-end-line="10" selection-end-column="12" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/ctServer.java"> <entry file="file://$PROJECT_DIR$/src/ctServer.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51"> <state relative-caret-position="272">
<caret line="61" column="32" selection-start-line="61" selection-start-column="32" selection-end-line="61" selection-end-column="32" /> <caret line="40" column="25" selection-start-line="40" selection-start-column="25" selection-end-line="40" selection-end-column="25" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -877,8 +960,8 @@
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/console.java"> <entry file="file://$PROJECT_DIR$/src/console.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="178"> <state relative-caret-position="-906">
<caret line="30" column="38" selection-start-line="30" selection-start-column="38" selection-end-line="30" selection-end-column="38" /> <caret line="6" column="31" selection-start-line="6" selection-start-column="31" selection-end-line="6" selection-end-column="31" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -887,8 +970,8 @@
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/client.java"> <entry file="file://$PROJECT_DIR$/src/client.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1309"> <state relative-caret-position="289">
<caret line="254" column="52" selection-start-line="254" selection-start-column="52" selection-end-line="254" selection-end-column="52" /> <caret line="246" column="11" selection-start-line="243" selection-start-column="2" selection-end-line="246" selection-end-column="11" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>

1
ctServer.iml

@ -7,5 +7,6 @@
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="javax.json.processing-1.0" level="project" />
</component> </component>
</module> </module>

BIN
lib/javax.json.jar

Binary file not shown.

BIN
out/production/ctServer/client.class

Binary file not shown.

BIN
out/production/ctServer/console.class

Binary file not shown.

BIN
out/production/ctServer/ctServer$ClientInfo.class

Binary file not shown.

BIN
out/production/ctServer/ctServer.class

Binary file not shown.

71
src/client.java

@ -1,5 +1,5 @@
import jdk.nashorn.internal.parser.JSONParser; import javax.json.Json;
import javax.json.JsonObject;
import javax.xml.bind.DatatypeConverter; import javax.xml.bind.DatatypeConverter;
import java.io.*; import java.io.*;
import java.net.*; import java.net.*;
@ -15,61 +15,47 @@ import java.util.regex.Pattern;
*/ */
public class client extends Thread { public class client extends Thread {
private Socket socket; private Socket socket;
private BufferedReader reader;
private OutputStreamWriter writer;
private OutputStream out; private OutputStream out;
private InputStream in; private InputStream in;
public Boolean httpAuthed = false; private Integer id;
public Boolean socketAuthed = false;
public int socketID;
public void openSocket(Socket s) throws IOException { public void openSocket(Socket s) throws IOException {
socket = s; socket = s;
out = socket.getOutputStream(); out = socket.getOutputStream();
in = socket.getInputStream(); in = socket.getInputStream();
id = socketInfo.getNewID();
console.debug("Create new socket "+ id);
socketInfo.create(this,id);
start(); start();
} }
public void run() { public void run() {
socketID = ctServer.socketID; console.socket(id,"New connection");
ctServer.sockets.add(socketID, this);
console.socket(socketID,"New connection");
wsControl(); wsControl();
} }
public void close(){ public void close(){
try{ try {
if(socket.isClosed()){ in.close();
return; out.close();
}
socket.close(); socket.close();
}catch (IOException e){
} }
catch(IOException e){ console.socket(id,"Disconnected");
} socketInfo.close(id);
if(socketAuthed){
ctServer.clientInfoList.remove(socketID);
}
ctServer.sessions[socketID] = false;
httpAuthed = false;
socketAuthed = false;
console.socket(socketID,"Disconnected");
this.interrupt();
} }
public void wsControl(){ public void wsControl(){
try{
handshake(); handshake();
while (httpAuthed) { if(!socketInfo.isHttpAuth(id)){
return;
}
while (socketInfo.isOnline(id)) {
String msg = readSocket(); String msg = readSocket();
sendSocket(msg); sendSocket(msg);
//TODO: сделать проверку протокола //TODO: сделать проверку протокола
} }
} finally {
close();
}
} }
private String bytesToStringUTFCustom(int[] ints) { private String bytesToStringUTFCustom(int[] ints) {
@ -83,7 +69,7 @@ public class client extends Thread {
private void handshake(){ private void handshake(){
try{ try{
if(!httpAuthed) { if(!socketInfo.isHttpAuth(id)) {
socket.setSoTimeout(2000); socket.setSoTimeout(2000);
String data = new Scanner(in, "UTF-8").useDelimiter("\\r\\n\\r\\n").next(); String data = new Scanner(in, "UTF-8").useDelimiter("\\r\\n\\r\\n").next();
Matcher get = Pattern.compile("^GET").matcher(data); Matcher get = Pattern.compile("^GET").matcher(data);
@ -110,16 +96,16 @@ public class client extends Thread {
console.out("Server Error:", e.toString()); console.out("Server Error:", e.toString());
} }
socket.setSoTimeout(0); socket.setSoTimeout(0);
httpAuthed = true; socketInfo.setHttpAuth(id, true);
console.socket(socketID,"Handshake accepted!"); console.socket(id,"Handshake accepted!");
} }
} }
}catch (SocketException e){ }catch (SocketException e){
console.debug("исключение 22"); console.debug("исключение 22");
//TODO: написать исключение если сокет закрыт //TODO: написать исключение если сокет закрыт
}catch (NoSuchElementException e){ }catch (NoSuchElementException e){
console.socket(socketID,"Handshake Timeout (2000ms)"); console.socket(id,"Handshake Timeout (2000ms)");
httpAuthed = false; socketInfo.setHttpAuth(id, false);
} }
} }
@ -129,7 +115,7 @@ public class client extends Thread {
try{ try{
response = message.getBytes("UTF-8"); response = message.getBytes("UTF-8");
}catch (UnsupportedEncodingException e){ }catch (UnsupportedEncodingException e){
console.socket(socketID, "Unsupported encoding!"); console.socket(id, "Unsupported encoding!");
return false; return false;
} }
catch (NullPointerException e){ catch (NullPointerException e){
@ -252,24 +238,21 @@ public class client extends Thread {
console.out("Socket Exception", "Client socket is closed?! Closing socket connection!"); console.out("Socket Exception", "Client socket is closed?! Closing socket connection!");
close(); close();
} }
console.socket(socketID, "Message: "+out); console.socket(id, "Message: "+out);
return out; return out;
} }
// //
// public Socket getSocketbyId(socketID){ // public static Boolean checkProtocol(String input){
// if(socket.closed) // JsonObject first = Json.createParser(new StringReader(input)).getStrint;
// return this.socket;
// } // }
// public void sControl(){ // public void sControl(){
// try{ // try{
// while (true) { // while (true) {
// String input = reader.readLine(); // String input = reader.readLine();
// if(input == null){break;} // if(input == null){break;}
// Pattern main = Pattern.compile(";"); // Pattern main = Pattern.compile(";");
// if(!httpAuthed) { // if(!httpAuth) {
// if (!ctServer.checkClient(this, main.split(input))) { // if (!ctServer.checkClient(this, main.split(input))) {
// writer.println("CONNECT_DENIED"); // writer.println("CONNECT_DENIED");
// break; // break;

47
src/console.java

@ -1,5 +1,3 @@
import javafx.application.Application;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
@ -23,45 +21,46 @@ public class console extends Thread{
} }
public static void out(String parent, String msg){ public static void out(String parent, String msg){
Instant instant2 = Clock.systemUTC().instant(); String time = Clock.systemUTC().instant().toString();
String time = instant2.toString();
System.out.println("["+time+"|"+parent+"]: "+msg); System.out.println("["+time+"|"+parent+"]: "+msg);
} }
public static void socket(Integer socketId, String msg){ public static void socket(Integer socketId, String msg){
Instant instant2 = Clock.systemUTC().instant(); String time = Clock.systemUTC().instant().toString();
String time = instant2.toString();
System.out.println("["+time+"|"+"Socket "+socketId+"]: "+msg); System.out.println("["+time+"|"+"Socket "+socketId+"]: "+msg);
} }
public static void debug(String msg){ public static void debug(String msg){
Instant instant2 = Clock.systemUTC().instant(); String out = "[";
String time = instant2.toString(); out += Clock.systemUTC().instant().toString();
System.out.println("["+time+"|DEBUG]: "+msg); out += "|DEBUG]: ";
out += msg;
System.out.println(out);
} }
public void run() { public void run() {
while (line.equalsIgnoreCase("quit") == false) { while (line.equalsIgnoreCase("quit") == false) {
try{ try{
line = in.readLine(); line = in.readLine();
Integer sid;
Pattern main = Pattern.compile(" "); Pattern main = Pattern.compile(" ");
String[] sx = main.split(line); String[] sx = main.split(line);
switch (sx[0]){ switch (sx[0]){
case "/list": case "/list":
ArrayList<ctServer.ClientInfo> cil = ctServer.clientInfoList;
console.out("Server","/list"); console.out("Server","/list");
for(int i = 0; ctServer.sessions[i]; i++){ for(int i = 0; socketInfo.SOCKETID.size() > i; i++){
if(ctServer.sockets.get(Integer.valueOf(i)).socketAuthed) { int id = socketInfo.SOCKETID.get(i);
ctServer.ClientInfo ci = cil.get(i); if(socketInfo.isProtocolAuth(id)) {
console.out("Socket " + i, "VKID " + ci.VKID + " and PROTOCOL " + ci.PROTOCOL); console.socket(id,"VKID " + socketInfo.VKID.get(id) + " and PROTOCOL " + socketInfo.PROTOCOL.get(id));
}else{ }else{
console.out("Socket "+ i,"Not authed!"); console.socket(id,"Protocol not checked!");
} }
} }
break; break;
case "/kick": case "/kick":
if(sx.length < 2) { sid = Integer.valueOf(sx[1]);
console.out("Server","/kick - Укажите имя сокета"); if(socketInfo.findSocket(Integer.valueOf(sx[1])) != -1){
socketInfo.getClient(sid).close();
} }
break; break;
case "/help": case "/help":
@ -72,17 +71,23 @@ public class console extends Thread{
console.out("Server","ctServer Proto Defend Development 2016"); console.out("Server","ctServer Proto Defend Development 2016");
break; break;
case "/send": case "/send":
if(ctServer.sessions[Integer.valueOf(sx[1])]) { sid = socketInfo.findSocket(Integer.valueOf(sx[1]));
if ((ctServer.sockets.size() >= Integer.valueOf(sx[1])) && (Integer.valueOf(sx[1]) >= 0)) { if(sid != -1){
ctServer.sockets.get(Integer.valueOf(sx[1])).sendSocket(sx[2]); String msg = "";
for (int i = 2; i < sx.length ; i++) {
msg += " ";
msg += sx[i];
} }
socketInfo.getClient(Integer.valueOf(sx[1])).sendSocket(msg);
} }
break; break;
default: console.out("Server","Введите /help для помощи"); default: console.out("Server","Введите /help для помощи");
} }
}catch (IOException e){ }catch (IOException e){
console.out("Console","Something goes wrong...");
}catch (NumberFormatException e){
console.out("Console","Hey guy, don't be so crazy!!!");
} }
} }
} }

65
src/ctServer.java

@ -1,68 +1,53 @@
import java.net.*; import java.net.*;
import java.io.*; import java.io.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
public class ctServer { public class ctServer {
public static Boolean[] sessions; // public static int socketID;
public static List<client> sockets; // public static ArrayList<socketInfo> socketInfoList;
public static int socketID;
public static ArrayList<ClientInfo> clientInfoList;
public static class ClientInfo{
public static String VKID, ROLE, PROTOCOL, EVENT, TRACKID;
public static int TIME;
public static Boolean notEmpty = false;
public static void destroy(){
VKID = null;
ROLE = null;
PROTOCOL = null;
EVENT = null;
TRACKID = null;
TIME = 0;
notEmpty = false;
}
}
public static boolean checkClient(client c, String[] args){ public static boolean checkClient(socketInfo socketID, String[] args){
ClientInfo ci = new ClientInfo(); /*
ci.destroy(); socketInfo flow = new socketInfo();
//TODO: Устарело
//TODO: перенести в console.java
try { try {
for (String name : args) { for (String name : args) {
Pattern main = Pattern.compile(":"); Pattern main = Pattern.compile(":");
String[] sx = main.split(name); String[] sx = main.split(name);
switch (sx[0]) { switch (sx[0]) {
case "PROTOCOL": case "PROTOCOL":
ci.PROTOCOL = sx[1]; flow.PROTOCOL = sx[1];
break; break;
case "VKID": case "VKID":
ci.VKID = sx[1]; flow.VKID = sx[1];
break; break;
} }
} }
if (!ci.VKID.equals("")) { if (!flow.VKID.equals("")) {
if (!ci.PROTOCOL.equals("")) { if (!flow.PROTOCOL.equals("")) {
clientInfoList.add(c.socketID, ci); flow.httpAuth = true;
c.httpAuthed = true; socketInfoList.set(flow.SOCKETID, flow);
console.debug("Авторизация произошла!"); console.debug("Авторизация произошла!");
return true; return true;
} }
} }
} catch (NullPointerException e){ } catch (NullPointerException e){
return false; return false;
}finally {
flow.close();
System.gc();
} }
*/
return false; return false;
} }
public static void main(String[] args) throws IOException{ public static void main(String[] args) throws IOException{
sessions = new Boolean[1000]; socketInfo.init();
for (int i = 0; i < sessions.length; i++) { // socketID = 0;
sessions[i] = false;
}
clientInfoList = new ArrayList<>();
sockets = new ArrayList<>();
try{ try{
new console().consoleListner(); new console().consoleListner();
} }
@ -77,18 +62,6 @@ public class ctServer {
while(true) { while(true) {
Socket socket = ss.accept(); Socket socket = ss.accept();
try { try {
for(int i = 0; ctServer.sessions.length > i; i++){
if(ctServer.sessions[i] == null){
ctServer.socketID = i;
ctServer.sessions[i] = true;
break;
}
if(ctServer.sessions[i] == false){
ctServer.socketID = i;
ctServer.sessions[i] = true;
break;
}
}
new client().openSocket(socket); new client().openSocket(socket);
} catch (IOException e) { } catch (IOException e) {
socket.close(); socket.close();

118
src/socketInfo.java

@ -0,0 +1,118 @@
import java.util.ArrayList;
import java.util.function.BooleanSupplier;
/**
* Created by itsmy_000 on 13.08.2016.
*/
public class socketInfo {
public static ArrayList<String> ROLE, PROTOCOL, EVENT, TRACKID;
public static ArrayList<Integer> VKID, TIME, SOCKETID, PARTYID;
public static ArrayList<Boolean> ONLINE, httpAuth, protocolAuth;
public static ArrayList<client> CLIENT;
public static Integer sid;
public static void init(){
sid = 0;
VKID = new ArrayList<>();
TIME = new ArrayList<>();
ROLE = new ArrayList<>();
EVENT = new ArrayList<>();
CLIENT = new ArrayList<>();
PARTYID = new ArrayList<>();
TRACKID = new ArrayList<>();
PROTOCOL = new ArrayList<>();
SOCKETID = new ArrayList<>();
ONLINE = new ArrayList<>();
httpAuth = new ArrayList<>();
protocolAuth = new ArrayList<>();
}
public static void create(client c, Integer sid){
VKID.add(0);
TIME.add(0);
ROLE.add("");
EVENT.add("");
ONLINE.add(true);
CLIENT.add(c);
TRACKID.add("");
PROTOCOL.add("");
PARTYID.add(0);
SOCKETID.add(sid);
httpAuth.add(false);
protocolAuth.add(false);
}
public static void close(Integer sid){
int s = findSocket(sid);
VKID.remove(s);
ROLE.remove(s);
PROTOCOL.remove(s);
EVENT.remove(s);
TRACKID.remove(s);
SOCKETID.remove(s);
TIME.remove(s);
PARTYID.remove(s);
CLIENT.remove(s);
ONLINE.remove(s);
httpAuth.remove(s);
protocolAuth.remove(s);
}
public static Integer getNewID(){
sid++;
return sid;
}
public static Integer findSocket(int s){
int id = -1;
for (int i = 0; i < SOCKETID.size(); i++) {
if(SOCKETID.get(i) == s){
id = i;
}
}
return id;
}
public static void setHttpAuth(Integer sid, Boolean b){
int s = findSocket(sid);
if(s == -1) return;
httpAuth.set(s, b);
}
public static void setProtocol(Integer sid, Integer vkid, Integer pid, String role){
int s = findSocket(sid);
if(s == -1) return;
protocolAuth.set(s, true);
VKID.set(s, vkid);
PARTYID.set(s, pid);
ROLE.set(s, role);
}
public static Boolean isProtocolAuth(Integer sid){
int s = findSocket(sid);
if(s == -1) return Boolean.FALSE;
return protocolAuth.get(s);
}
public static Boolean isHttpAuth(Integer sid){
int s = findSocket(sid);
if(s == -1) return Boolean.FALSE;
return httpAuth.get(s);
}
public static Boolean isOnline(Integer sid){
int s = findSocket(sid);
if(s == -1) return Boolean.FALSE;
return ONLINE.get(s);
}
public static client getClient(Integer sid){
int s = findSocket(sid);
if(s == -1) return null;
return socketInfo.CLIENT.get(s);
}
}
Loading…
Cancel
Save