Blog

  • Using setCredentials in Flex 2 via Renaun’s RemoteObjectAMF0 in AMFPHP 1.2.5

    To skip rant and see solution, scroll to bottom.

    This crap was too frikin’ hard to find in Google. After spending 3 hours debugging, I figured out a solution, but not the source of the problem. Following the authentication example at amfphp.org, it just wans’t working. I kept getting an error about the user not having access to the method I was calling, in this case doLogin. Props to Patrick btw for giving us such informative and useful error messages we can catch in our fault handlers.

    This, however, didn’t go away when I put in the correct credentials. Credentials are basically the username and password added as a header to the remoting call so the server can authenticate you. This method is on NetConnection, but in ActionScript 2, you’d access it via:

    serviceInstance.connection.setCredentials ( "username" , "password" )

    and in AS1 via:

    serviceInstance.setCredentials ( "username" , "password" )

    The AS2 way is the same way it was in Flex 1.5 I think.

    Now, the proxying in Abstract service is working. Although the class is dynamic, and I think uses a __resolve like mechnism (returning a make-shift function if that function doesn’t exist on the class instance you are calling ), you can clearly see by ServiceCapture & TamperData that it only makes the 1 remoting call. However, both TamperData and ServiceCapture don’t show the damn headers. I couldn’t figure out how to do traces in AMFPHP to see what the headers were, and I can’t find a NetConnection swf anywhere on my hard drive to use the old NetDebug.trace way.

    Now, mx.rpc.AbstractService isn’t included in the Flex source. I put up with this no source bullshit back in Flex 1.5 and was hoping it wouldn’t negatively affect me in Flex 2, but apparently not. GIVE ME THE F’ING CODE, ADOBE! That said, you CAN at least set a breakpoint. Oddly, it was creating a credential variable and I think like using a “:” colon as a seperator; the var was called “cred”. I was wondering if maybe AMFPHP was hardcoded to look for a specific header called “Credentials”, what it was called in Flex 1.5 & Flash 8 on down, and this perhaps changed in Flex 2. Or, maybe the actual names changed to username vs. userid, which was what it was in ActionScript 2. :: shrugs ::

    Google didn’t turn up anything (first 10 results anyway), but Renauns blog had a comment with a guy with a similiar problem. He posted his solution. I had problems understanding it, though, because my copies of Cairngorm 2 and 2.1 don’t have the getRPCService, so that through me for a loop, but I saw what he was doing; he was basically manually adding the header. I didn’t want to mess with Renaun’s class, so I did it manually.

    It didn’t work. Kept bitching about a null reference. Digging in Renaun’s code, the connection “gateway_conn” is instantiated via lazy loading. In Flex 1.5 & Flash 8 & 7, this was done in the constructor. Renaun’s, however, does it on the first remoting call you make.

    if( gateway_conn == null )
    	gateway_conn = new RemotingConnection( endpoint );

    So, I first did a call to ping which sets the connection, and then added the header to the connection, THEN called doLogin.

    my_ro.ping();
    my_ro.gateway_conn.addHeader("Credentials", false, {userid: "admin", password: "myPassword"});

    She worked.

    SON OF A LAKSJDROItuioqasdf… :: whips out MG42 :: :: lights up office, flooding neihborhood with bullets ::

    Speaking of hellfire, my site now works in IE7; I’m not finished, but at least you can read the text. I hope IE burns for all eternity. While I do dig their implementation of RSS, if that is their best attempt at making RSS friendly to users… well.. um… we have a loooooooong way to go. Installing it didn’t fix that dang IE script pop-up error I get in Flex Builder 2 either. Weeeeeeeeeee!!!!!!!!

  • Net Neutrality & Mobile Gaming Parallels

    Lawrence Lessig links to a RampRate market commentary about how Net Neutrality” will seriously hurt online gaming. Like global warming, with Net Neutrality I’ve had a bunch of articles shoved in my face and expected to take them as fact and act upon them vs. discussion, research into the facts, and a clear, widely accepted tangible solution. So, while I get the general idea and thus threat of Net Neutrality I’m still extremely skeptical. Congress is 1 for 1 for me on the with regards to the internet. Their prevention of online taxes for so long is perceived for me as awesome to spur growth. Ted Steven’s rant about tubes, while not a neccessarey true representation of the tech knowledge of my Senate, still doesn’t seem to bode well. I’m indifferent about online gambling.

    In short, not sure what to think.

    For the sake of disscussion, let’s assume Network Neutrality truly means speed prioritization of internet service based on paying a higher fee to Internet Service Providers. The article makes a really good comparison to Mobile based on this assumption in the ” Parallels with Mobile” section, specifically mobile gaming. I think this could apply to any mobile software service, though, since they have the same distribution mechinism. Their bullet points pretty much summarzie my attitude as a developer towards Flash Lite, at least as a USA developer. Mainly being forced to assume insane business risk with weird revenue sharing, no easy access to the direct consumer, and having success held on the thread of being “chosen” by the operator to be put on the phone if they “feel like it”.

    I know of one guy in the US here in Atlanta doing work for oversea’s mobile clients. That’s just one guy, and yet, any Flash Developer is hard to judge “the rest of the market” by because we are so small in number compared to other software programmer industries.

    Anyway, this paragraph summarized it for me; the whole bloody section hit home:

    In short, when the network controlled the content, developers could not effectively iterate towards improvement or be fairly rewarded for their accomplishments. Their businesses and products suffered, which in turn severely retarded market development. Mobile gaming today is probably better on an original GameBoy than on the latest smartphone. And for all the limitless possibilities of using unique portability and location features to create new gaming communities, there is no World of Warcraft or Everquest or Second Life on mobile. If IP networks become akin to mobile networks in their restrictiveness, we may all find out why billion dollar revenue generators such as these die off.

    That “Parallels with Mobile” section is to me an accurate assessment of the mobile industry as perceived by a wanna-be Flash Lite developer right now. As such, if that accurate assessment is also an accurate assessment of Network Neutrality with regards to online gaming, yeah, major suck ahead, hard to port! The #1 problem with online gaming is lag, and if Network Neutrality increases ping time vs. the trend that has continued for years in ping time being LOWERED, then well… bummer.

    I’m not saying my life would be a different place if her majesty had said “lol” 8 seconds later vs. 1 second… I just wonder if it would of even happened online in the first place had Network Neutrality actually come to fruition when Star Wars Galaxies first started. Scary thought.

  • Flash Media Server 3 Feature Requests

    Steve Wolkoff, Flash Media Server Product Manager, is asking the community for feature requests for the next version of Flash Media Server. I’ve put my comments there, but wanted to post them to myblog as well for reference.

    1. A Remote SharedObject version with different licensing.

    I don’t want video, I don’t want audio. I just want server-side scripting with Remote SharedObjects. I shouldn’t have to pay for things I’ll never use. There are a lot of multi -user, real-time data applications I’d like to create, and FMS is the best technology for those apps compared to XMLSocket, and yet to be released Binary socket alternatives. I’m down with Red5, but not all my clients will be.

    It’s about empowering smaller markets. Think After Effects vs. Combustion / AVID; or Ruby on Rails vs. Java’s Spring & Hibernate. There is a lot of room for smaller scale, quicker to market applications that need the insane power FMS has in it’s data part. These apps don’t need video and audio.

    If it’s a new product, so be it.

    2. Streaming 3GP.

    Being forced to use RealPlayer for streaming 3GP via Flash Lite is an f’ing joke. Give us an integrated solution! Or… I’ll keep RealPlayer on my phone, but at least allow the server to progressively stream them so I can not pollute my server. The reverse is true as well. 3GP conversion to FLV would allow better integration with this format from devices to desktop translation. A lot of weird, zombie-rific “solutions” are out there to allow clients to use cellphone video to be used on the web. 3GP to FLV server-side conversion could really be a nice niche here.

    3. Backwards compatibility on Server-Side Scripting.

    I’ve seen a lot of people ask for ActionScript 3 support, or even a move to a “mature” or “enterprise” language like Java. Whatever. Rhino’s ECMA 3 thing works great for me. If you move to a new language, fine, but keep it so I can still code in case-sensitive JavaScript like I have been. If you can’t expose the same API’s like they do for Flash 8 & 9 via AS1, AS2, and AS3, that’s fine; just make it so my old server-side code works in FMS 3. If not, at least allow some sort of scripting engine like .NET’s CLR where we can code in whatever we want.

    4. SMS – Text Message Support

    I’ve seen people wanting some form of VOIP bridge. It’d be nice to have some form of API for SMS too. If this is traditionally the forte of middle-ware, no problem.

  • Email False Positives – My New Daily Tragedy

    I’ve got 1995 emails after just a weekend, 75 of those made it through Mail, Apple’s default email program. 35 of those “not junk” emails are spam. I’ve been prompted in the past to make Junk mail automatically head to the junk folder, but I got too many false positives, incorrect marking of legitimate email as spam, to feel comfortable doing so. I don’t have time anymore, however, to continue to teach Mail what is good email. I’ve turned it on so I can move on with my life.

    I can whine about the fact that I’m losing good email, be a studious developer, and implement the various server-side / client side methods that exist out there. I don’t, however, have time. Email is screwed; it’s built on a flawed platform of not verifying authenticity.

    X gens on back to baby boomers wonder why us Y gens really don’t get all uppity about privacy issues, like blogging our personal lives, voluntarily installing spy ware, and handing over personal information on disparate websites. Yes, a few of us think the US government’s various privacy violations need to have multiple people be held accountable because they are wrong, but bottom line is the perception is different. One of the reasons is, we recognize the value of identity and the power it entails by knowing, for sure, another’s identify. Social networking systems abound that allow control over our relationships. It’s not so much retaining control of our data, but rather getting more control over our communications with others.

    Email has no forced identify, and therefore, has no control. As such, it has slid far from my personal social network. Yes, I still get and read emails, but the time invested is getting less and less return. Many attempts have been made to off load the work to the sender by clicking those authorize email links in auto-responders. I’ll never click those as they themselves are spam messages and do not adapt to changing email addresses.

    Instead, the move to a stronger identify has strengthened my network. For example, I now text a whole lot more than I did last year. I used to hear on the news and blogs that “kids” these days were textting, and thought email was something old people used. I thought textting was pretty dumb. Now, I use it all the time. Unlike my wife who gets copious amounts of incorrect text messages, I get text messages from people I know. I don’t get spam. You can’t send me a text message unless you know my phone number, which isn’t hard to get. For now, I have more control. I’ve gotten spammed twice in my life on IM. I have various identities on IM to ensure I have control over “how much presence” I truly am exposing. My phone numbers are still my #1 fave to communicate.

    Textting, IM, and phone calls rock. Email sucks.

    On the flip-side, I need to be accessible to potential new clients, friends & family, and other people asking me questions, hence I have 3 email addresses. I’ll let Mail’s junk filter, SpamSoap, and whatever Google uses handle the frontal assaults. While spam does get through, it is extremely manageable now, and 3 points of contact allows an easier time of communication.

    While it is a shame I don’t have time to remove all false positives from my life, this is the world I live in and I need to move on. It’s email’s fault for not being built with spam control built into the protocol. Networking is one the pivotal things that helped me be successful. It is hard to walk the fine line how you communicate with those in your network to ensure relevance, and generally filter out the signal to noise ratio for both friends and business. I’d say this year email took the biggest hit in terms of relevance. My primary means of interacting with the world is via email, and I don’t see that changing any time soon. Yet today I just pressed “apply” on settings dialog that could negatively impact my life.

    Drama Queen? Sure. Worried? Don’t have time. Email is very important to me and I have no choice but to put faith in the email that gets through being relevant.