Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
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
community
godot
Commits
29908d32
Commit
29908d32
authored
Mar 04, 2017
by
Karol Walasek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a SceneTree.has_network_peer, closes #7922
parent
74eace2b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
0 deletions
+13
-0
classes.xml
doc/base/classes.xml
+7
-0
scene_main_loop.cpp
scene/main/scene_main_loop.cpp
+5
-0
scene_main_loop.h
scene/main/scene_main_loop.h
+1
-0
No files found.
doc/base/classes.xml
View file @
29908d32
...
...
@@ -35451,6 +35451,13 @@
Returns true if this SceneTree's [NetworkedMultiplayerPeer] is in server mode (listening for connections).
</description>
</method>
<method
name=
"has_network_peer"
qualifiers=
"const"
>
<return
type=
"bool"
>
</return>
<description>
Returns true if there is a [NetworkedMultiplayerPeer] set (with [method SceneTree.set_network_peer]).
</description>
</method>
<method
name=
"is_paused"
qualifiers=
"const"
>
<return
type=
"bool"
>
</return>
scene/main/scene_main_loop.cpp
View file @
29908d32
...
...
@@ -1803,6 +1803,10 @@ bool SceneTree::is_network_server() const {
}
bool
SceneTree
::
has_network_peer
()
const
{
return
network_peer
.
is_valid
();
}
int
SceneTree
::
get_network_unique_id
()
const
{
ERR_FAIL_COND_V
(
!
network_peer
.
is_valid
(),
0
);
...
...
@@ -2310,6 +2314,7 @@ void SceneTree::_bind_methods() {
ClassDB
::
bind_method
(
D_METHOD
(
"set_network_peer"
,
"peer:NetworkedMultiplayerPeer"
),
&
SceneTree
::
set_network_peer
);
ClassDB
::
bind_method
(
D_METHOD
(
"is_network_server"
),
&
SceneTree
::
is_network_server
);
ClassDB
::
bind_method
(
D_METHOD
(
"has_network_peer"
),
&
SceneTree
::
has_network_peer
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_network_unique_id"
),
&
SceneTree
::
get_network_unique_id
);
ClassDB
::
bind_method
(
D_METHOD
(
"set_refuse_new_network_connections"
,
"refuse"
),
&
SceneTree
::
set_refuse_new_network_connections
);
ClassDB
::
bind_method
(
D_METHOD
(
"is_refusing_new_network_connections"
),
&
SceneTree
::
is_refusing_new_network_connections
);
...
...
scene/main/scene_main_loop.h
View file @
29908d32
...
...
@@ -447,6 +447,7 @@ public:
void
set_network_peer
(
const
Ref
<
NetworkedMultiplayerPeer
>&
p_network_peer
);
bool
is_network_server
()
const
;
bool
has_network_peer
()
const
;
int
get_network_unique_id
()
const
;
void
set_refuse_new_network_connections
(
bool
p_refuse
);
...
...
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