public SendResult SendRequestWithResult()
        {
            if (logger.IsDebugEnabled)
            {
                logger.Debug("Sending list request.");
            }

            return(messageSender.TrySendMessage(OperationType.Request, new GameServerListRequestPayload(), DeliveryMethod.ReliableOrdered, true));
        }
        public SendResult SendRequestWithResult()
        {
            SendResult result = messageSender.TrySendMessage(OperationType.Request, new AuthenticationRequest(loginDetails.LoginString, loginDetails.Password), DeliveryMethod.ReliableOrdered, true);

            //We don't need the login object anymore
            Destroy(loginDetails as UnityEngine.Object);

            return(result);
        }
        protected override void Start()
        {
            base.Start();

            //Broadcast spawn on start
            this.messageBroadcaster.SendEvent(new PlayerEntitySpawnEventPayload(guidContainer.NetworkGuid, entityTransform.position.ToSurrogate(), entityTransform.rotation.ToSurrogate()),
                                              DeliveryMethod.ReliableUnordered, false, 0);

            //After broadcasting this entities spawn we should send spawn events for each other connected player.
            foreach (var entity in entityCollection.Values.Where(e => e.NetworkGuid.EntityType == EntityType.Player))
            {
                //Don't send spawn event about self to self
                if (entity.NetworkGuid != guidContainer.NetworkGuid)
                {
                    peer.TrySendMessage(OperationType.Event, new PlayerEntitySpawnEventPayload(entity.NetworkGuid, entity.WorldObject.transform.position.ToSurrogate(), entity.WorldObject.transform.rotation.ToSurrogate()),
                                        DeliveryMethod.ReliableUnordered, false, 0);
                }
            }
        }