public void OnTextPacket(TextPacket packet) { Connection.SendPacketAsync(new TextPacket { Text = $"You said: {packet.Text}" }); }
// Token: 0x0600048B RID: 1163 RVA: 0x000188F4 File Offset: 0x00016AF4 public void _IDtpCgDjmC1AQOcZCJSFNAYjlbH(TextPacket text) { AntiSpam._NALkTCRxB8Bckmseeqnv7i0kCyI nalkTCRxB8Bckmseeqnv7i0kCyI = new AntiSpam._NALkTCRxB8Bckmseeqnv7i0kCyI(); if (text.NumStars < 0) { return; } string text2 = new string(text.Text.Where(new Func <char, bool>(AntiSpam._vivpEx53PFCsVvObdFSPnLCt1jI.< > 9._2dxsRhxa41ZKWVboSAEZpelfEdH)).ToArray <char>()).ToLower(); nalkTCRxB8Bckmseeqnv7i0kCyI._sZl5VVGwUNhpSevGpchDKxixKmq = string.Concat(new string[] { text2, "|", text2.Normalize(NormalizationForm.FormC), "|", text2.Normalize(NormalizationForm.FormD), "|", text2.Normalize(NormalizationForm.FormKC), "|", text2.Normalize(NormalizationForm.FormKD) }); IEnumerable <string> source = AntiSpam._bEmgoLZoxB0Dj38HfcyPeu2va8F.Where(new Func <string, bool>(nalkTCRxB8Bckmseeqnv7i0kCyI._q4iwLAZzsaapIsfQm7wlxlSVPoG)); text.Send = !source.Any <string>(); }
private void OnServerPacketReceived(object sender, PacketEventArgs e) { var worker = (SocketProxyWorker)sender; if (e.ID == tool.PacketTable.TEXT) { TextPacket packet = TextPacket.Read(new NBufferReader(e.Content)); e.Send = !tool.Filter.IsSpam(packet); var logSpam = tool.Settings.GetValue <bool>("spam.log", "true"); if (logSpam && !e.Send) { tool.AppendLog("<{0}> {1}", packet.name, packet.text); } } else if (e.ID == tool.PacketTable.FAILURE) { var reader = new NBufferReader(e.Content) { Position = 4 }; string msg = reader.ReadUTF(); tool.AppendLog("****{0}****", msg); } }
public void SendMessage(string message) { TextPacket pk = new TextPacket(); pk.Type = TextPacket.TYPE_RAW; pk.Message = message; this.SendPacket(pk); }
public void SendTextMessage(string message, uint objectID, bool sendAsReliable = false) { TextPacket textPacket = new TextPacket(); textPacket.payload = message; SendPacket(textPacket, objectID); }
private void OnText(Client client, TextPacket packet) { if (packet.Name == Name) { packet.Name = FakeName; packet.NumStars = Stars; } }
public void SendChat(string message, string xboxUserId = "") { TextPacket pk = new TextPacket(); pk.Type = TextPacket.TYPE_CHAT; pk.Message = message; pk.XboxUserId = xboxUserId; this.SendPacket(pk); }
protected override bool Process(Player player, RealmTime time, string[] args) { Random rand = new Random(); int Prob = rand.Next(0, 1); var inv = player.Inventory; string taskname = ""; switch (Prob) { case 0: for (int d = 0; d < inv.Length; d++) { if (inv[d] == null) { continue; } if (inv[d].ObjectId == "Sor Crystal") { for (int i = 0; i < inv.Length; i++) { if (inv[i] == null) { continue; } if (inv[i].ObjectId == "Task Tablet: Inactive") { inv[i] = player.Manager.GameData.Items[0x42c8]; inv[d] = null; player.UpdateCount++; player.SaveToCharacter(); taskname = "Search for Spirit"; return(false); } } } } break; } if (taskname == "") { player.SendInfo("You do not have to correct materials to activate a task."); } else { TextPacket packet = new TextPacket { BubbleTime = 0, Stars = -1, Name = "", Text = player.Name + " has activated the task [" + taskname + "]" }; player.Owner.BroadcastPacket(packet, null); player.SendInfo("A task has been activated!"); } return(true); }
private void OnText(Client client, Packet p) { TextPacket packet = p as TextPacket; if (packet.Name == client.PlayerData?.Name || packet.NumStars < 1) { return; } receiveMesssage?.Invoke(this, new MessageEventArgs(packet.Text, packet.Name, packet.Recipient == client.PlayerData?.Name ? true : false)); }
public void SendMessage(string message) { TextPacket pk = new TextPacket { Type = TextPacket.TYPE_RAW, Message = message }; this.SendPacket(pk); }
protected override bool Process(Player player, RealmTime time, string[] args) { Random rand = new Random(); int Prob = rand.Next(0, 1); var inv = player.Inventory; bool done = false; switch (Prob) { case 0: for (int d = 0; d < inv.Length; d++) { if (inv[d] == null) { continue; } if (inv[d].ObjectId == "Exanimation Stone") { for (int i = 0; i < inv.Length; i++) { if (inv[i] == null) { continue; } if (inv[i].ObjectId == "Sword of Dark Necromancy") { inv[i] = player.Manager.GameData.Items[0x47bd]; inv[d] = null; player.UpdateCount++; player.SaveToCharacter(); done = true; return(false); } } } } break; } if (done == false) { player.SendInfo("You do not have the Exanimation Stone in your inventory."); } else { TextPacket packet = new TextPacket { BubbleTime = 0, Stars = -1, Name = "", Text = player.Name + " has evolved a Sword of Dark Necromancy." }; player.Owner.BroadcastPacket(packet, null); } return(true); }
// Token: 0x060004EE RID: 1262 RVA: 0x0001C970 File Offset: 0x0001AB70 private void SendTextToClient(string text) { TextPacket textPacket = (TextPacket)Packet.Create(PacketType.TEXT); textPacket.CleanText = text; textPacket.Text = textPacket.CleanText; textPacket.NumStars = -1; textPacket.Name = ""; textPacket.Recipient = ""; this.client.SendToClient(textPacket); }
private void _ProcessPacket(Packet p) { switch (p.type) { case PacketType.Ping: { // userId = 0일 경우 ping용 패킷 // 그 외는 아이디 할당 if (p.userId != 0) { id = p.userId; } } break; case PacketType.Text: { TextPacket t = (TextPacket)p; Application.Current.Dispatcher.Invoke(() => { _mainWindow.ShowMessage(t.text, t.userId); }); } break; case PacketType.Draw: { DrawPacket dp = (DrawPacket)p; Application.Current.Dispatcher.Invoke(() => { _mainWindow.Draw(dp); }); } break; case PacketType.Clear: { Application.Current.Dispatcher.Invoke(() => { _mainWindow.ClearDrawing(); }); } break; case PacketType.PlayerList: { PlayerListPacket pl = (PlayerListPacket)p; players = pl.list; Application.Current.Dispatcher.Invoke(() => { _mainWindow.ShowPlayers(); }); } break; case PacketType.Ready: { ReadyPacket rp = (ReadyPacket)p; turn = rp.turn; word = rp.word; Application.Current.Dispatcher.Invoke(() => { _mainWindow.ShowWord(); }); } break; } }
private void OnTextPacketReceived(Client client, TextPacket packet) { if (packet.Text.Contains("ORYXSH0P.NET")) { var editAccListPacket = Packet.Create(PacketType.EDITACCOUNTLIST) as EditAccountListPacket; editAccListPacket.Add = true; editAccListPacket.AccountListId = 1; editAccListPacket.ObjectId = packet.ObjectId; client.SendToServer(editAccListPacket); packet.Send = false; } }
// Token: 0x0600047F RID: 1151 RVA: 0x0001807C File Offset: 0x0001627C public void Text(TextPacket text) { if (!this._selfInGuild) { return; } if (text.NumStars == -1) { if (text.Recipient == "*Guild*" && text.Text.Contains(this.client.Player.Guild)) { if (!text.Text.StartsWith("{\"key\":\"server.guild_join\",\"tokens\":{\"name\":\"")) { if (text.Text.Contains(" has left ")) { string[] array = text.Text.Split(new string[] { " has left " }, StringSplitOptions.RemoveEmptyEntries); if (array.Length != 2) { return; } string name = array[0].ToLower(); string guild = array[1]; this._UpdateIfPlayerFound(name, guild); } } else { string[] array = text.Text.Split(new string[] { "{\"key\":\"server.guild_join\",\"tokens\":{\"name\":\"" }, StringSplitOptions.RemoveEmptyEntries); if (array.Length != 1) { return; } array = array[0].Split(new string[] { "\",\"guild\":\"" }, StringSplitOptions.RemoveEmptyEntries); if (array.Length != 2) { return; } string name2 = array[0].ToLower(); string guild2 = array[1].Substring(0, array[1].Length - 3); this._UpdateIfPlayerFound(name2, guild2); return; } } } }
public void Execute(Player player, string[] args) { if (player.Guild != "") { try { string saytext = string.Join(" ", args); foreach (var w in RealmManager.Worlds) { World world = w.Value; if (w.Key != 0) // 0 is limbo?? { foreach (var i in world.Players) { if (i.Value.Guild == player.Guild) { if (saytext == "" || saytext == null) { player.SendHelp("Usage: /g <text>"); } else { var tp = new TextPacket { BubbleTime = 10, Stars = player.Stars, Name = player.ResolveGuildChatName(), Recipient = "*Guild*", Text = saytext }; if (world.Id == player.Owner.Id) { tp.ObjectId = player.Id; } i.Value.Client.SendPacket(tp); } } } } } } catch { player.SendInfo("Cannot guild chat!"); } } else { player.SendInfo("You need to be in a guild to use guild chat!"); } }
/// <summary> /// Creates an in-game message with the error format and coloring. /// </summary> /// <param name="message">Message text</param> /// <returns></returns> public static TextPacket CreateErrorNotification(string message) { TextPacket tpacket = Packet.Create <TextPacket>(PacketType.TEXT); tpacket.BubbleTime = 0; tpacket.CleanText = message; tpacket.Name = "*Error*"; tpacket.NumStars = -1; tpacket.ObjectId = -1; tpacket.Recipient = string.Empty; tpacket.Text = message; return(tpacket); }
/// <summary> /// Creates an in-game message with the Oryx format and coloring. /// </summary> /// <param name="sender">Message sender</param> /// <param name="message">Message text</param> /// <returns></returns> public static TextPacket CreateOryxNotification(string sender, string message) { TextPacket tpacket = (TextPacket)Packet.Create(PacketType.TEXT); tpacket.BubbleTime = 0; tpacket.CleanText = message; tpacket.Name = "#" + sender; tpacket.NumStars = -1; tpacket.ObjectId = -1; tpacket.Recipient = ""; tpacket.Text = message; return(tpacket); }
public static TextPacket SendSystemMessage(string message) { TextPacket obj = (TextPacket)Packet.CreatePacketFromType(PacketType.TEXT); obj._StarBackground = 0; obj._Message = message; obj._Name = string.Empty; obj._NumStars = -1; obj._ObjectId = -1; obj._Recipient = string.Empty; obj._CleanMessage = message; return(obj); }
// Token: 0x06000436 RID: 1078 RVA: 0x000169FC File Offset: 0x00014BFC public static TextPacket _mUSCETHrZHWd7DqaW04ilsvEbiCA(string sender, string message) { TextPacket cbwOjnzusZzuPkHfx7wuwePHqrf = (TextPacket)Packet.Create(PacketType.TEXT); cbwOjnzusZzuPkHfx7wuwePHqrf.BubbleTime = 0; cbwOjnzusZzuPkHfx7wuwePHqrf.CleanText = message; cbwOjnzusZzuPkHfx7wuwePHqrf.Name = ""; cbwOjnzusZzuPkHfx7wuwePHqrf.NumStars = -1; cbwOjnzusZzuPkHfx7wuwePHqrf.ObjectId = -1; cbwOjnzusZzuPkHfx7wuwePHqrf.Recipient = ""; cbwOjnzusZzuPkHfx7wuwePHqrf.Text = (string.IsNullOrEmpty(sender) ? message : ("<" + sender + "> " + message)); return(cbwOjnzusZzuPkHfx7wuwePHqrf); }
// Token: 0x06000437 RID: 1079 RVA: 0x00016A68 File Offset: 0x00014C68 public static TextPacket _FqfB8lZabDqgXbSDkwlX4ALcdCp(string message) { TextPacket cbwOjnzusZzuPkHfx7wuwePHqrf = Packet._queixqbllHBpUVN7AOyM0TqcZNH <TextPacket>(PacketType.TEXT); cbwOjnzusZzuPkHfx7wuwePHqrf.BubbleTime = 0; cbwOjnzusZzuPkHfx7wuwePHqrf.CleanText = message; cbwOjnzusZzuPkHfx7wuwePHqrf.Name = string.Empty; cbwOjnzusZzuPkHfx7wuwePHqrf.NumStars = -1; cbwOjnzusZzuPkHfx7wuwePHqrf.ObjectId = -1; cbwOjnzusZzuPkHfx7wuwePHqrf.Recipient = string.Empty; cbwOjnzusZzuPkHfx7wuwePHqrf.Text = message; return(cbwOjnzusZzuPkHfx7wuwePHqrf); }
public static TextPacket _AXNXHsenc7q4bGIXtJncJXAdxxW(string message) { TextPacket obj = (TextPacket)Packet.CreatePacketFromType(PacketType.TEXT); obj._StarBackground = 0; obj._Message = message; obj._Name = string.Empty; obj._NumStars = -1; obj._ObjectId = -1; obj._Recipient = string.Empty; obj._CleanMessage = message; return(obj); }
public static TextPacket _cuj5TuKzQrJc4m81deq6Jyw3r0H(string name, string message) { TextPacket obj = (TextPacket)Packet.CreatePacketFromType(PacketType.TEXT); obj._StarBackground = 0; obj._Message = message; obj._Name = name; obj._NumStars = -1; obj._ObjectId = -1; obj._Recipient = string.Empty; obj._CleanMessage = message; return(obj); }
/// <summary> /// Creates an in-game message with the announcement format and coloring. /// </summary> /// <param name="message">Message text</param> /// <returns></returns> public static TextPacket CreateAnnouncement(string message) { TextPacket tpacket = Packet.Create <TextPacket>(PacketType.TEXT); tpacket.BubbleTime = 0; tpacket.CleanText = message; tpacket.Name = string.Empty; tpacket.NumStars = -1; tpacket.ObjectId = -1; tpacket.Recipient = string.Empty; tpacket.Text = message; return(tpacket); }
public static TextPacket SendToPlayer(string sender, string message) { TextPacket obj = (TextPacket)Packet.CreatePacketFromType(PacketType.TEXT); obj._StarBackground = 0; obj._Message = message; obj._Name = (sender.StartsWith("#") ? sender : ("#" + sender)); obj._NumStars = -1; obj._ObjectId = -1; obj._Recipient = ""; obj._CleanMessage = (string.IsNullOrEmpty(sender) ? message : ("<" + sender + "> " + message)); return(obj); }
// Token: 0x06000507 RID: 1287 RVA: 0x0001DBD0 File Offset: 0x0001BDD0 internal void _IDtpCgDjmC1AQOcZCJSFNAYjlbH(TextPacket text) { if (!this._vb0DX76k2oGNsxzar6rSoSPQjNG) { return; } if (text.NumStars > -1) { return; } Console.WriteLine("O3 text: <" + text.Name + "> " + text.Text); this._jD069csRPo3TtZu4eUegBA1njRh = this._KbHw3Ra3u250PHwUB4Qi44L9irF.Contains(text.Text); }
public static TextPacket Announce(string message, string name) { TextPacket textPacket = (TextPacket)Packet.Create(PacketType.TEXT); textPacket.BubbleTime = 0; textPacket.CleanText = message; textPacket.Name = name; textPacket.NumStars = -1; textPacket.ObjectId = -1; textPacket.Recipient = ""; textPacket.Text = "<Mila> " + message; return(textPacket); }
private void OnConnectCommand(Client client, string command, string[] args) { if (args.Length == 0) { string LastConnection = ((MapInfoPacket)client.State["MapInfo"]).Name; string Text = GameData.GameData.Servers.Map.Single(x => x.Value.Address == Proxy.DefaultServer).Value.Name + ", "; Text += LastConnection == "Realm of the Mad God" ? client.State.LastReconnect.Name.Split('.').Last() : LastConnection; Text += GameData.GameData.Servers.Map.Where(x => x.Value.Address == client.State.ConTargetAddress).Count() == 0 ? client.State.LastRealm.Name.Split('.').Last() : LastConnection; TextPacket tpacket = (TextPacket)Packet.Create(PacketType.TEXT); tpacket.BubbleTime = 184; tpacket.NumStars = -1; tpacket.ObjectId = -1; tpacket.Name = ""; tpacket.Recipient = ""; tpacket.CleanText = ""; tpacket.Text = Text; client.SendToClient(tpacket); } else if (args.Length == 1) { string serverNameUpper = args[0].ToUpper(); IEnumerable <ServerStructure> servers = GameData.GameData.Servers.Map.Where(x => x.Key == serverNameUpper || x.Value.Name.ToUpper() == serverNameUpper).Select(x => x.Value); if (servers.Count() == 1) { ServerStructure server = servers.First(); ChangeDefault(server); ReconnectPacket reconnect = (ReconnectPacket)Packet.Create(PacketType.RECONNECT); reconnect.Host = server.Address; reconnect.Port = 2050; reconnect.GameId = -2; reconnect.Name = "Nexus"; reconnect.IsFromArena = false; reconnect.Key = new byte[0]; reconnect.KeyTime = 0; reconnect.Stats = string.Empty; SendReconnect(client, reconnect); } else { client.SendToClient(PluginUtils.CreateOryxNotification("K Relay", "Unknown server!")); } } }
protected override void TickCore(Entity host, RealmTime time, ref object state) { if (state == null) { return; } int cool = (int)state; Status = CycleStatus.NotStarted; if (cool <= 0) { TextPacket packet = new TextPacket { Name = "#" + (host.ObjectDesc.DisplayId ?? host.ObjectDesc.ObjectId), ObjectId = host.Id, Stars = -1, BubbleTime = 5, Recipient = "", Text = text, CleanText = "" }; if (text.Contains("{PLAYER}")) { Entity player = host.GetNearestEntity(10, null); if (player == null) { return; } text.Replace("{PLAYER}", player.Name); } text.Replace("{HP}", (host as Enemy).HP.ToString()); foreach (Player i in host.Owner.PlayersCollision.HitTest(host.X, host.Y, 999).OfType <Player>()) { if (host.Dist(i) < 999) { i.Client.SendPacket(packet); } } } else { cool -= time.thisTickTimes; Status = CycleStatus.InProgress; } state = cool; }
public void SendMessage(string message, params object[] args) { List <string> list = new List <string>(); for (int i = 0; i < args.Length; ++i) { list.Add(args[i].ToString()); } TextPacket pk = new TextPacket(); pk.Type = TextPacket.TYPE_TRANSLATION; pk.Message = message; pk.IsLocalized = true; pk.Parameters = list.ToArray(); this.SendPacket(pk); }