예제 #1
0
        public static void UserChat(WvsGameClient c, CInPacket p)
        {
            p.Decode4();
            var sText        = p.DecodeString();
            var bOnlyBalloon = p.Decode1() != 0;

            if (sText.Length >= sbyte.MaxValue)
            {
                return;
            }

            var handle = ServerApp.Container.Resolve <CommandHandle>();

            if (!handle.Execute(c.Character, sText))
            {
                var bAdmin = c.Account.AccountData.Admin > 0;
                CCurseProcess.ProcessString(sText, out var output);

                if (output.Length <= 0)
                {
                    return;
                }

                c.Character.Field.Broadcast(CPacket.UserChat(c.Character.dwId, output, bAdmin, bOnlyBalloon));
            }
        }
예제 #2
0
        public void DoChat(Character pFrom, string sMsg)
        {
            if (sMsg.Length > Constants.MaxChatMessageLength || sMsg.Length <= 0)
            {
                pFrom.Socket.Disconnect();
                return;
            }

            CCurseProcess.ProcessString(sMsg, out string processedString);

            Broadcast(ChatMessage(processedString), pFrom);
        }