Exemple #1
0
        static void initServerItems()
        {
            SqlConnection sqlConnection_ = new SqlConnection();

            sqlConnection_.ConnectionString = ConstAspect.mConnectionString;
            sqlConnection_.Open();

            SqlCommand sqlCommand_ = new SqlCommand();

            sqlCommand_.Connection  = sqlConnection_;
            sqlCommand_.CommandType = CommandType.Text;
            sqlCommand_.CommandText = mInitServerItems;
            SqlDataReader sqlDataReader_ = sqlCommand_.ExecuteReader();

            while (sqlDataReader_.Read())
            {
                string     gameName_   = sqlDataReader_.GetString(0).Trim();
                ServerItem serverItem_ = new ServerItem();
                serverItem_.mServerId    = sqlDataReader_.GetInt32(1);
                serverItem_.mServerNo    = sqlDataReader_.GetInt32(2);
                serverItem_.mServerName  = sqlDataReader_.GetString(3).Trim();
                serverItem_.mServerState = sqlDataReader_.GetInt16(4);
                if (!mServerStates.ContainsKey(gameName_))
                {
                    ServerState serverState_ = new ServerState();
                    mServerStates[gameName_] = serverState_;
                }
                mServerStates[gameName_].pushServerItem(serverItem_);
            }
            sqlDataReader_.Close();
            sqlConnection_.Close();
        }
Exemple #2
0
 public void pushServerItem(ServerItem nServerItem)
 {
     mServerItems[nServerItem.mServerId] = nServerItem;
 }