View Issue Details

IDProjectCategoryView StatusLast Update
0001123Spring engineGeneralpublic2008-10-13 12:43
Reporterel_matarife Assigned ToKloot  
PrioritynormalSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
Product Version0.77b3 
Summary0001123: Player bonus / handicap exploit
DescriptionHandicap applies to ALL incoming metal / energy including reclaim, so you can build units / structures and reclaim for more than you spent, leading to an infinite economy exploit. Attached is a replay proving it.
TagsNo tags attached.
Attached Files
20081012_121814_SpeedMetal_0.77b3.sdf (Attachment missing)
handicapreclaim.diff (Attachment missing)
Checked infolog.txt for Errors

Activities

el_matarife

2008-10-12 20:06

reporter   ~0002823

Lurker wrote a fix, and hooked me up with the diff since he couldn't attach it to this or upload it to SVN.

imbaczek

2008-10-12 21:44

reporter   ~0002825

committed in r6686, please test and report if it's fixed.

Kloot

2008-10-12 22:04

developer   ~0002827

Last edited: 2008-10-12 22:18

On a general note, this ...

if (handicap) { amount *= handicap; }

... is not a very useful expression since handicap is a bool, ie. if it is true then <amount> is just multiplied by 1 (no-op) and if it is false then <amount> is left untouched. That means the patch won't work.



float f(float amount, bool arg) {
    if (arg) { amount *= arg; }
    return amount;
}

int main(void) {
    printf("%f\n", f(5.0f, 0)); // 5.0
    printf("%f\n", f(5.0f, 1)); // 5.0
    printf("%f\n", f(5.0f, 2)); // 5.0
    printf("%f\n", f(5.0f, 3)); // 5.0
    return 0;
}



Also, the patch breaks handicap itself (a value of 100 which should double your commander's metal income gives only the default amount).

imbaczek

2008-10-12 22:06

reporter   ~0002828

i admit i didn't do a thorough review, and lurker can't even see this mantis issue since it's marked private, so he won't see any comments ^_^

imbaczek

2008-10-12 22:32

reporter   ~0002829

aye i'm not thinking too well today, only just understood what you were talking about... will fix asap.

el_matarife

2008-10-12 22:44

reporter   ~0002830

Well, I've been thinking about it and I guess we can open this up. It's easy enough to work around this for now, and since we know it will be fixed soon there's no reason to keep it private.

imbaczek

2008-10-12 22:52

reporter   ~0002831

fixed the fix.

also opening up to public disclosure at reporter's request.

lurker

2008-10-13 02:47

reporter   ~0002832

I told matarife I hadn't been able to test it, I guess he neglected to put that in the mantis comment..

Kloot

2008-10-13 12:43

developer   ~0002839

fixed now

Issue History

Date Modified Username Field Change
2008-10-12 19:25 el_matarife New Issue
2008-10-12 19:26 el_matarife File Added: 20081012_121814_SpeedMetal_0.77b3.sdf
2008-10-12 20:05 el_matarife File Added: handicapreclaim.diff
2008-10-12 20:06 el_matarife Note Added: 0002823
2008-10-12 21:44 imbaczek Note Added: 0002825
2008-10-12 21:50 Kloot Status new => confirmed
2008-10-12 22:04 Kloot Note Added: 0002827
2008-10-12 22:06 Kloot Note Edited: 0002827
2008-10-12 22:06 imbaczek Note Added: 0002828
2008-10-12 22:18 Kloot Note Edited: 0002827
2008-10-12 22:32 imbaczek Note Added: 0002829
2008-10-12 22:44 el_matarife Note Added: 0002830
2008-10-12 22:52 imbaczek Note Added: 0002831
2008-10-12 22:52 imbaczek View Status private => public
2008-10-13 02:47 lurker Note Added: 0002832
2008-10-13 12:43 Kloot Status confirmed => resolved
2008-10-13 12:43 Kloot Resolution open => fixed
2008-10-13 12:43 Kloot Assigned To => Kloot
2008-10-13 12:43 Kloot Note Added: 0002839