FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CODE: salvaged buildings on war planets go to faction storag

 
Post new topic   Reply to topic    Drop Shock Forum Index -> Open Source
View previous topic :: View next topic  
Author Message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Sun Dec 16, 2012 4:26 am    Post subject: CODE: salvaged buildings on war planets go to faction storag Reply with quote

file: process_turn.php

on line 3680

before

Code:
$sqltext ="UPDATE tinywarz_live.buildings SET i_owner=".$effect->i_owner.", is_destroyed = 'N'
                  WHERE id=".$unitdata[$effect->i_target]["unit_id"];


after

Code:
 if($planet_faction=="Y")
               $sqltext ="UPDATE tinywarz_live.buildings SET i_owner=".$userdata[$effect->i_owner]["i_faction"].", is_destroyed = 'N'
                  WHERE id=".$unitdata[$effect->i_target]["unit_id"];
            else $sqltext ="UPDATE tinywarz_live.buildings SET i_owner=".$effect->i_owner.", is_destroyed = 'N'
                  WHERE id=".$unitdata[$effect->i_target]["unit_id"];


only for buildings, units tend to be redistributed on their own no need to send them to faction storage

ticket link: https://sourceforge.net/p/dropshock/tickets/32/

question for frizz: why are buildings not treated as mods but as units (have a count for each type instead of independent records)? they can't have vars 8(, i know mods used to be like this so wouldn't be healthier for database to convert them like you did with mods?
Back to top
View user's profile Send private message
Dark Leth
Council Member


Joined: 05 Jul 2005
Posts: 1498

PostPosted: Sun Dec 16, 2012 3:25 pm    Post subject: Reply with quote

Support.
Back to top
View user's profile Send private message
Frizz
Site Admin


Joined: 10 Jun 2005
Posts: 3814

PostPosted: Sun Dec 16, 2012 5:41 pm    Post subject: Re: CODE: salvaged buildings on war planets go to faction st Reply with quote

khaibar wrote:

question for frizz: why are buildings not treated as mods but as units (have a count for each type instead of independent records)? they can't have vars 8(, i know mods used to be like this so wouldn't be healthier for database to convert them like you did with mods?


This is because the "deployed_units" table ties the deployed unit / building back to the appropriate unit / building in the "units" or "buildings" table.

"deployed_units" is a detailed tracking of a unit / building while it is on a planet (shields, armor, speed, ID for weapons & effects). This table changes frequently.

"units" / "buildings" are the ownership and sale tracking tables. This table changes in-frequently.
_________________

Back to top
View user's profile Send private message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Mon Dec 17, 2012 1:37 am    Post subject: Reply with quote

ah... thanks

But since buildings don't have vars (can but don't), we can treat them the way like mods right?

When you deploy a building, your stock is decremented and the stats are pulled from library then a building is inserted in the deployed_units. The id of that inserted record can be used to tag the according weapons.

If the building is salvaged/Uded u delete that record from deployed_units and increment the number of buildings of that id you have by 1.

Same thing for market, pretty much like the mods' way of trading

It can work either way i think
Back to top
View user's profile Send private message
SpaceGhost
Mentor


Joined: 07 Sep 2007
Posts: 57

PostPosted: Thu Dec 27, 2012 10:51 am    Post subject: Reply with quote

Would support so there is option to salvage for faction or personally
Thanks SpaceGhost
Back to top
View user's profile Send private message
Slayer_666
Council Member


Joined: 20 Dec 2012
Posts: 226

PostPosted: Thu Dec 27, 2012 2:10 pm    Post subject: Reply with quote

SpaceGhost wrote:
Would support so there is option to salvage for faction or personally
Thanks SpaceGhost


Slayer
Back to top
View user's profile Send private message
Dark Leth
Council Member


Joined: 05 Jul 2005
Posts: 1498

PostPosted: Thu Dec 27, 2012 11:32 pm    Post subject: Reply with quote

Still waiting for more votes. Khai, can you clarify whether you want to implement the additional suggestions.
Back to top
View user's profile Send private message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Fri Dec 28, 2012 1:24 am    Post subject: Reply with quote

It depends if frizz allows table structure modifications

What spaceghost suggested requires access to account settings (to choose whether to go to storage or faction storage) and a new variable in database for that choice.

Me doing it depends if frizz accepts that so ask him Cool
Back to top
View user's profile Send private message
RoseThorn
Site Admin


Joined: 28 Dec 2006
Posts: 864
Location: Somewhere over the Rainbow

PostPosted: Sat Dec 29, 2012 2:35 am    Post subject: Reply with quote

Gotta post, I would support this only if SpaceGhost's comment that you can choose whether they go to the faction or the player


~Rose
_________________
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Drop Shock Forum Index -> Open Source All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group