Pular para o conteúdo principal

Connection status

Description

This page contains the connection statuses used by NetStats_ConnectionStatus. These constants are used internally by RakNet (the networking library SA-MP uses).

Often used

IDStateMeaning
0CONNECTION_STATUS_NO_ACTION / CONNSTAT_NO_ACTIONWhenever a packet has to be sent to the client, it will be processed by a separate thread. As this thread is sending a packet, it is possible for the server to say... receive a disconnection packet, which may get processed in the meantime. This would result in data racing (and thus the behavior is undefined). To solve this problem, the connection state will change to CONNECTION_STATUS_NO_ACTION, and any changes to the player ID will not occur until the update thread has given the main thread the "green light". Now, as a server developer, this connection state is not really relevant to you, so you probably won't ever need it.
1CONNECTION_STATUS_DISCONNECT_ASAP / CONNSTAT_DISCONNECT_ASAPThe client is to be disconnected as soon as possible. It is possible for NetStats_ConnectionStatus to return this value during the disconnect process, specifically when a player is not yet "truely" disconnected, yet OnPlayerDisconnect may have fired already for this player.
2CONNECTION_STATUS_DISCONNECT_ASAP_SILENTLY / CONNSTAT_DISCONNECT_ASAP_SILNTThe client is to be disconnected as soon as possible, but without sending the ID_DISCONNECTION_NOTIFICATION packet to the client. SA-MP sends this in several cases (however SA-MP itself most likely doesn't, RakNet definitely does), for example when the server password is entered incorrectly.
3CONNECTION_STATUS_DISCONNECT_ON_NO_ACK / CONNSTAT_DISCONNECT_ON_NO_ACKUnknown.
4CONNECTION_STATUS_REQUESTED_CONNECTION / CONNSTAT_REQUESTED_CONNECTIONThe client has requested a connection with the server.
5CONNECTION_STATUS_HANDLING_CONNECTION_REQUEST / CONNSTAT_HANDLING_CONN_REQThe server is currently handling the connection request.
6CONNECTION_STATUS_UNVERIFIED_SENDER / CONNSTAT_UNVERIFIED_SENDERInitially, incoming connection requests appear to use UNVERIFIED_SENDER. While the client-server connection is in this state, only ID_CONNECTION_REQUEST packets are read. The server will automatically close the connection and add the client IP to a temporary blacklist if anything else is sent. Whether or not it is possible for NetStats_ConnectionStatus to return this status is doubtful.
7CONNECTION_STATUS_SET_ENCRYPTION_ON_MULTIPLE_16_BYTE_PACKET / CONNSTAT_SET_ENCRYPTION
Unknown.
8CONNECTION_STATUS_CONNECTED / CONNSTAT_CONNECTEDThe client is connected to the server.