Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Commit

Permalink
Clean up socket logic. (#1531)
Browse files Browse the repository at this point in the history
* Clean up socket logic.

* Replace ..\packages
  • Loading branch information
jjskuld authored and hardknoxni69a committed Apr 20, 2017
1 parent 371c2f6 commit e7ff0a4
Show file tree
Hide file tree
Showing 55 changed files with 465 additions and 131 deletions.
58 changes: 1 addition & 57 deletions PoGo.NecroBot.CLI/PoGo.NecroBot.CLI.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -144,27 +144,18 @@
</Reference>
<Reference Include="SuperSocket.Common, Version=1.6.6.1, Culture=neutral, PublicKeyToken=6c80000676988ebb, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\SuperSocket.1.6.6.1\lib\net45\SuperSocket.Common.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SuperSocket.Facility, Version=1.6.6.1, Culture=neutral, PublicKeyToken=6c80000676988ebb, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\SuperSocket.1.6.6.1\lib\net45\SuperSocket.Facility.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SuperSocket.SocketBase, Version=1.6.6.1, Culture=neutral, PublicKeyToken=6c80000676988ebb, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\SuperSocket.1.6.6.1\lib\net45\SuperSocket.SocketBase.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SuperSocket.SocketEngine, Version=1.6.6.1, Culture=neutral, PublicKeyToken=6c80000676988ebb, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\SuperSocket.Engine.1.6.6.1\lib\net45\SuperSocket.SocketEngine.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SuperSocket.SocketService, Version=1.6.6.1, Culture=neutral, PublicKeyToken=6c80000676988ebb, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\SuperSocket.Engine.1.6.6.1\lib\net45\SuperSocket.SocketService.exe</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SuperSocket.WebSocket, Version=1.6.6.1, Culture=neutral, PublicKeyToken=6c80000676988ebb, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\SuperSocket.WebSocket.1.6.6.1\lib\net45\SuperSocket.WebSocket.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System">
<Private>True</Private>
Expand Down Expand Up @@ -196,13 +187,8 @@
<Reference Include="WebDriver.Support, Version=3.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Selenium.Support.3.3.0\lib\net40\WebDriver.Support.dll</HintPath>
</Reference>
<Reference Include="websocket-sharp, Version=1.0.2.59611, Culture=neutral, PublicKeyToken=5660b08a1845a91e, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\WebSocketSharp.1.0.3-rc11\lib\websocket-sharp.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="BotDataSocketClient.cs" />
<Compile Include="CommandLineUtility\Arguments.cs" />
<Compile Include="Forms\AuthAPIForm.cs">
<SubType>Form</SubType>
Expand Down Expand Up @@ -235,48 +221,6 @@
<Compile Include="Resources\ProgressBar.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WebSocketHandler\ActionCommands\FastpokemapHandler.cs" />
<Compile Include="WebSocketHandler\ActionCommands\SetTrainerNicknameHandler.cs" />
<Compile Include="WebSocketHandler\ActionCommands\UpgradePokemonHandler.cs" />
<Compile Include="WebSocketHandler\ActionCommands\SetMoveToTargetHandler.cs" />
<Compile Include="WebSocketHandler\ActionCommands\SetConfigHandler.cs" />
<Compile Include="WebSocketHandler\ActionCommands\HumanSnipeRemovePokemonHandler.cs" />
<Compile Include="WebSocketHandler\ActionCommands\HumanSnipePriorityPokemonHandler.cs" />
<Compile Include="WebSocketHandler\ActionCommands\FavoritePokemonHandler.cs" />
<Compile Include="WebSocketHandler\ActionCommands\DropItemHandler.cs" />
<Compile Include="WebSocketHandler\ActionCommands\LevelUpPokemonHandler.cs" />
<Compile Include="WebSocketHandler\GetCommands\Events\ConfigResponce.cs" />
<Compile Include="WebSocketHandler\GetCommands\Events\SnipeListResponce.cs" />
<Compile Include="WebSocketHandler\GetCommands\Events\WebResponce.cs" />
<Compile Include="WebSocketHandler\GetCommands\Events\EggListResponce.cs" />
<Compile Include="WebSocketHandler\GetCommands\Events\ItemListResponce.cs" />
<Compile Include="WebSocketHandler\GetCommands\Events\TrainerProfileResponce.cs" />
<Compile Include="WebSocketHandler\GetCommands\GetEggListHandler.cs" />
<Compile Include="WebSocketHandler\GetCommands\GetPokemonSnipeListHandler.cs" />
<Compile Include="WebSocketHandler\GetCommands\GetItemsListHandler.cs" />
<Compile Include="WebSocketHandler\GetCommands\GetPokemonSettingsHandler.cs" />
<Compile Include="WebSocketHandler\GetCommands\GetTrainerProfileHandler.cs" />
<Compile Include="WebSocketHandler\GetCommands\Helpers\ConfigWeb.cs" />
<Compile Include="WebSocketHandler\GetCommands\Helpers\TrainerProfileWeb.cs" />
<Compile Include="WebSocketHandler\GetCommands\Tasks\GetConfigTask.cs" />
<Compile Include="WebSocketHandler\GetCommands\Tasks\GetPokemonSnipeListTask.cs" />
<Compile Include="WebSocketHandler\GetCommands\Tasks\GetPokemonSettingsTask.cs" />
<Compile Include="WebSocketHandler\GetCommands\Tasks\GetTrainerProfileTask.cs" />
<Compile Include="WebSocketHandler\ActionCommands\EvolvePokemonHandler.cs" />
<Compile Include="WebSocketHandler\ActionCommands\TransferPokemonHandler.cs" />
<Compile Include="WebSocketHandler\GetCommands\Helpers\EggListWeb.cs" />
<Compile Include="WebSocketHandler\GetCommands\Tasks\GetEggListTask.cs" />
<Compile Include="WebSocketHandler\GetCommands\Tasks\GetItemListTask.cs" />
<Compile Include="WebSocketHandler\EncodingHelper.cs" />
<Compile Include="WebSocketHandler\GetCommands\GetConfigHandler.cs" />
<Compile Include="WebSocketHandler\IWebSocketResponce.cs" />
<Compile Include="WebSocketHandler\IWebSocketRequestHandler.cs" />
<Compile Include="WebSocketHandler\GetCommands\Events\PokemonListResponce.cs" />
<Compile Include="WebSocketHandler\GetCommands\Helpers\PokemonListWeb.cs" />
<Compile Include="WebSocketHandler\GetCommands\GetPokemonListHandler.cs" />
<Compile Include="WebSocketHandler\GetCommands\Tasks\GetPokemonListTask.cs" />
<Compile Include="WebSocketHandler\WebSocketEventManager.cs" />
<Compile Include="WebSocketInterface.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ public static void RunBotWithParameters(Action<ISession, StatisticsAggregator> o

if (_session.LogicSettings.DataSharingConfig.EnableSyncData)
{
BotDataSocketClient.StartAsync(_session);
BotDataSocketClient.StartAsync(_session, Properties.Resources.EncryptKey);
_session.EventDispatcher.EventReceived += evt => BotDataSocketClient.Listen(evt, _session);
}
settings.CheckProxy(_session.Translation);
Expand Down
2 changes: 0 additions & 2 deletions PoGo.NecroBot.CLI/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,5 @@
<package id="Selenium.WebDriver.ChromeDriver" version="2.29.0" targetFramework="net462" />
<package id="SuperSocket" version="1.6.6.1" targetFramework="net462" />
<package id="SuperSocket.Engine" version="1.6.6.1" targetFramework="net462" />
<package id="SuperSocket.WebSocket" version="1.6.6.1" targetFramework="net462" />
<package id="TinyIoC" version="1.3" targetFramework="net462" developmentDependency="true" />
<package id="WebSocketSharp" version="1.0.3-rc11" targetFramework="net462" />
</packages>
73 changes: 73 additions & 0 deletions PoGo.NecroBot.Logic/Config/log4net.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
<appender name="errorAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="ERROR" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\err.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="infoAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\info.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="debugAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="DEBUG" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\debug.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="perfAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\perf.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %logger - %message%newline" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="errorAppender" />
<appender-ref ref="infoAppender" />
<appender-ref ref="debugAppender" />
</root>
<logger name="Performance" additivity="false">
<level value="ALL" />
<appender-ref ref="perfAppender" />
</logger>
</log4net>
73 changes: 73 additions & 0 deletions PoGo.NecroBot.Logic/Config/log4net.unix.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
<appender name="errorAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="ERROR" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<File value="Logs/err.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="infoAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs/info.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="debugAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="DEBUG" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs/debug.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="perfAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs/perf.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %logger - %message%newline" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="errorAppender" />
<appender-ref ref="infoAppender" />
<appender-ref ref="debugAppender" />
</root>
<logger name="Performance" additivity="false">
<level value="ALL" />
<appender-ref ref="perfAppender" />
</logger>
</log4net>
Loading

0 comments on commit e7ff0a4

Please sign in to comment.