Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro2
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
nanahira
srvpro2
Commits
7dcde5ac
Commit
7dcde5ac
authored
Feb 14, 2026
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update config things & ocgcore wasm path
parent
2d537ea0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
3 deletions
+40
-3
config.example.yaml
config.example.yaml
+1
-0
src/client/ip-resolver.ts
src/client/ip-resolver.ts
+2
-2
src/config.ts
src/config.ts
+2
-0
src/ocgcore-worker/ocgcore-worker-options.ts
src/ocgcore-worker/ocgcore-worker-options.ts
+1
-0
src/ocgcore-worker/ocgcore-worker.ts
src/ocgcore-worker/ocgcore-worker.ts
+9
-1
src/room/room-manager.ts
src/room/room-manager.ts
+10
-0
src/room/room.ts
src/room/room.ts
+15
-0
No files found.
config.example.yaml
View file @
7dcde5ac
...
@@ -19,6 +19,7 @@ DECK_EXTRA_MAX: "15"
...
@@ -19,6 +19,7 @@ DECK_EXTRA_MAX: "15"
DECK_SIDE_MAX
:
"
15"
DECK_SIDE_MAX
:
"
15"
DECK_MAX_COPIES
:
"
3"
DECK_MAX_COPIES
:
"
3"
OCGCORE_DEBUG_LOG
:
"
"
OCGCORE_DEBUG_LOG
:
"
"
OCGCORE_WASM_PATH
:
"
"
WELCOME
:
"
"
WELCOME
:
"
"
ENABLE_RECONNECT
:
"
1"
ENABLE_RECONNECT
:
"
1"
RECONNECT_TIMEOUT
:
"
180000"
RECONNECT_TIMEOUT
:
"
180000"
...
...
src/client/ip-resolver.ts
View file @
7dcde5ac
...
@@ -174,7 +174,7 @@ export class IpResolver {
...
@@ -174,7 +174,7 @@ export class IpResolver {
*/
*/
clearConnectionCounts
():
void
{
clearConnectionCounts
():
void
{
this
.
connectedIpCount
.
clear
();
this
.
connectedIpCount
.
clear
();
this
.
logger
.
info
(
'
Connection counts cleared
'
);
this
.
logger
.
debug
(
'
Connection counts cleared
'
);
}
}
/**
/**
...
@@ -182,6 +182,6 @@ export class IpResolver {
...
@@ -182,6 +182,6 @@ export class IpResolver {
*/
*/
clearBadIpCounts
():
void
{
clearBadIpCounts
():
void
{
this
.
badIpCount
.
clear
();
this
.
badIpCount
.
clear
();
this
.
logger
.
info
(
'
Bad IP counts cleared
'
);
this
.
logger
.
debug
(
'
Bad IP counts cleared
'
);
}
}
}
}
src/config.ts
View file @
7dcde5ac
...
@@ -53,6 +53,8 @@ export const defaultConfig = {
...
@@ -53,6 +53,8 @@ export const defaultConfig = {
// Enable ocgcore debug logs.
// Enable ocgcore debug logs.
// Boolean parse rule (default false): ''/'0'/'false'/'null' => false, otherwise true.
// Boolean parse rule (default false): ''/'0'/'false'/'null' => false, otherwise true.
OCGCORE_DEBUG_LOG
:
''
,
OCGCORE_DEBUG_LOG
:
''
,
// OCGCore wasm file path. Format: filesystem path string. Empty means use default wasm loading.
OCGCORE_WASM_PATH
:
''
,
// Welcome message sent when players join. Format: plain string.
// Welcome message sent when players join. Format: plain string.
WELCOME
:
''
,
WELCOME
:
''
,
// Enable reconnect feature.
// Enable reconnect feature.
...
...
src/ocgcore-worker/ocgcore-worker-options.ts
View file @
7dcde5ac
...
@@ -5,6 +5,7 @@ import { TransportType } from 'yuzuthread';
...
@@ -5,6 +5,7 @@ import { TransportType } from 'yuzuthread';
export
class
OcgcoreWorkerOptions
{
export
class
OcgcoreWorkerOptions
{
ygoproPaths
:
string
[];
ygoproPaths
:
string
[];
extraScriptPaths
:
string
[];
extraScriptPaths
:
string
[];
ocgcoreWasmPath
?:
string
;
seed
:
number
[];
seed
:
number
[];
hostinfo
:
HostInfo
;
hostinfo
:
HostInfo
;
@
TransportType
(()
=>
[
YGOProDeck
])
@
TransportType
(()
=>
[
YGOProDeck
])
...
...
src/ocgcore-worker/ocgcore-worker.ts
View file @
7dcde5ac
...
@@ -37,6 +37,7 @@ import {
...
@@ -37,6 +37,7 @@ import {
YGOProMsgResponseBase
,
YGOProMsgResponseBase
,
YGOProMsgRetry
,
YGOProMsgRetry
,
}
from
'
ygopro-msg-encode
'
;
}
from
'
ygopro-msg-encode
'
;
import
*
as
fs
from
'
node:fs
'
;
const
{
OcgcoreScriptConstants
}
=
_OcgcoreConstants
;
const
{
OcgcoreScriptConstants
}
=
_OcgcoreConstants
;
...
@@ -90,8 +91,15 @@ export class OcgcoreWorker {
...
@@ -90,8 +91,15 @@ export class OcgcoreWorker {
@
WorkerInit
()
@
WorkerInit
()
async
init
()
{
async
init
()
{
let
wasmBinary
:
Uint8Array
|
undefined
;
if
(
this
.
options
.
ocgcoreWasmPath
)
{
wasmBinary
=
await
fs
.
promises
.
readFile
(
this
.
options
.
ocgcoreWasmPath
);
}
// Create ocgcore wrapper
// Create ocgcore wrapper
this
.
ocgcore
=
await
createOcgcoreWrapper
();
this
.
ocgcore
=
await
createOcgcoreWrapper
(
wasmBinary
?
{
wasmBinary
}
:
undefined
,
);
this
.
ocgcore
.
setMessageHandler
((
_
,
message
,
type
)
=>
this
.
ocgcore
.
setMessageHandler
((
_
,
message
,
type
)
=>
this
.
handleMessage
(
message
,
type
),
this
.
handleMessage
(
message
,
type
),
);
);
...
...
src/room/room-manager.ts
View file @
7dcde5ac
...
@@ -27,6 +27,8 @@ export class RoomManager {
...
@@ -27,6 +27,8 @@ export class RoomManager {
private
roomCreateLock
=
new
BetterLock
();
private
roomCreateLock
=
new
BetterLock
();
private
logger
=
this
.
ctx
.
createLogger
(
'
RoomManager
'
);
async
findOrCreateByName
(
name
:
string
)
{
async
findOrCreateByName
(
name
:
string
)
{
const
existing
=
this
.
findByName
(
name
);
const
existing
=
this
.
findByName
(
name
);
if
(
existing
)
return
existing
;
if
(
existing
)
return
existing
;
...
@@ -37,12 +39,20 @@ export class RoomManager {
...
@@ -37,12 +39,20 @@ export class RoomManager {
const
room
=
new
Room
(
this
.
ctx
,
name
).
addFinalizor
((
r
)
=>
{
const
room
=
new
Room
(
this
.
ctx
,
name
).
addFinalizor
((
r
)
=>
{
this
.
rooms
.
delete
(
r
.
name
);
this
.
rooms
.
delete
(
r
.
name
);
this
.
logger
.
debug
(
{
room
:
r
.
name
,
roomCount
:
this
.
rooms
.
size
},
'
Room finalized and removed
'
,
);
});
});
for
(
const
finalizor
of
this
.
finalizors
)
{
for
(
const
finalizor
of
this
.
finalizors
)
{
room
.
addFinalizor
(
finalizor
);
room
.
addFinalizor
(
finalizor
);
}
}
await
room
.
init
();
await
room
.
init
();
this
.
rooms
.
set
(
name
,
room
);
this
.
rooms
.
set
(
name
,
room
);
this
.
logger
.
debug
(
{
room
:
name
,
roomCount
:
this
.
rooms
.
size
},
'
Room created
'
,
);
return
room
;
return
room
;
});
});
}
}
...
...
src/room/room.ts
View file @
7dcde5ac
...
@@ -92,6 +92,7 @@ import { canIncreaseTime } from '../utility/can-increase-time';
...
@@ -92,6 +92,7 @@ import { canIncreaseTime } from '../utility/can-increase-time';
import
{
parseConfigBoolean
}
from
'
../utility/parse-config-boolean
'
;
import
{
parseConfigBoolean
}
from
'
../utility/parse-config-boolean
'
;
import
{
TimerState
}
from
'
./timer-state
'
;
import
{
TimerState
}
from
'
./timer-state
'
;
import
{
makeArray
}
from
'
aragami/dist/src/utility/utility
'
;
import
{
makeArray
}
from
'
aragami/dist/src/utility/utility
'
;
import
path
from
'
path
'
;
const
{
OcgcoreScriptConstants
}
=
_OcgcoreConstants
;
const
{
OcgcoreScriptConstants
}
=
_OcgcoreConstants
;
...
@@ -204,6 +205,13 @@ export class Room {
...
@@ -204,6 +205,13 @@ export class Room {
}
}
this
.
finalizing
=
true
;
this
.
finalizing
=
true
;
this
.
resetResponseState
();
this
.
resetResponseState
();
this
.
logger
.
debug
(
{
playerCount
:
this
.
playingPlayers
.
length
,
watcherCount
:
this
.
watchers
.
size
,
},
'
Finalizing room
'
,
);
await
this
.
cleanPlayers
(
sendReplays
);
await
this
.
cleanPlayers
(
sendReplays
);
while
(
this
.
finalizors
.
length
)
{
while
(
this
.
finalizors
.
length
)
{
const
finalizor
=
this
.
finalizors
.
pop
()
!
;
const
finalizor
=
this
.
finalizors
.
pop
()
!
;
...
@@ -1202,11 +1210,18 @@ export class Room {
...
@@ -1202,11 +1210,18 @@ export class Room {
{
seed
:
duelRecord
.
seed
,
registry
,
hostinfo
:
this
.
hostinfo
},
{
seed
:
duelRecord
.
seed
,
registry
,
hostinfo
:
this
.
hostinfo
},
'
Initializing OCGCoreWorker
'
,
'
Initializing OCGCoreWorker
'
,
);
);
const
ocgcoreWasmPathConfig
=
this
.
ctx
.
getConfig
(
'
OCGCORE_WASM_PATH
'
,
''
);
const
ocgcoreWasmPath
=
ocgcoreWasmPathConfig
?
path
.
resolve
(
process
.
cwd
(),
ocgcoreWasmPathConfig
)
:
undefined
;
this
.
ocgcore
=
await
initWorker
(
OcgcoreWorker
,
{
this
.
ocgcore
=
await
initWorker
(
OcgcoreWorker
,
{
seed
:
duelRecord
.
seed
,
seed
:
duelRecord
.
seed
,
hostinfo
:
this
.
hostinfo
,
hostinfo
:
this
.
hostinfo
,
ygoproPaths
:
this
.
resourceLoader
.
ygoproPaths
,
ygoproPaths
:
this
.
resourceLoader
.
ygoproPaths
,
extraScriptPaths
,
extraScriptPaths
,
ocgcoreWasmPath
,
registry
,
registry
,
decks
:
duelRecord
.
players
.
map
((
p
)
=>
p
.
deck
),
decks
:
duelRecord
.
players
.
map
((
p
)
=>
p
.
deck
),
isTag
:
this
.
isTag
,
isTag
:
this
.
isTag
,
...
...
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