public VolunteerCEO AddVolunteer(Corporation corporation, Character character)
        {
            var volunteerCEO = new VolunteerCEO
            {
                character   = character,
                expiry      = Expiry,
                corporation = corporation
            };

            _volunteerCEORepository.Insert(volunteerCEO);
            return(volunteerCEO);
        }
Example #2
0
        public virtual void AddMember(Character member, CorporationRole role, Corporation oldCorporation)
        {
            //update history
            WriteMemberHistory(member, oldCorporation);
            member.CorporationEid = Eid;

            Db.Query().CommandText("update corporationmembers set corporationEID = @corporationEID,role = @role where memberid = @memberid")
            .SetParameter("@corporationEID", Eid)
            .SetParameter("@memberid", member.Id)
            .SetParameter("@role", role)
            .ExecuteNonQuery().ThrowIfEqual(0, ErrorCodes.SQLUpdateError);

            _members = null;
        }
Example #3
0
        public void SendBulletinUpdate(BulletinDescription bulletin, CorporationBulletinEvent bulletinEvent, Character issuer)
        {
            var result = new Dictionary <string, object>
            {
                { k.description, bulletin.ToDictionary() },
                { k.eventType, (int)bulletinEvent },
                { k.characterID, issuer.Id }
            };

            var corporation = Corporation.GetOrThrow(bulletin.groupEID);

            Message.Builder.SetCommand(Commands.CorporationBulletinUpdate)
            .WithData(result)
            .ToCorporation(corporation)
            .Send();
        }
Example #4
0
        private void WriteMemberHistory(Character character, Corporation oldCorporation)
        {
            //old corp
            Db.Query().CommandText("update corporationHistory set corporationLeft=@now where characterID=@characterID and corporationLeft is NULL and corporationeid=@oldCorpEID")
            .SetParameter("@characterID", character.Id)
            .SetParameter("@now", DateTime.Now)
            .SetParameter("@oldCorpEID", oldCorporation.Eid)
            .ExecuteNonQuery();

            //new corp
            Db.Query().CommandText("insert corporationHistory (characterID, corporationEID, corporationJoined) values (@characterID, @corporationEID, @now)")
            .SetParameter("@characterID", character.Id)
            .SetParameter("@corporationEID", Eid)
            .SetParameter("@now", DateTime.Now)
            .ExecuteNonQuery();
        }
        public void InformCorporationMemberTransferred(Corporation oldCorporation, Corporation newCorporation, Character member, Character kicker)
        {
            var data = new Dictionary <string, object>
            {
                { k.@from, oldCorporation.Eid },
                { k.to, newCorporation.Eid },
                { k.memberID, member.Id }
            };

            if (kicker.Id > 0)
            {
                data.Add(k.kickedBy, kicker.Id);
            }

            if (newCorporation is PrivateCorporation)
            {
                Message.Builder.SetCommand(Commands.CorporationMemberTransferred)
                .WithData(data)
                .ToCorporation(newCorporation)
                .Send();
            }
            else
            {
                Message.Builder.SetCommand(Commands.CorporationMemberTransferred)
                .WithData(data)
                .ToCharacter(member)
                .Send();
            }

            if (oldCorporation is PrivateCorporation)
            {
                Message.Builder.SetCommand(Commands.CorporationMemberTransferred)
                .WithData(data)
                .ToCorporation(oldCorporation)
                .Send();
            }

            CorporationData.RemoveFromCache(newCorporation.Eid);
            CorporationData.RemoveFromCache(oldCorporation.Eid);
        }
Example #6
0
 public CorporationWallet(Corporation corporation)
 {
     Corporation = corporation;
 }
 public void InformCorporationMemberTransferred(Corporation oldCorporation, Corporation newCorporation, Character member)
 {
     InformCorporationMemberTransferred(oldCorporation, newCorporation, member, Character.None);
 }
Example #8
0
 public Corporation GetCorporation()
 {
     return(Corporation.GetOrThrow(Owner));
 }
 public override void AddMember(Character member, CorporationRole role, Corporation oldCorporation)
 {
     member.AllianceEid = 0L;
     base.AddMember(member, role, oldCorporation);
 }
 public new static PrivateCorporation Get(long eid)
 {
     return(Corporation.GetOrThrow(eid) as PrivateCorporation);
 }
Example #11
0
 private Corporation GetOrAddCorporation(long corporationEid)
 {
     Debug.Assert(corporationEid > 0);
     return(_corporations.GetOrAdd(corporationEid, _ => Corporation.GetOrThrow(corporationEid)));
 }
Example #12
0
 public override void AddMember(Character member, CorporationRole role, Corporation oldCorporation)
 {
     member.AllianceEid = DefaultCorporationDataCache.GetAllianceEidByCorporationEid(Eid);
     base.AddMember(member, role, oldCorporation);
 }