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); }
public void SelectCharacter(int slot) { Preferences = new PlayerPreferences(Preferences.Characters, slot, Preferences.AdminOOCColor); var msg = _netManager.CreateNetMessage <MsgSelectCharacter>(); msg.SelectedCharacterIndex = slot; _netManager.ClientSendMessage(msg); }
#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); }
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); }
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); }
private void AckGameState(uint sequence) { var msg = networkManager.CreateNetMessage <MsgStateAck>(); msg.Sequence = sequence; networkManager.ClientSendMessage(msg); }
private void AckGameState(GameTick sequence) { var msg = _network.CreateNetMessage <MsgStateAck>(); msg.Sequence = sequence; _network.ClientSendMessage(msg); }
/// <inheritdoc /> public void Startup(INetChannel channel) { LocalPlayer = new LocalPlayer(_network, _config); var msgList = _network.CreateNetMessage <MsgPlayerListReq>(); // message is empty _network.ClientSendMessage(msgList); }
/// <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; }
protected void SendMessage(EuiMessageBase msg) { var netMsg = _netManager.CreateNetMessage <MsgEuiMessage>(); netMsg.Id = Id; netMsg.Message = msg; _netManager.ClientSendMessage(netMsg); }
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); }
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); } }
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); }
private void OnRespawnButtonOnOnPressed(BaseButton.ButtonEventArgs args) { _netManager.ClientSendMessage(_netManager.CreateNetMessage <MsgSandboxRespawn>()); }