Example #1
0
        public void UpdateRecviveCoper()
        {
            MasterMember Master = this.MasterList.Find(m => m.IsMaster == true);

            if (Master != null)
            {
                Program.DatabaseManager.GetClient().ExecuteQuery("UPDATE character SET ReviveCoper=" + RecviveCoperMaster + " WHERE CharID =" + Master.CharID + "");
            }
        }
Example #2
0
        public static MasterMember LoadFromDatabase(DataRow row)
        {
            MasterMember Member = new MasterMember
            {
                pMemberName  = row["MemberName"].ToString(),
                CharID       = GetDataTypes.GetInt(row["CharID"]),
                Level        = GetDataTypes.GetByte(row["Level"]),
                IsMaster     = GetDataTypes.GetBool(row["isMaster"]),
                MasterID     = GetDataTypes.GetInt(row["MasterID"]),
                RegisterDate = DateTime.ParseExact(row["RegisterDate"].ToString(), "dd.MM.yyyy HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture),
            };

            Member.pMember  = ClientManager.Instance.GetClientByCharname(Member.pMemberName);
            Member.IsOnline = ClientManager.Instance.IsOnline(Member.pMemberName);
            return(Member);
        }
Example #3
0
        public void LoadMasterList()
        {
            DataTable Masterdata = null;

            using (DatabaseClient dbClient = Program.DatabaseManager.GetClient())
            {
                Masterdata = dbClient.ReadDataTable("SELECT * FROM Masters WHERE CharID='" + this.ID + "'");
            }
            if (Masterdata != null)
            {
                foreach (DataRow row in Masterdata.Rows)
                {
                    MasterMember DBMember = MasterMember.LoadFromDatabase(row);
                    this.MasterList.Add(DBMember);
                    if (DBMember.IsOnline)
                    {
                        DBMember.SetMemberStatus(true, this.Client.Character.Character.Name);
                    }
                }
            }
        }