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); } }
protected virtual bool SendProxyMessageToTarget(ProxyMessage message) { return(true); }
protected virtual bool ProxyMessageInTarget(ProxyMessage message) { return(true); }
protected virtual bool ProxyMessageReceived(ProxyMessage message) { return(true); }