Database up and running

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Abstrct
    replied
    Re: Database up and running

    Originally posted by YenTheFirst
    that's actually a bit annoying, as it means that the effective max speed of a ship is 2500 instead of 5000, as move() wants there to be enough fuel to stop.

    It's also quite a bit less fuel efficient in certain instances.

    Ya, I realize it can be annoying. For DC I have changed the max fuel of a ship to 16000 and max speed is 5000. That should help things out.


    Anyways, I have to be up for a flight in 3 hours for some reason.

    See you at DEFCON :D
    -Abstrct

    Leave a comment:


  • YenTheFirst
    replied
    Re: Database up and running

    Originally posted by Abstrct
    I have also tried to fix the update speed issue (where no fuel used) and have decided against fixing this properly for the time being. Since it is going to take me longer than I anticipated to finish and test I have removed the ability to update speed and direction directly with an UPDATE. You now must use MOVE() to alter the speed and direction.
    that's actually a bit annoying, as it means that the effective max speed of a ship is 2500 instead of 5000, as move() wants there to be enough fuel to stop.

    It's also quite a bit less fuel efficient in certain instances.

    Leave a comment:


  • Abstrct
    replied
    Re: Database up and running

    Originally posted by YenTheFirst
    actually, I think in both cases, I was confused about player reserve fuel and ship fuel. ignore the problems with fuel being deducted.

    Although, I managed to get one of my ships into a negative fuel state. not sure how.

    after refueling, I still can't set a direction.
    Ya, a ship has its own fuel, which you need to refuel from your players fuel_reserve. Once a ship has fuel it cannot go back to the reserve.

    I have also tried to fix the update speed issue (where no fuel used) and have decided against fixing this properly for the time being. Since it is going to take me longer than I anticipated to finish and test I have removed the ability to update speed and direction directly with an UPDATE. You now must use MOVE() to alter the speed and direction.


    Thanks for pointing out that resource conversion bug too. It should be resolves as well now.


    Has anybody come across anything else they wish to share? I went through and fixed a bunch of areas where an SQL injection was completely possible but I would love some more last minute testing to confirm I found the obvious ones at least.

    Leave a comment:


  • YenTheFirst
    replied
    Re: Database up and running

    actually, I think in both cases, I was confused about player reserve fuel and ship fuel. ignore the problems with fuel being deducted.

    Although, I managed to get one of my ships into a negative fuel state. not sure how.

    after refueling, I still can't set a direction.
    Last edited by YenTheFirst; July 30, 2011, 19:47.

    Leave a comment:


  • YenTheFirst
    replied
    Re: Database up and running

    as of tonight, move() doesn't seem to want to set a direction, nor deduct fuel.

    select current_tic from current_stats;
    3084

    select fuel_reserve from my_player
    114076

    select move(199,5000,174,null,null);
    t

    [no errors]
    [wait a minute or two]

    select current_tic from current_stats;
    3087

    select fuel_reserve from my_player
    114076

    select id,speed,direction from my_ships where id = 199
    199, 5000, 0


    ---


    directly updating seems to not work at all.
    update my_ships set speed=4000, direction=174 where id=199;
    [no response]

    select id,speed,direction from my_ships where id = 199
    199, 5000, 174

    [after a minute or so]
    select id,speed,direction from my_ships where id = 199
    199, 5000, 0
    Last edited by YenTheFirst; July 30, 2011, 19:26.

    Leave a comment:


  • YenTheFirst
    replied
    Re: Database up and running

    edit: it's no longer doing this, I guess it resolved itself . .?

    this should speak for itself:

    select balance, fuel_reserve from my_player;
    0, 159680

    select convert_resource('FUEL',1);
    [no response]

    error stream:
    [Error] You do not have that much fuel to convert
    Last edited by YenTheFirst; July 28, 2011, 13:24.

    Leave a comment:


  • TheCotMan
    replied
    Re: Database up and running

    Originally posted by Abstrct
    If the forum mods don't mind it being discussed here, I certainly don't mind it as well!
    It is the best way that my mistakes can at least help to generate interest in the game ;)
    I won't speak for all of the mods, but I find no problem with this, and would go so far as to say it is healthy for the forums to have discussions like this here; it encourages participation, speaking up, and increases the chances that various players will network with each other.

    I approved this message. :-)

    Leave a comment:


  • Abstrct
    replied
    Re: Database up and running

    If the forum mods don't mind it being discussed here, I certainly don't mind it as well!
    It is the best way that my mistakes can at least help to generate interest in the game ;)

    If you find something more serious though that you rather deal with privately, please feel free to email josh at schemaverse dot com


    As for the actual bug that we were discussing, my night last night ended up being focused on some other more serious bugs. Tonight, as long as I can eventually leave the office, I hope to tackle this bug and go over all the other rules to try and find any other slip ups.

    Again, I fully expect that everybody will adhere to the honour system and only use MOVE() until the my_ships update rule is fixed.

    Leave a comment:


  • YenTheFirst
    replied
    Re: Database up and running

    Originally posted by TheCotMan
    Value in both:

    By reporting bugs here, it naturally keeps the thread active to draw attention to this contest.
    true, but it could also be noise.
    Originally posted by TheCotMan
    By reporting the bugs here, other people learn about them and may exploit them.

    By reporting bugs there, bug tracking is visible and there is no need for double-entry and double-response to issues.
    on github, the bugs are still publicly viewable, and anyone can learn about them, and exploit them (if not patched before the contest.) Even if not for the bugs, anyone seriously interested should probably be checking out the source code there.

    The biggest negative, IMO:
    There may exist players who have a DEFCON forum account, but not a github account, and thus could not report a bug without registering.


    As an aside: Given their nature, I'm not concerned with exploitation of bugs I've publicly reported so far.

    Leave a comment:


  • TheCotMan
    replied
    Re: Database up and running

    Value in both:

    By reporting bugs here, it naturally keeps the thread active to draw attention to this contest.

    By reporting the bugs here, other people learn about them and may exploit them.

    By reporting bugs there, bug tracking is visible and there is no need for double-entry and double-response to issues.

    Leave a comment:


  • YenTheFirst
    replied
    Re: Database up and running

    incidentally, should I keep reporting any bugs I find here, or would you prefer them on the github bug tracker, to keep the forum clean-ish?

    Leave a comment:


  • Abstrct
    replied
    Re: Database up and running

    Originally posted by YenTheFirst
    possible bug:

    I set a ship in motion with update my_ships.
    ship id 10348, direction 0, speed 100.

    as far as I can tell, current_fuel was never deducted. it's still 100, and I never refueld.

    Yup, definitely a bug. Nice find :D
    Thanks Yen!

    I will tackle that one tonight. Until then, I am sure everyone will use the honour system and only move using the MOVE function and not directly update the speed column in my_ships.

    Leave a comment:


  • YenTheFirst
    replied
    Re: Database up and running

    possible bug:

    I set a ship in motion with update my_ships.
    ship id 10348, direction 0, speed 100.

    as far as I can tell, current_fuel was never deducted. it's still 100, and I never refueld.

    Leave a comment:


  • Abstrct
    replied
    Re: Database up and running

    Originally posted by YenTheFirst
    this seems to be a bit annoying/unexpected, though. If I have a ship on (0,0), and I want to move it to (200,0) at speed 10, it will use up 20 fuel and move to just (10,0). I suppose this is because it's now 'in range' of (200,0), I was expecting it to actually get itself to (200,0).
    Fair enough, it becomes more useful when ships start traveling longer distances though. Otherwise you blow past the destination sometimes.

    Also keep in mind that you can actually create ships anywhere you want within the range 3000 and -3000 (x and y). Outside of that range you must create the ships on the same coordinates as planets you currently have conquered.

    If fuel is an issue for you, make sure you start building on your home planet first. (SELECT location_x,location_y FROM planets WHERE conqueror_id = GET_PLAYER_ID(SESSION_USER);)

    Your home planet is likely pretty far from other planets so it is a safe place to mine and prepare for battle in the centre of the map. Investing in prospecting skill on your miners will also drastically improve the mount of fuel you take in each tic.

    -Abstrct

    Leave a comment:


  • YenTheFirst
    replied
    Re: Database up and running

    hmm. today, the move() command seems to work, more or less.

    As for the ship stopping, this is to be expected if you have a destination_x and destination_y set. Once the ship is within range of this destination, it will stop (set speed=0). If you would like to to go and never stop, update destination_x and destination_y to be NULL.
    this seems to be a bit annoying/unexpected, though. If I have a ship on (0,0), and I want to move it to (200,0) at speed 10, it will use up 20 fuel and move to just (10,0). I suppose this is because it's now 'in range' of (200,0), I was expecting it to actually get itself to (200,0).

    Leave a comment:

Working...