ProtocolCode.lua 6.4 KB
-- 协议号
actionCodes = {
	Sys_heartBeat = 1,
	Sys_errorMsg = 3,
	Sys_innerErrorMsg = 4,
	Sys_commonNotice = 5,
	Sys_maintainNotice = 6,
	Sys_kickdown = 7,
	Sys_runningHorse = 8,

	Gm_clientRequest = 20,
	Gm_receiveResponse = 21,

	Role_notifyNewEvent = 100,
	Role_queryLoginRpc = 101,
	Role_createRpc = 102,
	Role_loginRpc = 103,
	Role_updateProperty = 105,
	Role_updateProperties = 106,
	Role_changeFormationRpc = 107,
	Role_setCrownRpc = 108,
	Role_formationPosRpc = 109,
	Role_entrustRpc = 110,
	Role_finishEntrustRpc = 111,
	Role_updateStoryBook = 112,
	Role_finishTalkRpc = 113,
	Role_updateHeroBook = 114,
	Role_guideRpc = 115,
	Role_changeAutoSateRpc = 116,
	Role_signRpc = 117,
	Role_dailyTaskRpc = 118,
	Role_mainTaskRpc = 119,
	Role_missionRpc = 120,
	Role_formationQuickRpc = 121,
	Role_changeNameRpc = 122,
	Role_changeHomeBgRpc = 123,
	Role_changeHeadIconRpc = 124,
	Role_changeHeadFrameRpc = 125,
	Role_cookNotesRpc = 126,
	Role_cookAddFavoritesRpc = 127,
	Role_cookDelFavoritesRpc = 128,
	Role_drawCodeRpc = 129,
	Role_chat = 130,
	Role_signGiftRpc = 131,
	Role_changeToRealUserRpc = 132,
	Role_cafeSignRpc = 133,
	Role_syncTimeRpc = 134,
	Role_getLevelRankRpc = 135,
	Role_deletAccountRpc = 136,
	Role_getItemRankRpc = 137,

	Hero_loadInfos = 201,
	Hero_updateProperty = 202,
	Hero_decomposeRpc = 203,
	Hero_qualityRpc = 204,
	Hero_strengthRpc = 205,
	Hero_lockRpc = 206,
	Hero_researchRpc = 207,
	Hero_finishResearchRpc = 208,
	Hero_treatRpc = 209,
	Hero_finishTreatRpc = 210,
	Hero_loveItemRpc = 211,
	Hero_finishLoveTaskRpc = 212,
	Hero_changeDressRpc = 213,
	Hero_quickTreatRpc = 214,
	Hero_skillUpRpc = 215,
	Hero_changeNameRpc = 216,
	Hero_likeHeroRpc = 217,
	Hero_commentHeroRpc = 218,
	Hero_getCommentsRpc = 219,
	Hero_likeCommentRpc = 220,



	Item_updateProperty = 301,
	
	Store_produceRpc = 401,
	Store_finishBuildRpc = 402,
	Store_diamondBuyRpc = 403,
	Store_itemBuyRpc = 404,
	Store_rechargeRpc = 405,
	Store_ayncPurchaseRpc = 406,
	Store_purchaseOrderResult = 407,
	Store_iapPurchaseRpc = 408,
	Store_iapCancelPurchase = 409,
	Store_restorePurchaseRpc = 410,
	Store_googlePurchaseRpc = 411,
	Store_googleCancelPurchase = 412,
	Store_samsungPurchaseRpc = 413,
	Store_samsungCancelPurchase = 414,

	Trade_getInfoRpc = 450,
	Trade_sellRpc = 451,
	Trade_buyRpc = 452,
	Trade_giveUpRpc = 453,
	Trade_cleanBuyRpc = 454,

	Carbon_arrangeCarbonRpc = 500,
	Carbon_moveRpc = 501,
	Carbon_actionEndRpc = 502,
	Carbon_beginGameRpc = 503,
	Carbon_endGameRpc = 504,
	Carbon_cancelMoveRpc = 505,
	Carbon_updateProperty = 506,
	Carbon_endCarbonRpc = 507,
	Carbon_exitTeamRpc = 508,
	Carbon_supplyRpc = 509,
	Map_updateProperty = 510,
	Carbon_changePosRpc = 511,
	Carbon_generateBoss = 512,
	Carbon_givpUpBoss = 513,
	Carbon_drawBossAward = 514,
	Carbon_SelectRpc = 515,
	
	Friend_updateProperty = 550,
	Friend_listRpc = 551,
	Friend_searchRpc = 552,
	Friend_randomRpc = 553,
	Friend_deleteRpc = 554,
	Friend_applyRpc	 = 555,
	Friend_applyListRpc = 556,
	Friend_handleApplyRpc = 557,
	Friend_report = 558,

	Farm_updateProperty = 600,
	Farm_drawMaterial = 601,
	Farm_levelUpBuilding = 602,
	Farm_changeShowMedal = 603,
	Farm_plantRpc = 604,
	Farm_useItemRpc = 605,
	Farm_getPlantRpc = 606,
	Farm_farmInfoRpc = 607,
	Farm_changeFarmerRpc = 608,

	Tower_updateProperty = 630,
	Tower_battleBeginRpc = 631,
	Tower_battleEndRpc = 632,
	Tower_resetRpc = 633,
	Tower_cureRpc = 634,
	Tower_changeFormatRpc = 635,
	Tower_getRankRpc = 636,
	Tower_formatQuickRpc = 637,
	Tower_formationPosRpc = 638,
	Tower_breakRpc = 639,

	Email_listRpc = 650,
	Email_drawAttachRpc = 651,
	Email_checkRpc = 652,
	Email_delRpc = 653,
	Email_drawAllAttachRpc = 654,

	Pvp_updateProperty = 670,
	Pvp_battleBeginRpc = 671,
	Pvp_battleEndRpc = 672,
	Pvp_resetRpc = 673,
	Pvp_enterPvpRpc = 674,
	Pvp_getRankRpc = 675,
	Pvp_changeFormatRpc = 676,
	Pvp_formatQuickRpc = 677,
	Pvp_formationPosRpc = 678,
	Pvp_skillOrderRpc = 679,
	Pvp_shopBuyRpc = 680,
	
	Equip_updateProperty = 750,
	Equip_wearEquipRpc = 751,
	Equip_repairEquipRpc = 752,
	Equip_forgeEquipAttrsRpc = 753,
	Equip_replaceEquipAttrRpc = 754,
	Equip_buildEquipRpc = 755,
	Equip_finishBuildEquipRpc = 756,
	Equip_decomposEquipRpc = 757,
	Equip_resetEquipRpc = 758,
	Equip_upEquipRpc = 759,

	Activity_getRewardRpc = 801,
	Activity_lotteryGiftRpc = 802,
	Activity_shopBuyRpc = 803,
	Activity_puzzleRewardRpc = 804,
	Activity_inheritRewardRpc = 805,
	Activity_midAutRewardRpc = 806,
	Activity_clearRed = 807,
	Activity_halloweenMoveRpc = 808,
	Activity_halloweenResetRpc = 809,
	Activity_halloweenRewardRpc = 810,
	Activity_traditionalRewardRpc = 811,
	Activity_africanRpc = 812,
	Activity_oldBackRpc = 813,
	Activity_orderRewardRpc = 814,
	Activity_cookHeroRpc = 815,

	Moon_arrangeCarbonRpc = 850,
	Moon_moveRpc = 851,
	Moon_actionEndRpc = 852,
	Moon_beginGameRpc = 853,
	Moon_endGameRpc = 854,
	Moon_cancelMoveRpc = 855,
	Moon_updateProperty = 856,
	Moon_endCarbonRpc = 857,
	Moon_exitTeamRpc = 858,
	Moon_supplyRpc = 859,
	Moon_changePosRpc = 860,
	Moon_generateBoss = 861,
	Moon_givpUpBoss = 862,
	Moon_drawBossAward = 863,
	Moon_SelectRpc = 864,

	Paradise_arrangeCarbonRpc = 875,
	Paradise_moveRpc = 876,
	Paradise_actionEndRpc = 877,
	Paradise_beginGameRpc = 878,
	Paradise_endGameRpc = 879,
	Paradise_cancelMoveRpc = 880,
	Paradise_updateProperty = 881,
	Paradise_endCarbonRpc = 882,
	Paradise_exitTeamRpc = 883,
	Paradise_supplyRpc = 884,
	Paradise_changePosRpc = 885,
	Paradise_SelectRpc = 886,
	Paradise_buyCountRpc = 887,

	Diner_loadRpc = 900,
	Diner_updateProperty = 901,
	Diner_updateProperties = 902,
	Diner_accessoryUpdateProperty = 903,
	Diner_itemUpdateProperty = 904,
	Diner_wearAccessoryRpc = 905,
	Diner_upLevelAccessoryRpc = 906,
	Diner_supplyMaterialRpc = 907,
	Diner_changeCarRpc = 908,
	Diner_recycleAccessoryRpc = 909,
	Diner_heroToBoxRpc = 910,
	Diner_saveBoxFitmentRpc = 911,
	Diner_recycleFitmentsRpc = 912,
	Diner_sellRpc = 913,
	Diner_finishSellRpc = 914,
	Diner_shopBuyRpc = 915,
	Diner_drawRewardRpc = 916,
	Diner_talentUpdateProperty = 917,

	Diner_likeOtherBoxRpc = 918,
	Diner_comfortRankRpc = 919,
	Diner_nearLikeMeRpc = 920,
	Diner_friendListRpc = 921,
	Diner_getBoxDataRpc = 922,
	Diner_changeTalkRpc = 923,
	Diner_changeTalkBgRpc = 924,
}

rpcResponseBegin = 10000

actionHandlers = {}
for key, value in pairs(actionCodes) do
	local suffix = string.sub(key, -3, -1)
	local handlerName = string.gsub(key, "_", ".")

	if suffix == "Rpc" then
		actionHandlers[value + rpcResponseBegin] = handlerName .. "Response"
	end
	actionHandlers[value] = string.gsub(key, "_", ".")
end