Commit 8e49c80d authored by IceYGO's avatar IceYGO

Update to the latest OCGWrapper and update to the version 133D

parent 560ccf09
using OCGWrapper.Enums; using System.Collections.Generic;
using System.Collections.Generic; using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game.AI namespace WindBot.Game.AI
{ {
......
using OCGWrapper.Enums; using System.Collections.Generic;
using System.Collections.Generic; using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game.AI namespace WindBot.Game.AI
{ {
......
using OCGWrapper.Enums; using System.Collections.Generic;
using System.Collections.Generic;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
using YGOSharp.OCGWrapper.Enums;
namespace DevBot.Game.AI.Decks namespace DevBot.Game.AI.Decks
{ {
......
using OCGWrapper.Enums; using System.Collections.Generic;
using System.Collections.Generic;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
using YGOSharp.OCGWrapper.Enums;
namespace DevBot.Game.AI.Decks namespace DevBot.Game.AI.Decks
{ {
......
using OCGWrapper.Enums; using System.Collections.Generic;
using System.Collections.Generic; using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
......
using OCGWrapper.Enums; using System.Collections.Generic;
using System.Collections.Generic;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
using YGOSharp.OCGWrapper.Enums;
namespace DevBot.Game.AI.Decks namespace DevBot.Game.AI.Decks
{ {
......
using OCGWrapper.Enums; using System.Collections.Generic;
using System.Collections.Generic;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
using YGOSharp.OCGWrapper.Enums;
namespace DevBot.Game.AI.Decks namespace DevBot.Game.AI.Decks
{ {
......
...@@ -36,9 +36,8 @@ namespace WindBot.Game.AI ...@@ -36,9 +36,8 @@ namespace WindBot.Game.AI
object[] attributes = info.GetCustomAttributes(false); object[] attributes = info.GetCustomAttributes(false);
foreach (object attribute in attributes) foreach (object attribute in attributes)
{ {
if (attribute is DeckAttribute) if (attribute is DeckAttribute deck)
{ {
DeckAttribute deck = (DeckAttribute)attribute;
_decks.Add(deck.Name, new DeckInstance(deck.File, type)); _decks.Add(deck.Name, new DeckInstance(deck.File, type));
} }
} }
......
using OCGWrapper.Enums; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game.AI namespace WindBot.Game.AI
{ {
......
using OCGWrapper.Enums; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game.AI namespace WindBot.Game.AI
{ {
......
using OCGWrapper; using System.Collections.Generic;
using OCGWrapper.Enums;
using System.Collections.Generic;
using System.IO; using System.IO;
using YGOSharp.Network; using YGOSharp.OCGWrapper;
using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game namespace WindBot.Game
{ {
......
using OCGWrapper.Enums; using System.Collections.Generic;
using System.Collections.Generic; using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game namespace WindBot.Game
{ {
......
using OCGWrapper; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using YGOSharp.OCGWrapper;
namespace WindBot.Game namespace WindBot.Game
{ {
...@@ -63,8 +63,7 @@ namespace WindBot.Game ...@@ -63,8 +63,7 @@ namespace WindBot.Game
continue; continue;
} }
int id; if (!int.TryParse(line, out int id))
if (!int.TryParse(line, out id))
continue; continue;
deck.AddNewCard(id, side); deck.AddNewCard(id, side);
......
using OCGWrapper.Enums; using System.Collections.Generic;
using System.Collections.Generic; using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game namespace WindBot.Game
{ {
......
using OCGWrapper.Enums; using System.Collections.Generic;
using System.Collections.Generic;
using WindBot.Game.AI; using WindBot.Game.AI;
using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game namespace WindBot.Game
{ {
......
using OCGWrapper; using System;
using OCGWrapper.Enums;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
...@@ -8,6 +6,8 @@ using WindBot.Game.AI; ...@@ -8,6 +6,8 @@ using WindBot.Game.AI;
using YGOSharp.Network; using YGOSharp.Network;
using YGOSharp.Network.Enums; using YGOSharp.Network.Enums;
using YGOSharp.Network.Utils; using YGOSharp.Network.Utils;
using YGOSharp.OCGWrapper;
using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game namespace WindBot.Game
{ {
...@@ -571,6 +571,7 @@ namespace WindBot.Game ...@@ -571,6 +571,7 @@ namespace WindBot.Game
for (int i = 0; i < count; ++i) for (int i = 0; i < count; ++i)
{ {
packet.ReadByte(); // flag
packet.ReadInt32(); // card id packet.ReadInt32(); // card id
int con = GetLocalPlayer(packet.ReadByte()); int con = GetLocalPlayer(packet.ReadByte());
int loc = packet.ReadByte(); int loc = packet.ReadByte();
...@@ -601,7 +602,7 @@ namespace WindBot.Game ...@@ -601,7 +602,7 @@ namespace WindBot.Game
{ {
packet.ReadByte(); // player packet.ReadByte(); // player
int type = packet.ReadInt16(); int type = packet.ReadInt16();
int quantity = packet.ReadByte(); int quantity = packet.ReadInt16();
IList<ClientCard> cards = new List<ClientCard>(); IList<ClientCard> cards = new List<ClientCard>();
IList<int> counters = new List<int>(); IList<int> counters = new List<int>();
...@@ -612,17 +613,16 @@ namespace WindBot.Game ...@@ -612,17 +613,16 @@ namespace WindBot.Game
int player = GetLocalPlayer(packet.ReadByte()); int player = GetLocalPlayer(packet.ReadByte());
CardLocation loc = (CardLocation) packet.ReadByte(); CardLocation loc = (CardLocation) packet.ReadByte();
int seq = packet.ReadByte(); int seq = packet.ReadByte();
int num = packet.ReadByte(); int num = packet.ReadInt16();
cards.Add(_duel.GetCard(player, loc, seq)); cards.Add(_duel.GetCard(player, loc, seq));
counters.Add(num); counters.Add(num);
} }
IList<int> used = _ai.OnSelectCounter(type, quantity, cards, counters); IList<int> used = _ai.OnSelectCounter(type, quantity, cards, counters);
byte[] result = new byte[used.Count];
for (int i = 0; i < quantity; ++i)
result[i] = (byte) used[i];
BinaryWriter reply = GamePacketFactory.Create(CtosMessage.Response); BinaryWriter reply = GamePacketFactory.Create(CtosMessage.Response);
reply.Write(result); for (int i = 0; i < quantity; ++i)
reply.Write((short)used[i]);
Connection.Send(reply); Connection.Send(reply);
} }
......
using OCGWrapper; using System;
using System;
using System.IO; using System.IO;
using System.Threading; using System.Threading;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
using YGOSharp.OCGWrapper;
namespace WindBot namespace WindBot
{ {
public class Program public class Program
{ {
public static short ProVersion = 0x1330; public static short ProVersion = 0x133D;
public static int PlayerNameSize = 20; public static int PlayerNameSize = 20;
internal static Random Rand; internal static Random Rand;
......
...@@ -34,19 +34,39 @@ ...@@ -34,19 +34,39 @@
<PropertyGroup> <PropertyGroup>
<StartupObject /> <StartupObject />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Mono.Data.Sqlite"> <Reference Include="Mono.Data.Sqlite">
<HintPath>.\Mono.Data.Sqlite.dll</HintPath> <HintPath>.\Mono.Data.Sqlite.dll</HintPath>
</Reference> </Reference>
<Reference Include="OCGWrapper">
<HintPath>.\OCGWrapper.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="YGOSharp.Network"> <Reference Include="YGOSharp.Network">
<HintPath>.\YGOSharp.Network.dll</HintPath> <HintPath>.\YGOSharp.Network.dll</HintPath>
</Reference> </Reference>
<Reference Include="YGOSharp.OCGWrapper">
<HintPath>.\YGOSharp.OCGWrapper.dll</HintPath>
</Reference>
<Reference Include="YGOSharp.OCGWrapper.Enums">
<HintPath>.\YGOSharp.OCGWrapper.Enums.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Game\AI\AIFunctions.cs" /> <Compile Include="Game\AI\AIFunctions.cs" />
......
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14 # Visual Studio 15
VisualStudioVersion = 14.0.24720.0 VisualStudioVersion = 15.0.26206.0
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindBot", "WindBot.csproj", "{3E7FAF67-A27D-4A61-B161-93AD4414183E}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindBot", "WindBot.csproj", "{3E7FAF67-A27D-4A61-B161-93AD4414183E}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86 Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86 Release|x86 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3E7FAF67-A27D-4A61-B161-93AD4414183E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E7FAF67-A27D-4A61-B161-93AD4414183E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E7FAF67-A27D-4A61-B161-93AD4414183E}.Debug|x86.ActiveCfg = Debug|x86 {3E7FAF67-A27D-4A61-B161-93AD4414183E}.Debug|x86.ActiveCfg = Debug|x86
{3E7FAF67-A27D-4A61-B161-93AD4414183E}.Debug|x86.Build.0 = Debug|x86 {3E7FAF67-A27D-4A61-B161-93AD4414183E}.Debug|x86.Build.0 = Debug|x86
{3E7FAF67-A27D-4A61-B161-93AD4414183E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E7FAF67-A27D-4A61-B161-93AD4414183E}.Release|Any CPU.Build.0 = Release|Any CPU
{3E7FAF67-A27D-4A61-B161-93AD4414183E}.Release|x86.ActiveCfg = Release|x86 {3E7FAF67-A27D-4A61-B161-93AD4414183E}.Release|x86.ActiveCfg = Release|x86
{3E7FAF67-A27D-4A61-B161-93AD4414183E}.Release|x86.Build.0 = Release|x86 {3E7FAF67-A27D-4A61-B161-93AD4414183E}.Release|x86.Build.0 = Release|x86
EndGlobalSection EndGlobalSection
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment