예제 #1
0
        public virtual void SendMessageToProxy(PrimaryMessage message)
        {
            if (message.MessageType == PrimaryMessageType.Ping)
            {
                message.MessageType = PrimaryMessageType.PingAnswer;
                Manager.ReceiveMessage(message);
                return;
            }
            var proxymes = new ProxyMessage();

            proxymes.Message = message;
            var user = Manager.Users.GetUserFromId(message.MessageRoot.RemoteId);
            var serv = Server.Find((server) => server.OwnedUser.Contains(user));

            if (user == null || serv == null)
            {
                message.IgnoreProxy = true;
                Manager.SendMessage(message);
            }
            else
            {
                proxymes.TargetId = user.GlobalId;
                proxymes.MessageRoot.SetFromUser(serv.ServerUser);
                var pm = new PrimaryMessage();
                pm.ClientData.SetMessage(proxymes);
                pm.MessageType = PrimaryMessageType.ProxySend;
                pm.MessageRoot.SetFromUser(serv.ServerUser);
                Manager.SendMessage(pm);
            }
        }
예제 #2
0
 protected virtual bool SendProxyMessageToTarget(ProxyMessage message)
 {
     return(true);
 }
예제 #3
0
 protected virtual bool ProxyMessageInTarget(ProxyMessage message)
 {
     return(true);
 }
예제 #4
0
 protected virtual bool ProxyMessageReceived(ProxyMessage message)
 {
     return(true);
 }