Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOProUnity_V2
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
perfectdicky
YGOProUnity_V2
Commits
cde559d8
Commit
cde559d8
authored
May 29, 2023
by
perfectdicky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge lllyasviel/YGOProUnity_V2 offline AI codes
parent
64ddcba4
Pipeline
#21964
waiting for manual action with stage
Changes
14
Pipelines
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
3095 additions
and
3789 deletions
+3095
-3789
Assets/SibylSystem/ChildProcessTracker.cs
Assets/SibylSystem/ChildProcessTracker.cs
+141
-0
Assets/SibylSystem/ChildProcessTracker.cs.meta
Assets/SibylSystem/ChildProcessTracker.cs.meta
+12
-0
Assets/SibylSystem/Menu/Menu.cs
Assets/SibylSystem/Menu/Menu.cs
+135
-6
Assets/SibylSystem/MonoHelpers/TcpHelper.cs
Assets/SibylSystem/MonoHelpers/TcpHelper.cs
+7
-2
Assets/SibylSystem/Ocgcore/Ocgcore.cs
Assets/SibylSystem/Ocgcore/Ocgcore.cs
+3
-2
Assets/SibylSystem/Program.cs
Assets/SibylSystem/Program.cs
+8
-6
Assets/SibylSystem/Room/AIRoom.cs
Assets/SibylSystem/Room/AIRoom.cs
+195
-135
Assets/SibylSystem/Room/Room.cs
Assets/SibylSystem/Room/Room.cs
+0
-2
Assets/SibylSystem/WindowServantSP.cs
Assets/SibylSystem/WindowServantSP.cs
+17
-17
Assets/SibylSystem/precy.cs
Assets/SibylSystem/precy.cs
+24
-22
Assets/SibylSystem/selectServer/SelectServer.cs
Assets/SibylSystem/selectServer/SelectServer.cs
+1
-0
Assets/transUI/UIselectableList.cs
Assets/transUI/UIselectableList.cs
+16
-0
Assets/transUI/prefab/trans_AIroom.prefab
Assets/transUI/prefab/trans_AIroom.prefab
+2321
-3597
config/bot.conf
config/bot.conf
+215
-0
No files found.
Assets/SibylSystem/ChildProcessTracker.cs
0 → 100644
View file @
cde559d8
using
System
;
using
System.ComponentModel
;
using
System.Diagnostics
;
using
System.Runtime.InteropServices
;
/// <summary>
/// Allows processes to be automatically killed if this parent process unexpectedly quits.
/// This feature requires Windows 8 or greater. On Windows 7, nothing is done.</summary>
/// <remarks>References:
/// https://stackoverflow.com/a/37034966/5264011
/// https://stackoverflow.com/a/4657392/386091
/// https://stackoverflow.com/a/9164742/386091 </remarks>
public
static
class
ChildProcessTracker
{
/// <summary>
/// Add the process to be tracked. If our current process is killed, the child processes
/// that we are tracking will be automatically killed, too. If the child process terminates
/// first, that's fine, too.</summary>
/// <param name="process"></param>
public
static
void
AddProcess
(
Process
process
)
{
if
(
s_jobHandle
!=
IntPtr
.
Zero
)
{
bool
success
=
AssignProcessToJobObject
(
s_jobHandle
,
process
.
Handle
);
if
(!
success
&&
!
process
.
HasExited
)
throw
new
Win32Exception
();
}
}
static
ChildProcessTracker
()
{
// This feature requires Windows 8 or later. To support Windows 7 requires
// registry settings to be added if you are using Visual Studio plus an
// app.manifest change.
// https://stackoverflow.com/a/4232259/386091
// https://stackoverflow.com/a/9507862/386091
if
(
Environment
.
OSVersion
.
Version
<
new
Version
(
6
,
2
))
return
;
// The job name is optional (and can be null) but it helps with diagnostics.
// If it's not null, it has to be unique. Use SysInternals' Handle command-line
// utility: handle -a ChildProcessTracker
string
jobName
=
"ChildProcessTracker"
+
Process
.
GetCurrentProcess
().
Id
;
s_jobHandle
=
CreateJobObject
(
IntPtr
.
Zero
,
jobName
);
var
info
=
new
JOBOBJECT_BASIC_LIMIT_INFORMATION
();
// This is the key flag. When our process is killed, Windows will automatically
// close the job handle, and when that happens, we want the child processes to
// be killed, too.
info
.
LimitFlags
=
JOBOBJECTLIMIT
.
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE
;
var
extendedInfo
=
new
JOBOBJECT_EXTENDED_LIMIT_INFORMATION
();
extendedInfo
.
BasicLimitInformation
=
info
;
int
length
=
Marshal
.
SizeOf
(
typeof
(
JOBOBJECT_EXTENDED_LIMIT_INFORMATION
));
IntPtr
extendedInfoPtr
=
Marshal
.
AllocHGlobal
(
length
);
try
{
Marshal
.
StructureToPtr
(
extendedInfo
,
extendedInfoPtr
,
false
);
if
(!
SetInformationJobObject
(
s_jobHandle
,
JobObjectInfoType
.
ExtendedLimitInformation
,
extendedInfoPtr
,
(
uint
)
length
))
{
throw
new
Win32Exception
();
}
}
finally
{
Marshal
.
FreeHGlobal
(
extendedInfoPtr
);
}
}
[
DllImport
(
"kernel32.dll"
,
CharSet
=
CharSet
.
Unicode
)]
static
extern
IntPtr
CreateJobObject
(
IntPtr
lpJobAttributes
,
string
name
);
[
DllImport
(
"kernel32.dll"
)]
static
extern
bool
SetInformationJobObject
(
IntPtr
job
,
JobObjectInfoType
infoType
,
IntPtr
lpJobObjectInfo
,
uint
cbJobObjectInfoLength
);
[
DllImport
(
"kernel32.dll"
,
SetLastError
=
true
)]
static
extern
bool
AssignProcessToJobObject
(
IntPtr
job
,
IntPtr
process
);
// Windows will automatically close any open job handles when our process terminates.
// This can be verified by using SysInternals' Handle utility. When the job handle
// is closed, the child processes will be killed.
private
static
readonly
IntPtr
s_jobHandle
;
}
public
enum
JobObjectInfoType
{
AssociateCompletionPortInformation
=
7
,
BasicLimitInformation
=
2
,
BasicUIRestrictions
=
4
,
EndOfJobTimeInformation
=
6
,
ExtendedLimitInformation
=
9
,
SecurityLimitInformation
=
5
,
GroupInformation
=
11
}
[
StructLayout
(
LayoutKind
.
Sequential
)]
public
struct
JOBOBJECT_BASIC_LIMIT_INFORMATION
{
public
Int64
PerProcessUserTimeLimit
;
public
Int64
PerJobUserTimeLimit
;
public
JOBOBJECTLIMIT
LimitFlags
;
public
UIntPtr
MinimumWorkingSetSize
;
public
UIntPtr
MaximumWorkingSetSize
;
public
UInt32
ActiveProcessLimit
;
public
Int64
Affinity
;
public
UInt32
PriorityClass
;
public
UInt32
SchedulingClass
;
}
[
Flags
]
public
enum
JOBOBJECTLIMIT
:
uint
{
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE
=
0x2000
}
[
StructLayout
(
LayoutKind
.
Sequential
)]
public
struct
IO_COUNTERS
{
public
UInt64
ReadOperationCount
;
public
UInt64
WriteOperationCount
;
public
UInt64
OtherOperationCount
;
public
UInt64
ReadTransferCount
;
public
UInt64
WriteTransferCount
;
public
UInt64
OtherTransferCount
;
}
[
StructLayout
(
LayoutKind
.
Sequential
)]
public
struct
JOBOBJECT_EXTENDED_LIMIT_INFORMATION
{
public
JOBOBJECT_BASIC_LIMIT_INFORMATION
BasicLimitInformation
;
public
IO_COUNTERS
IoInfo
;
public
UIntPtr
ProcessMemoryLimit
;
public
UIntPtr
JobMemoryLimit
;
public
UIntPtr
PeakProcessMemoryUsed
;
public
UIntPtr
PeakJobMemoryUsed
;
}
\ No newline at end of file
Assets/SibylSystem/ChildProcessTracker.cs.meta
0 → 100644
View file @
cde559d8
fileFormatVersion: 2
guid: e6f01f5f8a85eb94e971006330b7192b
timeCreated: 1664152009
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/SibylSystem/Menu/Menu.cs
View file @
cde559d8
...
@@ -9,7 +9,7 @@ using UnityEngine.Networking;
...
@@ -9,7 +9,7 @@ using UnityEngine.Networking;
public
class
Menu
:
WindowServantSP
public
class
Menu
:
WindowServantSP
{
{
private
static
int
lastTime
;
//
private static int lastTime;
private
bool
msgPermissionShowed
;
private
bool
msgPermissionShowed
;
private
bool
msgUpdateShowed
;
private
bool
msgUpdateShowed
;
...
@@ -26,7 +26,7 @@ public class Menu : WindowServantSP
...
@@ -26,7 +26,7 @@ public class Menu : WindowServantSP
UIHelper
.
registEvent
(
gameObject
,
"online_"
,
onClickOnline
);
UIHelper
.
registEvent
(
gameObject
,
"online_"
,
onClickOnline
);
UIHelper
.
registEvent
(
gameObject
,
"replay_"
,
onClickReplay
);
UIHelper
.
registEvent
(
gameObject
,
"replay_"
,
onClickReplay
);
UIHelper
.
registEvent
(
gameObject
,
"single_"
,
onClickPizzle
);
UIHelper
.
registEvent
(
gameObject
,
"single_"
,
onClickPizzle
);
UIHelper
.
registEvent
(
gameObject
,
"ai_"
,
Program
.
gugugu
);
UIHelper
.
registEvent
(
gameObject
,
"ai_"
,
onClickAI
);
UIHelper
.
registEvent
(
gameObject
,
"exit_"
,
onClickExit
);
UIHelper
.
registEvent
(
gameObject
,
"exit_"
,
onClickExit
);
Program
.
I
().
StartCoroutine
(
checkUpdate
());
Program
.
I
().
StartCoroutine
(
checkUpdate
());
}
}
...
@@ -117,10 +117,10 @@ public class Menu : WindowServantSP
...
@@ -117,10 +117,10 @@ public class Menu : WindowServantSP
Program
.
I
().
shiftToServant
(
Program
.
I
().
selectServer
);
Program
.
I
().
shiftToServant
(
Program
.
I
().
selectServer
);
}
}
//
private void onClickAI()
private
void
onClickAI
()
//
{
{
//
Program.I().shiftToServant(Program.I().aiRoom);
Program
.
I
().
shiftToServant
(
Program
.
I
().
aiRoom
);
//
}
}
private
void
onClickPizzle
()
private
void
onClickPizzle
()
{
{
...
@@ -141,4 +141,133 @@ public class Menu : WindowServantSP
...
@@ -141,4 +141,133 @@ public class Menu : WindowServantSP
{
{
Program
.
I
().
shiftToServant
(
Program
.
I
().
selectDeck
);
Program
.
I
().
shiftToServant
(
Program
.
I
().
selectDeck
);
}
}
public
static
void
deleteShell
()
{
try
{
if
(
File
.
Exists
(
"commamd.shell"
)
==
true
)
{
File
.
Delete
(
"commamd.shell"
);
}
}
catch
(
Exception
)
{
}
}
static
int
lastTime
=
0
;
public
static
void
checkCommend
()
{
if
(
Program
.
TimePassed
()
-
lastTime
>
1000
)
{
lastTime
=
Program
.
TimePassed
();
if
(
Program
.
I
().
selectDeck
==
null
)
{
return
;
}
if
(
Program
.
I
().
selectReplay
==
null
)
{
return
;
}
if
(
Program
.
I
().
puzzleMode
==
null
)
{
return
;
}
if
(
Program
.
I
().
selectServer
==
null
)
{
return
;
}
try
{
if
(
File
.
Exists
(
"commamd.shell"
)
==
false
)
{
File
.
Create
(
"commamd.shell"
).
Close
();
}
}
catch
(
System
.
Exception
e
)
{
Program
.
noAccess
=
true
;
UnityEngine
.
Debug
.
Log
(
e
);
}
string
all
=
""
;
try
{
all
=
File
.
ReadAllText
(
"commamd.shell"
,
Encoding
.
UTF8
);
char
[]
parmChars
=
all
.
ToCharArray
();
bool
inQuote
=
false
;
for
(
int
index
=
0
;
index
<
parmChars
.
Length
;
index
++)
{
if
(
parmChars
[
index
]
==
'"'
)
{
inQuote
=
!
inQuote
;
parmChars
[
index
]
=
'\n'
;
}
if
(!
inQuote
&&
parmChars
[
index
]
==
' '
)
parmChars
[
index
]
=
'\n'
;
}
string
[]
mats
=
(
new
string
(
parmChars
)).
Split
(
new
char
[]
{
'\n'
},
StringSplitOptions
.
RemoveEmptyEntries
);
if
(
mats
.
Length
>
0
)
{
switch
(
mats
[
0
])
{
case
"online"
:
if
(
mats
.
Length
==
5
)
{
UIHelper
.
iniFaces
();
//加载用户头像
Program
.
I
().
selectServer
.
KF_onlineGame
(
mats
[
1
],
mats
[
2
],
mats
[
3
],
mats
[
4
]);
}
if
(
mats
.
Length
==
6
)
{
UIHelper
.
iniFaces
();
Program
.
I
().
selectServer
.
KF_onlineGame
(
mats
[
1
],
mats
[
2
],
mats
[
3
],
mats
[
4
],
mats
[
5
]);
}
break
;
case
"edit"
:
if
(
mats
.
Length
==
2
)
{
Program
.
I
().
selectDeck
.
KF_editDeck
(
mats
[
1
]);
//编辑卡组
}
break
;
case
"replay"
:
if
(
mats
.
Length
==
2
)
{
UIHelper
.
iniFaces
();
Program
.
I
().
selectReplay
.
KF_replay
(
mats
[
1
]);
//编辑录像
}
break
;
case
"puzzle"
:
if
(
mats
.
Length
==
2
)
{
UIHelper
.
iniFaces
();
Program
.
I
().
puzzleMode
.
KF_puzzle
(
mats
[
1
]);
//运行残局
}
break
;
default
:
break
;
}
}
}
catch
(
System
.
Exception
e
)
{
Program
.
noAccess
=
true
;
UnityEngine
.
Debug
.
Log
(
e
);
}
try
{
if
(
all
!=
""
)
{
if
(
File
.
Exists
(
"commamd.shell"
)
==
true
)
{
File
.
WriteAllText
(
"commamd.shell"
,
""
);
}
}
}
catch
(
System
.
Exception
e
)
{
Program
.
noAccess
=
true
;
UnityEngine
.
Debug
.
Log
(
e
);
}
}
}
}
}
\ No newline at end of file
Assets/SibylSystem/MonoHelpers/TcpHelper.cs
View file @
cde559d8
...
@@ -192,7 +192,6 @@ public static class TcpHelper
...
@@ -192,7 +192,6 @@ public static class TcpHelper
if
(
onDisConnected
)
if
(
onDisConnected
)
{
{
onDisConnected
=
false
;
onDisConnected
=
false
;
Program
.
I
().
ocgcore
.
returnServant
=
Program
.
I
().
selectServer
;
if
(
tcpClient
!=
null
)
if
(
tcpClient
!=
null
)
if
(
tcpClient
.
Connected
)
if
(
tcpClient
.
Connected
)
{
{
...
@@ -203,7 +202,13 @@ public static class TcpHelper
...
@@ -203,7 +202,13 @@ public static class TcpHelper
tcpClient
=
null
;
tcpClient
=
null
;
if
(
Program
.
I
().
ocgcore
.
isShowed
==
false
)
if
(
Program
.
I
().
ocgcore
.
isShowed
==
false
)
{
{
if
(
Program
.
I
().
menu
.
isShowed
==
false
)
Program
.
I
().
shiftToServant
(
Program
.
I
().
selectServer
);
if
(
Program
.
I
().
menu
.
isShowed
==
false
)
{
if
(
Program
.
I
().
ocgcore
.
returnServant
!=
null
)
Program
.
I
().
shiftToServant
(
Program
.
I
().
ocgcore
.
returnServant
);
else
Program
.
I
().
shiftToServant
(
Program
.
I
().
selectServer
);
}
Program
.
I
().
cardDescription
.
RMSshow_none
(
InterString
.
Get
(
"连接被断开。"
));
Program
.
I
().
cardDescription
.
RMSshow_none
(
InterString
.
Get
(
"连接被断开。"
));
packagesInRecord
.
Clear
();
packagesInRecord
.
Clear
();
}
}
...
...
Assets/SibylSystem/Ocgcore/Ocgcore.cs
View file @
cde559d8
...
@@ -797,6 +797,7 @@ public class Ocgcore : ServantWithCardDescription
...
@@ -797,6 +797,7 @@ public class Ocgcore : ServantWithCardDescription
if
(
Program
.
exitOnReturn
&&
returnServant
!=
Program
.
I
().
deckManager
)
if
(
Program
.
exitOnReturn
&&
returnServant
!=
Program
.
I
().
deckManager
)
Program
.
I
().
menu
.
onClickExit
();
Program
.
I
().
menu
.
onClickExit
();
else
if
(
returnServant
!=
null
)
Program
.
I
().
shiftToServant
(
returnServant
);
else
if
(
returnServant
!=
null
)
Program
.
I
().
shiftToServant
(
returnServant
);
else
Program
.
I
().
shiftToServant
(
Program
.
I
().
selectServer
);
}
}
public
void
onExit
()
public
void
onExit
()
...
@@ -805,11 +806,10 @@ public class Ocgcore : ServantWithCardDescription
...
@@ -805,11 +806,10 @@ public class Ocgcore : ServantWithCardDescription
{
{
if
(
TcpHelper
.
tcpClient
.
Connected
)
if
(
TcpHelper
.
tcpClient
.
Connected
)
{
{
Program
.
I
().
ocgcore
.
returnServant
=
Program
.
I
().
selectServer
;
TcpHelper
.
tcpClient
.
Client
.
Shutdown
(
0
);
TcpHelper
.
tcpClient
.
Client
.
Shutdown
(
0
);
TcpHelper
.
tcpClient
.
Close
();
TcpHelper
.
tcpClient
.
Close
();
}
}
Program
.
I
().
aiRoom
.
killServerProcess
();
TcpHelper
.
tcpClient
=
null
;
TcpHelper
.
tcpClient
=
null
;
}
}
...
@@ -6861,6 +6861,7 @@ public class Ocgcore : ServantWithCardDescription
...
@@ -6861,6 +6861,7 @@ public class Ocgcore : ServantWithCardDescription
private
void
returnFromDeckEdit
()
private
void
returnFromDeckEdit
()
{
{
TcpHelper
.
CtosMessage_UpdateDeck
(
Program
.
I
().
deckManager
.
getRealDeck
());
TcpHelper
.
CtosMessage_UpdateDeck
(
Program
.
I
().
deckManager
.
getRealDeck
());
returnServant
=
Program
.
I
().
selectServer
;
}
}
public
override
void
show
()
public
override
void
show
()
...
...
Assets/SibylSystem/Program.cs
View file @
cde559d8
...
@@ -393,6 +393,7 @@ public class Program : MonoBehaviour
...
@@ -393,6 +393,7 @@ public class Program : MonoBehaviour
initializeALLservants
();
initializeALLservants
();
loadResources
();
loadResources
();
readParams
();
}
}
private
void
readParams
()
private
void
readParams
()
...
@@ -716,7 +717,7 @@ public class Program : MonoBehaviour
...
@@ -716,7 +717,7 @@ public class Program : MonoBehaviour
public
SelectServer
selectServer
;
public
SelectServer
selectServer
;
public
Book
book
;
public
Book
book
;
public
puzzleMode
puzzleMode
;
public
puzzleMode
puzzleMode
;
//
public AIRoom aiRoom;
public
AIRoom
aiRoom
;
private
void
initializeALLservants
()
private
void
initializeALLservants
()
{
{
...
@@ -741,8 +742,8 @@ public class Program : MonoBehaviour
...
@@ -741,8 +742,8 @@ public class Program : MonoBehaviour
servants
.
Add
(
selectReplay
);
servants
.
Add
(
selectReplay
);
puzzleMode
=
new
puzzleMode
();
puzzleMode
=
new
puzzleMode
();
servants
.
Add
(
puzzleMode
);
servants
.
Add
(
puzzleMode
);
//
aiRoom = new AIRoom();
aiRoom
=
new
AIRoom
();
//
servants.Add(aiRoom);
servants
.
Add
(
aiRoom
);
}
}
public
void
shiftToServant
(
Servant
to
)
public
void
shiftToServant
(
Servant
to
)
...
@@ -757,7 +758,7 @@ public class Program : MonoBehaviour
...
@@ -757,7 +758,7 @@ public class Program : MonoBehaviour
if
(
to
!=
selectServer
&&
selectServer
.
isShowed
)
selectServer
.
hide
();
if
(
to
!=
selectServer
&&
selectServer
.
isShowed
)
selectServer
.
hide
();
if
(
to
!=
selectReplay
&&
selectReplay
.
isShowed
)
selectReplay
.
hide
();
if
(
to
!=
selectReplay
&&
selectReplay
.
isShowed
)
selectReplay
.
hide
();
if
(
to
!=
puzzleMode
&&
puzzleMode
.
isShowed
)
puzzleMode
.
hide
();
if
(
to
!=
puzzleMode
&&
puzzleMode
.
isShowed
)
puzzleMode
.
hide
();
//
if (to != aiRoom && aiRoom.isShowed) aiRoom.hide();
if
(
to
!=
aiRoom
&&
aiRoom
.
isShowed
)
aiRoom
.
hide
();
if
(
to
==
backGroundPic
&&
backGroundPic
.
isShowed
==
false
)
backGroundPic
.
show
();
if
(
to
==
backGroundPic
&&
backGroundPic
.
isShowed
==
false
)
backGroundPic
.
show
();
if
(
to
==
menu
&&
menu
.
isShowed
==
false
)
menu
.
show
();
if
(
to
==
menu
&&
menu
.
isShowed
==
false
)
menu
.
show
();
...
@@ -769,7 +770,7 @@ public class Program : MonoBehaviour
...
@@ -769,7 +770,7 @@ public class Program : MonoBehaviour
if
(
to
==
selectServer
&&
selectServer
.
isShowed
==
false
)
selectServer
.
show
();
if
(
to
==
selectServer
&&
selectServer
.
isShowed
==
false
)
selectServer
.
show
();
if
(
to
==
selectReplay
&&
selectReplay
.
isShowed
==
false
)
selectReplay
.
show
();
if
(
to
==
selectReplay
&&
selectReplay
.
isShowed
==
false
)
selectReplay
.
show
();
if
(
to
==
puzzleMode
&&
puzzleMode
.
isShowed
==
false
)
puzzleMode
.
show
();
if
(
to
==
puzzleMode
&&
puzzleMode
.
isShowed
==
false
)
puzzleMode
.
show
();
//
if (to == aiRoom && aiRoom.isShowed == false) aiRoom.show();
if
(
to
==
aiRoom
&&
aiRoom
.
isShowed
==
false
)
aiRoom
.
show
();
}
}
#
endregion
#
endregion
...
@@ -909,7 +910,7 @@ public class Program : MonoBehaviour
...
@@ -909,7 +910,7 @@ public class Program : MonoBehaviour
public
static
bool
noAccess
=
false
;
public
static
bool
noAccess
=
false
;
public
static
bool
exitOnReturn
;
public
static
bool
exitOnReturn
=
false
;
private
void
OnApplicationQuit
()
private
void
OnApplicationQuit
()
{
{
...
@@ -928,6 +929,7 @@ public class Program : MonoBehaviour
...
@@ -928,6 +929,7 @@ public class Program : MonoBehaviour
}
}
foreach
(
var
zip
in
GameZipManager
.
Zips
)
zip
.
Dispose
();
foreach
(
var
zip
in
GameZipManager
.
Zips
)
zip
.
Dispose
();
aiRoom
.
killServerProcess
();
}
}
public
void
quit
()
public
void
quit
()
...
...
Assets/SibylSystem/Room/AIRoom.cs
View file @
cde559d8
This diff is collapsed.
Click to expand it.
Assets/SibylSystem/Room/Room.cs
View file @
cde559d8
...
@@ -38,7 +38,6 @@ public class Room : WindowServantSP
...
@@ -38,7 +38,6 @@ public class Room : WindowServantSP
public
override
void
show
()
public
override
void
show
()
{
{
base
.
show
();
base
.
show
();
Program
.
I
().
ocgcore
.
returnServant
=
Program
.
I
().
selectServer
;
Program
.
I
().
ocgcore
.
handler
=
handler
;
Program
.
I
().
ocgcore
.
handler
=
handler
;
UIHelper
.
registEvent
(
toolBar
,
"input_"
,
onChat
);
UIHelper
.
registEvent
(
toolBar
,
"input_"
,
onChat
);
Program
.
charge
();
Program
.
charge
();
...
@@ -267,7 +266,6 @@ public class Room : WindowServantSP
...
@@ -267,7 +266,6 @@ public class Room : WindowServantSP
public
void
StocMessage_DuelStart
(
BinaryReader
r
)
public
void
StocMessage_DuelStart
(
BinaryReader
r
)
{
{
Program
.
I
().
ocgcore
.
returnServant
=
Program
.
I
().
selectServer
;
needSide
=
false
;
needSide
=
false
;
joinWithReconnect
=
true
;
joinWithReconnect
=
true
;
if
(
Program
.
I
().
deckManager
.
isShowed
)
if
(
Program
.
I
().
deckManager
.
isShowed
)
...
...
Assets/SibylSystem/WindowServantSP.cs
View file @
cde559d8
...
@@ -32,7 +32,7 @@ public class WindowServantSP : Servant
...
@@ -32,7 +32,7 @@ public class WindowServantSP : Servant
if
(
glass
!=
null
)
glass
.
gameObject
.
SetActive
(
false
);
if
(
glass
!=
null
)
glass
.
gameObject
.
SetActive
(
false
);
}
}
//
resize();
resize
();
}
}
public
void
SetActiveFalse
()
public
void
SetActiveFalse
()
...
@@ -59,24 +59,24 @@ public class WindowServantSP : Servant
...
@@ -59,24 +59,24 @@ public class WindowServantSP : Servant
if
(
glass
!=
null
)
glass
.
gameObject
.
SetActive
(
true
);
if
(
glass
!=
null
)
glass
.
gameObject
.
SetActive
(
true
);
}
}
//
resize();
resize
();
}
}
//
private void resize()
private
void
resize
()
//
{
{
//
if (gameObject != null)
if
(
gameObject
!=
null
)
//
{
{
//
if (Program.I().setting.setting.resize.value)
if
(
Program
.
I
().
setting
.
setting
.
resize
.
value
)
//
{
{
//
var f = Screen.height / 700f;
var
f
=
Screen
.
height
/
700f
;
//
gameObject.transform.localScale = new Vector3(f, f, f);
gameObject
.
transform
.
localScale
=
new
Vector3
(
f
,
f
,
f
);
//
}
}
//
else
else
//
{
{
//
gameObject.transform.localScale = new Vector3(1, 1, 1);
gameObject
.
transform
.
localScale
=
new
Vector3
(
1
,
1
,
1
);
//
}
}
//
}
}
//
}
}
public
void
SetWindow
(
GameObject
mod
)
public
void
SetWindow
(
GameObject
mod
)
{
{
...
...
Assets/SibylSystem/precy.cs
View file @
cde559d8
...
@@ -62,28 +62,30 @@ public class PrecyOcg
...
@@ -62,28 +62,30 @@ public class PrecyOcg
}
}
}
}
// public void startAI(string playerDek, string aiDeck, string aiScript, bool playerGo, bool unrand, int life,
public
void
startAI
(
string
playerDek
,
string
aiDeck
,
string
aiScript
,
bool
playerGo
,
bool
unrand
,
int
life
,
// bool god, int rule)
bool
god
,
int
rule
)
// {
{
// if (Program.I().ocgcore.isShowed == false)
if
(
Program
.
I
().
ocgcore
.
isShowed
==
false
)
// {
{
// Program.I().room.mode = 0;
Program
.
I
().
room
.
mode
=
0
;
// Program.I().ocgcore.MasterRule = rule;
Program
.
I
().
ocgcore
.
MasterRule
=
rule
;
// godMode = god;
godMode
=
god
;
// prepareOcgcore();
prepareOcgcore
();
// Program.I().ocgcore.lpLimit = life;
Program
.
I
().
ocgcore
.
lpLimit
=
life
;
// Program.I().ocgcore.isFirst = playerGo;
Program
.
I
().
ocgcore
.
isFirst
=
playerGo
;
// Program.I().ocgcore.returnServant = Program.I().aiRoom;
Program
.
I
().
ocgcore
.
returnServant
=
Program
.
I
().
aiRoom
;
// if (!ygopro.startAI(playerDek, aiDeck, aiScript, playerGo, unrand, life, god, rule))
if
(!
ygopro
.
startAI
(
playerDek
,
aiDeck
,
aiScript
,
playerGo
,
unrand
,
life
,
god
,
rule
))
// {
{
// Program.I().cardDescription.RMSshow_none(InterString.Get("游戏内部出错,请重试。"));
Program
.
I
().
cardDescription
.
RMSshow_none
(
InterString
.
Get
(
"游戏内部出错,请重试,文件名中不能包含中文。"
));
// return;
return
;
// }
}
//
else
// //Config.ClientVersion = 0x233c;
{
// Program.I().shiftToServant(Program.I().ocgcore);
//Config.ClientVersion = 0x233c;
// }
Program
.
I
().
shiftToServant
(
Program
.
I
().
ocgcore
);
// }
}
}
}
private
void
prepareOcgcore
()
private
void
prepareOcgcore
()
{
{
...
...
Assets/SibylSystem/selectServer/SelectServer.cs
View file @
cde559d8
...
@@ -75,6 +75,7 @@ public class SelectServer : WindowServantSP
...
@@ -75,6 +75,7 @@ public class SelectServer : WindowServantSP
Program
.
I
().
room
.
RMSshow_clear
();
Program
.
I
().
room
.
RMSshow_clear
();
printFile
(
true
);
printFile
(
true
);
Program
.
charge
();
Program
.
charge
();
Program
.
I
().
ocgcore
.
returnServant
=
Program
.
I
().
selectServer
;
}
}
private
void
printFile
(
bool
first
)
private
void
printFile
(
bool
first
)
...
...
Assets/transUI/UIselectableList.cs
View file @
cde559d8
...
@@ -26,6 +26,22 @@ public class UIselectableList : MonoBehaviour {
...
@@ -26,6 +26,22 @@ public class UIselectableList : MonoBehaviour {
}
}
}
}
}
}
public
int
selectedIndex
{
get
{
for
(
int
i
=
0
;
i
<
selections
.
Count
;
i
++)
{
if
(
selections
[
i
].
str
==
selectedString
)
{
return
i
;
}
}
return
-
1
;
}
}
public
Action
selectedAction
;
public
Action
selectedAction
;
UIScrollView
uIScrollView
;
UIScrollView
uIScrollView
;
float
heightOfEach
=
20
;
float
heightOfEach
=
20
;
...
...
Assets/transUI/prefab/trans_AIroom.prefab
View file @
cde559d8
This diff is collapsed.
Click to expand it.
config/bot.conf
0 → 100644
View file @
cde559d8
#bots list
# !name
# command
# description
# flags (avail flags: SUPPORT_MASTER_RULE_3, SUPPORT_NEW_MASTER_RULE, SUPPORT_MASTER_RULE_2020, SELECT_DECKFILE)
!随机-非常简单
Random
=
AI_LV1
主要是一些沙包。
SUPPORT_MASTER_RULE_2020
!随机-简单
Random
=
AI_LV2
一些比较弱的卡组。
SUPPORT_MASTER_RULE_2020
!随机-普通
Random
=
AI_LV3
一些环境里可以看到的卡组。
SUPPORT_MASTER_RULE_2020
!随机-报社
Random
=
AI_ANTI_META
一些报复社会(针对主流卡组的弱点)的卡组。
SUPPORT_MASTER_RULE_2020
!
P2
-自选卡组
Name
=
P2
Deck
=
Lucky
Dialog
=
gugugu
.
zh
-
CN
人机卡组由你选择。随缘出牌。
SELECT_DECKFILE
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!悠悠
Name
=悠悠
Deck
=
MokeyMokey
Dialog
=
mokey
.
zh
-
CN
沙包。
AI_LV1
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!悠悠王
Name
=悠悠王
Deck
=
MokeyMokeyKing
Dialog
=
mokey
.
zh
-
CN
大沙包。
AI_LV1
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!谜之剑士
LV4
-龙骑星爆
Name
=谜之剑士
LV4
Deck
=
Dragunity
Dialog
=
swordsman
.
zh
-
CN
龙骑轴星尘龙爆裂体卡组。
AI_LV2
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!谜之剑士
LV4
-
L8
Name
=谜之剑士
LV4
Deck
=
'Level VIII'
Dialog
=
swordsman
.
zh
-
CN
8
星同调卡组。
AI_LV2
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!谜之剑士
LV4
-
R5
Name
=谜之剑士
LV4
Deck
=
'Rank V'
Dialog
=
swordsman
.
zh
-
CN
5
阶超量卡组。
AI_LV2
SUPPORT_MASTER_RULE_3
SUPPORT_MASTER_RULE_2020
!谜之剑士
LV4
-异热同心武器
Name
=谜之剑士
LV4
Deck
=
'Zexal Weapons'
Dialog
=
swordsman
.
zh
-
CN
神装电光皇卡组。
AI_LV2
SUPPORT_MASTER_RULE_3
SUPPORT_MASTER_RULE_2020
!琪露诺-彩虹
Name
=琪露诺
Deck
=
Rainbow
Dialog
=
cirno
.
zh
-
CN
全属性凡骨卡组。
AI_LV2
SUPPORT_MASTER_RULE_3
SUPPORT_MASTER_RULE_2020
!琪露诺-饼蛙
Name
=琪露诺
Deck
=
'Toadally Awesome'
Dialog
=
cirno
.
zh
-
CN
大师规则三的全盛饼蛙卡组。
SUPPORT_MASTER_RULE_3
SUPPORT_MASTER_RULE_2020
!复制植物-青眼
Name
=复制植物
Deck
=
Blue
-
Eyes
Dialog
=
copy
.
zh
-
CN
青眼卡组。
AI_LV2
SUPPORT_MASTER_RULE_3
SUPPORT_MASTER_RULE_2020
!复制植物-十二兽
Name
=复制植物
Deck
=
Zoodiac
Dialog
=
copy
.
zh
-
CN
大师规则三的十四兽卡组。
SUPPORT_MASTER_RULE_3
SUPPORT_MASTER_RULE_2020
!尼亚-妖仙兽
Name
=尼亚
Deck
=
Yosenju
Dialog
=
near
.
zh
-
CN
妖仙兽卡组。
AI_ANTI_META
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!尼亚-机壳
Name
=尼亚
Deck
=
Qliphort
Dialog
=
near
.
zh
-
CN
机壳卡组。
AI_ANTI_META
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!尼亚-淘气仙星
Name
=尼亚
Deck
=
Trickstar
Dialog
=
near
.
zh
-
CN
旧式淘气仙星卡组。
AI_LV3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!尼亚-幻变骚灵
Name
=尼亚
Deck
=
Altergeist
Dialog
=
near
.
zh
-
CN
幻变骚灵卡组。
AI_LV3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!复制梁龙-闪刀姬
Name
=复制梁龙
Deck
=
SkyStriker
Dialog
=
anothercopy
.
zh
-
CN
旧式闪刀姬卡组。
AI_LV3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!复制梁龙-自奏圣乐
Name
=复制梁龙
Deck
=
Orcust
Dialog
=
anothercopy
.
zh
-
CN
旧式自奏圣乐卡组。
AI_LV3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!复制梁龙-转生炎兽
Name
=复制梁龙
Deck
=
Salamangreat
Dialog
=
anothercopy
.
zh
-
CN
转生炎兽卡组。
AI_LV3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!
VI
-
1911
-凭依装着
Name
=
VI
-
1911
Deck
=
FamiliarPossessed
Dialog
=
VI
-
1911
.
zh
-
CN
凭依装着卡组。
AI_ANTI_META
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!
VI
-
1911
-时劫者
Name
=
VI
-
1911
Deck
=
TimeThief
Dialog
=
VI
-
1911
.
zh
-
CN
时间潜行者卡组。
AI_LV2
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!永远之魂-削血
Name
=永远之魂
Deck
=
Burn
Dialog
=
soul
.
zh
-
CN
老式削血卡组。
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!永远之魂-青蛙
Name
=永远之魂
Deck
=
Frog
Dialog
=
soul
.
zh
-
CN
老式青蛙卡组。
AI_LV1
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!永远之魂-荷鲁斯
Name
=永远之魂
Deck
=
Horus
Dialog
=
soul
.
zh
-
CN
老式龙族卡组。
AI_LV1
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!比特机灵-微风
Name
=比特机灵
Deck
=
PureWinds
Dialog
=
zh
-
CN
风属性卡组。
AI_LV2
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!试作型机器人
1732
Name
=试作型机器人
1732
Deck
=
ST1732
Dialog
=
zh
-
CN
由三盒
ST17
和三盒
SD32
组成的卡组。
AI_LV2
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!奇異果
Name
=奇異果
Deck
=
LightswornShaddoldinosour
Dialog
=
kiwi
.
zh
-
TW
光道影依恐龙卡组。
AI_LV3
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!奇魔果
Name
=奇魔果
Deck
=
DarkMagician
Dialog
=
kiwi
.
zh
-
TW
黑魔术师卡组。
AI_LV3
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!
MAX
龍果
Name
=
MAX
龍果
Deck
=
BlueEyesMaxDragon
Dialog
=
kiwi
.
zh
-
TW
青眼混沌极龙卡组。
AI_LV2
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!幻煌果
Name
=幻煌果
Deck
=
Phantasm
Dialog
=
kiwi
.
zh
-
TW
幻煌龙卡组。
AI_ANTI_META
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!燃血鬥士
Name
=燃血鬥士
Deck
=
ChainBurn
Dialog
=
kiwi
.
zh
-
TW
连锁烧卡组。
AI_ANTI_META
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!報社鬥士
Name
=報社鬥士
Deck
=
GrenMajuThunderBoarder
Dialog
=
kiwi
.
zh
-
TW
红莲雷王滑板卡组。
AI_ANTI_META
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!我太帅了-真红眼龙骑士
Name
=我太帅了
Deck
=
Dragun
Dialog
=
smart
.
zh
-
CN
超魔导真红眼龙骑士卡组。
AI_LV3
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!我太帅了-水百凤凰勇者
Name
=我太帅了
Deck
=
Brave
Dialog
=
smart
.
zh
-
CN
水机百头龙凤凰人勇者卡组。
AI_LV3
SUPPORT_MASTER_RULE_2020
!玻璃女巫-魔女术
Name
=玻璃女巫
Deck
=
Witchcraft
Dialog
=
verre
.
zh
-
CN
魔女术卡组。
AI_LV3
SUPPORT_MASTER_RULE_3
SUPPORT_NEW_MASTER_RULE
SUPPORT_MASTER_RULE_2020
!玻璃女巫-救祓少女
Name
=玻璃女巫
Deck
=
Exosister
Dialog
=
verre
.
zh
-
CN
救祓少女卡组。
AI_LV3
SUPPORT_MASTER_RULE_3
SUPPORT_MASTER_RULE_2020
!神数不神-刹帝利
Name
=神数不神
Deck
=
Kashtira
Dialog
=
Zefra
.
zh
-
CN
俱舍怒威族卡组。
AI_LV3
SUPPORT_MASTER_RULE_2020
![狂野模式]神数不神-雷龙
Name
=神数不神
Deck
=
ThunderDragon
Dialog
=
Zefra
.
zh
-
CN
深渊混沌雷龙卡组。(普通模式的人机的卡组会符合其使用的卡池对应的环境的禁限卡表,但在狂野模式中,人机的卡组不符合任何禁限卡表。)
SUPPORT_MASTER_RULE_2020
!神数不神-珠泪哀歌
Name
=神数不神
Deck
=
Tearlaments
Dialog
=
Zefra
.
zh
-
CN
旧式地天使珠泪哀歌族卡组。
AI_LV3
SUPPORT_MASTER_RULE_2020
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