public override void Process(Level level)
        {
            var alliance = ObjectManager.GetAlliance(m_vAllianceId);
            if (alliance != null)
            {
                if(!alliance.IsAllianceFull())
                {
                    level.GetPlayerAvatar().SetAllianceId(alliance.GetAllianceId());
                    AllianceMemberEntry member = new AllianceMemberEntry(level.GetPlayerAvatar().GetId());
                    member.SetRole(1);
                    alliance.AddAllianceMember(member);

                    var joinAllianceCommand = new JoinAllianceCommand();
                    joinAllianceCommand.SetAlliance(alliance);
                    var availableServerCommandMessage = new AvailableServerCommandMessage(this.Client);
                    availableServerCommandMessage.SetCommandId(1);
                    availableServerCommandMessage.SetCommand(joinAllianceCommand);

                    PacketManager.ProcessOutgoingPacket(availableServerCommandMessage);
                    PacketManager.ProcessOutgoingPacket(new AllianceStreamMessage(this.Client, alliance));

                    if(alliance.GetScore() == 10000)
                    {
                        alliance.SetScore(0);
                    }

                    int percentuale = (level.GetPlayerAvatar().GetScore()) / (2);
                    alliance.SetScore(alliance.GetScore() + percentuale);
                }
            }
        }
        public override void Process(Level level)
        {
            //Clan creation
            Alliance alliance = ObjectManager.CreateAlliance(0);
            alliance.SetAllianceName(m_vAllianceName);
            alliance.SetAllianceDescription(m_vAllianceDescription);
            alliance.SetAllianceType(m_vAllianceType);
            alliance.SetRequiredScore(m_vRequiredScore);
            alliance.SetAllianceBadgeData(m_vAllianceBadgeData);
            //alliance.SetAllianceOrigin(m_vAllianceOrigin);
            alliance.SetWarFrequency(m_vWarFrequency);

            //Set player clan
            //ObjectManager.OnlinePlayers.TryGetValue(p.Client, out player);
            level.GetPlayerAvatar().SetAllianceId(alliance.GetAllianceId());
            AllianceMemberEntry member = new AllianceMemberEntry(level.GetPlayerAvatar().GetId());
            member.SetRole(2);
            alliance.AddAllianceMember(member);

            var joinAllianceCommand = new JoinAllianceCommand();
            joinAllianceCommand.SetAlliance(alliance);
            var availableServerCommandMessage = new AvailableServerCommandMessage(this.Client);
            availableServerCommandMessage.SetCommandId(1);
            availableServerCommandMessage.SetCommand(joinAllianceCommand);
            PacketManager.ProcessOutgoingPacket(availableServerCommandMessage);
        }
Exemple #3
0
        public void SetAllianceRole(int a)
        {
            AllianceMemberEntry allianceMemberEntry = this.GetAllianceMemberEntry();

            if (allianceMemberEntry != null)
            {
                allianceMemberEntry.SetRole(a);
            }
        }
Exemple #4
0
        public async void SetAllianceRole(int a)
        {
            try
            {
                AllianceMemberEntry ame = await GetAllianceMemberEntry();

                if (ame != null)
                {
                    ame.SetRole(a);
                }
            }
            catch (Exception) {}
        }