Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
Windbot-408
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
神之吹息
Windbot-408
Commits
7b46ed23
Commit
7b46ed23
authored
Jul 27, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "speed up some operations"
This reverts commit
9e0baa79
.
parent
65e2bde7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
18 deletions
+1
-18
Game/GameBehavior.cs
Game/GameBehavior.cs
+0
-13
Game/GameClient.cs
Game/GameClient.cs
+0
-4
Program.cs
Program.cs
+1
-1
No files found.
Game/GameBehavior.cs
View file @
7b46ed23
...
@@ -295,7 +295,6 @@ namespace WindBot.Game
...
@@ -295,7 +295,6 @@ namespace WindBot.Game
private
void
OnNewTurn
(
BinaryReader
packet
)
private
void
OnNewTurn
(
BinaryReader
packet
)
{
{
Game
.
nextTickDelay
=
1
;
_duel
.
Turn
++;
_duel
.
Turn
++;
_duel
.
Player
=
GetLocalPlayer
(
packet
.
ReadByte
());
_duel
.
Player
=
GetLocalPlayer
(
packet
.
ReadByte
());
_ai
.
OnNewTurn
();
_ai
.
OnNewTurn
();
...
@@ -303,14 +302,12 @@ namespace WindBot.Game
...
@@ -303,14 +302,12 @@ namespace WindBot.Game
private
void
OnNewPhase
(
BinaryReader
packet
)
private
void
OnNewPhase
(
BinaryReader
packet
)
{
{
Game
.
nextTickDelay
=
1
;
_duel
.
Phase
=
(
DuelPhase
)
packet
.
ReadInt16
();
_duel
.
Phase
=
(
DuelPhase
)
packet
.
ReadInt16
();
_ai
.
OnNewPhase
();
_ai
.
OnNewPhase
();
}
}
private
void
OnDamage
(
BinaryReader
packet
)
private
void
OnDamage
(
BinaryReader
packet
)
{
{
Game
.
nextTickDelay
=
1
;
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
final
=
_duel
.
LifePoints
[
player
]
-
packet
.
ReadInt32
();
int
final
=
_duel
.
LifePoints
[
player
]
-
packet
.
ReadInt32
();
if
(
final
<
0
)
final
=
0
;
if
(
final
<
0
)
final
=
0
;
...
@@ -319,14 +316,12 @@ namespace WindBot.Game
...
@@ -319,14 +316,12 @@ namespace WindBot.Game
private
void
OnRecover
(
BinaryReader
packet
)
private
void
OnRecover
(
BinaryReader
packet
)
{
{
Game
.
nextTickDelay
=
1
;
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
_duel
.
LifePoints
[
player
]
+=
packet
.
ReadInt32
();
_duel
.
LifePoints
[
player
]
+=
packet
.
ReadInt32
();
}
}
private
void
OnLpUpdate
(
BinaryReader
packet
)
private
void
OnLpUpdate
(
BinaryReader
packet
)
{
{
Game
.
nextTickDelay
=
1
;
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
_duel
.
LifePoints
[
player
]
=
packet
.
ReadInt32
();
_duel
.
LifePoints
[
player
]
=
packet
.
ReadInt32
();
}
}
...
@@ -377,7 +372,6 @@ namespace WindBot.Game
...
@@ -377,7 +372,6 @@ namespace WindBot.Game
private
void
OnAttack
(
BinaryReader
packet
)
private
void
OnAttack
(
BinaryReader
packet
)
{
{
Game
.
nextTickDelay
=
1
;
int
ca
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
ca
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
la
=
packet
.
ReadByte
();
int
la
=
packet
.
ReadByte
();
int
sa
=
packet
.
ReadByte
();
int
sa
=
packet
.
ReadByte
();
...
@@ -422,21 +416,18 @@ namespace WindBot.Game
...
@@ -422,21 +416,18 @@ namespace WindBot.Game
private
void
OnChainEnd
(
BinaryReader
packet
)
private
void
OnChainEnd
(
BinaryReader
packet
)
{
{
Game
.
nextTickDelay
=
1
;
_ai
.
OnChainEnd
();
_ai
.
OnChainEnd
();
//_duel.ChainTargets.Clear();
//_duel.ChainTargets.Clear();
}
}
private
void
OnChainSorting
(
BinaryReader
packet
)
private
void
OnChainSorting
(
BinaryReader
packet
)
{
{
Game
.
nextTickDelay
=
1
;
BinaryWriter
writer
=
GamePacketFactory
.
Create
(
CtosMessage
.
Response
);
BinaryWriter
writer
=
GamePacketFactory
.
Create
(
CtosMessage
.
Response
);
Connection
.
Send
(
CtosMessage
.
Response
,
-
1
);
Connection
.
Send
(
CtosMessage
.
Response
,
-
1
);
}
}
private
void
OnUpdateCard
(
BinaryReader
packet
)
private
void
OnUpdateCard
(
BinaryReader
packet
)
{
{
Game
.
nextTickDelay
=
1
;
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
loc
=
packet
.
ReadByte
();
int
loc
=
packet
.
ReadByte
();
int
seq
=
packet
.
ReadByte
();
int
seq
=
packet
.
ReadByte
();
...
@@ -451,7 +442,6 @@ namespace WindBot.Game
...
@@ -451,7 +442,6 @@ namespace WindBot.Game
private
void
OnUpdateData
(
BinaryReader
packet
)
private
void
OnUpdateData
(
BinaryReader
packet
)
{
{
Game
.
nextTickDelay
=
1
;
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
CardLocation
loc
=
(
CardLocation
)
packet
.
ReadByte
();
CardLocation
loc
=
(
CardLocation
)
packet
.
ReadByte
();
...
@@ -619,7 +609,6 @@ namespace WindBot.Game
...
@@ -619,7 +609,6 @@ namespace WindBot.Game
private
void
OnSelectChain
(
BinaryReader
packet
)
private
void
OnSelectChain
(
BinaryReader
packet
)
{
{
Game
.
nextTickDelay
=
1
;
packet
.
ReadByte
();
// player
packet
.
ReadByte
();
// player
int
count
=
packet
.
ReadByte
();
int
count
=
packet
.
ReadByte
();
packet
.
ReadByte
();
// specount
packet
.
ReadByte
();
// specount
...
@@ -792,7 +781,6 @@ namespace WindBot.Game
...
@@ -792,7 +781,6 @@ namespace WindBot.Game
private
void
OnSelectPlace
(
BinaryReader
packet
)
private
void
OnSelectPlace
(
BinaryReader
packet
)
{
{
Game
.
nextTickDelay
=
1
;
packet
.
ReadByte
();
// player
packet
.
ReadByte
();
// player
packet
.
ReadByte
();
// min
packet
.
ReadByte
();
// min
int
field
=
~
packet
.
ReadInt32
();
int
field
=
~
packet
.
ReadInt32
();
...
@@ -862,7 +850,6 @@ namespace WindBot.Game
...
@@ -862,7 +850,6 @@ namespace WindBot.Game
private
void
OnSelectPosition
(
BinaryReader
packet
)
private
void
OnSelectPosition
(
BinaryReader
packet
)
{
{
Game
.
nextTickDelay
=
1
;
packet
.
ReadByte
();
// player
packet
.
ReadByte
();
// player
int
cardId
=
packet
.
ReadInt32
();
int
cardId
=
packet
.
ReadInt32
();
int
pos
=
packet
.
ReadByte
();
int
pos
=
packet
.
ReadByte
();
...
...
Game/GameClient.cs
View file @
7b46ed23
...
@@ -14,9 +14,6 @@ namespace WindBot.Game
...
@@ -14,9 +14,6 @@ namespace WindBot.Game
public
string
Deck
;
public
string
Deck
;
public
string
Dialog
;
public
string
Dialog
;
public
int
TickDelay
=
30
;
public
int
nextTickDelay
=
1
;
private
string
_serverHost
;
private
string
_serverHost
;
private
int
_serverPort
;
private
int
_serverPort
;
private
short
_proVersion
;
private
short
_proVersion
;
...
@@ -63,7 +60,6 @@ namespace WindBot.Game
...
@@ -63,7 +60,6 @@ namespace WindBot.Game
public
void
Tick
()
public
void
Tick
()
{
{
nextTickDelay
=
TickDelay
;
Connection
.
Update
();
Connection
.
Update
();
}
}
...
...
Program.cs
View file @
7b46ed23
...
@@ -200,7 +200,7 @@ namespace WindBot
...
@@ -200,7 +200,7 @@ namespace WindBot
try
try
{
{
client
.
Tick
();
client
.
Tick
();
Thread
.
Sleep
(
client
.
nextTickDelay
);
Thread
.
Sleep
(
30
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment