예제 #1
0
        // -------------------------------------------------------------------------------
        // Save
        // -------------------------------------------------------------------------------
        public override BaseDataTable Save()
        {
            BaseDataTable data = new BaseDataTable();

            data.AddString(DatabaseManager.fieldName, sActorName);
            data.AddString(DatabaseManager.fieldId, sAccountName);
            data.AddBool(DatabaseManager.fieldBanned, bBanned);
            data.AddBool(DatabaseManager.fieldDeleted, bDeleted);

            return(data);
        }
예제 #2
0
        // -------------------------------------------------------------------------------
        // Save
        // -------------------------------------------------------------------------------
        public override BaseDataTable Save()
        {
            BaseDataTable data = new BaseDataTable();

            for (int i = 0; i < syncAttributes.Count; ++i)
            {
                data.AddString(DatabaseManager.fieldName, parent.name, i);
                data.AddString(DatabaseManager.fieldId, syncAttributes[i].name, i);
                data.AddInt(DatabaseManager.fieldValue, syncAttributes[i].nValue, i);
            }

            return(data);
        }
예제 #3
0
 // -------------------------------------------------------------------------------
 // Load
 // -------------------------------------------------------------------------------
 public void Load(BaseDataTable data)
 {
     sName      = data.GetString(DatabaseManager.fieldName);
     sPassword  = data.GetString(DatabaseManager.fieldPassword);
     sMail      = data.GetString(DatabaseManager.fieldEmail);
     _nAction   = data.GetLongAsInt(DatabaseManager.fieldAction);
     sDeviceId  = data.GetString(DatabaseManager.fieldDeviceId);
     bBanned    = data.GetBoolFromInt(DatabaseManager.fieldBanned);
     bDeleted   = data.GetBoolFromInt(DatabaseManager.fieldDeleted);
     bConfirmed = data.GetBoolFromInt(DatabaseManager.fieldConfirmed);
     bDone      = data.GetBoolFromInt(DatabaseManager.fieldDone);
     nCode      = data.GetLongAsInt(DatabaseManager.fieldCode);
 }
예제 #4
0
        // -------------------------------------------------------------------------------
        // Save
        // -------------------------------------------------------------------------------
        public override BaseDataTable Save()
        {
            BaseDataTable data = new BaseDataTable();

            for (int i = 0; i < syncStatus.Count; ++i)
            {
                data.AddString(DatabaseManager.fieldName, parent.name, i);
                data.AddString(DatabaseManager.fieldId, syncStatus[i].name, i);
                data.AddInt(DatabaseManager.fieldLevel, syncStatus[i].nLevel, i);
                data.AddDouble(DatabaseManager.fieldDuration, syncStatus[i].dTimer, i);
            }

            return(data);
        }
예제 #5
0
        // -------------------------------------------------------------------------------
        // ActorPlayerLoad
        // -------------------------------------------------------------------------------
        public GameObject ActorPlayerLoad(string sName)
        {
            if (String.IsNullOrWhiteSpace(sName) ||
                !databaseProvider.RowExists(tableActorPlayers, fieldName, sName).Result
                )
            {
                return(null);
            }


            GameObject actorObject = null;

            BaseDataTable data = databaseProvider.LoadAspects(sName).Result;

            // -- load the required prefab via the actors aspects
            for (int i = 0; i < data.Rows.Count; ++i)
            {
                TemplateAspect tmpl;

                if (DataManager.dictAspect.TryGetValue(data.GetIdHash(i), out tmpl))
                {
                    if (tmpl.actorPrefab)
                    {
                        actorObject = tmpl.actorPrefab;
                        break;
                    }
                }
                else
                {
                    Debug.LogWarning("Skipped template '" + data.GetString(DatabaseManager.fieldName) + "' as it was not found in Library.");
                }
            }

            actorObject.GetComponent <MetaSubsystem>().Load(databaseProvider.LoadMeta(sName).Result);
            actorObject.GetComponent <AlignmentSubsystem>().Load(databaseProvider.LoadAlignments(sName).Result);
            actorObject.GetComponent <AspectSubsystem>().Load(databaseProvider.LoadAspects(sName).Result);
            actorObject.GetComponent <ProfessionSubsystem>().Load(databaseProvider.LoadProfessions(sName).Result);
            actorObject.GetComponent <AttributeSubsystem>().Load(databaseProvider.LoadAttributes(sName).Result);
            actorObject.GetComponent <CurrencySubsystem>().Load(databaseProvider.LoadCurrencies(sName).Result);
            actorObject.GetComponent <EnergySubsystem>().Load(databaseProvider.LoadEnergies(sName).Result);
            actorObject.GetComponent <EquipmentSubsystem>().Load(databaseProvider.LoadEquipment(sName).Result);
            actorObject.GetComponent <InventorySubsystem>().Load(databaseProvider.LoadInventory(sName).Result);
            actorObject.GetComponent <SkillSubsystem>().Load(databaseProvider.LoadSkills(sName).Result);
            actorObject.GetComponent <StatusSubsystem>().Load(databaseProvider.LoadStatus(sName).Result);

            return(actorObject);
        }
예제 #6
0
        // -------------------------------------------------------------------------------
        // Save
        // -------------------------------------------------------------------------------
        public BaseDataTable Save()
        {
            BaseDataTable data = new BaseDataTable();

            data.AddString(DatabaseManager.fieldName, sName);
            data.AddString(DatabaseManager.fieldPassword, sPassword);
            data.AddString(DatabaseManager.fieldEmail, sMail);
            data.AddInt(DatabaseManager.fieldAction, _nAction);
            data.AddString(DatabaseManager.fieldDeviceId, sDeviceId);
            data.AddBool(DatabaseManager.fieldBanned, bBanned);
            data.AddBool(DatabaseManager.fieldDeleted, bDeleted);
            data.AddBool(DatabaseManager.fieldConfirmed, bConfirmed);
            data.AddBool(DatabaseManager.fieldDone, bDone);
            data.AddInt(DatabaseManager.fieldCode, nCode);

            return(data);
        }
예제 #7
0
        // -------------------------------------------------------------------------------
        // Save
        // -------------------------------------------------------------------------------
        public override BaseDataTable Save()
        {
            BaseDataTable data = new BaseDataTable();

            for (int i = 0; i < syncInventory.Count; ++i)
            {
                data.AddString(DatabaseManager.fieldName, parent.name, i);
                data.AddString(DatabaseManager.fieldId, syncInventory[i].name, i);
                data.AddInt(DatabaseManager.fieldId, syncInventory[i].nSlot, i);
                data.AddInt(DatabaseManager.fieldId, syncInventory[i].nAmount, i);
                data.AddInt(DatabaseManager.fieldId, syncInventory[i].nAmmo, i);
                data.AddInt(DatabaseManager.fieldId, syncInventory[i].nCharges, i);
                data.AddInt(DatabaseManager.fieldLevel, syncInventory[i].nLevel, i);
            }

            return(data);
        }
예제 #8
0
        // -------------------------------------------------------------------------------
        // Load
        // -------------------------------------------------------------------------------
        public override void Load(BaseDataTable data)
        {
            syncAttributes.Clear();

            for (int i = 0; i < data.Rows.Count; ++i)
            {
                TemplateAttribute tmpl;

                if (DataManager.dictAttribute.TryGetValue(data.GetIdHash(i), out tmpl))
                {
                    SAttribute sAttribute = new SAttribute(tmpl.GetId, data.GetLongAsInt(DatabaseManager.fieldValue, i));
                    syncAttributes.Add(sAttribute);
                }
                else
                {
                    Debug.LogWarning("Skipped template '" + data.GetString(DatabaseManager.fieldName) + "' as it was not found in Library.");
                }
            }

            data.Cleanup();
        }
예제 #9
0
        // -------------------------------------------------------------------------------
        // Load
        // -------------------------------------------------------------------------------
        public override void Load(BaseDataTable data)
        {
            syncInventory.Clear();

            for (int i = 0; i < data.Rows.Count; ++i)
            {
                TemplateItem tmpl;

                if (DataManager.dictItem.TryGetValue(data.GetIdHash(i), out tmpl))
                {
                    SItem sItem = new SItem(tmpl.GetId, data.GetLongAsInt(DatabaseManager.fieldSlot, i), data.GetLongAsInt(DatabaseManager.fieldAmount, i), data.GetLongAsInt(DatabaseManager.fieldAmmo, i), data.GetLongAsInt(DatabaseManager.fieldCharges, i), data.GetLongAsInt(DatabaseManager.fieldLevel, i));
                    syncInventory.Add(sItem);
                }
                else
                {
                    Debug.LogWarning("Skipped template '" + data.GetString(DatabaseManager.fieldName) + "' as it was not found in Library.");
                }
            }

            data.Cleanup();
        }
예제 #10
0
        // -------------------------------------------------------------------------------
        // Load
        // -------------------------------------------------------------------------------
        public override void Load(BaseDataTable data)
        {
            syncStatus.Clear();

            for (int i = 0; i < data.Rows.Count; ++i)
            {
                TemplateStatus tmpl;

                if (DataManager.dictStatus.TryGetValue(data.GetIdHash(i), out tmpl))
                {
                    SStatus sStatus = new SStatus(tmpl.GetId, data.GetLongAsInt(DatabaseManager.fieldLevel, i), data.GetDouble(DatabaseManager.fieldDuration, i));
                    syncStatus.Add(sStatus);
                }
                else
                {
                    Debug.LogWarning("Skipped template '" + data.GetString(DatabaseManager.fieldName) + "' as it was not found in Library.");
                }
            }

            data.Cleanup();
        }
예제 #11
0
        // ===============================================================================
        // ACCOUNT RELATED
        // ===============================================================================

        // -------------------------------------------------------------------------------
        // AccountLoad
        // -------------------------------------------------------------------------------
        public CAccount AccountLoad(string sName)
        {
            CAccount cAccount = null;

            if (String.IsNullOrWhiteSpace(sName))
            {
                return(cAccount);
            }

            if (!String.IsNullOrWhiteSpace(sName) &&
                databaseProvider.RowExists(tableAccounts, fieldName, sName).Result)
            {
                BaseDataTable data = databaseProvider.LoadAccount(sName).Result;

                if (data != null)
                {
                    cAccount = new CAccount();
                    cAccount.Load(data);
                }
            }

            return(cAccount);
        }
예제 #12
0
 // -------------------------------------------------------------------------------
 // Load
 // -------------------------------------------------------------------------------
 public abstract void Load(BaseDataTable data);
예제 #13
0
 // -------------------------------------------------------------------------------
 //
 // -------------------------------------------------------------------------------
 public bool AccountModify(string sName, BaseDataTable data, int nCode = 0)
 {
     return(true);
 }
예제 #14
0
 // -------------------------------------------------------------------------------
 // Load
 // -------------------------------------------------------------------------------
 public override void Load(BaseDataTable data)
 {
 }