Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
MDPro2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
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
赤子奈落
MDPro2
Commits
f20f545b
Commit
f20f545b
authored
Jun 14, 2023
by
perfectdicky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ai to play player's ydk
parent
41919acf
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
2927 additions
and
2404 deletions
+2927
-2404
Assets/Editor/NGUIPrefabStageHelper.cs
Assets/Editor/NGUIPrefabStageHelper.cs
+343
-0
Assets/Editor/NGUIPrefabStageHelper.cs.meta
Assets/Editor/NGUIPrefabStageHelper.cs.meta
+11
-0
Assets/Plugins/Editor/0Harmony.dll
Assets/Plugins/Editor/0Harmony.dll
+0
-0
Assets/Plugins/Editor/0Harmony.dll.meta
Assets/Plugins/Editor/0Harmony.dll.meta
+32
-0
Assets/SibylSystem/Room/AIRoom.cs
Assets/SibylSystem/Room/AIRoom.cs
+17
-5
Assets/transUI/prefab/trans_AIroom.prefab
Assets/transUI/prefab/trans_AIroom.prefab
+2524
-2399
No files found.
Assets/Editor/NGUIPrefabStageHelper.cs
0 → 100644
View file @
f20f545b
This diff is collapsed.
Click to expand it.
Assets/Editor/NGUIPrefabStageHelper.cs.meta
0 → 100644
View file @
f20f545b
fileFormatVersion: 2
guid: 88e23aeef8fc8a24eace5e7fcf3395a2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Plugins/Editor/0Harmony.dll
0 → 100644
View file @
f20f545b
File added
Assets/Plugins/Editor/0Harmony.dll.meta
0 → 100644
View file @
f20f545b
fileFormatVersion: 2
guid: dcc1be876af31db4a9a0422b13fb06e6
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
Assets/SibylSystem/Room/AIRoom.cs
View file @
f20f545b
...
@@ -9,6 +9,7 @@ public class AIRoom : WindowServantSP
...
@@ -9,6 +9,7 @@ public class AIRoom : WindowServantSP
{
{
#
region
ui
#
region
ui
UIselectableList
superScrollView
=
null
;
UIselectableList
superScrollView
=
null
;
GameObject
aideck_
;
string
sort
=
"sortByTimeDeck"
;
string
sort
=
"sortByTimeDeck"
;
System
.
Diagnostics
.
Process
serverProcess
;
System
.
Diagnostics
.
Process
serverProcess
;
System
.
Diagnostics
.
Process
botProcess
;
System
.
Diagnostics
.
Process
botProcess
;
...
@@ -35,7 +36,7 @@ public class AIRoom : WindowServantSP
...
@@ -35,7 +36,7 @@ public class AIRoom : WindowServantSP
newBot
.
desc
=
reader
.
ReadLine
().
Trim
();
newBot
.
desc
=
reader
.
ReadLine
().
Trim
();
line
=
reader
.
ReadLine
().
Trim
();
line
=
reader
.
ReadLine
().
Trim
();
newBot
.
flags
=
line
.
Split
(
' '
);
newBot
.
flags
=
line
.
Split
(
' '
);
if
(
Array
.
IndexOf
(
newBot
.
flags
,
"SELECT_DECKFILE"
)
<
0
)
//
if (Array.IndexOf(newBot.flags, "SELECT_DECKFILE") < 0)
Bots
.
Add
(
newBot
);
Bots
.
Add
(
newBot
);
}
}
}
}
...
@@ -68,14 +69,24 @@ public class AIRoom : WindowServantSP
...
@@ -68,14 +69,24 @@ public class AIRoom : WindowServantSP
UIHelper
.
trySetLableText
(
gameObject
,
"botdesc_"
,
InterString
.
Get
(
"请选择对手。"
));
UIHelper
.
trySetLableText
(
gameObject
,
"botdesc_"
,
InterString
.
Get
(
"请选择对手。"
));
superScrollView
.
install
();
superScrollView
.
install
();
ReadBots
(
"config/bot.conf"
);
ReadBots
(
"config/bot.conf"
);
aideck_
=
GameObject
.
Find
(
"aideck_"
);
aideck_
.
SetActive
(
false
);
//perfectdicky read deck ydk name
//ReadDecks();
SetActiveFalse
();
SetActiveFalse
();
}
}
void
onSelected
()
void
onSelected
()
{
{
int
sel
=
superScrollView
.
selectedIndex
;
int
sel
=
superScrollView
.
selectedIndex
;
if
(
sel
>=
0
&&
sel
<
Bots
.
Count
)
if
(
sel
>=
0
&&
sel
<
Bots
.
Count
)
{
UIHelper
.
trySetLableText
(
gameObject
,
"botdesc_"
,
Bots
[
sel
].
desc
);
UIHelper
.
trySetLableText
(
gameObject
,
"botdesc_"
,
Bots
[
sel
].
desc
);
//Make visible for aideck_
if
(
Array
.
IndexOf
(
Bots
[
sel
].
flags
,
"SELECT_DECKFILE"
)
>=
0
)
aideck_
.
SetActive
(
true
);
else
aideck_
.
SetActive
(
false
);
}
else
else
UIHelper
.
trySetLableText
(
gameObject
,
"botdesc_"
,
InterString
.
Get
(
"请选择对手。"
));
UIHelper
.
trySetLableText
(
gameObject
,
"botdesc_"
,
InterString
.
Get
(
"请选择对手。"
));
}
}
...
@@ -166,7 +177,8 @@ public class AIRoom : WindowServantSP
...
@@ -166,7 +177,8 @@ public class AIRoom : WindowServantSP
serverProcess
.
StartInfo
.
RedirectStandardOutput
=
true
;
serverProcess
.
StartInfo
.
RedirectStandardOutput
=
true
;
serverProcess
.
Start
();
serverProcess
.
Start
();
string
port
=
serverProcess
.
StandardOutput
.
ReadLine
();
string
port
=
serverProcess
.
StandardOutput
.
ReadLine
();
command
+=
" Port="
+
port
;
//perfectdicky change DeckFile path
command
+=
" Port="
+
port
+
" DeckFile=\"deck/cyberdragon.ydk\""
;
botProcess
=
new
System
.
Diagnostics
.
Process
();
botProcess
=
new
System
.
Diagnostics
.
Process
();
botProcess
.
StartInfo
.
UseShellExecute
=
false
;
botProcess
.
StartInfo
.
UseShellExecute
=
false
;
...
@@ -184,7 +196,7 @@ public class AIRoom : WindowServantSP
...
@@ -184,7 +196,7 @@ public class AIRoom : WindowServantSP
string
name
=
Config
.
Get
(
"name"
,
"一秒一咕机会"
);
string
name
=
Config
.
Get
(
"name"
,
"一秒一咕机会"
);
Program
.
I
().
ocgcore
.
returnServant
=
Program
.
I
().
aiRoom
;
Program
.
I
().
ocgcore
.
returnServant
=
Program
.
I
().
aiRoom
;
(
new
Thread
(()
=>
{
Thread
.
Sleep
(
500
);
TcpHelper
.
join
(
"127.0.0.1"
,
name
,
port
,
""
,
""
);
})).
Start
();
(
new
Thread
(()
=>
{
Thread
.
Sleep
(
500
);
TcpHelper
.
join
(
"127.0.0.1"
,
name
,
port
,
""
,
""
);
})).
Start
();
RMSshow_none
(
InterString
.
Get
(
"您在AI模式下遇到的BUG也极有可能会在联机的时候出现,所以请务必向我们报告。"
));
//
RMSshow_none(InterString.Get("您在AI模式下遇到的BUG也极有可能会在联机的时候出现,所以请务必向我们报告。"));
}
}
public
override
void
preFrameFunction
()
public
override
void
preFrameFunction
()
{
{
...
...
Assets/transUI/prefab/trans_AIroom.prefab
View file @
f20f545b
This diff is collapsed.
Click to expand it.
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