Commit 8efd8d09 authored by IceYGO's avatar IceYGO

Update for YGOPro v1338 + Major code cleanup

Use OCGWrapper and YGOSharp.Network to remove a lot of duplicate code.
parent 90b783d5
using System.Collections.Generic;
using WindBot.Game.Enums;
using OCGWrapper.Enums;
using System.Collections.Generic;
namespace WindBot.Game.AI
{
......
using System.Collections.Generic;
using WindBot.Game.Enums;
using OCGWrapper.Enums;
using System.Collections.Generic;
namespace WindBot.Game.AI
{
......
using System.Collections.Generic;
using WindBot.Game.Enums;
using OCGWrapper.Enums;
using System.Collections.Generic;
namespace WindBot.Game.AI.Decks
{
......@@ -86,9 +86,9 @@ namespace WindBot.Game.AI.Decks
private bool BellowOfTheSilverDragon()
{
if (Duel.Player == 0 && (Duel.Phase == Phase.Draw || Duel.Phase == Phase.Standby))
if (Duel.Player == 0 && (Duel.Phase == DuelPhase.Draw || Duel.Phase == DuelPhase.Standby))
return false;
if (Duel.Player == 1 && Duel.Phase == Phase.End)
if (Duel.Player == 1 && Duel.Phase == DuelPhase.End)
return false;
List<ClientCard> cards = new List<ClientCard>(Duel.Fields[0].Graveyard);
......
using System;
using OCGWrapper.Enums;
using System;
using System.Collections.Generic;
using WindBot.Game.Enums;
namespace WindBot.Game.AI
{
......
using System;
using OCGWrapper.Enums;
using System;
using System.Collections.Generic;
using WindBot.Game.Enums;
namespace WindBot.Game.AI
{
......
using System.Collections.Generic;
using WindBot.Game.Data;
using WindBot.Game.Enums;
using WindBot.Game.Network;
using OCGWrapper;
using OCGWrapper.Enums;
using System.Collections.Generic;
using YGOSharp.Network;
namespace WindBot.Game
{
public class ClientCard
{
public int Id { get; private set; }
public CardData Data { get; private set; }
public NamedCard Data { get; private set; }
public string Name { get; private set; }
public int Position { get; set; }
......@@ -49,12 +49,12 @@ namespace WindBot.Game
{
if (Id == id) return;
Id = id;
Data = CardsManager.GetCard(Id);
Data = NamedCard.Get(Id);
if (Data != null)
Name = Data.Name;
}
public void Update(GameServerPacket packet, Duel duel)
public void Update(GamePacketReader packet, Duel duel)
{
int flag = packet.ReadInt32();
if ((flag & (int)Query.Code) != 0)
......@@ -170,7 +170,7 @@ namespace WindBot.Game
public bool IsDefense()
{
return HasPosition(CardPosition.Defense);
return HasPosition(CardPosition.Defence);
}
public int GetDefensePower()
......
using System.Collections.Generic;
using WindBot.Game.Enums;
using OCGWrapper.Enums;
using System.Collections.Generic;
namespace WindBot.Game
{
......
using WindBot.Game.Enums;
namespace WindBot.Game.Data
{
public class CardData
{
public int Id { get; private set; }
public int AliasId { get; set; }
public int Type { get; set; }
public int Level { get; set; }
public int Attribute { get; set; }
public int Race { get; set; }
public int Atk { get; set; }
public int Def { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public CardData(int id)
{
Id = id;
}
public bool HasType(CardType type)
{
return ((Type & (int)type) != 0);
}
public bool IsExtraCard()
{
return (HasType(CardType.Fusion) || HasType(CardType.Synchro) || HasType(CardType.Xyz));
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Reflection;
using Mono.Data.Sqlite;
namespace WindBot.Game.Data
{
public class CardsManager
{
private static IDictionary<int, CardData> _cards;
public static void Init()
{
try
{
_cards = new Dictionary<int, CardData>();
string currentPath = Assembly.GetExecutingAssembly().Location;
currentPath = Path.GetDirectoryName(currentPath) ?? "";
string absolutePath = Path.Combine(currentPath, "cards.cdb");
if (!File.Exists(absolutePath))
{
throw new Exception("Could not find the cards database.");
}
using (SqliteConnection connection = new SqliteConnection("Data Source=" + absolutePath))
{
connection.Open();
const string select =
"SELECT datas.id, alias, type, level, race, attribute, atk, def, name, desc " +
"FROM datas INNER JOIN texts ON datas.id = texts.id";
using (SqliteCommand command = new SqliteCommand(select, connection))
using (SqliteDataReader reader = command.ExecuteReader())
InitCards(reader);
}
}
catch (Exception ex)
{
throw new Exception("Could not initialize the cards database. Check the inner exception for more details.", ex);
}
}
private static void InitCards(IDataReader reader)
{
while (reader.Read())
{
int id = reader.GetInt32(0);
CardData card = new CardData(id)
{
AliasId = reader.GetInt32(1),
Type = reader.GetInt32(2),
Level = reader.GetInt32(3) & 0xFF,
Race = reader.GetInt32(4),
Attribute = reader.GetInt32(5),
Atk = reader.GetInt32(6),
Def = reader.GetInt32(7),
Name = reader.GetString(8),
Description = reader.GetString(9)
};
_cards.Add(id, card);
}
}
public static int GetCount()
{
return _cards.Count;
}
public static CardData GetCard(int id)
{
if (_cards.ContainsKey(id))
{
return _cards[id];
}
return null;
}
}
}
\ No newline at end of file
using System;
using OCGWrapper;
using System;
using System.Collections.Generic;
using System.IO;
namespace WindBot.Game.Data
namespace WindBot.Game
{
public class Deck
{
public IList<CardData> Cards { get; private set; }
public IList<CardData> ExtraCards { get; private set; }
public IList<CardData> SideCards { get; private set; }
public IList<NamedCard> Cards { get; private set; }
public IList<NamedCard> ExtraCards { get; private set; }
public IList<NamedCard> SideCards { get; private set; }
public Deck()
{
Cards = new List<CardData>();
ExtraCards = new List<CardData>();
SideCards = new List<CardData>();
Cards = new List<NamedCard>();
ExtraCards = new List<NamedCard>();
SideCards = new List<NamedCard>();
}
private void AddNewCard(int cardId, bool sideDeck)
{
CardData newCard = CardsManager.GetCard(cardId);
NamedCard newCard = NamedCard.Get(cardId);
if (newCard == null)
return;
......@@ -29,7 +30,7 @@ namespace WindBot.Game.Data
SideCards.Add(newCard);
}
private void AddCard(CardData card)
private void AddCard(NamedCard card)
{
if (card.IsExtraCard())
ExtraCards.Add(card);
......
using System.Collections.Generic;
using WindBot.Game.Enums;
using OCGWrapper.Enums;
using System.Collections.Generic;
namespace WindBot.Game
{
......@@ -12,7 +12,7 @@ namespace WindBot.Game
public int Turn { get; set; }
public int Player { get; set; }
public Phase Phase { get; set; }
public DuelPhase Phase { get; set; }
public MainPhase MainPhase { get; set; }
public BattlePhase BattlePhase { get; set; }
......
namespace WindBot.Game.Enums
{
public enum CardAttribute
{
Earth = 0x01,
Water = 0x02,
Fire = 0x04,
Wind = 0x08,
Light = 0x10,
Dark = 0x20,
Divine = 0x40
}
}
\ No newline at end of file
namespace WindBot.Game.Enums
{
public enum CardLocation
{
Deck = 0x01,
Hand = 0x02,
MonsterZone = 0x04,
SpellZone = 0x08,
Grave = 0x10,
Removed = 0x20,
Extra = 0x40,
Overlay = 0x80,
Onfield = 0x0C
}
}
\ No newline at end of file
namespace WindBot.Game.Enums
{
public enum CardPosition
{
FaceUpAttack = 0x1,
FaceDownAttack = 0x2,
FaceUpDefense = 0x4,
FaceDownDefense = 0x8,
FaceUp = 0x5,
FaceDown = 0xA,
Attack = 0x3,
Defense = 0xC
}
}
\ No newline at end of file
namespace WindBot.Game.Enums
{
public enum CardRace
{
Warrior = 0x1,
SpellCaster = 0x2,
Fairy = 0x4,
Fiend = 0x8,
Zombie = 0x10,
Machine = 0x20,
Aqua = 0x40,
Pyro = 0x80,
Rock = 0x100,
WindBeast = 0x200,
Plant = 0x400,
Insect = 0x800,
Thunder = 0x1000,
Dragon = 0x2000,
Beast = 0x4000,
BestWarrior = 0x8000,
Dinosaur = 0x10000,
Fish = 0x20000,
SeaSerpent = 0x40000,
Reptile = 0x80000,
Psycho = 0x100000,
DivineBeast = 0x200000
}
}
\ No newline at end of file
namespace WindBot.Game.Enums
{
public enum CardType
{
Monster = 0x1,
Spell = 0x2,
Trap = 0x4,
Normal = 0x10,
Effect = 0x20,
Fusion = 0x40,
Ritual = 0x80,
TrapMonster = 0x100,
Spirit = 0x200,
Union = 0x400,
Dual = 0x800,
Tuner = 0x1000,
Synchro = 0x2000,
Token = 0x4000,
QuickPlay = 0x10000,
Continuous = 0x20000,
Equip = 0x40000,
Field = 0x80000,
Counter = 0x100000,
Flip = 0x200000,
Toon = 0x400000,
Xyz = 0x800000
}
}
\ No newline at end of file
namespace WindBot.Game.Enums
{
public enum Phase
{
Draw = 0x01,
Standby = 0x02,
Main1 = 0x04,
Battle = 0x08,
Damage = 0x10,
DamageCal = 0x20,
Main2 = 0x40,
End = 0x80
}
}
\ No newline at end of file
namespace WindBot.Game.Enums
{
public enum Query
{
Code = 0x01,
Position = 0x02,
Alias = 0x04,
Type = 0x08,
Level = 0x10,
Rank = 0x20,
Attribute = 0x40,
Race = 0x80,
Attack = 0x100,
Defence = 0x200,
BaseAttack = 0x400,
BaseDefence = 0x800,
Reason = 0x1000,
ReasonCard = 0x2000,
EquipCard = 0x4000,
TargetCard = 0x8000,
OverlayCard = 0x10000,
Counters = 0x20000,
Owner = 0x40000,
IsDisabled = 0x80000,
IsPublic = 0x100000,
LScale = 0x200000,
RScale = 0x400000
}
}
\ No newline at end of file
using System.Collections.Generic;
using OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot.Game.AI;
using WindBot.Game.Enums;
using WindBot.Game.Network;
using YGOSharp.Network;
namespace WindBot.Game
{
public class GameAI
{
public GameClient Game { get; private set; }
public GameConnection Connection { get; private set; }
public CoreClient Connection { get; private set; }
public Duel Duel { get; private set; }
public Executor Executor { get; set; }
public AIFunctions Utils { get; private set; }
......@@ -58,7 +58,7 @@ namespace WindBot.Game
m_nextSelector = null;
m_option = -1;
m_position = CardPosition.FaceUpAttack;
if (Duel.Player == 0 && Duel.Phase == Phase.Draw)
if (Duel.Player == 0 && Duel.Phase == DuelPhase.Draw)
_dialogs.SendNewTurn();
}
......
This diff is collapsed.
using System.Net;
using System.Text;
using WindBot.Game.Network;
using WindBot.Game.Network.Enums;
using System.Text;
using YGOSharp.Network;
using YGOSharp.Network.Enums;
namespace WindBot.Game
{
public class GameClient
{
public GameConnection Connection { get; private set; }
public CoreClient Connection { get; private set; }
public string Username;
public string Deck;
......@@ -17,7 +16,7 @@ namespace WindBot.Game
private GameBehavior _behavior;
public GameClient(string username, string deck, string serverHost, int serverPort, string roomInfos)
public GameClient(string username, string deck, string serverHost, int serverPort, string roomInfos = "")
{
Username = username;
Deck = deck;
......@@ -28,15 +27,17 @@ namespace WindBot.Game
public void Start()
{
Connection = new GameConnection(IPAddress.Parse(_serverHost), _serverPort);
Connection = new CoreClient(_serverHost, _serverPort);
Connection.MessageReceived += OnMessageReceived;
_behavior = new GameBehavior(this);
GameClientPacket packet = new GameClientPacket(CtosMessage.PlayerInfo);
GamePacketWriter packet = new GamePacketWriter(CtosMessage.PlayerInfo);
packet.Write(Username, 20);
Connection.Send(packet);
byte[] junk = { 0xCC, 0xCC, 0x00, 0x00, 0x00, 0x00 };
packet = new GameClientPacket(CtosMessage.JoinGame);
packet = new GamePacketWriter(CtosMessage.JoinGame);
packet.Write(Program.ProVersion);
packet.Write(junk);
packet.Write(_roomInfos, 30);
......@@ -45,23 +46,21 @@ namespace WindBot.Game
public void Tick()
{
if (!Connection.IsConnected)
{
return;
}
while (Connection.HasPacket())
{
GameServerPacket packet = Connection.Receive();
_behavior.OnPacket(packet);
}
Connection.UpdateNetwork();
Connection.Update();
}
public void Chat(string message)
{
byte[] content = Encoding.Unicode.GetBytes(message + "\0");
GameClientPacket chat = new GameClientPacket(CtosMessage.Chat);
GamePacketWriter chat = new GamePacketWriter(CtosMessage.Chat);
chat.Write(content);
Connection.Send(chat);
}
private void OnMessageReceived(object sender, MessageEventArgs e)
{
_behavior.OnPacket(e.Message);
}
}
}
\ No newline at end of file
using System;
using System.IO;
using System.Text;
namespace WindBot.Game.Network
{
public static class BinaryExtensions
{
public static void WriteUnicode(this BinaryWriter writer, string text, int len)
{
byte[] unicode = Encoding.Unicode.GetBytes(text);
byte[] result = new byte[len * 2];
int max = len * 2 - 2;
Array.Copy(unicode, result, unicode.Length > max ? max : unicode.Length);
writer.Write(result);
}
public static string ReadUnicode(this BinaryReader reader, int len)
{
byte[] unicode = reader.ReadBytes(len*2);
string text = Encoding.Unicode.GetString(unicode);
if (text.Contains("\0"))
text = text.Substring(0, text.IndexOf('\0'));
return text;
}
}
}
\ No newline at end of file
namespace WindBot.Game.Network.Enums
{
public enum CtosMessage
{
Response = 0x1,
UpdateDeck = 0x2,
HandResult = 0x3,
TpResult = 0x4,
PlayerInfo = 0x10,
CreateGame = 0x11,
JoinGame = 0x12,
LeaveGame = 0x13,
Surrender = 0x14,
TimeConfirm = 0x15,
Chat = 0x16,
HsToDuelist = 0x20,
HsToObserver = 0x21,
HsReady = 0x22,
HsNotReady = 0x23,
HsKick = 0x24,
HsStart = 0x25
}
}
\ No newline at end of file
namespace WindBot.Game.Network.Enums
{
public enum GameMessage
{
Retry = 1,
Hint = 2,
Waiting = 3,
Start = 4,
Win = 5,
UpdateData = 6,
UpdateCard = 7,
RequestDeck = 8,
SelectBattleCmd = 10,
SelectIdleCmd = 11,
SelectEffectYn = 12,
SelectYesNo = 13,
SelectOption = 14,
SelectCard = 15,
SelectChain = 16,
SelectPlace = 18,
SelectPosition = 19,
SelectTribute = 20,
SortChain = 21,
SelectCounter = 22,
SelectSum = 23,
SelectDisfield = 24,
SortCard = 25,
ConfirmDecktop = 30,
ConfirmCards = 31,
ShuffleDeck = 32,
ShuffleHand = 33,
RefreshDeck = 34,
SwapGraveDeck = 35,
ShuffleSetCard = 36,
ReverseDeck = 37,
DeckTop = 38,
NewTurn = 40,
NewPhase = 41,
Move = 50,
PosChange = 53,
Set = 54,
Swap = 55,
FieldDisabled = 56,
Summoning = 60,
Summoned = 61,
SpSummoning = 62,
SpSummoned = 63,
FlipSummoning = 64,
FlipSummoned = 65,
Chaining = 70,
Chained = 71,
ChainSolving = 72,
ChainSolved = 73,
ChainEnd = 74,
ChainNegated = 75,
ChainDisabled = 76,
CardSelected = 80,
RandomSelected = 81,
BecomeTarget = 83,
Draw = 90,
Damage = 91,
Recover = 92,
Equip = 93,
LpUpdate = 94,
Unequip = 95,
CardTarget = 96,
CancelTarget = 97,
PayLpCost = 100,
AddCounter = 101,
RemoveCounter = 102,
Attack = 110,
Battle = 111,
AttackDisabled = 112,
DamageStepStart = 113,
DamageStepEnd = 114,
MissedEffect = 120,
BeChainTarget = 121,
CreateRelation = 122,
ReleaseRelation = 123,
TossCoin = 130,
TossDice = 131,
AnnounceRace = 140,
AnnounceAttrib = 141,
AnnounceCard = 142,
AnnounceNumber = 143,
CardHint = 160,
TagSwap = 161,
ReloadField = 162,
AiName = 163,
ShowHint = 164,
MatchKill = 170,
CustomMsg = 180
}
}
\ No newline at end of file
namespace WindBot.Game.Network.Enums
{
public enum PlayerChange
{
Observe = 0x8,
Ready = 0x9,
NotReady = 0xA,
Leave = 0xB
}
}
\ No newline at end of file
namespace WindBot.Game.Network.Enums
{
public enum StocMessage
{
GameMsg = 0x1,
ErrorMsg = 0x2,
SelectHand = 0x3,
SelectTp = 0x4,
HandResult = 0x5,
TpResult = 0x6,
ChangeSide = 0x7,
WaitingSide = 0x8,
CreateGame = 0x11,
JoinGame = 0x12,
TypeChange = 0x13,
LeaveGame = 0x14,
DuelStart = 0x15,
DuelEnd = 0x16,
Replay = 0x17,
TimeLimit = 0x18,
Chat = 0x19,
HsPlayerEnter = 0x20,
HsPlayerChange = 0x21,
HsWatchChange = 0x22
}
}
\ No newline at end of file
using System.IO;
using WindBot.Game.Network.Enums;
namespace WindBot.Game.Network
{
public class GameClientPacket
{
private BinaryWriter _writer;
private MemoryStream _stream;
public GameClientPacket(CtosMessage message)
{
_stream = new MemoryStream();
_writer = new BinaryWriter(_stream);
_writer.Write((byte)message);
}
public byte[] GetContent()
{
return _stream.ToArray();
}
public void Write(byte[] array)
{
_writer.Write(array);
}
public void Write(sbyte value)
{
_writer.Write(value);
}
public void Write(byte value)
{
_writer.Write(value);
}
public void Write(short value)
{
_writer.Write(value);
}
public void Write(int value)
{
_writer.Write(value);
}
public void Write(string text, int len)
{
_writer.WriteUnicode(text, len);
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using WindBot.Game.Network.Enums;
namespace WindBot.Game.Network
{
public class GameConnection
{
public bool IsConnected { get; private set; }
private TcpClient _client;
private BinaryReader _reader;
private Thread _thread;
private Queue<GameClientPacket> _sendQueue;
private Queue<GameServerPacket> _receiveQueue;
private DateTime _lastAction;
public GameConnection(IPAddress address, int port)
{
_sendQueue = new Queue<GameClientPacket>();
_receiveQueue = new Queue<GameServerPacket>();
_lastAction = DateTime.Now;
_client = new TcpClient(address.ToString(), port);
IsConnected = true;
_reader = new BinaryReader(_client.GetStream());
_thread = new Thread(NetworkTick);
_thread.Start();
}
public void Send(GameClientPacket packet)
{
lock (_sendQueue)
_sendQueue.Enqueue(packet);
}
public void Send(CtosMessage message)
{
Send(new GameClientPacket(message));
}
public void Send(CtosMessage message, byte value)
{
GameClientPacket packet = new GameClientPacket(message);
packet.Write(value);
Send(packet);
}
public void Send(CtosMessage message, int value)
{
GameClientPacket packet = new GameClientPacket(message);
packet.Write(value);
Send(packet);
}
public bool HasPacket()
{
lock (_receiveQueue)
return _receiveQueue.Count > 0;
}
public GameServerPacket Receive()
{
lock (_receiveQueue)
{
if (_receiveQueue.Count == 0)
return null;
return _receiveQueue.Dequeue();
}
}
public void Close()
{
if (!IsConnected) return;
IsConnected = false;
_client.Close();
_thread.Join();
}
private void NetworkTick()
{
try
{
int connectionCheckTick = 100;
while (IsConnected)
{
InternalTick();
if (--connectionCheckTick <= 0)
{
connectionCheckTick = 100;
if (!CheckIsConnected())
Close();
}
Thread.Sleep(1);
}
}
catch (Exception)
{
Close();
}
}
private void InternalTick()
{
lock (_sendQueue)
{
while (_sendQueue.Count > 0)
InternalSend(_sendQueue.Dequeue());
}
while (_client.Available > 1)
{
GameServerPacket packet = InternalReceive();
lock (_receiveQueue)
{
_receiveQueue.Enqueue(packet);
}
}
}
private void InternalSend(GameClientPacket packet)
{
_lastAction = DateTime.Now;
MemoryStream ms = new MemoryStream();
BinaryWriter writer = new BinaryWriter(ms);
byte[] content = packet.GetContent();
writer.Write((short)content.Length);
if (content.Length > 0)
writer.Write(content);
byte[] data = ms.ToArray();
_client.Client.Send(data);
}
private GameServerPacket InternalReceive()
{
_lastAction = DateTime.Now;
int len = _reader.ReadInt16();
GameServerPacket packet = new GameServerPacket(_reader.ReadBytes(len));
return packet;
}
private bool CheckIsConnected()
{
TimeSpan diff = DateTime.Now - _lastAction;
if (diff.TotalMinutes > 5)
return false;
return true;
}
}
}
\ No newline at end of file
using System.IO;
using WindBot.Game.Network.Enums;
namespace WindBot.Game.Network
{
public class GameServerPacket
{
public byte[] Content { get; private set; }
private BinaryReader _reader;
public GameServerPacket(byte[] content)
{
Content = content;
_reader = new BinaryReader(new MemoryStream(Content));
}
public StocMessage ReadStoc()
{
return (StocMessage)_reader.ReadByte();
}
public GameMessage ReadGameMsg()
{
return (GameMessage)_reader.ReadByte();
}
public byte ReadByte()
{
return _reader.ReadByte();
}
public byte[] ReadToEnd()
{
return _reader.ReadBytes((int)_reader.BaseStream.Length - (int)_reader.BaseStream.Position);
}
public sbyte ReadSByte()
{
return _reader.ReadSByte();
}
public short ReadInt16()
{
return _reader.ReadInt16();
}
public int ReadInt32()
{
return _reader.ReadInt32();
}
public string ReadUnicode(int len)
{
return _reader.ReadUnicode(len);
}
public long GetPosition()
{
return _reader.BaseStream.Position;
}
public void SetPosition(long pos)
{
_reader.BaseStream.Position = pos;
}
}
}
\ No newline at end of file
File added
using System;
using OCGWrapper;
using System;
using System.IO;
using System.Threading;
using WindBot.Game;
using WindBot.Game.AI;
using WindBot.Game.Data;
namespace WindBot
{
public class Program
{
public const short ProVersion = 0x1335;
public const short ProVersion = 0x1338;
public static Random Rand;
......@@ -31,12 +32,12 @@ namespace WindBot
private static void Run()
{
Rand = new Random();
CardsManager.Init();
DecksManager.Init();
InitCardsManager();
// Start two clients and connect them to the same room. Which deck is gonna win?
GameClient clientA = new GameClient("Wind", "Horus", "127.0.0.1", 13254, "000");
GameClient clientB = new GameClient("Fire", "OldSchool", "127.0.0.1", 13254, "000");
// Start two clients and connect them to the same server. Which deck is gonna win?
GameClient clientA = new GameClient("Wind", "Horus", "127.0.0.1", 7911);
GameClient clientB = new GameClient("Fire", "OldSchool", "127.0.0.1", 7911);
clientA.Start();
clientB.Start();
while (clientA.Connection.IsConnected || clientB.Connection.IsConnected)
......@@ -46,5 +47,12 @@ namespace WindBot
Thread.Sleep(1);
}
}
private static void InitCardsManager()
{
string currentPath = Path.GetFullPath(".");
string absolutePath = Path.Combine(currentPath, "cards.cdb");
NamedCardsManager.Init(absolutePath);
}
}
}
......@@ -38,9 +38,15 @@
<Reference Include="Mono.Data.Sqlite">
<HintPath>.\Mono.Data.Sqlite.dll</HintPath>
</Reference>
<Reference Include="OCGWrapper">
<HintPath>.\OCGWrapper.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="YGOSharp.Network">
<HintPath>.\YGOSharp.Network.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Game\AI\AIFunctions.cs" />
......@@ -67,30 +73,13 @@
<Compile Include="Game\BattlePhaseAction.cs" />
<Compile Include="Game\ClientCard.cs" />
<Compile Include="Game\ClientField.cs" />
<Compile Include="Game\Data\CardData.cs" />
<Compile Include="Game\Data\CardsManager.cs" />
<Compile Include="Game\Data\Deck.cs" />
<Compile Include="Game\Deck.cs" />
<Compile Include="Game\Duel.cs" />
<Compile Include="Game\Enums\CardAttribute.cs" />
<Compile Include="Game\Enums\CardLocation.cs" />
<Compile Include="Game\Enums\CardPosition.cs" />
<Compile Include="Game\Enums\CardRace.cs" />
<Compile Include="Game\Enums\CardType.cs" />
<Compile Include="Game\Enums\Phase.cs" />
<Compile Include="Game\Enums\Query.cs" />
<Compile Include="Game\GameAI.cs" />
<Compile Include="Game\GameBehavior.cs" />
<Compile Include="Game\GameClient.cs" />
<Compile Include="Game\MainPhase.cs" />
<Compile Include="Game\MainPhaseAction.cs" />
<Compile Include="Game\Network\BinaryExtensions.cs" />
<Compile Include="Game\Network\Enums\CtosMessage.cs" />
<Compile Include="Game\Network\Enums\GameMessage.cs" />
<Compile Include="Game\Network\Enums\PlayerChange.cs" />
<Compile Include="Game\Network\Enums\StocMessage.cs" />
<Compile Include="Game\Network\GameClientPacket.cs" />
<Compile Include="Game\Network\GameConnection.cs" />
<Compile Include="Game\Network\GameServerPacket.cs" />
<Compile Include="Game\Room.cs" />
<Compile Include="Logger.cs" />
<Compile Include="Program.cs" />
......
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