예제 #1
0
        public virtual enHelperActivityType Process(ref Socket soUDP,
                                                    ref IPEndPoint remoteIpEndPoint, string sessionID, Encoding enc)
        {
            ProcessCommand(ref soUDP, ref remoteIpEndPoint, sessionID, enc);

            // handle 555 BANNED and 598 - UNKNOWN COMMAND
            if (ResponseCode == 598)
            {
                return(enHelperActivityType.UnknownCommand_598);
            }
            if (ResponseCode == 555)
            {
                return(enHelperActivityType.Banned_555);
            }

            if (errorOccurred)
            {
                return(enHelperActivityType.NoSuchNotify);
            }

            // Process Response
            string sMsgType = socketResponse.Substring(0, 3);


            switch (sMsgType)
            {
            case "292":
            {
                NotifyMessage = new Raw_AniDB_NotifyMessage(socketResponse);
                return(enHelperActivityType.GotNotifyGet);
            }

            case "293":
            {
                NotifyAlert = new Raw_AniDB_NotifyAlert(socketResponse);
                return(enHelperActivityType.GotNotifyGet);
            }

            case "392":
            case "393":
            {
                return(enHelperActivityType.NoSuchNotify);
            }

            case "501":
            {
                return(enHelperActivityType.LoginRequired);
            }
            }

            return(enHelperActivityType.GotNotifyList);
        }
예제 #2
0
		public virtual enHelperActivityType Process(ref Socket soUDP,
			ref IPEndPoint remoteIpEndPoint, string sessionID, Encoding enc)
		{
			ProcessCommand(ref soUDP, ref remoteIpEndPoint, sessionID, enc);

			// handle 555 BANNED and 598 - UNKNOWN COMMAND
			if (ResponseCode == 598) return enHelperActivityType.UnknownCommand_598;
			if (ResponseCode == 555) return enHelperActivityType.Banned_555;

			if (errorOccurred) return enHelperActivityType.NoSuchNotify;

			// Process Response
			string sMsgType = socketResponse.Substring(0, 3);


			switch (sMsgType)
			{
				case "292":
					{

						NotifyMessage = new Raw_AniDB_NotifyMessage(socketResponse);
						return enHelperActivityType.GotNotifyGet;
					}

				case "293":
					{

						NotifyAlert = new Raw_AniDB_NotifyAlert(socketResponse);
						return enHelperActivityType.GotNotifyGet;

					}
				case "392":
				case "393":
					{
						return enHelperActivityType.NoSuchNotify;
					}
				case "501":
					{
						return enHelperActivityType.LoginRequired;
					}
			}

			return enHelperActivityType.GotNotifyList;

		}