Raised This Month: $51 Target: $400
 12% 

update broke us


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BBG_Theory
Veteran Member
Join Date: Oct 2010
Location: NC USA
Old 08-27-2013 , 20:54   update broke us
Reply With Quote #1

FF2 is broken on windows and Linux from update today. Is it itemes, or gamedata? or???
BBG_Theory is offline
Fearts
ferts of daeth
Join Date: Oct 2008
Old 08-27-2013 , 20:55   Re: update broke us
Reply With Quote #2

Looks like the same for my servers. Both Freak Fortress and Saxton Hale.
__________________
Fearts is offline
Jwu
AlliedModders Donor
Join Date: Sep 2011
Location: Austria
Old 08-28-2013 , 01:20   Re: update broke us
Reply With Quote #3

Indeed, how funny i made an update for FreakFortress 2 this morning and now its broke. -.-

Works for me now (after gamedata update).

Last edited by Jwu; 08-28-2013 at 01:27.
Jwu is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 08-29-2013 , 00:25   Re: update broke us
Reply With Quote #4

Attribute 0 is most likely the problem.
Creating an item with attribute zero will crash the server. Old versions of tf2items will allow you to send attribute zero. It did not use to crash the server, but now it will. Newer versions of tf2 items will prevent 0 from being sent and abort the item creation.

The functions used to create the weapons in ff2 need to be fixed so that it does not send attribute zero. Then, weapons will be created properly
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 08-29-2013 , 02:53   Re: update broke us
Reply With Quote #5

Looking through, I rewrote these ages ago when I moved all of the weapon handling in ff2 on my version into OGNI. Pretty sure the first ability set or whatever that spawns weapons for hales is still broken though. Has not had any effect on me, because I don't have any bosses that spawn blank stock weapons @ rage.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 08-29-2013 , 13:06   Re: update broke us
Reply With Quote #6

If issue is in these lines:

PHP Code:
    new count ExplodeString(att" ; "atts3232);
    if (
count 0
ExplodeString never returns 0. Ever. Even if you pass in an empty string, it'll set atts[0] to an empty string and return 1. Meaning that the next loop runs once, turns "" to 0 (apparently) and sets attributes 0 to 0. Which causes TF2Items 254 and down to crash.

There are several ways to fix this. VSH fixed it by changing count > 0 to count > 1. I personally think that's sloppy.

Instead, I'd do this:

PHP Code:
    new count 0;
    if (
att[0] != '\0')
    {
        
count ExplodeString(att" ; "atts3232);
    }
    if (
count 0
Note: This is the freaks/special_noanims.sp version, freak_fortress_2 has the same thing but with attribCount, att, and weaponAttribsArray... and the attribCount if is farther down (but I didn't change that if anyway).
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 08-29-2013 at 13:11.
Powerlord is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 08-29-2013 , 15:39   Re: update broke us
Reply With Quote #7

Quote:
Originally Posted by Powerlord View Post
If issue is in these lines:
Instead, I'd do this:

PHP Code:
    new count 0;
    if (
att[0] != '\0')
    {
        
count ExplodeString(att" ; "atts3232);
    }
    if (
count 0
This is a bad idea, if a user inputs something like this: " " then att[0] will be space, not string delim, and it will fail. Exploding the string first is okay, it's not that costly. The other option would be to strip whitespace... With just explodestring and then stringtoint checking if count > 1, you assume pairs, and stringtoint auto sanitizes returning zero (which could also cause the attribute zero problem, but .. oh well)

I for one still have tons of my bosses with attributes like this from when ff2 had broken string parsing:

" 2 ; 2.0 ; 134 ; 2 "

It's not good to assume that every empty string will be "", " " is perfectly valid.. and probably in some boss configs.
it may actually be better to do if(!(count % 2)) , since there MUST be an even number of args, or it WILL fail.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 08-29-2013 at 15:44.
friagram is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 08-29-2013 , 15:52   Re: update broke us
Reply With Quote #8

Quote:
Originally Posted by friagram View Post
This is a bad idea, if a user inputs something like this: " " then att[0] will be space, not string delim, and it will fail. Exploding the string first is okay, it's not that costly. The other option would be to strip whitespace... With just explodestring and then stringtoint checking if count > 1, you assume pairs, and stringtoint auto sanitizes returning zero (which could also cause the attribute zero problem, but .. oh well)

I for one still have tons of my bosses with attributes like this from when ff2 had broken string parsing:

" 2 ; 2.0 ; 134 ; 2 "

It's not good to assume that every empty string will be "", " " is perfectly valid.. and probably in some boss configs.
it may actually be better to do if(!(count % 2)) , since there MUST be an even number of args, or it WILL fail.
True, but the user could just as easily put "bacon sandwich". We can't fix stupid.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 08-29-2013 at 15:53.
Powerlord is offline
VoiDeD
AlliedModders Donor
Join Date: Mar 2009
Location: Illinois, USA
Old 08-29-2013 , 18:04   Re: update broke us
Reply With Quote #9

Quote:
Originally Posted by friagram View Post
and then stringtoint checking if count > 1, you assume pairs, and stringtoint auto sanitizes returning zero (which could also cause the attribute zero problem, but .. oh well)
This actually becomes an issue with how ff2 builds attribute strings for bosses.

Although I'm not sure if the most recent public version does this, but some old version (and my forked version) of the FF2 code will concat a bosses attribs with some hardcoded attribs in the plugin.

So if a boss is being given a weapon with blank attribs, the final string will be something like "2 ; <something> ; 49 ; <somevalue> ; " (attribs completely from memory, but emphasis on the final semicolon and whitespace).

Now when the item code runs through whatever gets exploded, an empty string is passed to StringToInt, and that returns 0 and the code interprets that as attrib 0 and it all explodes.
__________________
VoiDeD is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 08-29-2013 , 18:39   Re: update broke us
Reply With Quote #10

Quote:
Originally Posted by VoiDeD View Post
This actually becomes an issue with how ff2 builds attribute strings for bosses.

Although I'm not sure if the most recent public version does this, but some old version (and my forked version) of the FF2 code will concat a bosses attribs with some hardcoded attribs in the plugin.

So if a boss is being given a weapon with blank attribs, the final string will be something like "2 ; <something> ; 49 ; <somevalue> ; " (attribs completely from memory, but emphasis on the final semicolon and whitespace).

Now when the item code runs through whatever gets exploded, an empty string is passed to StringToInt, and that returns 0 and the code interprets that as attrib 0 and it all explodes.
As far as I'm aware, all public versions of FF2 concat hard-coded attributes for melee weapons.

Speaking of public versions, do you have a public source code repo for your version somewhere?
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode