示例#1
0
        public bool RegisterRealm(Realm Rm, RpcClientInfo Info)
        {
            Log.Debug("AccountMgr", "Realm Registering : " + Rm.Name);

            if (Rm == null)
            {
                return(false);
            }

            Rm.GenerateName();

            Realm Already = GetRealm(Rm.RealmId);

            if (Already == null)
            {
                Already = AccountDB.SelectObject <Realm>("RealmId=" + Rm.RealmId);
                if (Already == null)
                {
                    AccountDB.AddObject(Rm);
                }
            }

            if (Already != null)
            {
                Rm.ObjectId = Already.ObjectId;
                Realms.Remove(Already);
            }

            Rm.RpcInfo = Info;
            Rm.Dirty   = true;

            AccountDB.SaveObject(Rm);
            Realms.Add(Rm);

            if (Info != null)
            {
                Log.Success("AccountMgr", "Realm Online : " + Rm.Name);
            }
            else
            {
                Log.Success("AccountMgr", "Realm loaded : " + Rm.Name);
            }

            return(true);
        }
示例#2
0
        public bool RegisterRealm(Realm Rm,RpcClientInfo Info)
        {
            Log.Debug("AccountMgr", "Realm Registering : " + Rm.Name);

            if (Rm == null)
                return false;

            Rm.GenerateName();

            Realm Already = GetRealm(Rm.RealmId);
            if (Already == null)
            {
                Already = AccountDB.SelectObject<Realm>("RealmId=" + Rm.RealmId);
                if (Already == null)
                    AccountDB.AddObject(Rm);
            }

            if (Already != null)
            {
                Rm.ObjectId = Already.ObjectId;
                Realms.Remove(Already);
            }

            Rm.RpcInfo = Info;
            Rm.Dirty = true;

            AccountDB.SaveObject(Rm);
            Realms.Add(Rm);

            if (Info != null)
            {
                Log.Success("AccountMgr", "Realm Online : " + Rm.Name);
            }
            else
                Log.Success("AccountMgr", "Realm loaded : " + Rm.Name);

            return true;
        }