Skip to content

Instantly share code, notes, and snippets.

@jamesyoung
Created December 25, 2013 01:46
Show Gist options
  • Save jamesyoung/8119487 to your computer and use it in GitHub Desktop.
Save jamesyoung/8119487 to your computer and use it in GitHub Desktop.
UpdateGameInfo.as::sendRequest()
override public function sendRequest():void
{
var m_SendObj:Object = new Object;
m_SendObj.cApi = API_NAME;
m_SendObj.cMethodName = "POST";
var param : Map = getParms();
LoggerWrapper.instance.getGameInfo(param);
param.add("appID", SlotsConfigData.getInstance().getAppPackageName());
param.add("user_id", CSlotController.getInstance().globalData.user.id);
param.add("device_id", DeviceUtilHelper.getInstance().getDeviceId());
m_SendObj.cParams = param;
m_SendObj.caller = this;
var variables:URLVariables = new URLVariables(CHTTPComms.encodeUrl(param, "test"));
_req.url = "http://localhost:5000/update_user_state";
_req.method = URLRequestMethod.POST;
_req.data = variables;
_loader.addEventListener(flash.events.Event.COMPLETE, onUpdateGameInfo);
try
{
_loader.load(_req);
}
catch (e:*)
{
trace("Unable to load URL");
}
//ConnectionManager.getInstance().SendMessage(m_SendObj);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment