------------------------------------------------------------------
-- mainapp.lua
-- Author     : Xin Zhang
-- Version    : 1.0.0.0
-- Date       : 2011-10-15
-- Description:
------------------------------------------------------------------

local strModuleName = "mainapp";
--CCLuaLog("Module ".. strModuleName.. " loaded.");
strModuleName = nil;

------------------------------------------------------------------
--  ʼ ʼ 
------------------------------------------------------------------

local strRootDir = ScutDataLogic.CFileHelper:getPath("lua");
local strTmpPkgPath = package.path;

local strSubDirs =
{
	"scenes",
	"layers",
	"datapool",
	"config",
	"action",
	"lib",
	"commupdate",
	"payment",
	
	-- ڴµĿ¼
};

--package.path = string.format("%s/?.lua;%s/lib/?.lua;%s/action/?.lua;%s/common/?.lua;%s/datapool/?.lua;%s/Global/?.lua;%s/layers/?.lua;%s/LuaClass/?.lua;%s/scenes/?.lua;%s/titleMap/?.lua;%s",strRootDir,strRootDir,strRootDir,strRootDir,strRootDir,strRootDir,strRootDir,strRootDir,strRootDir,strRootDir, strTmpPkgPath);

-- ļ
for key, value in ipairs(strSubDirs) do
	local strOld = strTmpPkgPath;
	if(1 == key) then
		strTmpPkgPath = string.format("%s/%s/?.lua%s", strRootDir, value, strOld);
	else
		strTmpPkgPath = string.format("%s/%s/?.lua;%s", strRootDir, value, strOld);
	end
--	CCLuaLog(value.. " added.");
	strOld = nil;
end

package.path = string.format("%s/?.lua;%s", strRootDir, strTmpPkgPath);
strTmpPkgPath = nil;

------------------------------------------------------------------
--  ʼ  
------------------------------------------------------------------

-- requireڻʼ֮󣬱ļҲ
require("lib.lib")
require("scenes.LoginScene")



 g_frame_mgr = FrameManager:new()
    g_frame_mgr:init()

    function OnHandleData(pScene, nTag, nNetRet, pData)
        pScene = tolua.cast(pScene, "CCScene")
        g_scenes[pScene]:execCallback(nTag, nNetRet, pData)
    end

math.randomseed(os.time());
__NETWORK__=true
------------------------------------------------------------------
--  Эע ʼ 
------------------------------------------------------------------

function processCommonData(lpScene)
   return true;
end

function netDecodeEnd(pScutScene, nTag)

end
--עpushص
CCDirector:sharedDirector():RegisterSocketPushHandler("LoginScene.netCallback");



------------------------------------------------------------------
--  Эע  
------------------------------------------------------------------


LoginScene.init()

