Anyone want to walk me through how the fuck they did it, or give me some source code of theirs?
Lets say I was looking through the Towns 2 source and wanted to remove the timer on "Kneel" or something like that. I could just change the ActionScript so that instead of this:
I have this:Code:case this.ctr: { if (this.canKneel == true) { this.avatarController.doAction(AvatarConstants.ACTION_KNEEL); } this.canKneel = false; this.disableTimer.start(); break; }
But my question is: How would I then use this swf file, and still have it play on Gaia's servers? Is this how you would even make a custom client?Code:case this.ctr: { if (this.canKneel == true) { this.avatarController.doAction(AvatarConstants.ACTION_KNEEL); } this.canKneel = true; break; }
Sorry for all of the questions, I'm just confused as to how to go about this.
Thanks.
Results 1 to 27 of 27
Thread: Making a Gaia Towns client?
- 12 Dec. 2012 09:39pm #1
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 1720.00
Making a Gaia Towns client?
- 13 Dec. 2012 02:08am #2
Rewrites. Rewrite the code/properties to your liking then recompile. Flash Develop/Flash CS5.
If you don't know how to do that then don't even bother. No one's walking you through this in a step by step manner. You should be able to take it from here going off what I told you.
- 13 Dec. 2012 06:38am #3
Are flash compilers free?
- 13 Dec. 2012 07:10am #4
- 13 Dec. 2012 03:44pm #5
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 427.00
I already have flash develop and can recompile the code, but how does that help me at all? Recompiling doesn't mean that I can get it to remotely connect to gaia's game servers. How would I accomplish that?
- 13 Dec. 2012 03:53pm #6
- 13 Dec. 2012 05:24pm #7
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 571.00
So I could just open the SWF in firefox and have it work? o-o wat. Or would I have to host it on a webserver? And anyway, doesn't it say the GSI URL is www, not Welcome to Gaia | Gaia Online So how would it work if it's not hosted on Gaia's servers?
- 13 Dec. 2012 05:47pm #8
What. Why would you have to host it on a web server? lol. If you aren't using any resources from your computer then you just need to display it through a web browser. Like, launch the compiled SWF somehow. Or through an HTML file or something.
Also everything related to Gaia is located on gaia's servers. I have no idea what you're talking about lol.
Rewrite code -> Recompile -> Launch recompiled SWF(s) somehow -> ??? -> Profit.
That's all it should take. Anything else is extrinsic.
- 13 Dec. 2012 07:25pm #9
Most browsers (all modern) can run SWF files without it being embedded in HTML. Generally Windows is set by default to open SWF files in your browser as well.
- 13 Dec. 2012 07:43pm #10
SWFs run in Adobe's external Flash Player by default on my system and probably almost every system I've used.
Also it's pretty much required for the SWF file to be embedded in HTML when you make Flash injections for gaia towns or gaia flash games in general. Unless you can manage to make a clean compile which is incredibly difficult for some god forsaken reason.Last edited by The Unintelligible; 13 Dec. 2012 at 07:54pm.
- 13 Dec. 2012 09:49pm #11
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 1639.00
Would I just have to take the source of the Towns 2 launch page and save it locally, edit the HTML to embed my SWF instead of the normal one, and then just open that in my browser?
I just wasn't sure if that was possible, but if it is that's awesomely easy lol. Would it be possible to just, like, delete the collision kit? And then just noclip through everything? Or would it only show up client-wise, not server-wise? Sorry for all of the questions. Also (sorry) how would I recompile the project? Just exported all of the resources in the Towns 2 SWF using SoThink SWF Decompiler Pro, but when I open the .fla in Flash CS5, the only things that show up as resources are the images and stuff. Do I have to somehow manually add the other .as files to the project? Thanks, and sorry I'm such an idiot about this.
- 14 Dec. 2012 12:02am #12
Basically, yes.
Just decompile the SWF from Gaia, save it, edit it via Flash CS5, edit/throw in anything you want, recompile main swf. Save the rest of the things you need externally. Load the main swf from the same working directory as the other files required (if necessary).
Unless you can compile everything together cohesively. Which again is more difficult than you think. Previous towns clients like Lain's weren't even compiled like that because it's more of a hassle than the other method.
Isonyx could explain this better than I can. I've never really messed around with Flash stuff much.Last edited by The Unintelligible; 14 Dec. 2012 at 12:05am.
- 14 Dec. 2012 12:21am #13
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 181.00
- 14 Dec. 2012 12:52am #14
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 739.00
Well, it didn't work at all. Something in the JavaScript is making the page just load infinitely. When I delete them, though, the SWF embeds but is just the unconnected local SWF, nothing that actually loads the game or anything. I was trying to figure out what parameters I need in the HTML to get it to launch, but I couldn't get it. Any chance you could help?
- 14 Dec. 2012 04:37am #15
We didn't use Flash, Shockwaveflash, action script, or any of that willy-nilly crap. Look into Wireshark and learn how to use sockets. All we did was manipulate the packets being sent to act like we were using flash. Of course if you're going to pull this off, you're also going to need to learn how to use HTTP Captures and then learn their GSI's to get the information you need for the packets. OH! Not to mention the packets. You have to learn what each part does and then have to properly put it together.
It's all a pain in the ass but in the end it might be worth it.
- 14 Dec. 2012 04:45am #16
I propose an offer. Teach me how to do a new Gaiaonline login and I'll gladly throw a flash-less client together for rally or something to show you how it works in C#. Java and C# are fairly similar being of the OO Family.
- 14 Dec. 2012 06:55am #17
Lol, Flash and Shockwaveflash are literally the exact same thing. ActionScript is the code that runs on the Flash platform. So it's basically the same thing too.
Also the reason why this is more convenient than creating a TCP client is because it's visible. Because you're changing the client you actually use. It's also much easier. They're almost entirely different projects. OP is clearly trying to accomplish a modification to Gaia Towns, not create a client for it.
Your suggestion is sort of out of place considering rewrites to Flash and custom clients both have their respective benefits and advantages. It's not so black and white as "TCP b0tz > Flash d00d".Last edited by The Unintelligible; 14 Dec. 2012 at 07:03am.
- 14 Dec. 2012 06:58am #18
You can throw together a "flash-less" client for rally but you can't create a Gaia login? Nice.
Just a heads up bro, Artificial released a Gaia login in Python a while ago. You could always simply port it to C# or your language of use. Stapled has a login as well. All located in the programming section.
Gaia logins are at best simple to do though.
- 14 Dec. 2012 08:18am #19
When I say generally, I mean it's associated with Windows, but I wasn't sure if it comes with the system. It is probably a matter of which was installed last, with browser installations overriding the default flash file association.
Also it's pretty much required for the SWF file to be embedded in HTML when you make Flash injections for gaia towns or gaia flash games in general. Unless you can manage to make a clean compile which is incredibly difficult for some god forsaken reason.
- 14 Dec. 2012 05:29pm #20
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 647.00
Well Chad, I'm at least fairly sure I know how to do the new Gaia Login. If I tell you everything I know on it, would you be willing to throw the client together? I'm 99% sure that with my information you would be able to make a working login, as I got my information from Alex. Actually, I'll just PM it to you now.
- 14 Dec. 2012 05:37pm #21
Give it a spin yourself. Just try to recompile Towns. I never knew entirely why this occurred because I've never really looked too much into it, but successfully compiling Towns is extremely difficult. As such past gaia programmers worked out a workaround where we would use embedded HTML to display Towns through the external towns files (i.e. Lain's client).
Once again though, I've never been certain as to why compiling towns never really worked for most. But of course if it was compiled into a single SWF file it would not necessitate the use of HTML to execute it. If he can do that though kudos to him. But it'd be pretty bleak to attempt.
- 14 Dec. 2012 05:45pm #22
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 1691.00
There is actually a domain check and stuff, surprisingly enough. They use JavaScript to embed the SWF. There's one JavaScript script that says "if it's an swf object, check to see if it's a gaiaswfobject. If not, don't embed it". I removed that to no avail. You need the rest of the script besides that, because the rest of the script sets the GSI domain and the avatar sever and all of that stuff. The other problem appears to be from four JavaScript files included near the top of the HTML code. They're things like "RunProtectedContent.js" and other things like that, I'm fairly sure they play a part in not being able to embed the SWF without the page infinitely refreshing. I'm going to try to remove those but keep the script that embeds the SWF and tells it what each server is when I get home, and I'll post my results after that.
- 14 Dec. 2012 05:59pm #23
Is this Towns 2.0 or just Towns? Because I don't recall there being a domain check in the original or anything like that. All you needed was to embed the SWF or run it somehow.
- 14 Dec. 2012 06:18pm #24
- 14 Dec. 2012 08:01pm #25
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 14693.00
Towns 2.0, I should have said that in the main post, sorry about that.
Here's the page source:
Code:<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Towns | Gaia Online</title> <script type="text/javascript">/*<![CDATA[*/function GAIA_config(key){return {"main_server":"www.gaiaonline.com","graphics_server":"s.cdn.gaiaonline.com","jscompiler_server":"w.cdn.gaiaonline.com","gsi_server":"www.gaiaonline.com","no_image":"\/\/s.cdn.gaiaonline.com\/images\/s.gif","avatar_server":"a2.cdn.gaiaonline.com","avatar_save":"avatarsave.gaiaonline.com","session_page":0,"cache_value":"1340"}[key.toLowerCase()];}/*]]>*/</script> <script type="text/javascript"> /* <![CDATA[ */ var AC_FL_RunContent = 0; var DetectFlashVer = 0; function GAIA_launch(game) { YAHOO.gaia.app.Header.launch(game); } /* ]]> */ </script> <script type="text/javascript" src="http://w.cdn.gaiaonline.com/src/_/1340/pkg-gaia_core.js"></script> <script type="text/javascript" src="http://w.cdn.gaiaonline.com/src/_/1340/pkg-gaia_gim_global.js"></script> <script type="text/javascript" src="http://s.cdn.gaiaonline.com/src/js/AC_RunActiveContent.js?2"></script> <script type="text/javascript" src="http://s.cdn.gaiaonline.com/src/common/header.js"></script> <script type="text/javascript" src="http://s.cdn.gaiaonline.com/src/js/flash/launcher.js"></script> <script type="text/javascript"> /* <![CDATA[ */ var requiredMajorVersion = '10'; // Major version of Flash required var requiredMinorVersion = 0; // Minor version of Flash required var requiredRevision = 45; // Revision of Flash required /* ]]> */ </script> </head> <body style="margin:0; padding:0;"> <noscript> <div class="requires-javascript"><p>Your browser has JavaScript disabled. <a href="http://www.google.com/support/bin/answer.py?answer=23852"><strong>Enable JavaScript</strong></a> on your browser for most GaiaOnline features to work correctly.</p></div> </noscript> <div id="swf_obj" style="display: none;"> <p style="text-align: center">Y U NO HAVE FLASH?!</p> <div style="background-color: #eee; padding: 8px;"> <p>This application requires Adobe Flash.</p> <p>You either don't have it installed, or you may have an older version.</p> <p>Download Flash: <a href="http://get.adobe.com/flashplayer/">http://get.adobe.com/flashplayer/</a></p> <p>Note: iOS devices (iPad, iPod, iPhone) don't support Flash.</p> </div> </div> <script type="text/javascript"> /* <![CDATA[ */ /* Time tracking for spaces */ var start_time = new Date(); var elapsed_time = function() { end_time = new Date(); var total_time = end_time.getTime() - start_time.getTime(); total_time /= 1000; var tracking_image = new Image(1,1); tracking_image.src = 'http://www.gaiaonline.com/internal/prd_t.php?pid=' + Math.floor(total_time) + '&prd=84&loc=towns2&tm=' + end_time.getTime(); } window.onbeforeunload = elapsed_time; var unhideAlternative = function(e) { if (e.success !== true) { document.getElementById('swf_obj').style.display="block"; } }; var embed = function () { var params = {"flashvars":"g=towns2&gver=60&gsiUrl=www&websrv=www.gaiaonline.com&grsrv=s.cdn.gaiaonline.com","allowScriptAccess":"always","allowFullScreen":"true","salign":"","src":"http:\/\/s.cdn.gaiaonline.com\/images\/Gaia_Flash\/Towns2\/towns2.swf?60","base":"http:\/\/s.cdn.gaiaonline.com\/images\/Gaia_Flash\/Towns2\/","subdomain":"www","name":"towns2","game":"towns2","flversion":"10","flversionie":"10","gsiUrl":"www"}; var attributes = params; swfobject.embedSWF("http://s.cdn.gaiaonline.com/images/Gaia_Flash/Towns2/towns2.swf?60", "swf_obj", "975", "650", "10", "//s.cdn.gaiaonline.com/src/js/persist/expressInstall.swf", "g=towns2&gver=60&gsiUrl=www&websrv=www.gaiaonline.com&grsrv=s.cdn.gaiaonline.com", params, attributes, unhideAlternative); }; // Function to actually insert Flash content var launch_flash = function() { if (typeof swfobject !== "object") { (new YAHOO.gaia.util.GaiaLoader({ require: ['gaiaswfobject'], onSuccess: embed })).insert(); } else { embed(); } } var divhide = function(divname) { YAHOO.util.Dom.get(divname).style.display = 'none'; return true; } // Gaia Framework Object ("???" - Filipe) var GAIA = GAIA || {}; GAIA.GameFramework = { id: 0, storeID: function(ident) { var g = GAIA.GameFramework; g.id = ident; }, getID: function() { return GAIA.GameFramework.id; } }; // Gaia Sponsorship object ("?????!" - Filipe) GAIA.Sponsorship = { popup: function(url, name, w, h) { var newWindow = window.open(url, name, 'width='+ w +',height=' + h + ',resizble=no,scrollbars=no,status=no,toolbar=no'); newWindow.focus(); } } YAHOO.util.Event.onDOMReady(function() { launch_flash(); }); /* ]]> */ </script> <div style="display: none"> <img src="http://www.gaiaonline.com/internal/fls_t.php?fid=522&cls=towns2&tm=1355446367"> </div> </body> </html>
Code:<script type="text/javascript" src="http://w.cdn.gaiaonline.com/src/_/1340/pkg-gaia_core.js"></script> <script type="text/javascript" src="http://w.cdn.gaiaonline.com/src/_/1340/pkg-gaia_gim_global.js"></script> <script type="text/javascript" src="http://s.cdn.gaiaonline.com/src/js/AC_RunActiveContent.js?2"></script> <script type="text/javascript" src="http://s.cdn.gaiaonline.com/src/common/header.js"></script> <script type="text/javascript" src="http://s.cdn.gaiaonline.com/src/js/flash/launcher.js"></script>
Code:var unhideAlternative = function(e) { if (e.success !== true) { document.getElementById('swf_obj').style.display="block"; } }; var embed = function () { var params = {"flashvars":"g=towns2&gver=60&gsiUrl=www&websrv=www.gaiaonline.com&grsrv=s.cdn.gaiaonline.com","allowScriptAccess":"always","allowFullScreen":"true","salign":"","src":"http:\/\/s.cdn.gaiaonline.com\/images\/Gaia_Flash\/Towns2\/towns2.swf?60","base":"http:\/\/s.cdn.gaiaonline.com\/images\/Gaia_Flash\/Towns2\/","subdomain":"www","name":"towns2","game":"towns2","flversion":"10","flversionie":"10","gsiUrl":"www"}; var attributes = params; swfobject.embedSWF("http://s.cdn.gaiaonline.com/images/Gaia_Flash/Towns2/towns2.swf?60", "swf_obj", "975", "650", "10", "//s.cdn.gaiaonline.com/src/js/persist/expressInstall.swf", "g=towns2&gver=60&gsiUrl=www&websrv=www.gaiaonline.com&grsrv=s.cdn.gaiaonline.com", params, attributes, unhideAlternative); }; // Function to actually insert Flash content var launch_flash = function() { if (typeof swfobject !== "object") { (new YAHOO.gaia.util.GaiaLoader({ require: ['gaiaswfobject'], onSuccess: embed })).insert(); } else { embed(); } } var divhide = function(divname) { YAHOO.util.Dom.get(divname).style.display = 'none'; return true; } // Gaia Framework Object ("???" - Filipe) var GAIA = GAIA || {}; GAIA.GameFramework = { id: 0, storeID: function(ident) { var g = GAIA.GameFramework; g.id = ident; }, getID: function() { return GAIA.GameFramework.id; } };
I know how to do that, but wouldn't I need the other JavaScript that tells the swf what the different URLs are? I know how to do it without JavaScript, never tried it with JavaScript though. It would be awesome if you could give me a little lesson, I can provide you with a place on Gaia's servers where you would be able to embed it.
- 14 Dec. 2012 08:31pm #26
I don't know what this even means. What URLs? If the flash is compiled to be an edited version of the default flash file, you would just replace their flash file with your own with JavaScript. Or whatever you want to use. You can probably do it through Firebug too.
It would be awesome if you could give me a little lesson, I can provide you with a place on Gaia's servers where you would be able to embed it.Last edited by GAMEchief; 14 Dec. 2012 at 08:34pm.
- 14 Dec. 2012 09:44pm #27
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 1645.00
Ooh, the firebug idea is a good idea. The only way I know of for embedding SWFs is through profiles - there's an option to embed images, and it lets you embed SWFs or something like that, I forget the specifics of it but I know it works.
I think I might try that now, and if that doesn't work I'm going to try the firebug thing.
And, the URLs I was talking about is this:
Code:<script type="text/javascript">/*<![CDATA[*/function GAIA_config(key){return {"main_server":"www.gaiaonline.com","graphics_server":"s.cdn.gaiaonline.com","jscompiler_server":"w.cdn.gaiaonline.com","gsi_server":"www.gaiaonline.com","no_image":"\/\/s.cdn.gaiaonline.com\/images\/s.gif","avatar_server":"a2.cdn.gaiaonline.com","avatar_save":"avatarsave.gaiaonline.com","session_page":0,"cache_value":"1340"}[key.toLowerCase()];}/*]]>*/</script>