SimCity UI Code + DRM
gist.github.com
SimCity UI Code + DRM
1–10 of 66 posts
Re: SimCity UI Code + DRM
#2(Before you say "The UI, obvs", I'm wondering if it's a common practice to write UI code in games in javascript. I know that Gnome has a lot of JS that's tied into UI, I didn't expect the practice to make itself into game dev).
And if this code is actually from SimCity, does SimCity have some type of v8 or other js engine packaged with it?
Re: SimCity UI Code + DRM
#3Re: SimCity UI Code + DRM
#4What parts of SimCity were written in Javascript? (Before you say "The UI, obvs", I'm wondering if it's a common practice to write UI code in games in javascript. I know that Gnome has a lot of JS that's tied into UI, I didn't expect the practice to make itself into game dev). And if this code is actually from SimCity, does SimCity have some type of v8 or other js engine packaged with it?
[1] http://documentcloud.github.com/backbone/#examples-battlefie...
Re: SimCity UI Code + DRM
#5At the very least it seems cut off...
[1] https://gist.github.com/anonymous/5133829/raw/9340a6fdc35453...
Re: SimCity UI Code + DRM
#6At the very least it seems cut off...
Re: SimCity UI Code + DRM
#7At the very least it seems cut off...
Re: SimCity UI Code + DRM
#8Re: SimCity UI Code + DRM
#9Lots of nice references to cheats though! They all rely on simcity.DEBUG being true,
if (simcity.DEBUG)
switch (a) {
case scrui.kKeyCodeDigit1:
c && (e && !d) && scrui.RunCheat("scgameui -unlockalltools");
break;
case scrui.kKeyCodeLetterW:
c && (e && !d) && simcity.CreateUnit("T_RCI_AddHourlyIncomeCheat")
}
Also pretty nifty: There's a rest api built into the game for communication, (as wel as websockets) and the name and email of one of the programmers are still in the code. simcity.TutorialFakeUserData.creator = {
uri : "/rest/user/0",
tutorialState : 1,
id : 0,
screenName : "Chet Keno",
email : "mayorkeno@simcity.com",
nucleusId : 0,
lastLogin : 0,
isOnline : "true",
avatarImage : "Graphics/Tutorial/tutorial_avatar_keno.png",
cities_count : 1
};
Also interesting is that it seems that this is not just a stripped v8 engine. There's things in the code that make me think the whole game UI is actually a pretty decent webkit engine: simcity.gEventManager = new simcity.cEventManger;
simcity.gEventTypes = {
CLICK : "click",
MOUSEUP : "mouseUp",
MOUSEDOWN : "mouseDown",
MOUSEOVER : "mouseOver",
MOUSEOUT : "mouseOut",
ITEMSELECTED : "itemSelected",
KEYUP : "keyup",
KEYDOWN : "keydown",
DATACHANGED : "dataChanged",
HASHCHANGED : "hashChanged",
GENERICEVENT : "genericEvent",
SOCKETEVENT : "socketEvent",
SOCKETCONNECT : "socketConnect",
SOCKETDISCONNECT : "socketDisconnect"
};
simcity.SocketManager = {};
simcity.cSocketManager = function () {
this.mSocketListeners = [];
this.mSocketRequests = [];
update: It could be leftovers, but this indicates that this is code from a prerelease/debug build. simcity.SetUpDemoScreen = function () {
simcity.persistentLayout = gUIManager.LoadLayout("Layouts/PersistentPreAlpha.js", gUIManager.GetRootWindow());
simcity.SetTextOnElement(simcity.DemoExitButtonTxt, new scrui.cLocaleString("Tutorials.json", "0x0eaf7bc9", "EXIT"));
simcity.SetTextOnElement(simcity.DemoAvailableReleaseDateTxt, new scrui.cLocaleString("Tutorials.json", "0x0eaf7bb2", "AVAILABLE FEBRUARY 2013"));
simcity.SetTextOnElement(simcity.DemoThanksForPlayingTxt, new scrui.cLocaleString("Tutorials.json", "0x0eaf7b4b",
"THANKS for PLAYING"));
simcity.SetTextOnElement(simcity.DemoPreOrderTxt, new scrui.cLocaleString("Tutorials.json", "0x0eaf7bb1", "PRE-ORDER AT SIMCITY.COM"));
simcity.SetTextOnElement(simcity.DemoNotFinalSoftwareTxt, new scrui.cLocaleString("Tutorials.json", "0x0eaf7b3c", "Not Final Software"))
};Re: SimCity UI Code + DRM
#10Misleading title. This is obviously a formatted version of minified JS, presumably extracted from the shipping game, not a leak.