public void Update() { ChatText.Document.Blocks.Clear(); var tempItem = (from x in Client.AllPlayers where x.Value.Username == (string)Client.ChatItem.PlayerLabelName.Content select x.Value).FirstOrDefault(); if (tempItem != null) { foreach (var x in tempItem.Messages.ToArray()) { var message = x.Split('|'); var tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd); if (message[0] == tempItem.Username) { tr.Text = DateTime.Now.ToString("[HH:mm] ") + tempItem.Username + ": "; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Turquoise); } else { tr.Text = DateTime.Now.ToString("[HH:mm] ") + message[0] + ": "; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Yellow); } tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd) { Text = x.Replace(message[0] + "|", string.Empty) + Environment.NewLine }; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.White); } } ChatText.ScrollToEnd(); }
public void Update() { ChatText.Document.Blocks.Clear(); ChatPlayerItem tempItem = (from x in Client.AllPlayers where x.Value.Username == (string)Client.ChatItem.PlayerLabelName.Content select x.Value).FirstOrDefault(); if (tempItem != null) { foreach (string x in tempItem.Messages.ToArray()) { string[] message = x.Split('|'); var tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd); if (message[0] == tempItem.Username) { tr.Text = tempItem.Username + ": "; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Gold); } else { tr.Text = message[0] + ": "; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.SteelBlue); } tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd) { Text = x.Replace(message[0] + "|", "") + Environment.NewLine }; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.White); } } ChatText.ScrollToEnd(); }
private void SendButton_Click(object sender, RoutedEventArgs e) { var tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd) { Text = Client.LoginPacket.AllSummonerData.Summoner.Name + ": " }; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.SteelBlue); tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd) { Text = ChatTextBox.Text + Environment.NewLine }; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.White); ChatPlayerItem tempItem = null; string jid = ""; foreach ( var x in Client.AllPlayers.Where(x => x.Value.Username == (string)Client.ChatItem.PlayerLabelName.Content)) { tempItem = x.Value; jid = x.Key + "@pvp.net"; break; } if (tempItem != null) { tempItem.Messages.Add(Client.LoginPacket.AllSummonerData.Summoner.Name + "|" + ChatTextBox.Text); } ChatText.ScrollToEnd(); Client.ChatClient.Message(jid, Environment.NewLine + ChatTextBox.Text); ChatTextBox.Text = ""; }
public override void Write() { _worldPacket.WriteUInt8((byte)SlashCmd); _worldPacket.WriteUInt32((uint)_Language); _worldPacket.WritePackedGuid(SenderGUID); _worldPacket.WritePackedGuid(SenderGuildGUID); _worldPacket.WritePackedGuid(SenderAccountGUID); _worldPacket.WritePackedGuid(TargetGUID); _worldPacket.WriteUInt32(TargetVirtualAddress); _worldPacket.WriteUInt32(SenderVirtualAddress); _worldPacket.WritePackedGuid(PartyGUID); _worldPacket.WriteUInt32(AchievementID); _worldPacket.WriteFloat(DisplayTime); _worldPacket.WriteBits(SenderName.GetByteCount(), 11); _worldPacket.WriteBits(TargetName.GetByteCount(), 11); _worldPacket.WriteBits(Prefix.GetByteCount(), 5); _worldPacket.WriteBits(Channel.GetByteCount(), 7); _worldPacket.WriteBits(ChatText.GetByteCount(), 12); _worldPacket.WriteBits((byte)_ChatFlags, 14); _worldPacket.WriteBit(HideChatLog); _worldPacket.WriteBit(FakeSenderName); _worldPacket.WriteBit(Unused_801.HasValue); _worldPacket.FlushBits(); _worldPacket.WriteString(SenderName); _worldPacket.WriteString(TargetName); _worldPacket.WriteString(Prefix); _worldPacket.WriteString(Channel); _worldPacket.WriteString(ChatText); if (Unused_801.HasValue) { _worldPacket.WriteUInt32(Unused_801.Value); } }
public void init(string jsonData) { // 优先使用热更新的代码 if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("ChatData_hotfix", "init")) { ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.ChatData_hotfix", "init", null, jsonData); return; } m_chatTextList.Clear(); // string jsonData = Resources.Load("Entity/chat").ToString(); JsonData jd = JsonMapper.ToObject(jsonData); for (int i = 0; i < jd.Count; i++) { ChatText temp = new ChatText(); temp.m_id = (int)jd[i]["id"]; temp.m_text = (string)jd[i]["text"]; m_chatTextList.Add(temp); } OtherData.s_getNetEntityFile.GetFileSuccess("chat.json"); }
public void AddFriendChat(string id, ChatText chatText) { if (this.allFriends.ContainsKey(id)) { if (this.allFriendChat.ContainsKey(id)) { this.allFriendChat[id].transform.SetAsFirstSibling(); this.allFriendChat[id].UpdateShow(chatText); } else { Prefab_chat component = this.pool_chat.GetNGUIItem().GetComponent <Prefab_chat>(); component.InitShow(this.allFriends[id].PlayerInfo, chatText); component.transform.SetAsFirstSibling(); this.allFriendChat.Add(id, component); } } else { this.RemoveFriendChat(id); } this.obj_chatHintPoint.SetActive(this.CheckIsShowChatTipPoint()); this.UpdateFriendTip(); this.grid_chat.repositionNow = true; }
public void ChatBubbleAdd(ChatText chatText) { for (int i = 0; i < chatBubble.Count; i++) { if (chatBubble[i].Sender == chatText.Sender) { chatBubble[i] = chatText; bubbleOffsets[i].x = 0; bubbleOffsets[i].y = 0; bubbleOffsets[i].Width = 0; bubbleOffsets[i].Height = 0; bubbleOffsets[i].extra = noRepeats; noRepeats++; return; } } BubbleOffset bubbleOffset = new BubbleOffset(); bubbleOffset.name = chatText.Sender.ToString(); bubbleOffset.extra = noRepeats; noRepeats++; chatBubble.Add(chatText); bubbleOffsets.Add(bubbleOffset); }
public void InitShow(UserInfo userInfo, ChatText chatText) { this.curUserInfo = userInfo; AsyncImageDownload.Instance.SetAsyncImage(userInfo.headUrl, new Action <Texture2D>(this.AsyncGetHeadCallback)); this.lable_nick.text = this.curUserInfo.nick; this.UpdateShow(chatText); }
public TextLogEntry CreateTextLogEntry(ChannelSettings channel, uint senderId, List <Payload> senderPayLoads, List <Payload> payloads) { ChatText text = new ChatText { Channel = channel, SenderId = senderId, Timestamp = DateTime.Now, IncludePrefix = true, Sender = null }; if (senderPayLoads != null) { var senderInfo = ProcessPayloads(senderPayLoads, channel); if (senderInfo.Count() > 0) { var sender = senderInfo[0]; switch (channel.Name) { case "StandardEmote": break; case "CustomEmote": text.Sender = sender; break; case "TellOutgoing": sender.Text = $">> {sender.Text}: "; text.Sender = sender; break; case "TellIncoming": sender.Text = $"{sender.Text} >> "; text.Sender = sender; break; case "Party": sender.Text = $"({sender.Text}) "; text.Sender = sender; break; default: sender.Text = $"{sender.Text}: "; text.Sender = sender; break; } } } else { text.IncludePrefix = false; } text.Text = ProcessPayloads(payloads, channel); TextLogEntry textLogEntry = new TextLogEntry(text); return(textLogEntry); }
void FixedUpdate() { if (IfAdd == true) { if (m < 1) { m += 1f * Time.deltaTime * 0.8f; Chat.GetComponent <SpriteRenderer>().color = new Color(255, 255, 255, m); if (m > 1) { StartCoroutine("ChatTextAnim"); } } if (n < 1.3 && IfChat == true) { n += 1f * Time.deltaTime * 0.5f; ChatText.GetComponent <SpriteRenderer>().color = new Color(255, 255, 255, n); StartCoroutine("ChatTextFalse"); } } else { if (n > -1) { n -= 1f * Time.deltaTime * 0.8f; m -= 1f * Time.deltaTime * 0.5f; ChatText.GetComponent <SpriteRenderer>().color = new Color(255, 255, 255, n); Chat.GetComponent <SpriteRenderer>().color = new Color(255, 255, 255, m); } } }
void XmppConnection_OnMessage(object sender, Message msg) { if (!roomName.Contains(msg.From.User)) { return; } if (msg.From.Resource == Client.LoginPacket.AllSummonerData.Summoner.Name) { return; } Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() => { if (msg.Body == "This room is not anonymous") { return; } var tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd) { Text = msg.From.Resource + ": " }; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Turquoise); tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd) { Text = msg.Body.Replace("<![CDATA[", "").Replace("]]>", string.Empty) + Environment.NewLine }; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.White); ChatText.ScrollToEnd(); })); }
public void reqChat(ChatText chatText) { // 优先使用热更新的代码 if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("ChatPanelScript_hotfix", "reqChat")) { ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.ChatPanelScript_hotfix", "reqChat", null, chatText); return; } if (m_canChat) { m_canChat = false; if (m_parentScript != null) { m_parentScript.reqChat(1, chatText.m_id); } else if (m_parentScript_ddz != null) { m_parentScript_ddz.m_DDZ_NetReqLogic.reqChat(1, chatText.m_id); } Invoke("onInvoke", 4); } else { ToastScript.createToast("请隔3秒再发送"); } }
private void SendButton_MouseUp(object sender, MouseEventArgs e) { if (SendText.Text.Trim() != "") { String[] userQuestion = SendText.Text.Split(new String[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); string message = userQuestion[0]; // для отправки боту userQuestion[0] = userQuestion[0].Insert(0, "[" + DateTime.Now.ToString("HH:mm") + "] " + bot.UserName + ": "); bot.AddToHistory(userQuestion); // добавляем вопрос в файл ChatText.AppendText(userQuestion[0] + "\r\n"); SendText.Text = ""; // очищаем поле отправки string[] botAnswer = new string[] { bot.Answer(message) }; botAnswer[0] = botAnswer[0].Insert(0, "[" + DateTime.Now.ToString("HH:mm") + "] Бот: "); ChatText.AppendText(botAnswer[0] + Environment.NewLine); bot.AddToHistory(botAnswer); // добавляем ответ бота в файл } }
public void Broadcast(string message) { foreach (var tab in items) { ChatText tmp = new ChatText(); tmp.Time = GetTime(); tmp.ChannelShort = "[N]"; tmp.Channel = "Notice"; tmp.Sender = ""; tmp.ChannelColour = ConvertForArray("Notice"); List <TextTypes> rawtext = new List <TextTypes>(); PayloadType payloadType = PayloadType.RawText; TextTypes wrangler = new TextTypes(); wrangler.Text = message; wrangler.Type = payloadType; rawtext.Add(wrangler); tmp.Text = rawtext; tab.Chat.Add(tmp); if (tab.Chat.Count > 256) { tab.Chat.RemoveAt(0); } if (tab.AutoScroll == true) { tab.Scroll = true; } } }
public void Tran(XivChatType type, string messageString, string senderName) { string output = Translate(messageString); if (injectChat == true) { PrintChat(type, senderName, lTr + output + rTr); } foreach (var tab in items) { if (tab.Logs[ConvertForArray(type.ToString())] && tab.Config[2]) { ChatText tmp = new ChatText(); tmp.Time = GetTime(); tmp.ChannelShort = GetChannelName(type.ToString()); tmp.Channel = type.ToString(); tmp.Sender = senderName; TextTypes translate = new TextTypes(); translate.Text = lTr + output + rTr; translate.Type = PayloadType.RawText; tmp.Text.Add(translate); tab.Chat.Add(tmp); } } }
private void SendButton_Click(object sender, RoutedEventArgs e) { var tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd) { Text = Client.LoginPacket.AllSummonerData.Summoner.Name + ": " }; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Yellow); tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd) { Text = ChatTextBox.Text + Environment.NewLine }; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.White); if (String.IsNullOrEmpty(ChatTextBox.Text)) { return; } _newRoom.PublicMessage(ChatTextBox.Text); ChatTextBox.Text = ""; ChatText.ScrollToEnd(); }
public void Log(ChatText text) { //todo: Async writing not working well in tab console System.Console.CursorVisible = false; var top = Math.Max(0, System.Console.CursorTop); if (!GuiApp.Pause) { System.Console.SetCursorPosition(0, top); System.Console.Write(new string(' ', ConsoleUtils.Width - 1)); System.Console.SetCursorPosition(0, top); text.SetNext(new ChatText("\n", TextColor.Reset)); } text.PrintNext(GuiApp.ConsoleColors); if (!GuiApp.Pause) { System.Console.SetCursorPosition(0, top + text.GetLines(ConsoleUtils.Width).Count >= System.Console.BufferHeight ? Math.Max(0, System.Console.BufferHeight - 1) : Math.Max(0, top + text.GetLines(ConsoleUtils.Width).Count)); } if (!GuiApp.Pause) { SetCursorPos(); } }
public void Update() { ChatText.Document.Blocks.Clear(); ChatPlayerItem tempItem = null; foreach (KeyValuePair <string, ChatPlayerItem> x in Client.AllPlayers) { if (x.Value.Username == (string)Client.ChatItem.PlayerLabelName.Content) { tempItem = x.Value; break; } } foreach (string x in tempItem.Messages.ToArray()) { string[] Message = x.Split('|'); TextRange tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd); if (Message[0] == tempItem.Username) { tr.Text = tempItem.Username + ": "; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Gold); } else { tr.Text = Message[0] + ": "; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.SteelBlue); } tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd); tr.Text = x.Replace(Message[0] + "|", "") + Environment.NewLine; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.White); } ChatText.ScrollToEnd(); }
private void SendButton_Click(object sender, RoutedEventArgs e) { TextRange tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd); tr.Text = Client.LoginPacket.AllSummonerData.Summoner.Name + ": "; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.SteelBlue); tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd); tr.Text = ChatTextBox.Text + Environment.NewLine; tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.White); ChatPlayerItem tempItem = null; string JID = ""; foreach (KeyValuePair <string, ChatPlayerItem> x in Client.AllPlayers) { if (x.Value.Username == (string)Client.ChatItem.PlayerLabelName.Content) { tempItem = x.Value; JID = x.Key + "@pvp.net"; break; } } tempItem.Messages.Add(Client.LoginPacket.AllSummonerData.Summoner.Name + "|" + ChatTextBox.Text); ChatText.ScrollToEnd(); Client.ChatClient.Message(JID, Environment.NewLine + ChatTextBox.Text); ChatTextBox.Text = ""; }
public ServerListPingResponse(ServerListPingResponseVersion version, ServerListPingResponsePlayerList players, ChatText description, string faviconString) { Version = version; Players = players; Description = description; FaviconString = faviconString; }
/// <summary> /// </summary> /// <param name="character"> /// </param> public override void CommandHelp(ICharacter character) { character.Playfield.Publish( ChatText.CreateIM( character, "Usage: Select target and /command giveitem id ql\r\nIt doesn't matter if high or low id is given")); return; }
public void Kick(ChatText reason) { new Disconnect(Wrapper) { Reason = reason }.Write(); SavePlayer(); }
/// <summary> /// </summary> /// <param name="character"> /// </param> /// <exception cref="NotImplementedException"> /// </exception> public override void CommandHelp(ICharacter character) { character.Playfield.Publish( ChatText.CreateIM( character, "Teleports you\r\n" + "Usage: /tp [float] [float] [int] (X, Z, Playfield)\r\n" + "Or: /tp [float] [float] y [float] [int] (X, Z, Y, Playfield)")); }
public void BroadcastChat(ChatText message, ChatMessageType type, Player sender) { foreach (var lvl in Globals.LevelManager.GetLevels()) { lvl.BroadcastChat(message, type, sender); } Globals.LevelManager.MainLevel.BroadcastChat(message, type, sender); }
private void RestoreHistory() { Archive.Read(); ChatText.Text = Archive.IsExists() && !Archive.IsEmpty() ? Archive.GetMessages() : Bob.SayGreetings() + "\n"; ChatText.Focus(); ChatText.CaretIndex = ChatText.Text.Length; ChatText.ScrollToEnd(); }
public void UpdateShow(ChatText chatText) { this.label_chatText.text = chatText.chatInfo; DateTime dateTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)).AddMilliseconds((double)chatText.time); this.IsShowTipPoint(true); this.lable_time.text = dateTime.ToString("yyyy/MM/dd HH:mm:ss"); }
void Start() { if (NPC != null) { _npcText = NPC.GetComponent <ChatText>(); } _triggered = false; }
/// <summary> /// </summary> /// <param name="character"> /// </param> /// <param name="target"> /// </param> /// <param name="args"> /// </param> public override void ExecuteCommand(ICharacter character, Identity target, string[] args) { IInstancedEntity targetEntity = null; // Fall back to self it no target is selected if ((targetEntity = character.Playfield.FindByIdentity(target)) == null) { targetEntity = character; } IItemContainer container = targetEntity as IItemContainer; // Does this entity have a BaseInventory? if (container != null) { int lowId; int highId; int ql; if (!int.TryParse(args[1], out lowId)) { character.Playfield.Publish(ChatText.CreateIM(character, "LowId is no number")); return; } if (!int.TryParse(args[2], out ql)) { character.Playfield.Publish(ChatText.CreateIM(character, "QualityLevel is no number")); return; } // Determine low and high id depending on ql lowId = ItemLoader.ItemList[lowId].GetLowId(ql); highId = ItemLoader.ItemList[lowId].GetHighId(ql); Item item = new Item(ql, lowId, highId); if (ItemLoader.ItemList[lowId].IsStackable()) { item.MultipleCount = ItemLoader.ItemList[lowId].getItemAttribute(212); } InventoryError err = container.BaseInventory.TryAdd(item); if (err != InventoryError.OK) { character.Playfield.Publish( ChatText.CreateIM(character, "Could not add to inventory. (" + err + ")")); } if (targetEntity as Character != null) { AddTemplate.Send((targetEntity as Character).Client, item); } } else { character.Playfield.Publish(ChatText.CreateIM(character, "Target has no Inventory.")); } }
public void Begin(ChatText first, ChatText other) { _npcText = first; _playerText = other; _triggered = true; // REEEEEE BeginConversation(); }
/// <summary> /// </summary> /// <param name="client"> /// </param> /// <param name="quality"> /// </param> public static void TradeSkillBuildPressed(ZoneClient client, int quality) { TradeSkillInfo source = client.Character.TradeSkillSource; TradeSkillInfo target = client.Character.TradeSkillTarget; Item sourceItem = client.Character.BaseInventory.GetItemInContainer(source.Container, source.Placement); Item targetItem = client.Character.BaseInventory.GetItemInContainer(target.Container, target.Placement); TradeSkillEntry ts = TradeSkill.Instance.GetTradeSkillEntry(sourceItem.HighID, targetItem.HighID); quality = Math.Min(quality, ItemLoader.ItemList[ts.ResultHighId].Quality); if (ts != null) { if (WindowBuild(client, quality, ts, sourceItem, targetItem)) { Item newItem = new Item(quality, ts.ResultLowId, ts.ResultHighId); InventoryError inventoryError = client.Character.BaseInventory.TryAdd(newItem); if (inventoryError == InventoryError.OK) { AddTemplate.Send(client, newItem); // Delete source? if ((ts.DeleteFlag & 1) == 1) { client.Character.BaseInventory.RemoveItem(source.Container, source.Placement); DeleteItem.Send(client, source.Container, source.Placement); } // Delete target? if ((ts.DeleteFlag & 2) == 2) { client.Character.BaseInventory.RemoveItem(target.Container, target.Placement); DeleteItem.Send(client, target.Container, target.Placement); } client.Character.Playfield.Publish( ChatText.CreateIM( client.Character, SuccessMessage( sourceItem, targetItem, new Item(quality, ts.ResultLowId, ts.ResultHighId)))); client.Character.Stats[StatIds.xp].Value += CalculateXP(quality, ts); } } } else { client.Character.Playfield.Publish( ChatText.CreateIM( client.Character, "It is not possible to assemble those two items. Maybe the order was wrong?")); client.Character.Playfield.Publish(ChatText.CreateIM(client.Character, "No combination found!")); } }