Skip to main content

engage/generated/unity_engine/networking/player_connection/
playerconnection.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "unity_engine-networking-player_connection-playerconnection-types")]
4mod __types {
5    #[allow(unused_imports)] use ::unity::prelude::*;
6
7    use super::*;
8    use crate::{
9        system::object::{IObject, Object},
10        unity_engine::{
11            object_2::{IObject_2, Object_2},
12            scriptableobject::{IScriptableObject, ScriptableObject},
13        },
14    };
15
16    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/networking/player_connection/playerconnection/PlayerConnection.md"))]
17    #[::unity::class(namespace = "UnityEngine.Networking.PlayerConnection", name = "PlayerConnection")]
18    #[parent(crate::unity_engine::scriptableobject::ScriptableObject)]
19    pub struct PlayerConnection {
20        #[static_field]
21        #[rename(name = "connectionNative")]
22        pub connection_native: crate::unity_engine::iplayereditorconnectionnative::IPlayerEditorConnectionNative,
23        #[offset(24)]
24        #[rename(name = "m_PlayerEditorConnectionEvents")]
25        pub m_player_editor_connection_events:
26            crate::unity_engine::networking::player_connection::playereditorconnectionevents::PlayerEditorConnectionEvents,
27        #[offset(32)]
28        #[rename(name = "m_connectedPlayers")]
29        pub m_connected_players: crate::system::collections::generic::list_1::List_1<i32>,
30        #[offset(40)]
31        #[rename(name = "m_IsInitilized")]
32        pub m_is_initilized: bool,
33        #[static_field]
34        #[rename(name = "s_Instance")]
35        pub s_instance: crate::unity_engine::networking::player_connection::playerconnection::PlayerConnection,
36    }
37}
38
39#[cfg(feature = "unity_engine-networking-player_connection-playerconnection-types")]
40pub use __types::*;
41
42#[cfg(feature = "unity_engine-networking-player_connection-playerconnection")]
43impl PlayerConnection {
44    #[doc = "`get_instance()` overload"]
45    pub fn get_instance() -> crate::unity_engine::networking::player_connection::playerconnection::PlayerConnection {
46        unsafe {
47            ::unity::il2cpp_call!((::unity::module_base()+0x32f5bd0usize)as*mut u8,crate::unity_engine::networking::player_connection::playerconnection::PlayerConnection;
48            )
49        }
50    }
51
52    #[doc = "`CreateInstance()` overload"]
53    pub fn create_instance() -> crate::unity_engine::networking::player_connection::playerconnection::PlayerConnection {
54        unsafe {
55            ::unity::il2cpp_call!((::unity::module_base()+0x32f5dc0usize)as*mut u8,crate::unity_engine::networking::player_connection::playerconnection::PlayerConnection;
56            )
57        }
58    }
59
60    #[doc = "`MessageCallbackInternal(::unity::IntPtr, u64, u64, ::unity::Il2CppString)` overload"]
61    pub fn message_callback_internal(
62        data: impl ::core::convert::Into<::unity::IntPtr>,
63        size: impl ::core::convert::Into<u64>,
64        guid: impl ::core::convert::Into<u64>,
65        message_id: impl ::core::convert::Into<::unity::Il2CppString>,
66    ) -> () {
67        unsafe {
68            ::unity::il2cpp_call!((::unity::module_base()+0x32f7380usize)as*mut u8,();
69(::unity::IntPtr)::core::convert::Into::into(data),(u64)::core::convert::Into::into(size),(u64)::core::convert::Into::into(guid),(::unity::Il2CppString)::core::convert::Into::into(message_id))
70        }
71    }
72
73    #[doc = "`ConnectedCallbackInternal(i32)` overload"]
74    pub fn connected_callback_internal(player_id: impl ::core::convert::Into<i32>) -> () {
75        unsafe {
76            ::unity::il2cpp_call!((::unity::module_base()+0x32f78f0usize)as*mut u8,();
77(i32)::core::convert::Into::into(player_id))
78        }
79    }
80
81    #[doc = "`DisconnectedCallback(i32)` overload"]
82    pub fn disconnected_callback(player_id: impl ::core::convert::Into<i32>) -> () {
83        unsafe {
84            ::unity::il2cpp_call!((::unity::module_base()+0x32f7980usize)as*mut u8,();
85(i32)::core::convert::Into::into(player_id))
86        }
87    }
88}
89
90#[cfg(feature = "unity_engine-networking-player_connection-playerconnection")]
91pub trait IPlayerConnectionMethods: IPlayerConnection {
92    #[doc = "`get_isConnected()` overload"]
93    fn get_is_connected(self) -> bool {
94        unsafe {
95            let __receiver = <PlayerConnection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
96            ::unity::il2cpp_call!((::unity::module_base()+0x32f5e80usize)as*mut u8,bool;
97(PlayerConnection)__receiver)
98        }
99    }
100    #[doc = "`OnEnable()` overload"]
101    fn on_enable(self) -> () {
102        unsafe {
103            let __receiver = <PlayerConnection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
104            ::unity::il2cpp_call!((::unity::module_base()+0x32f6030usize)as*mut u8,();
105(PlayerConnection)__receiver)
106        }
107    }
108    #[doc = "`GetConnectionNativeApi()` overload"]
109    fn get_connection_native_api(self) -> crate::unity_engine::iplayereditorconnectionnative::IPlayerEditorConnectionNative {
110        unsafe {
111            let __receiver = <PlayerConnection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
112            ::unity::il2cpp_call!((::unity::module_base()+0x32f5f90usize)as*mut u8,crate::unity_engine::iplayereditorconnectionnative::IPlayerEditorConnectionNative;
113(PlayerConnection)__receiver)
114        }
115    }
116    #[doc = "`RegisterConnection(crate::unity_engine::events::unityaction_1::UnityAction_1<i32>)` overload"]
117    fn register_connection(self, callback: impl ::core::convert::Into<crate::unity_engine::events::unityaction_1::UnityAction_1<i32>>) -> () {
118        unsafe {
119            let __receiver = <PlayerConnection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
120            {
121                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
122                let __vi = *__vt.get(6usize).unwrap_or_else(|| {
123                    panic!(
124                        "unity: virtual slot {}
125 out of range (vtable len {}
126) on the runtime class behind {}
127 (method `{}
128`)",
129                        6usize,
130                        __vt.len(),
131                        <PlayerConnection as ::unity::ClassIdentity>::NAME,
132                        "RegisterConnection",
133                    )
134                });
135                let __inner: extern "C" fn(
136                    PlayerConnection,
137                    crate::unity_engine::events::unityaction_1::UnityAction_1<i32>,
138                    ::unity::OptionalMethod,
139                ) -> () = ::core::mem::transmute(__vi.method_ptr);
140                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
141                __inner(__receiver, ::core::convert::Into::into(callback), __mi)
142            }
143        }
144    }
145    #[doc = "`RegisterDisconnection(crate::unity_engine::events::unityaction_1::UnityAction_1<i32>)` overload"]
146    fn register_disconnection(self, callback: impl ::core::convert::Into<crate::unity_engine::events::unityaction_1::UnityAction_1<i32>>) -> () {
147        unsafe {
148            let __receiver = <PlayerConnection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
149            {
150                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
151                let __vi = *__vt.get(7usize).unwrap_or_else(|| {
152                    panic!(
153                        "unity: virtual slot {}
154 out of range (vtable len {}
155) on the runtime class behind {}
156 (method `{}
157`)",
158                        7usize,
159                        __vt.len(),
160                        <PlayerConnection as ::unity::ClassIdentity>::NAME,
161                        "RegisterDisconnection",
162                    )
163                });
164                let __inner: extern "C" fn(
165                    PlayerConnection,
166                    crate::unity_engine::events::unityaction_1::UnityAction_1<i32>,
167                    ::unity::OptionalMethod,
168                ) -> () = ::core::mem::transmute(__vi.method_ptr);
169                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
170                __inner(__receiver, ::core::convert::Into::into(callback), __mi)
171            }
172        }
173    }
174    #[doc = "`UnregisterConnection(crate::unity_engine::events::unityaction_1::UnityAction_1<i32>)` overload"]
175    fn unregister_connection(self, callback: impl ::core::convert::Into<crate::unity_engine::events::unityaction_1::UnityAction_1<i32>>) -> () {
176        unsafe {
177            let __receiver = <PlayerConnection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
178            {
179                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
180                let __vi = *__vt.get(8usize).unwrap_or_else(|| {
181                    panic!(
182                        "unity: virtual slot {}
183 out of range (vtable len {}
184) on the runtime class behind {}
185 (method `{}
186`)",
187                        8usize,
188                        __vt.len(),
189                        <PlayerConnection as ::unity::ClassIdentity>::NAME,
190                        "UnregisterConnection",
191                    )
192                });
193                let __inner: extern "C" fn(
194                    PlayerConnection,
195                    crate::unity_engine::events::unityaction_1::UnityAction_1<i32>,
196                    ::unity::OptionalMethod,
197                ) -> () = ::core::mem::transmute(__vi.method_ptr);
198                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
199                __inner(__receiver, ::core::convert::Into::into(callback), __mi)
200            }
201        }
202    }
203    #[doc = "`UnregisterDisconnection(crate::unity_engine::events::unityaction_1::UnityAction_1<i32>)` overload"]
204    fn unregister_disconnection(self, callback: impl ::core::convert::Into<crate::unity_engine::events::unityaction_1::UnityAction_1<i32>>) -> () {
205        unsafe {
206            let __receiver = <PlayerConnection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
207            {
208                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
209                let __vi = *__vt.get(9usize).unwrap_or_else(|| {
210                    panic!(
211                        "unity: virtual slot {}
212 out of range (vtable len {}
213) on the runtime class behind {}
214 (method `{}
215`)",
216                        9usize,
217                        __vt.len(),
218                        <PlayerConnection as ::unity::ClassIdentity>::NAME,
219                        "UnregisterDisconnection",
220                    )
221                });
222                let __inner: extern "C" fn(
223                    PlayerConnection,
224                    crate::unity_engine::events::unityaction_1::UnityAction_1<i32>,
225                    ::unity::OptionalMethod,
226                ) -> () = ::core::mem::transmute(__vi.method_ptr);
227                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
228                __inner(__receiver, ::core::convert::Into::into(callback), __mi)
229            }
230        }
231    }
232    #[doc = "`DisconnectAll()` overload"]
233    fn disconnect_all(self) -> () {
234        unsafe {
235            let __receiver = <PlayerConnection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
236            {
237                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
238                let __vi = *__vt.get(12usize).unwrap_or_else(|| {
239                    panic!(
240                        "unity: virtual slot {}
241 out of range (vtable len {}
242) on the runtime class behind {}
243 (method `{}
244`)",
245                        12usize,
246                        __vt.len(),
247                        <PlayerConnection as ::unity::ClassIdentity>::NAME,
248                        "DisconnectAll",
249                    )
250                });
251                let __inner: extern "C" fn(PlayerConnection, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
252                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
253                __inner(__receiver, __mi)
254            }
255        }
256    }
257    #[doc = "`.ctor()` overload"]
258    fn ctor(self) -> () {
259        unsafe {
260            let __receiver = <PlayerConnection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
261            ::unity::il2cpp_call!((::unity::module_base()+0x32f7a10usize)as*mut u8,();
262(PlayerConnection)__receiver)
263        }
264    }
265}
266
267#[cfg(feature = "unity_engine-networking-player_connection-playerconnection")]
268impl<__T: IPlayerConnection> IPlayerConnectionMethods for __T {}
269
270#[cfg(feature = "unity_engine-networking-player_connection-playerconnection")]
271impl PlayerConnection {
272    pub fn get_instance_method_info() -> &'static ::unity::il2cpp::MethodInfo {
273        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
274    }
275
276    pub fn get_is_connected_method_info() -> &'static ::unity::il2cpp::MethodInfo {
277        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
278    }
279
280    pub fn create_instance_method_info() -> &'static ::unity::il2cpp::MethodInfo {
281        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
282    }
283
284    pub fn on_enable_method_info() -> &'static ::unity::il2cpp::MethodInfo {
285        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
286    }
287
288    pub fn get_connection_native_api_method_info() -> &'static ::unity::il2cpp::MethodInfo {
289        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
290    }
291
292    pub fn register_connection_method_info() -> &'static ::unity::il2cpp::MethodInfo {
293        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
294    }
295
296    pub fn register_disconnection_method_info() -> &'static ::unity::il2cpp::MethodInfo {
297        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[8]
298    }
299
300    pub fn unregister_connection_method_info() -> &'static ::unity::il2cpp::MethodInfo {
301        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[9]
302    }
303
304    pub fn unregister_disconnection_method_info() -> &'static ::unity::il2cpp::MethodInfo {
305        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[10]
306    }
307
308    pub fn disconnect_all_method_info() -> &'static ::unity::il2cpp::MethodInfo {
309        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[14]
310    }
311
312    pub fn message_callback_internal_method_info() -> &'static ::unity::il2cpp::MethodInfo {
313        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[15]
314    }
315
316    pub fn connected_callback_internal_method_info() -> &'static ::unity::il2cpp::MethodInfo {
317        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[16]
318    }
319
320    pub fn disconnected_callback_method_info() -> &'static ::unity::il2cpp::MethodInfo {
321        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[17]
322    }
323
324    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
325        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[18]
326    }
327}
328
329#[cfg(feature = "unity_engine-networking-player_connection-playerconnection")]
330impl PlayerConnection {
331    #[doc = "Direct (non-virtual) call to `PlayerConnection`'s own `RegisterConnection`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
332    pub unsafe fn register_connection(
333        this: impl ::core::convert::Into<::unity::IlInstance>,
334        callback: crate::unity_engine::events::unityaction_1::UnityAction_1<i32>,
335    ) -> () {
336        let __mi = Self::register_connection_method_info();
337        let __inner: extern "C" fn(
338            ::unity::IlInstance,
339            crate::unity_engine::events::unityaction_1::UnityAction_1<i32>,
340            ::unity::OptionalMethod,
341        ) -> () = ::core::mem::transmute(__mi.method_ptr);
342        __inner(this.into(), callback, ::core::option::Option::None)
343    }
344
345    #[doc = "Direct (non-virtual) call to `PlayerConnection`'s own `RegisterDisconnection`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
346    pub unsafe fn register_disconnection(
347        this: impl ::core::convert::Into<::unity::IlInstance>,
348        callback: crate::unity_engine::events::unityaction_1::UnityAction_1<i32>,
349    ) -> () {
350        let __mi = Self::register_disconnection_method_info();
351        let __inner: extern "C" fn(
352            ::unity::IlInstance,
353            crate::unity_engine::events::unityaction_1::UnityAction_1<i32>,
354            ::unity::OptionalMethod,
355        ) -> () = ::core::mem::transmute(__mi.method_ptr);
356        __inner(this.into(), callback, ::core::option::Option::None)
357    }
358
359    #[doc = "Direct (non-virtual) call to `PlayerConnection`'s own `UnregisterConnection`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
360    pub unsafe fn unregister_connection(
361        this: impl ::core::convert::Into<::unity::IlInstance>,
362        callback: crate::unity_engine::events::unityaction_1::UnityAction_1<i32>,
363    ) -> () {
364        let __mi = Self::unregister_connection_method_info();
365        let __inner: extern "C" fn(
366            ::unity::IlInstance,
367            crate::unity_engine::events::unityaction_1::UnityAction_1<i32>,
368            ::unity::OptionalMethod,
369        ) -> () = ::core::mem::transmute(__mi.method_ptr);
370        __inner(this.into(), callback, ::core::option::Option::None)
371    }
372
373    #[doc = "Direct (non-virtual) call to `PlayerConnection`'s own `UnregisterDisconnection`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
374    pub unsafe fn unregister_disconnection(
375        this: impl ::core::convert::Into<::unity::IlInstance>,
376        callback: crate::unity_engine::events::unityaction_1::UnityAction_1<i32>,
377    ) -> () {
378        let __mi = Self::unregister_disconnection_method_info();
379        let __inner: extern "C" fn(
380            ::unity::IlInstance,
381            crate::unity_engine::events::unityaction_1::UnityAction_1<i32>,
382            ::unity::OptionalMethod,
383        ) -> () = ::core::mem::transmute(__mi.method_ptr);
384        __inner(this.into(), callback, ::core::option::Option::None)
385    }
386
387    #[doc = "Direct (non-virtual) call to `PlayerConnection`'s own `DisconnectAll`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
388    pub unsafe fn disconnect_all(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
389        let __mi = Self::disconnect_all_method_info();
390        let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
391        __inner(this.into(), ::core::option::Option::None)
392    }
393}
394
395#[cfg(feature = "unity_engine-networking-player_connection-playerconnection")]
396impl PlayerConnection {
397    #[doc = "`.ctor()` — no args"]
398    pub fn new() -> Self {
399        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
400            panic!(
401                "{}
402::{}
403 failed to instantiate",
404                ::core::stringify!(PlayerConnection),
405                ::core::stringify!(new),
406            )
407        });
408        <Self as IPlayerConnectionMethods>::ctor(this);
409        this
410    }
411}
412
413#[cfg(feature = "unity_engine-networking-player_connection-playerconnection")]
414#[doc(hidden)]
415pub mod prelude {
416    pub use super::{IPlayerConnection, IPlayerConnectionMethods, PlayerConnection};
417    #[cfg(feature = "system-object")]
418    pub use crate::system::object::IObjectMethods;
419    #[cfg(feature = "unity_engine-object_2")]
420    pub use crate::unity_engine::object_2::IObject_2Methods;
421    #[cfg(feature = "unity_engine-scriptableobject")]
422    pub use crate::unity_engine::scriptableobject::IScriptableObjectMethods;
423    pub use crate::{
424        system::object::IObject,
425        unity_engine::{object_2::IObject_2, scriptableobject::IScriptableObject},
426    };
427}