Esempio n. 1
0
        public static void CreateNews(string message, eRealm realm, eNewsType type, bool sendMessage)
        {
            if (sendMessage)
            {
                foreach (GameClient client in WorldMgr.GetAllClients())
                {
                    if (client.Player == null)
                    {
                        continue;
                    }
                    if ((client.Account.PrivLevel != 1 || realm == eRealm.None) || client.Player.Realm == realm)
                    {
                        client.Out.SendMessage(message, eChatType.CT_System, eChatLoc.CL_SystemWindow);
                    }
                }
            }

            if (ServerProperties.Properties.RECORD_NEWS)
            {
                DBNews news = new DBNews();
                news.Type  = (byte)type;
                news.Realm = (byte)realm;
                news.Text  = message;
                GameServer.Database.AddObject(news);
                GameEventMgr.Notify(DatabaseEvent.NewsCreated, new NewsEventArgs(news));
            }
        }
Esempio n. 2
0
		public static void CreateNews(string message, eRealm realm, eNewsType type, bool sendMessage)
		{
			if (sendMessage)
			{
				foreach (GameClient client in WorldMgr.GetAllClients())
				{
					if (client.Player == null)
						continue;
					if ((client.Account.PrivLevel != 1 || realm == eRealm.None) || client.Player.Realm == realm)
					{
						client.Out.SendMessage(message, eChatType.CT_System, eChatLoc.CL_SystemWindow);
					}
				}
			}

			if (ServerProperties.Properties.RECORD_NEWS)
			{
				DBNews news = new DBNews();
				news.Type = (byte)type;
				news.Realm = (byte)realm;
				news.Text = message;
				GameServer.Database.AddObject(news);
				GameEventMgr.Notify(DatabaseEvent.NewsCreated, new NewsEventArgs(news));
			}
		}