Ejemplo n.º 1
0
        internal static Toon CreateToon(Account p, ProtoShared.Packets.FromClient.CreateCharacter createCharacter)
        {
            if (_characters == null) _characters = new AccountDBDataSetTableAdapters.charactersTableAdapter();
            Toon toon = new Toon();
            toon.SceneSerial = 1;
            toon.Name = createCharacter.Name;
            toon.Location = new Vector3D(905, 13, 593);
            toon.Attributes.Add(new Attrib() { ID = AttribType.Health, Value = 50 });
            toon.Attributes.Add(new Attrib() { ID = AttribType.MaxHealth, Value = 50 });
            _characters.Insert(p.Serial, toon.Name, toon.GetData());

            LoadToonsForAccountID(p);
            return p.Toons.Where(t => t.Name.Equals(createCharacter.Name)).First();
        }
Ejemplo n.º 2
0
 internal static void SaveToon(Toon toon)
 {
     if (_characters == null) _characters = new AccountDBDataSetTableAdapters.charactersTableAdapter();
     Logger.Log("Saved Toon " + toon.Name);
     _characters.UpdateToon(toon.Name, toon.GetData(), toon.Serial);
 }