Browse Source

Release 21

master
Defend 8 years ago
parent
commit
bd514ab4b3
  1. 7
      .idea/misc.xml
  2. 237
      .idea/workspace (1).xml
  3. 210
      .idea/workspace.xml
  4. 240
      src/client.java
  5. 30
      src/console.java
  6. 42
      src/ctServer.java
  7. 43
      src/socketInfo.java

7
.idea/misc.xml

@ -59,13 +59,6 @@
<option name="OPEN_IN_BROWSER" value="true" /> <option name="OPEN_IN_BROWSER" value="true" />
<option name="OPTION_INCLUDE_LIBS" value="false" /> <option name="OPTION_INCLUDE_LIBS" value="false" />
</component> </component>
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="mavenHome" value="Bundled (Maven 3)" />
</MavenGeneralSettings>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false"> <component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" /> <OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" /> <OptionsSetting value="true" id="Remove" />

237
.idea/workspace (1).xml

@ -19,6 +19,14 @@
<component name="CreatePatchCommitExecutor"> <component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" /> <option name="PATCH_PATH" value="" />
</component> </component>
<component name="DatabaseView">
<option name="GROUP_SCHEMA" value="true" />
<option name="GROUP_CONTENTS" value="false" />
<option name="SORT_POSITIONED" value="false" />
<option name="SHOW_TABLE_DETAILS" value="true" />
<option name="SHOW_EMPTY_GROUPS" value="false" />
<option name="AUTO_SCROLL_FROM_SOURCE" value="false" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager"> <component name="FavoritesManager">
<favorites_list name="ctServer" /> <favorites_list name="ctServer" />
@ -28,8 +36,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="714"> <state relative-caret-position="17">
<caret line="54" column="21" selection-start-line="54" selection-start-column="21" selection-end-line="54" selection-end-column="21" /> <caret line="1" column="17" selection-start-line="1" selection-start-column="17" selection-end-line="1" selection-end-column="17" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -37,11 +45,11 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="console.java" pinned="false" current-in-tab="true"> <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="161"> <state relative-caret-position="-629">
<caret line="46" column="0" selection-start-line="46" selection-start-column="0" selection-end-line="46" selection-end-column="0" /> <caret line="5" column="3" selection-start-line="5" selection-start-column="3" selection-end-line="5" selection-end-column="3" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -52,8 +60,20 @@
<file leaf-file-name="client.java" pinned="false" current-in-tab="false"> <file leaf-file-name="client.java" pinned="false" current-in-tab="false">
<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="195"> <state relative-caret-position="471">
<caret line="62" column="50" selection-start-line="62" selection-start-column="50" selection-end-line="62" selection-end-column="50" /> <caret line="285" column="29" selection-start-line="285" selection-start-column="29" selection-end-line="285" selection-end-column="29" />
<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="29">
<caret line="51" column="82" selection-start-line="51" selection-start-column="82" selection-end-line="51" selection-end-column="82" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -80,9 +100,12 @@
<option name="CHANGED_PATHS"> <option name="CHANGED_PATHS">
<list> <list>
<option value="$PROJECT_DIR$/src/main.java" /> <option value="$PROJECT_DIR$/src/main.java" />
<option value="$PROJECT_DIR$/ctServer.iml" />
<option value="$PROJECT_DIR$/src/ctServer.java" /> <option value="$PROJECT_DIR$/src/ctServer.java" />
<option value="$PROJECT_DIR$/src/console.java" /> <option value="$PROJECT_DIR$/src/console.java" />
<option value="$APPLICATION_CONFIG_DIR$/consoles/db/cf3e1e55-303c-4850-a301-239177a61e9f/console.sql" />
<option value="$PROJECT_DIR$/src/client.java" /> <option value="$PROJECT_DIR$/src/client.java" />
<option value="$PROJECT_DIR$/src/socketInfo.java" />
</list> </list>
</option> </option>
</component> </component>
@ -92,11 +115,21 @@
<detection-done>true</detection-done> <detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting> <sorting>DEFINITION_ORDER</sorting>
</component> </component>
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="mavenHome" value="Bundled (Maven 3)" />
</MavenGeneralSettings>
</option>
</component>
<component name="MavenProjectNavigator">
<treeState />
</component>
<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" />
@ -123,7 +156,7 @@
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="Scratches" /> <pane id="Scope" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<PATH> <PATH>
@ -131,6 +164,10 @@
<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> <PATH>
<PATH_ELEMENT> <PATH_ELEMENT>
@ -142,10 +179,38 @@
<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> </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_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="lib" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane> </subPane>
</pane> </pane>
<pane id="Scratches" />
<pane id="PackagesPane" /> <pane id="PackagesPane" />
<pane id="Scope" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
@ -159,7 +224,7 @@
<property name="GenerateAntBuildDialog.outputFileNameProperty" value="ctserver" /> <property name="GenerateAntBuildDialog.outputFileNameProperty" value="ctserver" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="last_opened_file_path" value="$PROJECT_DIR$" />
</component> </component>
<component name="RunManager" selected="Application.Unnamed"> <component name="RunManager" selected="Application.Debug">
<configuration default="true" type="#com.intellij.j2meplugin.run.J2MEConfigurationType" factoryName="J2ME"> <configuration default="true" type="#com.intellij.j2meplugin.run.J2MEConfigurationType" factoryName="J2ME">
<module name="" /> <module name="" />
<USER_OPTIONS /> <USER_OPTIONS />
@ -601,7 +666,8 @@
<configuration default="true" type="osgi.bnd.run" factoryName="Test Launcher (JUnit)"> <configuration default="true" type="osgi.bnd.run" factoryName="Test Launcher (JUnit)">
<method /> <method />
</configuration> </configuration>
<configuration default="false" name="Unnamed" type="Application" factoryName="Application"> <configuration default="false" name="Debug" type="Application" factoryName="Application" singleton="true">
<output_file is_save="true" />
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" /> <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="ctServer" /> <option name="MAIN_CLASS_NAME" value="ctServer" />
<option name="VM_PARAMETERS" value="" /> <option name="VM_PARAMETERS" value="" />
@ -617,7 +683,7 @@
<method /> <method />
</configuration> </configuration>
<list size="1"> <list size="1">
<item index="0" class="java.lang.String" itemvalue="Application.Unnamed" /> <item index="0" class="java.lang.String" itemvalue="Application.Debug" />
</list> </list>
</component> </component>
<component name="ShelveChangesManager" show_recycled="false"> <component name="ShelveChangesManager" show_recycled="false">
@ -637,35 +703,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="9337000" /> <workItem from="1470992276279" duration="63044000" />
<workItem from="1471163816519" duration="11233000" />
</task> </task>
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="87125000" /> <option name="totallyTimeSpent" value="152065000" />
</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="false" />
<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.3288889" 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.32995737" 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="false" 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.32995737" 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="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.39935064" 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 +749,8 @@
<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" /> <window_info id="Database Console" 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="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" />
</layout> </layout>
</component> </component>
<component name="Vcs.Log.UiProperties"> <component name="Vcs.Log.UiProperties">
@ -689,7 +766,7 @@
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>
<option name="time" value="33" /> <option name="time" value="42" />
</breakpoint-manager> </breakpoint-manager>
<watches-manager /> <watches-manager />
</component> </component>
@ -698,6 +775,46 @@
<option name="FILTER_TARGETS" value="false" /> <option name="FILTER_TARGETS" value="false" />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/ctServer.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="17">
<caret line="1" column="17" selection-start-line="1" selection-start-column="17" selection-end-line="1" selection-end-column="17" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/socketInfo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1615">
<caret line="95" column="5" selection-start-line="95" selection-start-column="5" selection-end-line="95" 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="1003">
<caret line="59" column="13" selection-start-line="59" selection-start-column="13" selection-end-line="59" selection-end-column="13" />
<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="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/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="0"> <state relative-caret-position="0">
@ -821,38 +938,72 @@
</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" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/socketInfo.java___jb_tmp___" />
<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$/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" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/package-info.java" /> <entry file="file://$PROJECT_DIR$/ctServer.iml">
<entry file="jar://E:/ProfessionalPrograms/JDK8/src.zip!/java/lang/Thread.java" /> <provider selected="true" editor-type-id="text-editor">
<entry file="file://$PROJECT_DIR$/ctserver.properties"> <state relative-caret-position="170">
<caret line="10" column="12" selection-start-line="10" selection-start-column="12" selection-end-line="10" selection-end-column="12" />
</state>
</provider>
</entry>
<entry file="file://$APPLICATION_CONFIG_DIR$/consoles/db/cf3e1e55-303c-4850-a301-239177a61e9f/console.sql">
<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.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"> <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="714"> <state relative-caret-position="17">
<caret line="54" column="21" selection-start-line="54" selection-start-column="21" selection-end-line="54" selection-end-column="21" /> <caret line="1" column="17" selection-start-line="1" selection-start-column="17" selection-end-line="1" selection-end-column="17" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/socketInfo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-629">
<caret line="5" column="3" selection-start-line="5" selection-start-column="3" selection-end-line="5" selection-end-column="3" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -861,8 +1012,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="195"> <state relative-caret-position="471">
<caret line="62" column="50" selection-start-line="62" selection-start-column="50" selection-end-line="62" selection-end-column="50" /> <caret line="285" column="29" selection-start-line="285" selection-start-column="29" selection-end-line="285" selection-end-column="29" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -871,8 +1022,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="161"> <state relative-caret-position="29">
<caret line="46" column="0" selection-start-line="46" selection-start-column="0" selection-end-line="46" selection-end-column="0" /> <caret line="51" column="82" selection-start-line="51" selection-start-column="82" selection-end-line="51" selection-end-column="82" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>

210
.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="272"> <state relative-caret-position="485">
<caret line="40" column="25" selection-start-line="40" selection-start-column="25" selection-end-line="40" selection-end-column="25" /> <caret line="32" column="1" selection-start-line="32" selection-start-column="1" selection-end-line="32" selection-end-column="1" />
<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="socketInfo.java" pinned="false" current-in-tab="false"> <file leaf-file-name="console.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/socketInfo.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="-345"> <state relative-caret-position="264">
<caret line="70" column="0" selection-start-line="70" selection-start-column="0" selection-end-line="70" selection-end-column="0" /> <caret line="67" column="90" selection-start-line="67" selection-start-column="90" selection-end-line="67" selection-end-column="90" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -49,11 +49,21 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="socketInfo.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/socketInfo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="264">
<caret line="89" column="37" selection-start-line="89" selection-start-column="37" selection-end-line="89" selection-end-column="37" />
<folding />
</state>
</provider>
</entry>
</file>
<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="289"> <state relative-caret-position="162">
<caret line="246" column="11" selection-start-line="243" selection-start-column="2" selection-end-line="246" selection-end-column="11" /> <caret line="63" column="28" selection-start-line="63" selection-start-column="28" selection-end-line="63" selection-end-column="28" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -61,14 +71,12 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="console.java" pinned="false" current-in-tab="false"> <file leaf-file-name="JsonParser.class" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/console.java"> <entry file="jar://$PROJECT_DIR$/lib/javax.json.jar!/javax/json/stream/JsonParser.class">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-906"> <state relative-caret-position="204">
<caret line="6" column="31" selection-start-line="6" selection-start-column="31" selection-end-line="6" selection-end-column="31" /> <caret line="30" column="16" selection-start-line="30" selection-start-column="16" selection-end-line="30" selection-end-column="16" />
<folding> <folding />
<element signature="imports" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
@ -93,9 +101,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$/lib/javax.json.jar!/javax/json/stream/JsonParser.class" />
<option value="$PROJECT_DIR$/src/socketInfo.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>
@ -137,7 +145,9 @@
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="Scope" />
<pane id="Scratches" /> <pane id="Scratches" />
<pane id="PackagesPane" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<PATH> <PATH>
@ -145,34 +155,6 @@
<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>
@ -183,15 +165,9 @@
<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>
<pane id="PackagesPane" />
<pane id="Scope" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
@ -683,45 +659,37 @@
<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="57325000" /> <workItem from="1470992276279" duration="9337000" />
<workItem from="1471206887598" duration="5117000" />
</task> </task>
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="135113000" /> <option name="totallyTimeSpent" value="92242000" />
</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="1936" height="1066" extended-state="6" /> <frame x="-8" y="-8" width="1936" height="1066" extended-state="6" />
<editor active="true" /> <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.3290461" 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.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.3279743" 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="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3858521" sideWeight="0.45550162" order="2" 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="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.12846482" 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.0858209" 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="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.39871383" 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.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="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" />
@ -744,15 +712,7 @@
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>
<breakpoints> <option name="time" value="33" />
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/client.java</url>
<line>53</line>
<properties />
<option name="timeStamp" value="41" />
</line-breakpoint>
</breakpoints>
<option name="time" value="42" />
</breakpoint-manager> </breakpoint-manager>
<watches-manager /> <watches-manager />
</component> </component>
@ -761,6 +721,36 @@
<option name="FILTER_TARGETS" value="false" /> <option name="FILTER_TARGETS" value="false" />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/ctServer.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="527">
<caret line="32" column="1" selection-start-line="32" selection-start-column="1" selection-end-line="32" selection-end-column="1" />
<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="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/client.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="867">
<caret line="62" column="9" selection-start-line="62" selection-start-column="9" selection-end-line="62" selection-end-column="9" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</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="0"> <state relative-caret-position="0">
@ -884,74 +874,46 @@
</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$/.idea/copyright/profiles_settings.xml"> <entry file="file://$PROJECT_DIR$/ctServer.iml">
<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$/src/package-info.java" /> <entry file="file://$PROJECT_DIR$/.idea/copyright/profiles_settings.xml">
<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="file://$PROJECT_DIR$/ctServer.iml"> <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://$PROJECT_DIR$/lib/javax.json.jar!/javax/json/stream/JsonParser.class">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="170"> <state relative-caret-position="204">
<caret line="10" column="12" selection-start-line="10" selection-start-column="12" selection-end-line="10" selection-end-column="12" /> <caret line="30" column="16" selection-start-line="30" selection-start-column="16" selection-end-line="30" selection-end-column="16" />
<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="272"> <state relative-caret-position="485">
<caret line="40" column="25" selection-start-line="40" selection-start-column="25" selection-end-line="40" selection-end-column="25" /> <caret line="32" column="1" selection-start-line="32" selection-start-column="1" selection-end-line="32" selection-end-column="1" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -960,18 +922,26 @@
</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="-906"> <state relative-caret-position="264">
<caret line="6" column="31" selection-start-line="6" selection-start-column="31" selection-end-line="6" selection-end-column="31" /> <caret line="67" column="90" selection-start-line="67" selection-start-column="90" selection-end-line="67" selection-end-column="90" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/socketInfo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="264">
<caret line="89" column="37" selection-start-line="89" selection-start-column="37" selection-end-line="89" selection-end-column="37" />
<folding />
</state>
</provider>
</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="289"> <state relative-caret-position="162">
<caret line="246" column="11" selection-start-line="243" selection-start-column="2" selection-end-line="246" selection-end-column="11" /> <caret line="63" column="28" selection-start-line="63" selection-start-column="28" selection-end-line="63" selection-end-column="28" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>

240
src/client.java

@ -1,5 +1,6 @@
import javax.json.Json; import javax.json.Json;
import javax.json.JsonObject; import javax.json.JsonObject;
import javax.json.stream.JsonParser;
import javax.xml.bind.DatatypeConverter; import javax.xml.bind.DatatypeConverter;
import java.io.*; import java.io.*;
import java.net.*; import java.net.*;
@ -18,131 +19,140 @@ public class client extends Thread {
private OutputStream out; private OutputStream out;
private InputStream in; private InputStream in;
private Integer id; private Integer id;
private Boolean isClosing = false;
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(); id = socketInfo.getNewID();
console.debug("Create new socket "+ id); console.debug("Create new socket " + id);
socketInfo.create(this,id); socketInfo.create(this, id);
start(); start();
} }
public void run() { public void run() {
console.socket(id,"New connection"); console.socket(id, "New connection");
wsControl(); wsControl();
} }
public void close(){ public void close() {
if(!socketInfo.isOnline(id)){
return;
}
try { try {
in.close(); in.close();
out.close(); out.close();
socket.close(); socket.close();
}catch (IOException e){ } catch (IOException e) {
} }
console.socket(id,"Disconnected"); console.socket(id, "Disconnected");
socketInfo.close(id); socketInfo.close(id);
} }
public void wsControl(){ public void wsControl() {
handshake(); handshake();
if(!socketInfo.isHttpAuth(id)){ if (!socketInfo.isHttpAuth(id)) {
return; return;
} }
while (socketInfo.isOnline(id)) { while (socketInfo.isOnline(id)) {
String msg = readSocket(); String msg = readSocket();
parseInput(msg);
if(!socketInfo.isProtocolAuth(id)){socketInfo.checkProtocol(id);}
if(!socketInfo.isProtocolAuth(id)){sendSocket("{\"fn\":\"bad_protocol\"}");close();}
sendSocket(msg); sendSocket(msg);
//TODO: сделать проверку протокола
} }
} }
private String bytesToStringUTFCustom(int[] ints) { private String bytesToStringUTFCustom(int[] ints) {
char[] buffer = new char[ints.length]; char[] buffer = new char[ints.length];
for(int i = 0; i < buffer.length; i++) { for (int i = 0; i < buffer.length; i++) {
char c = (char) ints[i]; char c = (char) ints[i];
buffer[i] = c; buffer[i] = c;
} }
return new String(buffer); return new String(buffer);
} }
private void handshake(){ private void handshake() {
try{ if(!socketInfo.isOnline(id)){close(); return;}
if(!socketInfo.isHttpAuth(id)) { try {
socket.setSoTimeout(2000); if (!socketInfo.isHttpAuth(id)) {
String data = new Scanner(in, "UTF-8").useDelimiter("\\r\\n\\r\\n").next(); socket.setSoTimeout(2000);
Matcher get = Pattern.compile("^GET").matcher(data); String data = new Scanner(in, "UTF-8").useDelimiter("\\r\\n\\r\\n").next();
if (get.find()) { Matcher get = Pattern.compile("^GET").matcher(data);
Matcher match = Pattern.compile("Sec-WebSocket-Key: (.*)").matcher(data); if (get.find()) {
match.find(); Matcher match = Pattern.compile("Sec-WebSocket-Key: (.*)").matcher(data);
try { match.find();
byte[] response = ("HTTP/1.1 101 Switching Protocols\r\n" try {
+ "Connection: Upgrade\r\n" byte[] response = ("HTTP/1.1 101 Switching Protocols\r\n"
+ "Upgrade: websocket\r\n" + "Connection: Upgrade\r\n"
+ "Sec-WebSocket-Accept: " + "Upgrade: websocket\r\n"
+ DatatypeConverter + "Sec-WebSocket-Accept: "
.printBase64Binary( + DatatypeConverter
MessageDigest .printBase64Binary(
.getInstance("SHA-1") MessageDigest
.digest((match.group(1) + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11") .getInstance("SHA-1")
.getBytes("UTF-8"))) .digest((match.group(1) + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11")
+ "\r\n\r\n") .getBytes("UTF-8")))
.getBytes("UTF-8"); + "\r\n\r\n")
out.write(response, 0, response.length); .getBytes("UTF-8");
} catch (IOException e) { out.write(response, 0, response.length);
console.out("Server Error:", e.toString()); } catch (IOException e) {
} catch (NoSuchAlgorithmException e) { console.out("Server Error:", e.toString());
console.out("Server Error:", e.toString()); } catch (NoSuchAlgorithmException e) {
console.out("Server Error:", e.toString());
}
socket.setSoTimeout(0);
socketInfo.setHttpAuth(id, true);
console.socket(id, "Handshake accepted!");
} }
socket.setSoTimeout(0);
socketInfo.setHttpAuth(id, true);
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(id,"Handshake Timeout (2000ms)"); console.socket(id, "Handshake Timeout (2000ms)");
socketInfo.setHttpAuth(id, false); socketInfo.setHttpAuth(id, false);
close();
} catch(IllegalStateException e){
console.socket(id, "Bad handshake request!");
close();
} }
} }
public Boolean sendSocket(String message){ public Boolean sendSocket(String message) {
if(!socketInfo.isOnline(id)){close(); return false;}
byte[] response; byte[] response;
byte[] r; byte[] r;
try{ try {
response = message.getBytes("UTF-8"); response = message.getBytes("UTF-8");
}catch (UnsupportedEncodingException e){ } catch (UnsupportedEncodingException e) {
console.socket(id, "Unsupported encoding!"); console.socket(id, "Unsupported encoding!");
return false; return false;
} } catch (NullPointerException e) {
catch (NullPointerException e){
return false; return false;
} }
if (message.length() < 126) { if (message.length() < 126) {
r = new byte[response.length+2]; r = new byte[response.length + 2];
System.arraycopy(response,0,r,2,response.length); System.arraycopy(response, 0, r, 2, response.length);
r[0] = (byte) 129; r[0] = (byte) 129;
r[1] = (byte) (response.length); r[1] = (byte) (response.length);
} } else {
else{
if (message.length() < 65535) { if (message.length() < 65535) {
r = new byte[response.length+4]; r = new byte[response.length + 4];
System.arraycopy(response,0,r,4,response.length); System.arraycopy(response, 0, r, 4, response.length);
r[0] = (byte) 129; r[0] = (byte) 129;
r[1] = (byte) 126; r[1] = (byte) 126;
r[2] = (byte) (response.length >>> 8); r[2] = (byte) (response.length >>> 8);
r[3] = (byte) (response.length); r[3] = (byte) (response.length);
} } else {
else{ if (response.length > Long.MAX_VALUE) {
if(response.length > Long.MAX_VALUE){
console.out("Socket Exception", "Too long message for sending! (>64bit)"); console.out("Socket Exception", "Too long message for sending! (>64bit)");
return false; return false;
} }
r = new byte[response.length+8]; r = new byte[response.length + 8];
System.arraycopy(response,0,r,8,response.length); System.arraycopy(response, 0, r, 8, response.length);
r[0] = (byte) 129; r[0] = (byte) 129;
r[1] = (byte) 127; r[1] = (byte) 127;
r[2] = (byte) (response.length >>> 56); r[2] = (byte) (response.length >>> 56);
@ -155,42 +165,48 @@ public class client extends Thread {
r[9] = (byte) (response.length); r[9] = (byte) (response.length);
} }
} }
try{ try {
out.write(r, 0, r.length); out.write(r, 0, r.length);
return true; return true;
}catch(IOException e){ } catch (IOException e) {
console.out("Socket Exeption", "Client socket is closed?! Closing socket connection!"); console.out("Socket Exeption", "Client socket is closed?! Closing socket connection!");
close(); close();
return false; return false;
} }
} }
public String readSocket(){ public String readSocket() {
if(!socketInfo.isOnline(id)){close(); return null;}
String out = ""; String out = "";
try try {
{
int[] MSG = new int[0]; int[] MSG = new int[0];
int OPCOUNT = 1; int OPCOUNT = 1;
int LENGTH; int LENGTH;
int KEYFRAME = 0; int KEYFRAME = 0;
int[] KEY = new int[4]; int[] KEY = new int[4];
int OPCODE = in.read(); //читаем OPCODE byte int OPCODE = in.read(); //читаем OPCODE byte
switch(OPCODE){ switch (OPCODE) {
case -1: close(); //закрываем чтение потока при -1 case -1:
close(); //закрываем чтение потока при -1
return null; return null;
case 136: close(); case 136:
close();
return null; return null;
case 129: case 129:
LENGTH = in.read(); //читаем второй бит с данными о размере сообщения LENGTH = in.read(); //читаем второй бит с данными о размере сообщения
//TODO: which и switch OPCOUNT - необходимо убрать //TODO: which и switch OPCOUNT - необходимо убрать
while(OPCOUNT < 4) { while (OPCOUNT < 4) {
switch (OPCOUNT){ switch (OPCOUNT) {
case 1: switch (LENGTH){ //узнаем длину сообщения case 1:
default: KEYFRAME = 2; switch (LENGTH) { //узнаем длину сообщения
default:
KEYFRAME = 2;
break; break;
case 254: KEYFRAME = 4; //126-65535 case 254:
KEYFRAME = 4; //126-65535
break; break;
case 255: KEYFRAME = 10; //65535-... case 255:
KEYFRAME = 10; //65535-...
break; break;
} }
break; break;
@ -214,37 +230,70 @@ public class client extends Thread {
+ (in.read()); + (in.read());
MSG = new int[LENGTH]; MSG = new int[LENGTH];
break; break;
} }
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
KEY[i] = in.read(); KEY[i] = in.read();
} }
for (int j = 0; j < (MSG.length); j++) { for (int j = 0; j < (MSG.length); j++) {
int enc = in.read(); int enc = in.read();
MSG[j] = (byte) (enc ^ KEY[j & 0x3]); MSG[j] = (byte) (enc ^ KEY[j & 0x3]);
} }
break; break;
case 3: case 3:
if(MSG.length>0){ if (MSG.length > 0) {
out = bytesToStringUTFCustom(MSG); out = bytesToStringUTFCustom(MSG);
} } else {
else{
return null; return null;
} }
} }
OPCOUNT++; OPCOUNT++;
} }
}
}catch(IOException e){
console.out("Socket Exception", "Client socket is closed?! Closing socket connection!");
close();
} }
console.socket(id, "Message: "+out); } catch (IOException e) {
return out; console.out("Socket Exception", "Client socket is closed?! Closing socket connection!");
close();
} }
// if(!socketInfo.isOnline(id)){close(); return null;}
// public static Boolean checkProtocol(String input){ console.socket(id, "Message: " + out);
// JsonObject first = Json.createParser(new StringReader(input)).getStrint; return out;
// } }
public Boolean parseInput(String input) {
if(!socketInfo.isOnline(id)){close();return false;}
try {
String keyName = null;
JsonParser jsonParser = Json.createParser(new StringReader(input));
while (jsonParser.hasNext()) {
JsonParser.Event event = jsonParser.next();
switch (event) {
case KEY_NAME:
keyName = jsonParser.getString();
break;
case VALUE_STRING:
socketInfo.setString(id, keyName, jsonParser.getString());
break;
case VALUE_NUMBER:
socketInfo.setInteger(id, keyName, jsonParser.getInt());
break;
case VALUE_FALSE:
break;
case VALUE_TRUE:
break;
case VALUE_NULL:
// don't set anything
break;
default:
// we are not looking for other events
break;
}
}
return true;
}catch(NullPointerException e){
console.socket(id,"Request parsing error!");
return false;
}
}
}
// public void sControl(){ // public void sControl(){
// try{ // try{
@ -283,4 +332,3 @@ public class client extends Thread {
// } // }
// } // }
}

30
src/console.java

@ -21,13 +21,23 @@ public class console extends Thread{
} }
public static void out(String parent, String msg){ public static void out(String parent, String msg){
String time = Clock.systemUTC().instant().toString(); String out = "[";
System.out.println("["+time+"|"+parent+"]: "+msg); out += Clock.systemUTC().instant().toString();
out += "|";
out += parent;
out += "]: ";
out += msg;
System.out.println(out);
} }
public static void socket(Integer socketId, String msg){ public static void socket(Integer socketId, String msg){
String time = Clock.systemUTC().instant().toString(); String out = "[";
System.out.println("["+time+"|"+"Socket "+socketId+"]: "+msg); out += Clock.systemUTC().instant().toString();
out += "|Socket ";
out += socketId;
out += "]: ";
out += msg;
System.out.println(out);
} }
public static void debug(String msg){ public static void debug(String msg){
@ -49,11 +59,15 @@ public class console extends Thread{
case "/list": case "/list":
console.out("Server","/list"); console.out("Server","/list");
for(int i = 0; socketInfo.SOCKETID.size() > i; i++){ for(int i = 0; socketInfo.SOCKETID.size() > i; i++){
int id = socketInfo.SOCKETID.get(i); sid = socketInfo.SOCKETID.get(i);
if(socketInfo.isProtocolAuth(id)) { if(socketInfo.protocolAuth.get(i)) {
console.socket(id,"VKID " + socketInfo.VKID.get(id) + " and PROTOCOL " + socketInfo.PROTOCOL.get(id)); console.socket(sid,"VKID " + socketInfo.VKID.get(i)
+ " PROTOCOL " + socketInfo.PROTOCOL.get(i)
+ " EVENT " + socketInfo.EVENT.get(i)
+ " PARTYID " + socketInfo.PARTYID.get(i)
+ " TRACKDURATION " + socketInfo.DURATION.get(i));
}else{ }else{
console.socket(id,"Protocol not checked!"); console.socket(sid,"Protocol not checked!");
} }
} }
break; break;

42
src/ctServer.java

@ -1,49 +1,7 @@
import java.net.*; import java.net.*;
import java.io.*; import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
public class ctServer { public class ctServer {
// public static int socketID;
// public static ArrayList<socketInfo> socketInfoList;
public static boolean checkClient(socketInfo socketID, String[] args){
/*
socketInfo flow = new socketInfo();
//TODO: Устарело
//TODO: перенести в console.java
try {
for (String name : args) {
Pattern main = Pattern.compile(":");
String[] sx = main.split(name);
switch (sx[0]) {
case "PROTOCOL":
flow.PROTOCOL = sx[1];
break;
case "VKID":
flow.VKID = sx[1];
break;
}
}
if (!flow.VKID.equals("")) {
if (!flow.PROTOCOL.equals("")) {
flow.httpAuth = true;
socketInfoList.set(flow.SOCKETID, flow);
console.debug("Авторизация произошла!");
return true;
}
}
} catch (NullPointerException e){
return false;
}finally {
flow.close();
System.gc();
}
*/
return false;
}
public static void main(String[] args) throws IOException{ public static void main(String[] args) throws IOException{
socketInfo.init(); socketInfo.init();

43
src/socketInfo.java

@ -6,7 +6,7 @@ import java.util.function.BooleanSupplier;
*/ */
public class socketInfo { public class socketInfo {
public static ArrayList<String> ROLE, PROTOCOL, EVENT, TRACKID; public static ArrayList<String> ROLE, PROTOCOL, EVENT, TRACKID;
public static ArrayList<Integer> VKID, TIME, SOCKETID, PARTYID; public static ArrayList<Integer> VKID, TIME, SOCKETID, PARTYID, DURATION;
public static ArrayList<Boolean> ONLINE, httpAuth, protocolAuth; public static ArrayList<Boolean> ONLINE, httpAuth, protocolAuth;
public static ArrayList<client> CLIENT; public static ArrayList<client> CLIENT;
public static Integer sid; public static Integer sid;
@ -22,6 +22,7 @@ public class socketInfo {
PARTYID = new ArrayList<>(); PARTYID = new ArrayList<>();
TRACKID = new ArrayList<>(); TRACKID = new ArrayList<>();
PROTOCOL = new ArrayList<>(); PROTOCOL = new ArrayList<>();
DURATION = new ArrayList<>();
SOCKETID = new ArrayList<>(); SOCKETID = new ArrayList<>();
ONLINE = new ArrayList<>(); ONLINE = new ArrayList<>();
httpAuth = new ArrayList<>(); httpAuth = new ArrayList<>();
@ -38,6 +39,7 @@ public class socketInfo {
TRACKID.add(""); TRACKID.add("");
PROTOCOL.add(""); PROTOCOL.add("");
PARTYID.add(0); PARTYID.add(0);
DURATION.add(0);
SOCKETID.add(sid); SOCKETID.add(sid);
httpAuth.add(false); httpAuth.add(false);
protocolAuth.add(false); protocolAuth.add(false);
@ -52,6 +54,7 @@ public class socketInfo {
TRACKID.remove(s); TRACKID.remove(s);
SOCKETID.remove(s); SOCKETID.remove(s);
TIME.remove(s); TIME.remove(s);
DURATION.remove(s);
PARTYID.remove(s); PARTYID.remove(s);
CLIENT.remove(s); CLIENT.remove(s);
ONLINE.remove(s); ONLINE.remove(s);
@ -81,13 +84,12 @@ public class socketInfo {
httpAuth.set(s, b); httpAuth.set(s, b);
} }
public static void setProtocol(Integer sid, Integer vkid, Integer pid, String role){ public static void checkProtocol(Integer sid){
int s = findSocket(sid); int s = findSocket(sid);
if(s == -1) return; if(s == -1) return;
protocolAuth.set(s, true); if(PROTOCOL.get(s).equals("1A")){
VKID.set(s, vkid); protocolAuth.set(s, true);
PARTYID.set(s, pid); }
ROLE.set(s, role);
} }
public static Boolean isProtocolAuth(Integer sid){ public static Boolean isProtocolAuth(Integer sid){
@ -114,5 +116,34 @@ public class socketInfo {
return socketInfo.CLIENT.get(s); return socketInfo.CLIENT.get(s);
} }
public static void setString(Integer sid, String keyName, String value) {
int s = findSocket(sid);
if (s == -1) return;
switch (keyName) {
case "fn":
EVENT.set(s, value);
break;
case "tI":
TRACKID.set(s, value);
break;
case "protocol":
PROTOCOL.set(s, value);
break;
}
}
public static void setInteger(Integer sid, String keyName, Integer value){
int s = findSocket(sid);
if(s == -1) return;
switch (keyName){
case "vk_id": VKID.set(s, value);
break;
case "tT": TIME.set(s, value);
break;
case "partyId": PARTYID.set(s, value);
break;
case "tD": DURATION.set(s, value);
break;
}
}
} }

Loading…
Cancel
Save