예제 #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));
            }
        }
예제 #2
0
파일: NewsMgr.cs 프로젝트: mynew4/DAoC
		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));
			}
		}