plainblack / Lacuna-Server-Open

The open source Lacuna Server repository.
36 stars 29 forks source link

alliance members can demolish all embassies #215

Closed fireartist closed 9 years ago

fireartist commented 11 years ago

An alliance member (not the leader) can demolish any and all embassies, and still remain in their alliance. I don't think simply checking they have at least 1 colony with an Embassy would be sufficient. I think we really need to require an Embassy on an empire's homeworld, to ensure they don't abandon / lose their only planet with an embassy. And if they're in an alliance, they should not be able to change their homeworld unless the new planet already has an embassy.

fireartist commented 11 years ago

Currently, an alliance-leader cannot downgrade / demolish any of their embassies - which causes some complaints. If we require an embassy on the homeworld, we could allow alliance-leaders to demolish other embassies without any problems.

fireartist commented 11 years ago

If we go ahead with my suggested fix, I think we'd need to automatically move all alliance members' embassy onto their homeworld if ones not already there. And we'd need to communicate with anyone who has no space available on their homeworld.

icydee commented 11 years ago

and we would need to make sure that the embassy is sufficient level and it does not consume too many resources, hmm sounds like a bit of a problem.

(honest, I am not trying to be in a contradictory mood today!)

On 5 March 2013 10:19, fireartist notifications@github.com wrote:

If we go ahead with my suggested fix, I think we'd need to automatically move all alliance members' embassy onto their homeworld if ones not already there. And we'd need to communicate with anyone who has no space available on their homeworld.

— Reply to this email directly or view it on GitHubhttps://github.com/plainblack/Lacuna-Server-Open/issues/215#issuecomment-14432796 .

Kind Regards Iain

dmcbride commented 10 years ago

And then if the homeworld blows up, such that the capitol moves, then what?

Will the capitol building require the embassy be built first if you're in an alliance?

I'd suggest adding a new column in the empire table for embassy level, recalcing it any time an embassy was built, upgraded, downgraded, demolished, or a planet (that has an embassy?) was abandoned or otherwise removed from an empire (could restrict the recalc to only times where the embassy's old level was equal to the empire's embassy level). Similar to tech level, but allowed to go down, too.

And then use the leader's empire's embassy level for determining number of empires in the alliance.

icydee commented 10 years ago

With the new SS code all of the voting that takes place will take place in the Embassy, not the Parliament.

This means that if an alliance member deletes all their embassies, they can no longer vote.

I think this is sufficient deterrent against someone deleting all their embassies, if they do, they are a none-voting alliance member.

I suggest we don't do anything about this issue for now.

On 20 June 2014 18:45, Darin McBride notifications@github.com wrote:

And then if the homeworld blows up, such that the capitol moves, then what?

Will the capitol building require the embassy be built first if you're in an alliance?

I'd suggest adding a new column in the empire table for embassy level, recalcing it any time an embassy was built, upgraded, downgraded, demolished, or a planet (that has an embassy?) was abandoned or otherwise removed from an empire (could restrict the recalc to only times where the embassy's old level was equal to the empire's embassy level). Similar to tech level, but allowed to go down, too.

And then use the leader's empire's embassy level for determining number of empires in the alliance.

— Reply to this email directly or view it on GitHub https://github.com/plainblack/Lacuna-Server-Open/issues/215#issuecomment-46706369 .

Kind Regards Iain

dmcbride commented 10 years ago

I'd agree for those other than the leader (though I'm now realising that auto-vote code will have to scan an empire for the first available embassy...). But the leader would still not be able to demolish extraneous embassies with "do nothing."

Rather than the above, for the leader we could check if the level of the embassy after the requested downgrade or demolish would still support the alliance. That can be done entirely in the database:

perl5.12.1 -MLacuna -E '$e=Lacuna->db->resultset("Lacuna::DB::Result::Building")->search({"body.empire_id"=>2,"me.class"=>"Lacuna::DB::Result::Building::Embassy",body_id=>{"!=",182387}},{join=>"body",order_by=>{-desc=>"level"}})->single;say $e->level'
30

Of course, if I put this in DB/Result/Empire.pm for figuring out the current embassy level, it'd use variables, not hardcodes, but I only have the one empire on my test server :)

icydee commented 10 years ago

yes that's eminently doable.

On 23 June 2014 16:34, Darin McBride notifications@github.com wrote:

I'd agree for those other than the leader (though I'm now realising that auto-vote code will have to scan an empire for the first available embassy...). But the leader would still not be able to demolish extraneous embassies with "do nothing."

Rather than the above, for the leader we could check if the level of the embassy after the requested downgrade or demolish would still support the alliance. That can be done entirely in the database:

perl5.12.1 -MLacuna -E '$e=Lacuna->db->resultset("Lacuna::DB::Result::Building")->search({"body.empire_id"=>2,"me.class"=>"Lacuna::DB::Result::Building::Embassy",body_id=>{"!=",182387}},{join=>"body",order_by=>{-desc=>"level"}})->single;say $e->level' 30

Of course, if I put this in DB/Result/Empire.pm for figuring out the current embassy level, it'd use variables, not hardcodes, but I only have the one empire on my test server :)

— Reply to this email directly or view it on GitHub https://github.com/plainblack/Lacuna-Server-Open/issues/215#issuecomment-46861247 .

Kind Regards Iain

dmcbride commented 9 years ago

Empire stats now return the building ID of the highest level non-flat embassy, so that scripts can easily find an embassy to vote at. Alliance leaders can demolish spare embassies, and can downlevel their highest embassy as long as they still have room for all the allies currently in the alliance. Parliament voting can now be done via embassy, though it can also still be done via parliaments for now.

No new column added to the empire.

Given the additional functionality found in the embassy, and the public direction of eliminating parliament buildings, I think we can close this.