Enum valence_network::ConnectionMode
source · #[non_exhaustive]pub enum ConnectionMode {
Online {
prevent_proxy_connections: bool,
},
Offline,
BungeeCord,
Velocity {
secret: Arc<str>,
},
}
Expand description
Describes how new connections to the server are handled.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Online
The “online mode” fetches all player data (username, UUID, and properties) from the configured session server and enables encryption.
This mode should be used by all publicly exposed servers which are not behind a proxy.
Fields
prevent_proxy_connections: bool
Determines if client IP validation should take place during authentication.
When prevent_proxy_connections
is enabled, clients can no longer
log-in if they connected to the Yggdrasil server using a different
IP than the one used to connect to this server.
This is used by the default implementation of
NetworkCallbacks::session_server
. A different implementation may
choose to ignore this value.
Offline
Disables client authentication with the configured session server. Clients can join with any username and UUID they choose, potentially gaining privileges they would not otherwise have. Additionally, encryption is disabled and Minecraft’s default skins will be used.
This mode should be used for development purposes only and not for publicly exposed servers.
BungeeCord
This mode should be used under one of the following situations:
- The server is behind a BungeeCord/Waterfall proxy with IP forwarding enabled.
- The server is behind a Velocity proxy configured to use the
legacy
forwarding mode.
All player data (username, UUID, and properties) is fetched from the
proxy, but no attempt is made to stop connections originating from
elsewhere. As a result, you must ensure clients connect through the
proxy and are unable to connect to the server directly. Otherwise,
clients can use any username or UUID they choose similar to
ConnectionMode::Offline
.
To protect against this, a firewall can be used. However,
ConnectionMode::Velocity
is recommended as a secure alternative.
Velocity
This mode is used when the server is behind a Velocity proxy
configured with the forwarding mode modern
.
All player data (username, UUID, and properties) is fetched from the proxy and all connections originating from outside Velocity are blocked.
Trait Implementations§
source§impl Clone for ConnectionMode
impl Clone for ConnectionMode
source§fn clone(&self) -> ConnectionMode
fn clone(&self) -> ConnectionMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl PartialEq for ConnectionMode
impl PartialEq for ConnectionMode
impl StructuralPartialEq for ConnectionMode
Auto Trait Implementations§
impl Freeze for ConnectionMode
impl RefUnwindSafe for ConnectionMode
impl Send for ConnectionMode
impl Sync for ConnectionMode
impl Unpin for ConnectionMode
impl UnwindSafe for ConnectionMode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.