File: NetworkedMultiplayerCustom.xml

package info (click to toggle)
godot 3.6%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 270,588 kB
  • sloc: cpp: 971,579; ansic: 617,953; xml: 80,302; asm: 17,498; cs: 14,559; python: 11,744; java: 9,681; javascript: 4,654; pascal: 1,176; sh: 896; objc: 529; makefile: 176
file content (60 lines) | stat: -rw-r--r-- 3,255 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?xml version="1.0" encoding="UTF-8" ?>
<class name="NetworkedMultiplayerCustom" inherits="NetworkedMultiplayerPeer" version="3.6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
	<brief_description>
		A [NetworkedMultiplayerPeer] implementation that can be controlled from a script.
	</brief_description>
	<description>
		A [NetworkedMultiplayerPeer] implementation that can be used as a [member MultiplayerAPI.network_peer] and controlled from a script.
		Its purpose is to allow adding a new backend for the high-Level multiplayer API without needing to use GDNative.
	</description>
	<tutorials>
	</tutorials>
	<methods>
		<method name="deliver_packet">
			<return type="void" />
			<argument index="0" name="buffer" type="PoolByteArray" />
			<argument index="1" name="from_peer_id" type="int" />
			<description>
				Deliver a packet to the local [MultiplayerAPI].
				When your script receives a packet from other peers over the network (originating from the [signal packet_generated] signal on the sending peer), passing it to this method will deliver it locally.
			</description>
		</method>
		<method name="initialize">
			<return type="void" />
			<argument index="0" name="self_peer_id" type="int" />
			<description>
				Initialize the peer with the given [code]self_peer_id[/code] (must be between 1 and 2147483647).
				Can only be called if the connection status is [constant NetworkedMultiplayerPeer.CONNECTION_CONNECTING]. See [method set_connection_status].
			</description>
		</method>
		<method name="set_connection_status">
			<return type="void" />
			<argument index="0" name="connection_status" type="int" enum="NetworkedMultiplayerPeer.ConnectionStatus" />
			<description>
				Set the state of the connection. See [enum NetworkedMultiplayerPeer.ConnectionStatus].
				This will emit the [signal NetworkedMultiplayerPeer.connection_succeeded], [signal NetworkedMultiplayerPeer.connection_failed] or [signal NetworkedMultiplayerPeer.server_disconnected] signals depending on the status and if the peer has the unique network id of [code]1[/code].
				You can only change to [constant NetworkedMultiplayerPeer.CONNECTION_CONNECTING] from [constant NetworkedMultiplayerPeer.CONNECTION_DISCONNECTED] and to [constant NetworkedMultiplayerPeer.CONNECTION_CONNECTED] from [constant NetworkedMultiplayerPeer.CONNECTION_CONNECTING].
			</description>
		</method>
		<method name="set_max_packet_size">
			<return type="void" />
			<argument index="0" name="max_packet_size" type="int" />
			<description>
				Set the max packet size that this peer can handle.
			</description>
		</method>
	</methods>
	<signals>
		<signal name="packet_generated">
			<argument index="0" name="peer_id" type="int" />
			<argument index="1" name="buffer" type="PoolByteArray" />
			<argument index="2" name="transfer_mode" type="int" />
			<description>
				Emitted when the local [MultiplayerAPI] generates a packet (e.g. when calling [method Node.rpc]).
				Your script should take this packet and send it to the requested peer over the network (which should call [method deliver_packet] with the data when it's received).
			</description>
		</signal>
	</signals>
	<constants>
	</constants>
</class>