Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
op_16
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
op_16
Commits
4377498d
Commit
4377498d
authored
Feb 21, 2022
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: log
parent
ae582a97
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
5 deletions
+21
-5
op_16.meta
assets/op_16.meta
+15
-1
op_16.ts
assets/op_16/scene/op_16.ts
+2
-0
NetworkHelper.ts
assets/op_16/script/NetworkHelper.ts
+4
-4
No files found.
assets/op_16.meta
View file @
4377498d
{"ver":"1.1.2","uuid":"c35bb2f6-f24a-4850-ae44-643f2fdc7541","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
{
\ No newline at end of file
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
assets/op_16/scene/op_16.ts
View file @
4377498d
...
@@ -34,6 +34,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -34,6 +34,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
onLoadEnd
()
{
onLoadEnd
()
{
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this
.
log
(
'
onLoadEnd
'
);
this
.
initData
();
this
.
initData
();
this
.
initView
();
this
.
initView
();
this
.
initListener
();
this
.
initListener
();
...
...
assets/op_16/script/NetworkHelper.ts
View file @
4377498d
...
@@ -141,11 +141,11 @@ export class NetworkHelper {
...
@@ -141,11 +141,11 @@ export class NetworkHelper {
this
.
room
.
matchRoom
(
matchRoomPara
,
async
(
event
)
=>
{
this
.
room
.
matchRoom
(
matchRoomPara
,
async
(
event
)
=>
{
// console.log(JSON.stringify(event))
// console.log(JSON.stringify(event))
if
(
event
.
code
!==
0
)
{
if
(
event
.
code
!==
0
)
{
cc
.
log
(
"
匹配失败
"
);
this
.
log
(
"
匹配失败
"
);
reject
(
event
);
reject
(
event
);
return
;
return
;
}
}
cc
.
log
(
"
匹配成功:
"
+
event
.
data
.
roomInfo
.
id
);
this
.
log
(
"
匹配成功:
"
+
event
.
data
.
roomInfo
.
id
);
const
player
=
event
.
data
.
roomInfo
.
playerList
.
find
(
const
player
=
event
.
data
.
roomInfo
.
playerList
.
find
(
(
player
)
=>
player
.
name
==
playerName
(
player
)
=>
player
.
name
==
playerName
);
);
...
@@ -153,7 +153,7 @@ export class NetworkHelper {
...
@@ -153,7 +153,7 @@ export class NetworkHelper {
if
(
this
.
_eventListeners
[
"
playerOffLine
"
])
{
if
(
this
.
_eventListeners
[
"
playerOffLine
"
])
{
this
.
_eventListeners
[
"
playerOffLine
"
](
event
);
this
.
_eventListeners
[
"
playerOffLine
"
](
event
);
}
}
cc
.
log
(
"
房主掉线了
"
);
this
.
log
(
"
房主掉线了
"
);
resolve
(
null
);
resolve
(
null
);
return
;
return
;
}
}
...
@@ -292,7 +292,7 @@ export class NetworkHelper {
...
@@ -292,7 +292,7 @@ export class NetworkHelper {
if
(
this
.
_eventListeners
[
"
playerOffLine
"
])
{
if
(
this
.
_eventListeners
[
"
playerOffLine
"
])
{
this
.
_eventListeners
[
"
playerOffLine
"
](
event
);
this
.
_eventListeners
[
"
playerOffLine
"
](
event
);
}
}
cc
.
log
(
"
房主掉线了
"
);
this
.
log
(
"
房主掉线了
"
);
}
}
}
}
...
...
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