예제 #1
0
        private void OnConnected(object sender, NetChannelArgs args)
        {
            // request base info about the server
            var msgInfo = _net.CreateNetMessage <MsgServerInfoReq>();

            _net.ClientSendMessage(msgInfo);
        }
        public void SelectCharacter(int slot)
        {
            var msg = _netManager.CreateNetMessage <MsgSelectCharacter>();

            msg.SelectedCharacterIndex = slot;
            _netManager.ClientSendMessage(msg);
        }
예제 #3
0
        public void SelectCharacter(int slot)
        {
            Preferences = new PlayerPreferences(Preferences.Characters, slot, Preferences.AdminOOCColor);
            var msg = _netManager.CreateNetMessage <MsgSelectCharacter>();

            msg.SelectedCharacterIndex = slot;
            _netManager.ClientSendMessage(msg);
        }
예제 #4
0
#pragma warning restore 649

        /// <summary>
        /// Sends a message to the relevant system(s) server side.
        /// </summary>
        public void SendSystemNetworkMessage(EntitySystemMessage message)
        {
            var msg = _network.CreateNetMessage <MsgEntity>();

            msg.Type          = EntityMessageType.SystemMessage;
            msg.SystemMessage = message;
            _network.ClientSendMessage(msg);
        }
예제 #5
0
        public void StartSession()
        {
            if (!CanScript)
            {
                throw new InvalidOperationException("We do not have scripting permission.");
            }

            var msg = _netManager.CreateNetMessage <MsgScriptStart>();

            msg.ScriptSession = _nextSessionId++;
            _netManager.ClientSendMessage(msg);
        }
예제 #6
0
        public void HandleDeletion(IEntity entity)
        {
            if (!IsActive || !Eraser)
            {
                return;
            }

            var msg = NetworkManager.CreateNetMessage <MsgPlacement>();

            msg.PlaceType = PlacementManagerMessage.RequestEntRemove;
            msg.EntityUid = entity.Uid;
            NetworkManager.ClientSendMessage(msg);
        }
    public void SendGamePrototype(string prototype)
    {
        var msg = _netManager.CreateNetMessage <GamePrototypeLoadMessage>();

        msg.PrototypeData = prototype;
        _netManager.ClientSendMessage(msg);
    }
예제 #8
0
        private void AckGameState(uint sequence)
        {
            var msg = networkManager.CreateNetMessage <MsgStateAck>();

            msg.Sequence = sequence;
            networkManager.ClientSendMessage(msg);
        }
예제 #9
0
        private void AckGameState(GameTick sequence)
        {
            var msg = _network.CreateNetMessage <MsgStateAck>();

            msg.Sequence = sequence;
            _network.ClientSendMessage(msg);
        }
예제 #10
0
        /// <inheritdoc />
        public void Startup(INetChannel channel)
        {
            LocalPlayer = new LocalPlayer(_network, _config);

            var msgList = _network.CreateNetMessage <MsgPlayerListReq>();

            // message is empty
            _network.ClientSendMessage(msgList);
        }
예제 #11
0
        /// <summary>
        ///     Requests remote commands from server.
        /// </summary>
        public void SendServerCommandRequest()
        {
            if (_requestedCommands)
            {
                return;
            }

            if (!_network.IsConnected)
            {
                return;
            }

            var msg = _network.CreateNetMessage <MsgConCmdReg>();

            _network.ClientSendMessage(msg);

            _requestedCommands = true;
        }
예제 #12
0
        protected void SendMessage(EuiMessageBase msg)
        {
            var netMsg = _netManager.CreateNetMessage <MsgEuiMessage>();

            netMsg.Id      = Id;
            netMsg.Message = msg;

            _netManager.ClientSendMessage(netMsg);
        }
예제 #13
0
        protected void FinishPrompt(DMValueType responseType, object value)
        {
            if (_responseSent)
            {
                return;
            }
            _responseSent = true;

            var msg = _netManager.CreateNetMessage <MsgPromptResponse>();

            msg.PromptId = _promptId;
            msg.Type     = responseType;
            msg.Value    = value;
            _netManager.ClientSendMessage(msg);
        }
예제 #14
0
        private void BeforeBrowseHandler(IBeforeBrowseContext context)
        {
            if (string.IsNullOrEmpty(_webView.Url))
            {
                return;
            }

            Uri oldUri = new Uri(_webView.Url);
            Uri newUri = new Uri(context.Url);

            if (newUri.Scheme == "byond" || (newUri.AbsolutePath == oldUri.AbsolutePath && newUri.Query != String.Empty))
            {
                context.DoCancel();

                var msg = _netManager.CreateNetMessage <MsgTopic>();
                msg.Query = newUri.Query;
                _netManager.ClientSendMessage(msg);
            }
        }
예제 #15
0
        private void RequestPlacement()
        {
            if (CurrentPermission == null)
            {
                return;
            }
            if (!ValidPosition)
            {
                return;
            }

            var message = NetworkManager.CreateNetMessage <MsgPlacement>();

            message.PlaceType = PlacementManagerMessage.RequestPlacement;

            message.Align  = CurrentMode.ModeName;
            message.IsTile = CurrentPermission.IsTile;

            if (CurrentPermission.IsTile)
            {
                message.TileType = CurrentPermission.TileType;
            }
            else
            {
                message.EntityTemplateName = CurrentPermission.EntityType;
            }

            message.XValue    = CurrentMode.mouseCoords.X;
            message.YValue    = CurrentMode.mouseCoords.Y;
            message.GridIndex = CurrentMode.mouseCoords.GridID;
            message.MapIndex  = CurrentMode.mouseCoords.MapID;

            message.DirRcv = Direction;

            NetworkManager.ClientSendMessage(message, NetDeliveryMethod.ReliableUnordered);
        }
예제 #16
0
 private void OnRespawnButtonOnOnPressed(BaseButton.ButtonEventArgs args)
 {
     _netManager.ClientSendMessage(_netManager.CreateNetMessage <MsgSandboxRespawn>());
 }