Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
koishi-plugin-hisoutensoku-jammer
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
koishi-plugin-hisoutensoku-jammer
Commits
8b411397
Commit
8b411397
authored
Dec 05, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add constructor in config schema
parent
114a2e41
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
106 deletions
+14
-106
src/attacker.ts
src/attacker.ts
+7
-103
src/config.ts
src/config.ts
+3
-1
src/index.ts
src/index.ts
+4
-2
No files found.
src/attacker.ts
View file @
8b411397
...
...
@@ -2,113 +2,17 @@ import dgram from 'dgram';
import
_
from
'
lodash
'
;
const
messageStage1
=
[
1
,
2
,
0
,
42
,
49
,
127
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
2
,
0
,
42
,
49
,
127
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
109
,
44
,
0
,
0
,
1
,
2
,
0
,
42
,
49
,
127
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
2
,
0
,
42
,
49
,
127
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
109
,
44
,
0
,
0
,
];
const
smallMessage
=
[
3
];
const
messageStage2
=
[
5
,
110
,
115
,
101
,
217
,
255
,
196
,
110
,
72
,
141
,
124
,
161
,
146
,
49
,
52
,
114
,
149
,
16
,
0
,
1
,
0
,
40
,
0
,
0
,
0
,
1
,
9
,
112
,
114
,
111
,
102
,
105
,
108
,
101
,
49
,
112
,
0
,
0
,
0
,
0
,
0
,
81
,
57
,
68
,
0
,
74
,
2
,
65
,
8
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
51
,
1
,
0
,
0
,
18
,
0
,
0
,
0
,
5
,
110
,
115
,
101
,
217
,
255
,
196
,
110
,
72
,
141
,
124
,
161
,
146
,
49
,
52
,
114
,
149
,
16
,
0
,
1
,
0
,
40
,
0
,
0
,
0
,
1
,
9
,
112
,
114
,
111
,
102
,
105
,
108
,
101
,
49
,
112
,
0
,
0
,
0
,
0
,
0
,
81
,
57
,
68
,
0
,
74
,
2
,
65
,
8
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
51
,
1
,
0
,
0
,
18
,
0
,
0
,
0
,
];
enum
AttackType
{
...
...
@@ -251,7 +155,7 @@ export class Attacker {
this
.
socket
.
on
(
'
error
'
,
(
err
)
=>
{
this
.
error
=
err
;
});
for
(
le
t
step
of
AttackRoutine
)
{
for
(
cons
t
step
of
AttackRoutine
)
{
if
(
this
.
error
)
{
return
`Error:
${
this
.
error
.
toString
()}
`
;
}
...
...
src/config.ts
View file @
8b411397
...
...
@@ -7,6 +7,7 @@ import path from 'path';
@
RegisterSchema
()
export
class
HisoutensokuJammerPluginConfig
{
constructor
(
config
:
Partial
<
HisoutensokuJammerPluginConfig
>
)
{}
@
DefineSchema
({
description
:
'
干扰时间
'
,
default
:
10000
})
attackTimeout
:
number
;
...
...
@@ -65,4 +66,5 @@ export class HisoutensokuJammerPluginConfig {
}
}
export
type
HisoutensokuJammerPluginConfigLike
=
Partial
<
HisoutensokuJammerPluginConfig
>
;
export
type
HisoutensokuJammerPluginConfigLike
=
Partial
<
HisoutensokuJammerPluginConfig
>
;
src/index.ts
View file @
8b411397
...
...
@@ -30,8 +30,10 @@ declare module 'koishi' {
}
}
const
matcherGlobal
=
/
([
1-2
]?
*
\d?
*
\d
*
)(([^\d][
1-2
]?\d{1,2}){3})
.+
?([
1-6
]
*
\d
*
\d
*
\d
*
\d)
/g
;
const
matcherSingle
=
/
([
1-2
]?
*
\d?
*
\d
*
)(([^\d][
1-2
]?\d{1,2}){3})
.+
?([
1-6
]
*
\d
*
\d
*
\d
*
\d)
/
;
const
matcherGlobal
=
/
([
1-2
]?
*
\d?
*
\d
*
)(([^\d][
1-2
]?\d{1,2}){3})
.+
?([
1-6
]
*
\d
*
\d
*
\d
*
\d)
/g
;
const
matcherSingle
=
/
([
1-2
]?
*
\d?
*
\d
*
)(([^\d][
1-2
]?\d{1,2}){3})
.+
?([
1-6
]
*
\d
*
\d
*
\d
*
\d)
/
;
const
PROTOCOL_BASE64
=
'
base64://
'
;
...
...
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