示例#1
0
        /// <summary>
        /// Fires when client connected to room server
        /// </summary>
        protected virtual void OnClientConnectedToRoomServer()
        {
            logger.Info("We have successfully connected to the room server");

            roomServerConnection.RemoveConnectionListener(OnClientConnectedToRoomServer);
            roomServerConnection.SendMessage((short)MstMessageCodes.ValidateRoomAccessRequest, roomServerAccessInfo.Token, (status, response) =>
            {
                // If access denied
                if (status != ResponseStatus.Success)
                {
                    logger.Error(response.AsString());
                    OnAccessDiniedEvent?.Invoke();
                    return;
                }

                // If access granted
                OnAccessGrantedEvent?.Invoke();
            });
        }
示例#2
0
 protected virtual void OnDestroy()
 {
     // Remove listener
     _connection.RemoveConnectionListener(OnConnectedToMaster);
 }
 private void OnDestroy()
 {
     // Remove listener
     _connection.RemoveConnectionListener(OnConnectedToMaster);
 }