Exemplo n.º 1
0
        public override bool Process(ActionParameter parameter)
        {
            string        message = "【系统通知】 " + parameter.GetValue <string>("message");
            DynamicBuffer buffer  = new DynamicBuffer();

            buffer.WriteValue(message);
            DataPackage packet = new DataPackage(buffer, 100);

            foreach (var session in SessionClientPool.GetOnlineSession())
            {
                session.Send(packet);
            }
            return(true);
        }
Exemplo n.º 2
0
        public override bool Process(ActionParameter parameter)
        {
            List <string> onlineList = new List <string>();

            foreach (var session in SessionClientPool.GetOnlineSession())
            {
                onlineList.Add(session.GetRemoteAddress());
            }
            DynamicBuffer buffer = new DynamicBuffer(0);

            buffer.WriteObject(onlineList);
            DataPackage packet = new DataPackage(buffer, 100);

            Session.Send(packet);
            return(true);
        }