protected void FillFrom(CommandParameterGroup currrentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currrentParameterGroup == null)
                throw new ArgumentNullException("currrentParameterGroup");


            ChannelId = currrentParameterGroup.GetParameterValue<uint>("cid");
            ParentChannelId = currrentParameterGroup.GetParameterValue<uint>("pid");
            Order = currrentParameterGroup.GetParameterValue<uint>("channel_order");
            Name = currrentParameterGroup.GetParameterValue("channel_name");
            TotalClients = currrentParameterGroup.GetParameterValue<int>("total_clients");

            Topic = currrentParameterGroup.GetParameterValue("channel_topic");

            IsDefaultChannel = currrentParameterGroup.GetParameterValue<byte?>("channel_flag_default").ToNullableBool();
            IsPasswordProtected = currrentParameterGroup.GetParameterValue<byte?>("channel_flag_password").ToNullableBool();
            IsPermanent = currrentParameterGroup.GetParameterValue<byte?>("channel_flag_permanent").ToNullableBool();
            IsSemiPermanent = currrentParameterGroup.GetParameterValue<byte?>("channel_flag_semi_permanent").ToNullableBool();

            Codec = currrentParameterGroup.GetParameterValue<ushort?>("channel_codec");
            CodecQuality = currrentParameterGroup.GetParameterValue<double?>("channel_codec_quality");
            NeededTalkPower = currrentParameterGroup.GetParameterValue<uint?>("channel_needed_talk_power");

            MaxClients = currrentParameterGroup.GetParameterValue<int?>("channel_maxclients");
            MaxFamilyClients = currrentParameterGroup.GetParameterValue<int?>("channel_maxfamilyclients");
            ChannelIconId = currrentParameterGroup.GetParameterValue<uint?>("channel_icon_id");
        }
示例#2
0
        public static LogEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            String message = currentParameterGroup.GetParameterValue("l");

            DateTime timeStamp;
            DateTime.TryParse(message.Split('|')[0], System.Globalization.CultureInfo.CurrentCulture, System.Globalization.DateTimeStyles.None, out timeStamp);

            LogLevel logLevel = LogLevel.None;
            if (message.Split('|').Length >= 2 && Enum.GetNames(typeof(LogLevel)).Contains(message.Split('|')[1].Trim(), StringComparer.CurrentCultureIgnoreCase))
            {
                logLevel = (LogLevel)Enum.Parse(typeof(LogLevel), message.Split('|')[1].Trim(), true);
            }

            return new LogEntry
            {
                TimeStamp = timeStamp,
                LogLevel = logLevel,
                LastPos = firstParameterGroup.GetParameterValue<uint>("last_pos"),
                FileSize = firstParameterGroup.GetParameterValue<uint>("file_size"),
                Message = message
            };
        }
        public static ServerListItem Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException("currentParameterGroup");
            }

            string statusString        = currentParameterGroup.GetParameterValue("virtualserver_status");
            VirtualServerStatus status = VirtualServerStatusHelper.Parse(statusString);
            uint?uptime = currentParameterGroup.GetParameterValue <uint?>("virtualserver_uptime");

            return(new ServerListItem
            {
                UniqueId = currentParameterGroup.GetParameterValue("virtualserver_unique_identifier"),
                ServerId = currentParameterGroup.GetParameterValue <uint>("virtualserver_id"),
                ServerPort = currentParameterGroup.GetParameterValue <ushort>("virtualserver_port"),
                ServerStatus = status,
                ServerNumberOfClientsOnline = currentParameterGroup.GetParameterValue <uint?>("virtualserver_clientsonline"),
                ServerNumberOfQueryClientsOnline = currentParameterGroup.GetParameterValue <uint?>("virtualserver_queryclientsonline"),
                ServerMaximumClientsAllowed = currentParameterGroup.GetParameterValue <uint?>("virtualserver_maxclients"),
                ServerUptime = uptime.HasValue ? (TimeSpan?)TimeSpan.FromSeconds(uptime.Value) : null,
                ServerName = currentParameterGroup.GetParameterValue("virtualserver_name"),
                ServerAutoStart = currentParameterGroup.GetParameterValue("virtualserver_autostart") == "1",
                ServerMachineId = currentParameterGroup.GetParameterValue("virtualserver_machine_id"),
            });
        }
        protected override void OnPostApplyResponse()
        {
            CommandParameterGroup firstGroup = BodyCommandParameterGroupList.FirstOrDefault();

            Values = BodyCommandParameterGroupList.Select(currentGroup =>
            {
                TEntity entity = new TEntity();
                entity.ApplyFrom(currentGroup, firstGroup);

                return(entity);
            }).ToList();

            //if (ValueName == null)
            //    throw new InvalidOperationException("ValueName was not set and is null!");

            //if (BodyCommandParameterGroupList.Count == 0 || (ValueName == null && ParseMethod == null))
            //    Value = new List<TEntity>();

            //if (ParseMethod != null)
            //{
            //    CommandParameterGroup firstGroup = BodyCommandParameterGroupList.FirstOrDefault();
            //    Value = BodyCommandParameterGroupList.Select(currentGroup => ParseMethod(currentGroup, firstGroup)).ToList();
            //}
            //else
            //    Value = BodyCommandParameterGroupList.Select(cpg => cpg.GetParameterValue(ValueName).ChangeTypeInvariant(default(TEntity))).ToList();
        }
        protected void FillFrom(CommandParameterGroup currrentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currrentParameterGroup == null)
            {
                throw new ArgumentNullException("currentParameterGroup");
            }


            ChannelId       = currrentParameterGroup.GetParameterValue <uint>("cid");
            ParentChannelId = currrentParameterGroup.GetParameterValue <uint>("pid");
            Order           = currrentParameterGroup.GetParameterValue <uint>("channel_order");
            Name            = currrentParameterGroup.GetParameterValue("channel_name");
            TotalClients    = currrentParameterGroup.GetParameterValue <int>("total_clients");

            Topic = currrentParameterGroup.GetParameterValue("channel_topic");

            IsDefaultChannel    = currrentParameterGroup.GetParameterValue <byte?>("channel_flag_default").ToNullableBool();
            IsPasswordProtected = currrentParameterGroup.GetParameterValue <byte?>("channel_flag_password").ToNullableBool();
            IsPermanent         = currrentParameterGroup.GetParameterValue <byte?>("channel_flag_permanent").ToNullableBool();
            IsSemiPermanent     = currrentParameterGroup.GetParameterValue <byte?>("channel_flag_semi_permanent").ToNullableBool();

            Codec           = currrentParameterGroup.GetParameterValue <ushort?>("channel_codec");
            CodecQuality    = currrentParameterGroup.GetParameterValue <double?>("channel_codec_quality");
            NeededTalkPower = currrentParameterGroup.GetParameterValue <uint?>("channel_needed_talk_power");

            MaxClients       = currrentParameterGroup.GetParameterValue <int?>("channel_maxclients");
            MaxFamilyClients = currrentParameterGroup.GetParameterValue <int?>("channel_maxfamilyclients");
            ChannelIconId    = currrentParameterGroup.GetParameterValue <uint?>("channel_icon_id");
        }
        LogEntry IEntity <LogEntry> .ApplyFrom(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException(nameof(currentParameterGroup));
            }

            string message = currentParameterGroup.GetParameterValue("l");

            DateTime timeStamp;

            DateTime.TryParse(message.Split('|')[0], System.Globalization.CultureInfo.CurrentCulture, System.Globalization.DateTimeStyles.None, out timeStamp);

            LogLevel logLevel = LogLevel.None;

            if (message.Split('|').Length >= 2 && Enum.GetNames(typeof(LogLevel)).Contains(message.Split('|')[1].Trim(), StringComparer.CurrentCultureIgnoreCase))
            {
                logLevel = (LogLevel)Enum.Parse(typeof(LogLevel), message.Split('|')[1].Trim(), true);
            }

            TimeStamp = timeStamp;
            LogLevel  = logLevel;
            LastPos   = firstParameterGroup.GetParameterValue <uint>("last_pos");
            FileSize  = firstParameterGroup.GetParameterValue <uint>("file_size");
            Message   = message;

            return(this);
        }
示例#7
0
        ServerGroupClient IEntity <ServerGroupClient> .ApplyFrom(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            DatabaseId = currentParameterGroup.GetParameterValue <uint>("cldbid");
            Nickname   = currentParameterGroup.GetParameterValue("client_nickname");
            UniqueId   = currentParameterGroup.GetParameterValue("client_unique_identifier");

            return(this);
        }
 public static ServerGroupClient Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
 {
     return new ServerGroupClient
     {
         DatabaseId = currentParameterGroup.GetParameterValue<uint>("cldbid"),
         Nickname = currentParameterGroup.GetParameterValue("client_nickname"),
         UniqueId = currentParameterGroup.GetParameterValue("client_unique_identifier"),
     };
 }
示例#9
0
 public static ServerGroupClient Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
 {
     return(new ServerGroupClient
     {
         DatabaseId = currentParameterGroup.GetParameterValue <uint>("cldbid"),
         Nickname = currentParameterGroup.GetParameterValue("client_nickname"),
         UniqueId = currentParameterGroup.GetParameterValue("client_unique_identifier"),
     });
 }
示例#10
0
        protected virtual void ApplyFrom(CommandParameterGroup currentParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException(nameof(currentParameterGroup));
            }

            Id   = currentParameterGroup.GetParameterValue <uint>("sgid");
            Name = currentParameterGroup.GetParameterValue("name");
        }
示例#11
0
        public static ChannelFindEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new ChannelFindEntry
                   {
                       Id = currentParameterGroup.GetParameterValue<uint>("cid"),
                       Name = currentParameterGroup.GetParameterValue("channel_name"),
                   };
        }
示例#12
0
        public static ServerGroupLight Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new ServerGroupLight
                   {
                       Id = currentParameterGroup.GetParameterValue<uint>("sgid"),
                       Name = currentParameterGroup.GetParameterValue("name")
                   };
        }
示例#13
0
        public static ClientIdEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new ClientIdEntry
            {
                ClientId = currentParameterGroup.GetParameterValue<uint>("clid"),
                NickName = currentParameterGroup.GetParameterValue("name"),
            };
        }
示例#14
0
        protected override void OnPostApplyResponse()
        {
            base.OnPostApplyResponse();

            CommandParameterGroup firstCommandParameterGroup = BodyCommandParameterGroupList.Count == 0 ? null : BodyCommandParameterGroupList[0];

            if (firstCommandParameterGroup != null)
            {
                TotalClientsInDatabase = firstCommandParameterGroup.GetParameterValue <uint?>("count");
            }
        }
        protected void ApplyFrom(CommandParameterGroup currentParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException(nameof(currentParameterGroup));
            }

            ClientDatabaseId = currentParameterGroup.GetParameterValue <uint>("cldbid");
            Ident            = currentParameterGroup.GetParameterValue("ident");
            Value            = currentParameterGroup.GetParameterValue("value");
        }
        public static ChannelListEntry Parse(CommandParameterGroup currrentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currrentParameterGroup == null)
                throw new ArgumentNullException("currrentParameterGroup");

            ChannelListEntry result = new ChannelListEntry();
            result.FillFrom(currrentParameterGroup, firstParameterGroup);
            result.IsSubscribed = currrentParameterGroup.GetParameterValue<byte>("channel_flag_are_subscribed").ToBool();

            return result;
        }
        public static PermissionInfo Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new PermissionInfo
            {
                PermissionId = currentParameterGroup.GetParameterValue<uint>("permid"),
                PermissionName = currentParameterGroup.GetParameterValue("permsid"),
            };
        }
示例#18
0
        protected void FillFrom(CommandParameterGroup currrentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currrentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            IsSubscribed = currrentParameterGroup.GetParameterValue<byte>("channel_flag_are_subscribed").ToBool();
            ChannelId = currrentParameterGroup.GetParameterValue<uint>("cid");
            ParentChannelId = currrentParameterGroup.GetParameterValue<uint>("pid");
            Order = currrentParameterGroup.GetParameterValue<uint>("channel_order");
            Name = currrentParameterGroup.GetParameterValue("channel_name");
            TotalClients = currrentParameterGroup.GetParameterValue<uint?>("total_clients");
        }
        public static ChannelGroupClient Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new ChannelGroupClient
            {
                ChannelId = currentParameterGroup.GetParameterValue<uint>("cid"),
                ClientDatabaseId = currentParameterGroup.GetParameterValue<uint>("cldbid"),
                ChannelGroupId = currentParameterGroup.GetParameterValue<uint>("cgid"),
            };
        }
        PermissionInfo IEntity <PermissionInfo> .ApplyFrom(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException(nameof(currentParameterGroup));
            }

            PermissionId   = currentParameterGroup.GetParameterValue <uint>("permid");
            PermissionName = currentParameterGroup.GetParameterValue("permsid");

            return(this);
        }
        public static ChannelListEntry Parse(CommandParameterGroup currrentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currrentParameterGroup == null)
                throw new ArgumentNullException("currrentParameterGroup");

            ChannelListEntry result = new ChannelListEntry();
            result.FillFrom(currrentParameterGroup, firstParameterGroup);
            result.NeededSubscribePower = currrentParameterGroup.GetParameterValue<uint>("channel_needed_subscribe_power");
            result.TotalClientsFamily = currrentParameterGroup.GetParameterValue<int?>("total_clients_family");

            return result;
        }
        public static CustomSearchEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new CustomSearchEntry
            {
                ClientDatabaseId = currentParameterGroup.GetParameterValue<uint>("cldbid"),
                Ident = currentParameterGroup.GetParameterValue("ident"),
                Value = currentParameterGroup.GetParameterValue("value"),
            };
        }
        ClientIdEntry IEntity <ClientIdEntry> .ApplyFrom(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException(nameof(currentParameterGroup));
            }

            ClientId = currentParameterGroup.GetParameterValue <uint>("clid");
            NickName = currentParameterGroup.GetParameterValue("name");

            return(this);
        }
示例#24
0
        public static PermissionDetails Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new PermissionDetails
            {
                Id = currentParameterGroup.GetParameterValue<uint>("permid"),
                Name = currentParameterGroup.GetParameterValue("permname"),
                Description = currentParameterGroup.GetParameterValue("permdesc"),
            };
        }
示例#25
0
        public static ClientFindEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException("currentParameterGroup");
            }

            return(new ClientFindEntry
            {
                ClientId = currentParameterGroup.GetParameterValue <uint>("clid"),
                NickName = currentParameterGroup.GetParameterValue("client_nickname"),
            });
        }
示例#26
0
        PermissionDetails IEntity <PermissionDetails> .ApplyFrom(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException(nameof(currentParameterGroup));
            }

            Id          = currentParameterGroup.GetParameterValue <uint>("permid");
            Name        = currentParameterGroup.GetParameterValue("permname");
            Description = currentParameterGroup.GetParameterValue("permdesc");

            return(this);
        }
        public static PermissionInfo Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException("currentParameterGroup");
            }

            return(new PermissionInfo
            {
                PermissionId = currentParameterGroup.GetParameterValue <uint>("permid"),
                PermissionName = currentParameterGroup.GetParameterValue("permsid"),
            });
        }
        ChannelGroupClient IEntity <ChannelGroupClient> .ApplyFrom(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException(nameof(currentParameterGroup));
            }

            ChannelId        = currentParameterGroup.GetParameterValue <uint>("cid");
            ClientDatabaseId = currentParameterGroup.GetParameterValue <uint>("cldbid");
            ChannelGroupId   = currentParameterGroup.GetParameterValue <uint>("cgid");

            return(this);
        }
        public static ServerGroupLight Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException("currentParameterGroup");
            }

            return(new ServerGroupLight
            {
                Id = currentParameterGroup.GetParameterValue <uint>("sgid"),
                Name = currentParameterGroup.GetParameterValue("name")
            });
        }
示例#30
0
        public static LogEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new LogEntry
            {
                TimeStamp = new DateTime(1970, 1, 1).AddSeconds(currentParameterGroup.GetParameterValue<ulong>("timestamp")),
                LogLevel = (LogLevel)currentParameterGroup.GetParameterValue<uint>("level"),
                Channel = currentParameterGroup.GetParameterValue("channel"),
                Message = currentParameterGroup.GetParameterValue("msg")
            };
        }
        public static ChannelFindEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException("currentParameterGroup");
            }

            return(new ChannelFindEntry
            {
                Id = currentParameterGroup.GetParameterValue <uint>("cid"),
                Name = currentParameterGroup.GetParameterValue("channel_name"),
            });
        }
示例#32
0
        public static PermissionFindEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new PermissionFindEntry
            {
                T = currentParameterGroup.GetParameterValue<uint>("t"),
                Id1 = currentParameterGroup.GetParameterValue<uint>("id1"),
                Id2 = currentParameterGroup.GetParameterValue<uint>("id2"),
                PermissionId = currentParameterGroup.GetParameterValue<int>("p"),
            };
        }
        public static FileTransferFileEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new FileTransferFileEntry
            {
                ChannelId = firstParameterGroup.GetParameterValue<uint>("cid"),
                Name = currentParameterGroup.GetParameterValue("name"),
                Size = currentParameterGroup.GetParameterValue<ulong>("size"),
                Created = new DateTime(1970, 1, 1).AddSeconds(currentParameterGroup.GetParameterValue<ulong>("datetime")),
                Type = currentParameterGroup.GetParameterValue<uint?>("type"),
            };
        }
示例#34
0
        public static PermissionDetails Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException("currentParameterGroup");
            }

            return(new PermissionDetails
            {
                Id = currentParameterGroup.GetParameterValue <uint>("permid"),
                Name = currentParameterGroup.GetParameterValue("permname"),
                Description = currentParameterGroup.GetParameterValue("permdesc"),
            });
        }
示例#35
0
        public static ChannelListEntry Parse(CommandParameterGroup currrentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currrentParameterGroup == null)
                throw new ArgumentNullException("currrentParameterGroup");

            return new ChannelListEntry{
            IsSubscribed = currrentParameterGroup.GetParameterValue<byte>("channel_flag_are_subscribed").ToBool(),
            ChannelId = currrentParameterGroup.GetParameterValue<uint>("cid"),
            ParentChannelId = currrentParameterGroup.GetParameterValue<uint>("pid"),
            Order = currrentParameterGroup.GetParameterValue<uint>("channel_order"),
            Name = currrentParameterGroup.GetParameterValue("channel_name"),
            TotalClients = currrentParameterGroup.GetParameterValue<uint?>("total_clients"),
            };
        }
示例#36
0
        public new static ServerGroup Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new ServerGroup
            {
                Id = currentParameterGroup.GetParameterValue<uint>("sgid"),
                Name = currentParameterGroup.GetParameterValue("name"),
                Type = currentParameterGroup.GetParameterValue<ushort>("type"),
                IconId = currentParameterGroup.GetParameterValue<uint>("iconid"),
                SaveDb = currentParameterGroup.GetParameterValue("savedb") == "1",
            };
        }
示例#37
0
        public static Permission Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new Permission
            {
                Id = currentParameterGroup.GetParameter("permid") == null ? 0 : currentParameterGroup.GetParameterValue<uint>("permid"),
                Name = currentParameterGroup.GetParameterValue("permsid"),
                Value = currentParameterGroup.GetParameterValue<int>("permvalue"),
                Negated = currentParameterGroup.GetParameterValue("permnegated") == "1",
                Skip = currentParameterGroup.GetParameterValue("permskip") == "1"
            };
        }
示例#38
0
        public static Permission Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new Permission
            {
                Id = currentParameterGroup.GetParameter("permid") == null ? 0 : currentParameterGroup.GetParameterValue<uint>("permid"),
                Name = currentParameterGroup.GetParameterValue("permsid"),
                Value = currentParameterGroup.GetParameterValue<int>("permvalue"),
                Negated = currentParameterGroup.GetParameterValue("permnegated") == "1",
                Skip = currentParameterGroup.GetParameterValue("permskip") == "1"
            };
        }
        ServerGroup IEntity <ServerGroup> .ApplyFrom(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException(nameof(currentParameterGroup));
            }

            base.ApplyFrom(currentParameterGroup);
            Type   = currentParameterGroup.GetParameterValue <ushort>("type");
            IconId = currentParameterGroup.GetParameterValue <uint>("iconid");
            SaveDb = currentParameterGroup.GetParameterValue("savedb") == "1";

            return(this);
        }
示例#40
0
        public static ChannelListEntry Parse(CommandParameterGroup currrentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currrentParameterGroup == null)
            {
                throw new ArgumentNullException("currrentParameterGroup");
            }

            ChannelListEntry result = new ChannelListEntry();

            result.FillFrom(currrentParameterGroup, firstParameterGroup);
            result.IsSubscribed = currrentParameterGroup.GetParameterValue <byte>("channel_flag_are_subscribed").ToBool();

            return(result);
        }
        public static CustomInfoEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException("currentParameterGroup");
            }

            return(new CustomInfoEntry
            {
                ClientDatabaseId = firstParameterGroup.GetParameterValue <uint>("cldbid"),
                Ident = currentParameterGroup.GetParameterValue("ident"),
                Value = currentParameterGroup.GetParameterValue("value"),
            });
        }
示例#42
0
        public static Token Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new Token
            {
                TokenText = currentParameterGroup.GetParameterValue("token"),
                Type = currentParameterGroup.GetParameterValue<uint>("token_type"),
                GroupId = currentParameterGroup.GetParameterValue<uint>("token_id1"),
                ChannelId = currentParameterGroup.GetParameterValue<uint>("token_id2"),
                Description = currentParameterGroup.GetParameterValue("token_description")
            };
        }
示例#43
0
        public static MessageEntry Parse(CommandParameterGroup parameterGroup)
        {
            if (parameterGroup == null)
                throw new ArgumentNullException("parameterGroup");

            return new MessageEntry
            {
                MessageId = parameterGroup.GetParameterValue<uint>("msgid"),
                SenderUniqueId = parameterGroup.GetParameterValue("cluid"),
                Subject = parameterGroup.GetParameterValue("subject"),
                Created = new DateTime(1970, 1, 1).AddSeconds(parameterGroup.GetParameterValue<ulong>("timestamp")),
                WasRead = parameterGroup.GetParameterValue("flag_read").ToBool(),
            };
        }
        public static ChannelGroupClient Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException("currentParameterGroup");
            }

            return(new ChannelGroupClient
            {
                ChannelId = currentParameterGroup.GetParameterValue <uint>("cid"),
                ClientDatabaseId = currentParameterGroup.GetParameterValue <uint>("cldbid"),
                ChannelGroupId = currentParameterGroup.GetParameterValue <uint>("cgid"),
            });
        }
示例#45
0
        PermissionFindEntry IEntity <PermissionFindEntry> .ApplyFrom(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException(nameof(currentParameterGroup));
            }

            T            = currentParameterGroup.GetParameterValue <uint>("t");
            Id1          = currentParameterGroup.GetParameterValue <uint>("id1");
            Id2          = currentParameterGroup.GetParameterValue <uint>("id2");
            PermissionId = currentParameterGroup.GetParameterValue <int>("p");

            return(this);
        }
        protected void FillFrom(CommandParameterGroup currrentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currrentParameterGroup == null)
            {
                throw new ArgumentNullException("currentParameterGroup");
            }

            IsSubscribed    = currrentParameterGroup.GetParameterValue <byte>("channel_flag_are_subscribed").ToBool();
            ChannelId       = currrentParameterGroup.GetParameterValue <uint>("cid");
            ParentChannelId = currrentParameterGroup.GetParameterValue <uint>("pid");
            Order           = currrentParameterGroup.GetParameterValue <uint>("channel_order");
            Name            = currrentParameterGroup.GetParameterValue("channel_name");
            TotalClients    = currrentParameterGroup.GetParameterValue <uint?>("total_clients");
        }
        ChannelListEntry IEntity <ChannelListEntry> .ApplyFrom(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException(nameof(currentParameterGroup));
            }

            ChannelListEntry result = new ChannelListEntry();

            ApplyFrom(currentParameterGroup, firstParameterGroup);
            result.NeededSubscribePower = currentParameterGroup.GetParameterValue <uint>("channel_needed_subscribe_power");
            result.TotalClientsFamily   = currentParameterGroup.GetParameterValue <int?>("total_clients_family");

            return(this);
        }
示例#48
0
        public static ComplainListEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new ComplainListEntry
            {
                TargetClientDatabaseId = currentParameterGroup.GetParameterValue<uint>("tcldbid"),
                TargetName = currentParameterGroup.GetParameterValue("tname"),
                SourceClientDatabaseId = currentParameterGroup.GetParameterValue<uint>("fcldbid"),
                SourceName = currentParameterGroup.GetParameterValue("fname"),
                Message = currentParameterGroup.GetParameterValue("message"),
                Created = new DateTime(1970, 1, 1).AddSeconds(currentParameterGroup.GetParameterValue<ulong>("timestamp")),
            };
        }
示例#49
0
        public static ChannelListEntry Parse(CommandParameterGroup currrentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currrentParameterGroup == null)
            {
                throw new ArgumentNullException("currrentParameterGroup");
            }

            ChannelListEntry result = new ChannelListEntry();

            result.FillFrom(currrentParameterGroup, firstParameterGroup);
            result.NeededSubscribePower = currrentParameterGroup.GetParameterValue <uint>("channel_needed_subscribe_power");
            result.TotalClientsFamily   = currrentParameterGroup.GetParameterValue <int?>("total_clients_family");

            return(result);
        }
示例#50
0
        Token IEntity <Token> .ApplyFrom(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException(nameof(currentParameterGroup));
            }

            TokenText   = currentParameterGroup.GetParameterValue("token");
            Type        = currentParameterGroup.GetParameterValue <uint>("token_type");
            GroupId     = currentParameterGroup.GetParameterValue <uint>("token_id1");
            ChannelId   = currentParameterGroup.GetParameterValue <uint>("token_id2");
            Description = currentParameterGroup.GetParameterValue("token_description");

            return(this);
        }
示例#51
0
        public static ServerListItemBase Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            string statusString = currentParameterGroup.GetParameterValue("virtualserver_status");
            VirtualServerStatus status = VirtualServerStatusHelper.Parse(statusString);

            return new ServerListItemBase
            {
                ServerId = currentParameterGroup.GetParameterValue<uint>("virtualserver_id"),
                ServerPort = currentParameterGroup.GetParameterValue<ushort>("virtualserver_port"),
                ServerStatus = status,
            };
        }
示例#52
0
        public static ClientListEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new ClientListEntry
            {
                ClientId = currentParameterGroup.GetParameterValue<uint>("clid"),
                ChannelId = currentParameterGroup.GetParameterValue<uint>("cid"),
                ClientDatabaseId = currentParameterGroup.GetParameterValue<uint>("client_database_id"),
                Nickname = currentParameterGroup.GetParameterValue("client_nickname"),
                ClientType = currentParameterGroup.GetParameterValue<ushort>("client_type"),

            };
        }
示例#53
0
        Permission IEntity <Permission> .ApplyFrom(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException(nameof(currentParameterGroup));
            }

            Id      = currentParameterGroup.GetParameter("permid") == null ? 0 : currentParameterGroup.GetParameterValue <uint>("permid");
            Name    = currentParameterGroup.GetParameterValue("permsid");
            Value   = currentParameterGroup.GetParameterValue <int>("permvalue");
            Negated = currentParameterGroup.GetParameterValue("permnegated") == "1";
            Skip    = currentParameterGroup.GetParameterValue("permskip") == "1";

            return(this);
        }
示例#54
0
        public static LogEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException("currentParameterGroup");
            }

            return(new LogEntry
            {
                TimeStamp = new DateTime(1970, 1, 1).AddSeconds(currentParameterGroup.GetParameterValue <ulong>("timestamp")),
                LogLevel = (LogLevel)currentParameterGroup.GetParameterValue <uint>("level"),
                Channel = currentParameterGroup.GetParameterValue("channel"),
                Message = currentParameterGroup.GetParameterValue("msg")
            });
        }
        public static PermissionOverviewEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new PermissionOverviewEntry
            {
                T = currentParameterGroup.GetParameterValue<uint>("t"),
                Id1 = currentParameterGroup.GetParameterValue<uint>("id1"),
                Id2 = currentParameterGroup.GetParameterValue<uint>("id2"),
                Value = currentParameterGroup.GetParameterValue<int>("v"),
                PermissionId = currentParameterGroup.GetParameterValue<uint>("p"),
                Negated = currentParameterGroup.GetParameterValue("n") == "1",
                Skip = currentParameterGroup.GetParameterValue("s") == "1"
            };
        }
示例#56
0
        public static ClientDbEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new ClientDbEntry
            {
                DatabaseId = currentParameterGroup.GetParameterValue<uint>("cldbid"),
                NickName = currentParameterGroup.GetParameterValue("client_nickname"),
                UniqueId = currentParameterGroup.GetParameterValue("client_unique_identifier"),
                Description = currentParameterGroup.GetParameterValue("client_description"),
                LastConnected = new DateTime(1970, 1, 1).AddSeconds(currentParameterGroup.GetParameterValue<ulong>("client_lastconnected")),
                TotalConnections = currentParameterGroup.GetParameterValue<uint>("client_totalconnections"),
                LastIP = currentParameterGroup.GetParameterValue("client_lastip"),
            };
        }
示例#57
0
        public static ChannelGroup Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new ChannelGroup
            {
                Id = currentParameterGroup.GetParameterValue<uint>("cgid"),
                Name = currentParameterGroup.GetParameterValue("name"),
                Type = currentParameterGroup.GetParameterValue<ushort>("type"),
                IconId = currentParameterGroup.GetParameterValue<uint>("iconid"),
                SaveDb = currentParameterGroup.GetParameterValue("savedb").ToBool(),
                SortId = currentParameterGroup.GetParameterValue<uint>("sortid"),
                NameMode = currentParameterGroup.GetParameterValue<uint>("namemode"),
            };
        }
示例#58
0
        public static BanListEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new BanListEntry
            {
                Id = currentParameterGroup.GetParameterValue<uint>("banid"),
                Ip = currentParameterGroup.GetParameterValue("ip"),
                Created = new DateTime(1970, 1, 1).AddSeconds(currentParameterGroup.GetParameterValue<ulong>("created")),
                InvokerNickname = currentParameterGroup.GetParameterValue("invokername"),
                InvokerClientDatabaseId = currentParameterGroup.GetParameterValue<uint>("invokercldbid"),
                InvokerUniqueId = currentParameterGroup.GetParameterValue("invokeruid"),
                Reason = currentParameterGroup.GetParameterValue("reason"),
                Enforcements = currentParameterGroup.GetParameterValue<uint>("enforcements"),
            };
        }
        public static FileTransferListEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new FileTransferListEntry
            {
                ClientId = currentParameterGroup.GetParameterValue<uint>("clid"),
                Path = currentParameterGroup.GetParameterValue("path"),
                Name = currentParameterGroup.GetParameterValue("name"),
                Size = currentParameterGroup.GetParameterValue<ulong>("size"),
                SizeDone = currentParameterGroup.GetParameterValue<ulong>("sizedone"),
                ClientFtFileId = currentParameterGroup.GetParameterValue<uint>("clientftfid"),
                ServerFtFileId = currentParameterGroup.GetParameterValue<uint>("serverftfid"),
                Sender = currentParameterGroup.GetParameterValue<uint>("sender"),
                Status = currentParameterGroup.GetParameterValue<uint>("status"),
                CurrentSpeed = currentParameterGroup.GetParameterValue<double>("current_speed"),
            };
        }
        public static ClientListEntry Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            uint? idleSeconds = currentParameterGroup.GetParameterValue<uint?>("client_idle_time");
            ulong? created = currentParameterGroup.GetParameterValue<ulong?>("client_created");
            ulong? lastConnected = currentParameterGroup.GetParameterValue<ulong?>("client_lastconnected");

            return new ClientListEntry
            {
                ClientId = currentParameterGroup.GetParameterValue<uint>("clid"),
                ChannelId = currentParameterGroup.GetParameterValue<uint>("cid"),
                ClientDatabaseId = currentParameterGroup.GetParameterValue<uint>("client_database_id"),
                Nickname = currentParameterGroup.GetParameterValue("client_nickname"),
                ClientType = currentParameterGroup.GetParameterValue<ushort>("client_type"),
                ClientUniqueId = currentParameterGroup.GetParameterValue("client_unique_identifier"),
                IsClientAway = currentParameterGroup.GetParameterValue("client_away").ToNullableBool(),
                ClientAwayMessage = currentParameterGroup.GetParameterValue("client_away_message"),
                ServerGroups = currentParameterGroup.GetParameterValue("client_servergroups").ToIdList(),
                ClientChannelGroupId = currentParameterGroup.GetParameterValue<uint?>("client_channel_group_id"),
                IsClientTalking = currentParameterGroup.GetParameterValue("client_flag_talking").ToNullableBool(),
                IsClientTalker = currentParameterGroup.GetParameterValue("client_is_talker").ToNullableBool(),
                IsClientInputMuted = currentParameterGroup.GetParameterValue("client_input_muted").ToNullableBool(),
                IsClientOutputMuted = currentParameterGroup.GetParameterValue("client_output_muted").ToNullableBool(),
                HasClientInputHardware = currentParameterGroup.GetParameterValue("client_input_hardware").ToNullableBool(),
                HasClientOutputHardware = currentParameterGroup.GetParameterValue("client_output_hardware").ToNullableBool(),
                IsClientInputDeactivated = currentParameterGroup.GetParameterValue("client_input_deactivated").ToNullableBool(),
                ClientTalkPower = currentParameterGroup.GetParameterValue<uint?>("client_talk_power"),
                ClientVersion = currentParameterGroup.GetParameterValue("client_version"),
                ClientPlatform = currentParameterGroup.GetParameterValue("client_platform"),
                ClientIdleDuration = idleSeconds.HasValue ? (TimeSpan?)TimeSpan.FromMilliseconds(idleSeconds.Value) : null,
                IsPrioritySpeaker = currentParameterGroup.GetParameterValue("client_is_priority_speaker").ToNullableBool(),
                IsClientRecording = currentParameterGroup.GetParameterValue("client_is_recording").ToNullableBool(),
                ClientIconId = currentParameterGroup.GetParameterValue<uint?>("client_icon_id"),
                IsChannelCommander = currentParameterGroup.GetParameterValue("CLIENT_IS_CHANNEL_COMMANDER").ToNullableBool(),
                ClientCountry = currentParameterGroup.GetParameterValue("client_country"),
                ClientCreated = created.HasValue ? (DateTime?) new DateTime(1970, 1, 1).AddSeconds(created.Value) : null,
                ClientLastConnected = lastConnected.HasValue ? (DateTime?)new DateTime(1970, 1, 1).AddSeconds(lastConnected.Value) : null,
                ClientIP = currentParameterGroup.GetParameterValue("connection_client_ip"),
            };
        }