Permalink
Browse files

Initial release

  • Loading branch information...
Silv3rPRO committed Jun 11, 2016
1 parent 48bd5ef commit e2816ed6d42ad3bb63637a41b1fe513085ec10c6
Showing with 16,719 additions and 0 deletions.
  1. BIN Assets/message.wav
  2. +161 −0 BrightNetwork/BrightClient.cs
  3. +56 −0 BrightNetwork/BrightNetwork.csproj
  4. +36 −0 BrightNetwork/Properties/AssemblyInfo.cs
  5. +170 −0 BrightNetwork/SimpleTextClient.cs
  6. +174 −0 BrightNetwork/SocksConnection.cs
  7. +21 −0 PROBot/Account.cs
  8. +108 −0 PROBot/AccountManager.cs
  9. +377 −0 PROBot/BattleAI.cs
  10. +357 −0 PROBot/BotClient.cs
  11. +92 −0 PROBot/Modules/AutoReconnector.cs
  12. +52 −0 PROBot/Modules/MoveTeacher.cs
  13. +81 −0 PROBot/Modules/MovementResynchronizer.cs
  14. +68 −0 PROBot/Modules/PokemonEvolver.cs
  15. +73 −0 PROBot/Modules/StaffAvoider.cs
  16. +79 −0 PROBot/PROBot.csproj
  17. +222 −0 PROBot/Pathfinding.cs
  18. +35 −0 PROBot/Properties/AssemblyInfo.cs
  19. +32 −0 PROBot/Scripting/BaseScript.cs
  20. +26 −0 PROBot/Scripting/CustomScriptLoader.cs
  21. +1,165 −0 PROBot/Scripting/LuaScript.cs
  22. +24 −0 PROBot/Socks.cs
  23. +41 −0 PROBot/Utils/TaskUtils.cs
  24. +5 −0 PROBot/packages.config
  25. +16 −0 PROProtocol/AuthenticationResult.cs
  26. +183 −0 PROProtocol/Battle.cs
  27. +14 −0 PROProtocol/ChatChannel.cs
  28. +46 −0 PROProtocol/ChatEmotes.cs
  29. +79 −0 PROProtocol/Direction.cs
  30. +767 −0 PROProtocol/EffortValuesManager.cs
  31. +1,443 −0 PROProtocol/GameClient.cs
  32. +81 −0 PROProtocol/GameConnection.cs
  33. +60 −0 PROProtocol/HardwareHash.cs
  34. +18 −0 PROProtocol/InventoryItem.cs
  35. +44 −0 PROProtocol/Language.cs
  36. +601 −0 PROProtocol/Map.cs
  37. +16 −0 PROProtocol/MapLink.cs
  38. +3,802 −0 PROProtocol/MovesManager.cs
  39. +25 −0 PROProtocol/Npc.cs
  40. +80 −0 PROProtocol/PROProtocol.csproj
  41. +36 −0 PROProtocol/PlayerInfos.cs
  42. +104 −0 PROProtocol/Pokemon.cs
  43. +28 −0 PROProtocol/PokemonMove.cs
  44. +797 −0 PROProtocol/PokemonNamesManager.cs
  45. +84 −0 PROProtocol/PokemonStats.cs
  46. +74 −0 PROProtocol/PokemonType.cs
  47. +35 −0 PROProtocol/Properties/AssemblyInfo.cs
  48. +30 −0 PROProtocol/Shop.cs
  49. +16 −0 PROProtocol/ShopItem.cs
  50. +12 −0 PROProtocol/StatType.cs
  51. +30 −0 PROProtocol/Timeout.cs
  52. +1,741 −0 PROProtocol/TypesManager.cs
  53. +17 −0 PROProtocol/XorEncryption.cs
  54. +40 −0 PROShine.sln
  55. +6 −0 PROShine/App.config
  56. +9 −0 PROShine/App.xaml
  57. +24 −0 PROShine/App.xaml.cs
  58. BIN PROShine/Assets/logo-png/128.png
  59. BIN PROShine/Assets/logo-png/16.png
  60. BIN PROShine/Assets/logo-png/32.png
  61. BIN PROShine/Assets/logo-png/48.png
  62. BIN PROShine/Assets/logo-png/64.png
  63. BIN PROShine/Assets/logo.ico
  64. +12 −0 PROShine/Controls/ButtonTab.cs
  65. +18 −0 PROShine/Controls/ButtonTabHeader.xaml
  66. +21 −0 PROShine/Controls/ButtonTabHeader.xaml.cs
  67. +177 −0 PROShine/PROShine.csproj
  68. +56 −0 PROShine/Properties/AssemblyInfo.cs
  69. +63 −0 PROShine/Properties/Resources.Designer.cs
  70. +120 −0 PROShine/Properties/Resources.resx
  71. +30 −0 PROShine/Properties/Settings.Designer.cs
  72. +7 −0 PROShine/Properties/Settings.settings
  73. +122 −0 PROShine/Utils/FlashWindowHelper.cs
  74. +17 −0 PROShine/Views/ChatPanel.xaml
  75. +12 −0 PROShine/Views/ChatPanel.xaml.cs
  76. +17 −0 PROShine/Views/ChatView.xaml
  77. +392 −0 PROShine/Views/ChatView.xaml.cs
  78. +39 −0 PROShine/Views/InventoryView.xaml
  79. +34 −0 PROShine/Views/InventoryView.xaml.cs
  80. +79 −0 PROShine/Views/LoginWindow.xaml
  81. +361 −0 PROShine/Views/LoginWindow.xaml.cs
  82. +239 −0 PROShine/Views/MainWindow.xaml
  83. +806 −0 PROShine/Views/MainWindow.xaml.cs
  84. +54 −0 PROShine/Views/PlayersView.xaml
  85. +93 −0 PROShine/Views/PlayersView.xaml.cs
  86. +30 −0 PROShine/Views/TeamView.xaml
  87. +103 −0 PROShine/Views/TeamView.xaml.cs
  88. BIN PROShine/logo.ico
  89. +4 −0 PROShine/packages.config
BIN +49.8 KB Assets/message.wav
Binary file not shown.
@@ -0,0 +1,161 @@
using System;
using System.Net;
using System.Net.Sockets;

namespace BrightNetwork
{
public class BrightClient
{
public event Action Connected;
public event Action<Exception> Disconnected;
public event Action<byte[]> DataReceived;

public bool IsConnected { get; private set; }

public IPAddress RemoteIPAddress
{
get { return _endPoint.Address; }
}

private Socket _socket;
private IPEndPoint _endPoint;
private bool _isClosed;
private byte[] _receiveBuffer;

public BrightClient()
{
_receiveBuffer = new byte[4096];
}

public BrightClient(Socket socket)
{
_receiveBuffer = new byte[4096];
Initialize(socket);
}

public void Initialize(Socket socket)
{
_endPoint = (IPEndPoint)socket.RemoteEndPoint;
_socket = socket;
IsConnected = true;
Connected?.Invoke();
BeginReceive();
}

public void BeginConnect(IPAddress address, int port)
{
if (!IsConnected && !_isClosed)
{
IsConnected = true;
try
{
_endPoint = new IPEndPoint(address, port);
_socket = new Socket(_endPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
_socket.BeginConnect(_endPoint, new AsyncCallback(ConnectCallback), null);
}
catch (Exception ex)
{
Close(ex);
}
}
}

public void BeginSend(byte[] data)
{
try
{
_socket.BeginSend(data, 0, data.Length, SocketFlags.None, SendCallback, data.Length);
}
catch (Exception ex)
{
Close(ex);
}
}

public void Close(Exception error = null)
{
if (!_isClosed)
{
_isClosed = true;
try
{
if (_socket != null)
{
_socket.Close();
}
}
catch (Exception ex)
{
ex = new AggregateException(error, ex);
}
Disconnected?.Invoke(error);
}
}

private void BeginReceive()
{
try
{
_socket.BeginReceive(_receiveBuffer, 0, _receiveBuffer.Length, SocketFlags.None, ReceiveCallback, null);
}
catch (Exception ex)
{
Close(ex);
}
}

private void ConnectCallback(IAsyncResult result)
{
try
{
_socket.EndConnect(result);
}
catch (Exception ex)
{
Close(ex);
return;
}
Connected?.Invoke();
BeginReceive();
}

private void SendCallback(IAsyncResult result)
{
try
{
int bytesSent = _socket.EndSend(result);
if (bytesSent != (int)result.AsyncState)
{
Close();
}
}
catch (Exception ex)
{
Close(ex);
}
}

private void ReceiveCallback(IAsyncResult result)
{
int bytesRead;
try
{
bytesRead = _socket.EndReceive(result);
}
catch (Exception ex)
{
Close(ex);
return;
}
if (bytesRead == 0)
{
Close();
return;
}
byte[] data = new byte[bytesRead];
Array.Copy(_receiveBuffer, data, bytesRead);
DataReceived?.Invoke(data);
BeginReceive();
}
}
}
@@ -0,0 +1,56 @@
<?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>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F6F45690-9361-4DA4-8A8A-18D782E29752}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BrightNetwork</RootNamespace>
<AssemblyName>BrightNetwork</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="BrightClient.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SimpleTextClient.cs" />
<Compile Include="SocksConnection.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("BrightNetwork")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BrightNetwork")]
[assembly: AssemblyCopyright("Copyright © Silv3r, 2016-2032")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f6f45690-9361-4da4-8a8a-18d782e29752")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Oops, something went wrong.

0 comments on commit e2816ed

Please sign in to comment.