Exemple #1
0
        /// <summary>
        /// Get Server Channel info by server id
        /// </summary>
        /// <param name="svId"></param>
        /// <returns></returns>
        public static List<Channel> GetServerChannel(int svId)
        {
            using (MySqlConnection connection = new MySqlConnection(connectionString))
            {
                connection.Open();
                List<Channel> list = new List<Channel>();

                using (MySqlCommand command = connection.CreateCommand())
                {
                    command.CommandText = "SRV_CHANNEL_INFO_GET";
                    command.CommandType = System.Data.CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@worldId", svId);
                    var reader = command.ExecuteReader();

                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            Channel ch = new Channel()
                            {
                                wid = reader.GetInt32(0),
                                id = reader.GetInt32(1),
                                name = reader.GetString(2),
                                port = reader.GetInt32(3),
                                max_user = reader.GetInt32(4),
                                type = reader.GetInt32(5)
                            };
                            list.Add(ch);
                        }
                    }
                    reader.Close();
                }
                connection.Close();

                return list;
            }
        }
Exemple #2
0
 public SpSelectSrv(int svid, int chid)
 {
     SrvInfo = AgentServer.SvrListInfo.Where(v => v.id == svid).FirstOrDefault();
     ChnInfo = SrvInfo.channels.Where(v => v.id == chid).FirstOrDefault();
 }
Exemple #3
0
 public SpSelectSrv(int svid, int chid)
 {
     SrvInfo = AgentServer.SvrListInfo.Where(v => v.id == svid).FirstOrDefault();
     ChnInfo = SrvInfo.channels.Where(v => v.id == chid).FirstOrDefault();
 }