Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hahaha #4

Merged
merged 7 commits into from
Jan 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions BotWrapper/BotWrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

cd windbot

if [ "$#" -ne 3 ]; then
mono WindBot.exe
else
command=$1
flag=$2
port=$3
arg="${command//\'/\"}" # replace ' to "
if [ "$flag" -eq 1 ]; then arg=$arg" Hand=1"; fi
arg=$arg" Port="$port
eval "mono WindBot.exe "$arg
fi
4 changes: 2 additions & 2 deletions Dialogs/copy.zh-CN.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"welcome": [
"AI功能正在测试中,遇到问题请及时反馈",
"密码输入 AI#复制植物 就可以和我打牌了~"
"你好,我是一个机器人",
"AI功能正在测试中,遇到问题请及时反馈。"
],
"deckerror": [
"我的超主流卡组需要{0}才能玩。"
Expand Down
3 changes: 1 addition & 2 deletions Dialogs/swordsman.zh-CN.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"welcome": [
"你好,我是一个机器人。",
"AI功能正在测试中,遇到问题请及时反馈。",
"新的风暴已经出现,怎么能够停滞不前!我的R5卡组也得到了加强!"
"AI功能正在测试中,遇到问题请及时反馈。"
],
"deckerror": [
"抱歉,我的卡组里的{0}的数量似乎出了问题。"
Expand Down
12 changes: 12 additions & 0 deletions Game/GameBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ private void RegisterPackets()
_messages.Add(GameMessage.Draw, OnDraw);
_messages.Add(GameMessage.ShuffleDeck, OnShuffleDeck);
_messages.Add(GameMessage.ShuffleHand, OnShuffleHand);
_messages.Add(GameMessage.ShuffleExtra, OnShuffleExtra);
_messages.Add(GameMessage.TagSwap, OnTagSwap);
_messages.Add(GameMessage.NewTurn, OnNewTurn);
_messages.Add(GameMessage.NewPhase, OnNewPhase);
Expand Down Expand Up @@ -371,6 +372,17 @@ private void OnShuffleHand(BinaryReader packet)
card.SetId(packet.ReadInt32());
}

private void OnShuffleExtra(BinaryReader packet)
{
int player = GetLocalPlayer(packet.ReadByte());
packet.ReadByte();
foreach (ClientCard card in _duel.Fields[player].ExtraDeck)
{
if (!card.IsFaceup())
card.SetId(packet.ReadInt32());
}
}

private void OnTagSwap(BinaryReader packet)
{
int player = GetLocalPlayer(packet.ReadByte());
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ The parameters are same as commandlines, but low cased.

### Changelog

#### v0x1342 (2017-12-26)

- Update YGOPro protrol to 0x1342
- Add Linux BotWrapper (a simple bash script)

#### v0x1341 (2017-11-27)

- Update YGOPro protrol to 0x1341
Expand Down
2 changes: 1 addition & 1 deletion WindBotInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public WindBotInfo()
Host = "127.0.0.1";
Port = 7911;
HostInfo = "";
Version = 0x1341;
Version = 0x1342;
Hand = 0;
}
}
Expand Down
Binary file modified YGOSharp.OCGWrapper.Enums.dll
Binary file not shown.