Ejemplo n.º 1
0
        public void SendChat(ChatArgument arg)
        {
            SM_CHAT p = new SM_CHAT();

            p.Recipient(arg.Recipient, arg.Sender.ActorID);
            p.PutMessage(arg.Sender.Name, (byte)arg.Type, arg.Message);
            Network.SendPacket(p);
        }
Ejemplo n.º 2
0
        public void OnChat(CM_CHAT p)
        {
            string recipient = p.Recipient;
            string txt       = p.Text;

            if (!Commands.Instance.ProcessCommand(this, txt))
            {
                ChatArgument arg = new ChatArgument()
                {
                    Sender    = chara,
                    Type      = p.Type,
                    Recipient = recipient,
                    Message   = txt
                };
                switch (p.Type)
                {
                case ChatType.Whisper:
                    GameSession temp = GameClientManager.Instance.FindClient(p.Recipient);
                    if (temp != null)
                    {
                        map.OnEvent(MapEvents.CHAT, arg, chara, null);
                        map.OnEvent(MapEvents.CHAT, arg, temp.chara, null);
                    }
                    else
                    {
                        SM_CHAT_RESPONSE r = new SM_CHAT_RESPONSE()
                        {
                            MessageId = 17
                        };
                        Network.SendPacket(r);
                    }
                    break;

                case ChatType.UnknownParty:
                    break;

                case ChatType.General:
                default:
                    arg.Recipient = null;
                    map.SendEventToAllActorsWhoCanSeeActor(MapEvents.CHAT, arg, chara, true);
                    break;
                }
            }
        }
Ejemplo n.º 3
0
 public void OnChat(ChatArgument arg)
 {
     client.SendChat(arg);
 }