Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-libs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-libs
Commits
b9a5f08a
Commit
b9a5f08a
authored
Dec 25, 2019
by
XieChuanJin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去除多次提交限制
parent
44d29037
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
46 deletions
+5
-46
shoot-planet.json
dist/customs/shoot-planet.json
+1
-1
ShootPlanet.ts
src/custom/shoot-planet/ShootPlanet.ts
+4
-45
No files found.
dist/customs/shoot-planet.json
View file @
b9a5f08a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/custom/shoot-planet/ShootPlanet.ts
View file @
b9a5f08a
...
...
@@ -16,7 +16,6 @@ import { initNECaptcha } from "./Component/InitNECaptcha";
export
class
ShootPlanet
extends
engine
.
Container
{
public
game
:
Game
=
null
;
private
isSubmited
=
false
;
private
constantSubmitSeq
=
1
;
private
needSubmitCount
=
0
;
//实际分数减去ConstantSubmitScoreNum的次数
private
isSubmiting
=
false
;
...
...
@@ -50,6 +49,9 @@ export class ShootPlanet extends engine.Container {
this
.
game
.
onScoreChange
=
(
delta
:
number
)
=>
{
this
.
localScore
+=
delta
;
};
this
.
game
.
onGameOver
=
()
=>
{
this
.
finalSubmit
();
}
if
(
GuideMgr
.
instance
.
guideFlag
==
true
)
{
const
car
=
this
.
game
.
_car
;
GuideMgr
.
instance
.
runGuide
(
0
,
car
.
x
+
car
.
width
/
2
,
car
.
y
+
car
.
height
/
2
/* - 130 */
);
...
...
@@ -108,14 +110,6 @@ export class ShootPlanet extends engine.Container {
this
.
isSubmiting
=
true
;
let
seq
=
NetUtils
.
encryptSeq
(
this
.
constantSubmitSeq
);
/* return new Promise((resolve, reject) => {
console.error(this.constantSubmitSeq);
this.constantSubmitSeq++;
this.needSubmitCount--;
this.isSubmiting = false;
resolve();
}); */
return
new
Promise
((
resolve
,
reject
)
=>
{
Net
.
sendPost
(
Net
.
Url
.
constantSubmit
,
{
startId
:
this
.
startId
,
...
...
@@ -136,23 +130,7 @@ export class ShootPlanet extends engine.Container {
});
}
/* private updateTime() {
let temp = Math.ceil(this.game.timer / 1000);
let second = temp % 60;
let minute = (temp - second) / 60;
let str = "";
str += (minute < 10 ? "0" : "") + minute.toString();
str += ":";
str += (second < 10 ? "0" : "") + second.toString();
this.labelTime.text = str;
} */
public
async
finalSubmit
(
propsId
?:
string
,
onSubmited
?:
()
=>
void
)
{
if
(
this
.
isSubmited
)
{
return
;
}
this
.
isSubmited
=
true
;
Loading
.
instace
.
show
();
if
(
this
.
needSubmitCount
>
0
)
{
if
(
!
this
.
isSubmiting
)
{
...
...
@@ -191,32 +169,13 @@ export class ShootPlanet extends engine.Container {
}
});
engine
.
globalEvent
.
dispatchEvent
(
"ShootPlanetFinalSubmit"
,{
engine
.
globalEvent
.
dispatchEvent
(
"ShootPlanetFinalSubmit"
,
{
startId
:
this
.
startId
,
score
:
score
,
useSpId
:
propsId
||
""
,
token
:
NetUtils
.
md5
(
this
.
startId
.
toString
()
+
score
.
toString
()
+
"qzBankRPW@dui88"
),
validate
:
validate
});
return
;
return
new
Promise
<
any
>
((
resolve
,
reject
)
=>
{
//调用接口
Net
.
sendPost
(
Net
.
Url
.
finalSubmit
,
{
startId
:
this
.
startId
,
score
:
score
,
useSpId
:
propsId
||
""
,
token
:
NetUtils
.
md5
(
this
.
startId
.
toString
()
+
score
.
toString
()
+
"qzBankRPW@dui88"
),
validate
:
validate
},
(
res
)
=>
{
Loading
.
instace
.
hide
();
resolve
(
res
);
},
(
res
)
=>
{
Net
.
defaultOnFail
(
res
);
reject
(
res
);
});
});
}
}
...
...
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