import { HttpUtil } from "../Common/Utils/HttpUtil" ; import { Debug } from "../Common/Debug" ; import { Util } from "../Common/Utils/Util" ; import { UIComponent } from "../UI/Common/UIComponent" ; import DomainPanel from "../UI/Panel/DomainPanel/DomainPanel" ; import { PrefabUrl } from "./PrefabUrl" ; export default class WebApi { public onRequestSucc ( code , res , caller = null , succCallback = null , failCallback = null , isNeedShowDialog_failed = true , isNeedShowDialog_succeed = true , Sound_succeed = "ui_succeed" , Sound_failed = "ui_failed" ) { if ( code == 0 ) { let response = JSON . parse ( res ) ; Debug . log ( response ) ; let code = response . code ; let status = response . status ; let data = response . data ; let codeData = window . appContext . ConfigManager . GetCodeDataById ( code ) ; let tip = null ; if ( codeData ) { tip = codeData . code ; } tip = tip || "系统错误" ; Debug . log ( tip ) ; if ( code == 88 ) { Util . ToastByCode ( 198 , true ) ; let panel = window . appContext . UIManager . getCurrentPanel ( ) ; if ( panel ) { panel . scheduleOnce ( function ( ) { window . appContext . UIManager . ShowPanel ( PrefabUrl . LoginPanel ) ; } , 1 ) ; } } else { if ( status != "Succeed" ) { if ( isNeedShowDialog_failed ) { Util . ToastByCode ( code , true ) ; } if ( Sound_failed ) { window . appContext . SoundManager . playSFX ( Sound_failed ) ; } if ( caller && failCallback ) { failCallback . call ( caller , data ) ; } } else { if ( isNeedShowDialog_succeed ) { Util . ToastByCode ( code ) ; } if ( Sound_succeed ) { window . appContext . SoundManager . playSFX ( Sound_succeed ) ; } let panel = window . appContext . UIManager . getCurrentPanel ( ) ; if ( panel && panel . prefabUrl . lastIndexOf ( "DomainPanel" ) > - 1 ) { panel . refresh ( ) ; } if ( caller && succCallback ) { succCallback . call ( caller , data ) ; } if ( window . appContext . DataContainer . bool_init ) { window . appContext . DataContainer . calculate_tips ( ) ; } } } } } public login ( openid , password , channel , token , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . openid = openid ; request . password = password ; request . channel = channel ; request . token = token ; HttpUtil . Post ( "login" , request , function ( code , res ) { if ( code == 0 ) { let response = JSON . parse ( res ) ; Debug . log ( response ) ; let code = response . code ; let status = response . status ; let data = response . data ; let codeData = window . appContext . ConfigManager . GetCodeDataById ( code ) ; let tip = null ; if ( codeData ) { tip = codeData . code ; } tip = tip || "系统错误" ; Debug . log ( tip ) ; if ( status != "Succeed" ) { window . appContext . UIManager . ShowCommonDialog ( tip ) ; if ( caller && failCallback ) { failCallback . call ( caller ) ; } } else { window . appContext . DataContainer . token = data . token ; if ( caller && succCallback ) { succCallback . call ( caller , data ) ; } } } } ) ; } public get_character_info ( info_type , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . info_type = info_type ; let self = this ; HttpUtil . Post ( "get_character_info" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public get_store_info ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "get_store_info" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public get_secret_info ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "get_secret_info" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } /**
     * 获取世界地图信息
     */ public get_battle_info ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "get_battle_info" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } /**
     * 获取排行榜信息
     */ public get_users_rank ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "get_users_rank" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public set_user_init ( name , titles , init_params , head_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . name = name ; request . titles = titles ; request . init_params = init_params ; request . head_id = head_id ; let self = this ; HttpUtil . Post ( "set_user_init" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public purchase_goods ( goods_index , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . goods_index = goods_index ; let self = this ; HttpUtil . Post ( "purchase_goods" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public refresh_store ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "refresh_store" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public purchase_on_sale ( goods_index , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . goods_index = goods_index ; let self = this ; HttpUtil . Post ( "purchase_on_sale" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public recharge ( goods_index , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . jade_id = goods_index ; let self = this ; HttpUtil . Post ( "recharge" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public activate_skill ( id , resource , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . id = id ; request . resource = resource ; let self = this ; HttpUtil . Post ( "activate_skill" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public activate_formula ( id , resource , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . id = id ; request . resource = resource ; let self = this ; HttpUtil . Post ( "activate_formula" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public activate_avatar ( avatar_type , avatar_id , resource , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . avatar_type = avatar_type ; request . avatar_id = avatar_id ; request . resource = resource ; let self = this ; HttpUtil . Post ( "activate_avatar" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public set_avatar ( avatar_type , avatar_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . avatar_type = avatar_type ; request . avatar_id = avatar_id ; let self = this ; HttpUtil . Post ( "set_avatar" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public set_recover_configs ( item_phase_list , equipment_phase_list , item_quality_list , equipment_quality_list , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . item_phase_list = item_phase_list ; request . equipment_phase_list = equipment_phase_list ; request . item_quality_list = item_quality_list ; request . equipment_quality_list = equipment_quality_list ; let self = this ; HttpUtil . Post ( "set_recover_configs" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public guide_advance ( condition_type , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . condition_type = condition_type ; let self = this ; HttpUtil . Post ( "guide_advance" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public skip_guide ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "skip_guide" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public domain_upgrade ( building_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . building_id = building_id ; let self = this ; HttpUtil . Post ( "domain_upgrade" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public level_upgrade ( item , amount , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . item = item ; request . amount = amount ; let self = this ; HttpUtil . Post ( "level_upgrade" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public phase_break ( break_type , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . break_type = break_type ; let self = this ; HttpUtil . Post ( "phase_break" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public consciousness_upgrade ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "consciousness_upgrade" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public physique_upgrade ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "physique_upgrade" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public root_upgrade ( root_type , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . root_type = root_type ; let self = this ; HttpUtil . Post ( "root_upgrade" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public recover_item ( package_item_id , amount , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . package_item_id = package_item_id ; request . amount = amount ; let self = this ; HttpUtil . Post ( "recover_item" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public recover_item_batch ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "recover_item_batch" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public wear_equipment ( package_item_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . package_item_id = package_item_id ; let self = this ; HttpUtil . Post ( "wear_equipment" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , true , "ui_equipment" ) ; } ) ; } public strengthen_equipment ( equipment_class , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . equipment_class = equipment_class ; let self = this ; HttpUtil . Post ( "strengthen_equipment" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public use_item ( item_id , amount , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . item_id = item_id ; request . amount = amount ; let self = this ; HttpUtil . Post ( "use_item" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public lock_item ( package_item_id , use_lock , type , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . package_item_id = package_item_id ; request . use_lock = use_lock ; request . type = type ; let self = this ; HttpUtil . Post ( "lock_item" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public add_talent ( talent_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . talent_id = talent_id ; let self = this ; HttpUtil . Post ( "add_talent" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public upgrade_skill ( skill_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . skill_id = skill_id ; let self = this ; HttpUtil . Post ( "upgrade_skill" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public set_skill_list ( skill_list , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . skill_list = skill_list ; let self = this ; HttpUtil . Post ( "set_skill_list" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public compose ( formula_id , compose_amount , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . formula_id = formula_id ; request . compose_amount = compose_amount ; let self = this ; HttpUtil . Post ( "compose" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public give_gift ( partner_id , item_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . partner_id = partner_id ; request . item_id = item_id ; let self = this ; HttpUtil . Post ( "give_gift" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public get_partner_award ( partner_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . partner_id = partner_id ; let self = this ; HttpUtil . Post ( "get_partner_award" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } /**
    * 仙域战斗
    */ public battle_init ( mapId , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . map_id = mapId ; request . height = 300 ; let self = this ; HttpUtil . Post ( "battle_init" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public get_skill_list ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "get_skill_list" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public fight_node ( move_to_node , buff , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . move_to_node = move_to_node ; request . buff = buff ; let self = this ; HttpUtil . Post ( "fight_node" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public campfire_node ( move_to_node , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . move_to_node = move_to_node ; let self = this ; HttpUtil . Post ( "campfire_node" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public battle_statement ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "battle_statement" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public probe_secret ( secret_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . secret_id = secret_id ; let self = this ; HttpUtil . Post ( "probe_secret" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public probe_immediately ( secret_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . secret_id = secret_id ; let self = this ; HttpUtil . Post ( "probe_immediately" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public probe_statement ( secret_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . secret_id = secret_id ; let self = this ; HttpUtil . Post ( "probe_statement" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public box_node ( move_to_node , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . move_to_node = move_to_node ; let self = this ; HttpUtil . Post ( "box_node" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public event_node ( move_to_node , choice , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . move_to_node = move_to_node ; request . choice = choice ; let self = this ; HttpUtil . Post ( "event_node" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public thread_node ( move_to_node , choice , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . move_to_node = move_to_node ; request . choice = choice ; let self = this ; HttpUtil . Post ( "thread_node" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public get_achievement_award ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "get_achievement_award" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public fight_achievement ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "fight_achievement" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false ) ; } ) ; } public get_coupon ( coupon_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . coupon_id = coupon_id ; let self = this ; HttpUtil . Post ( "get_coupon" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public receive_mail ( mail_index , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . mail_index = mail_index ; let self = this ; HttpUtil . Post ( "receive_mail" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public receive_mail_batch ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "receive_mail_batch" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public get_remains_info ( remains_quality , page_index , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . remains_quality = remains_quality ; request . page_index = page_index ; let self = this ; HttpUtil . Post ( "get_remains_info" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false ) ; } ) ; } public remains_capture_free ( remains_quality , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . remains_quality = remains_quality ; let self = this ; HttpUtil . Post ( "remains_capture_free" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public remains_capture_exist ( remains_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . remains_id = remains_id ; let self = this ; HttpUtil . Post ( "remains_capture_exist" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public remains_harvest ( remains_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . remains_id = remains_id ; let self = this ; HttpUtil . Post ( "remains_harvest" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public remains_conquer ( remains_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . remains_id = remains_id ; let self = this ; HttpUtil . Post ( "remains_conquer" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public remains_emancipate ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "remains_emancipate" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public new_infinity_challenge ( phase , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . phase = phase ; let self = this ; HttpUtil . Post ( "new_infinity_challenge" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public infinity_challenge ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "infinity_challenge" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public get_world_boss_info ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "get_world_boss_info" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public world_boss_fight ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "world_boss_fight" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public create_alliance ( alliance_name , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . alliance_name = alliance_name ; let self = this ; HttpUtil . Post ( "create_alliance" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public upgrade_alliance ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "upgrade_alliance" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public search_alliance ( page_index , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . page_index = page_index ; let self = this ; HttpUtil . Post ( "search_alliance" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public set_join_threshold ( threshold , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . threshold = threshold ; let self = this ; HttpUtil . Post ( "set_join_threshold" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public join_alliance ( alliance_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . alliance_id = alliance_id ; let self = this ; HttpUtil . Post ( "join_alliance" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public fire_member ( member_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . member_id = member_id ; let self = this ; HttpUtil . Post ( "fire_member" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public apply_for_captain ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "apply_for_captain" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public exit_alliance ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "exit_alliance" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public upgrade_position ( member_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . member_id = member_id ; let self = this ; HttpUtil . Post ( "upgrade_position" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public donate_resource ( item_id , amount , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . item_id = item_id ; request . amount = amount ; let self = this ; HttpUtil . Post ( "donate_resource" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public donate_jade ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "donate_jade" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public exchange_award ( item_id , amount , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . item_id = item_id ; request . amount = amount ; let self = this ; HttpUtil . Post ( "exchange_award" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public upgrade_alliance_technology ( technology_id , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . technology_id = technology_id ; let self = this ; HttpUtil . Post ( "upgrade_alliance_technology" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } public fight_alliance_boss ( caller = null , succCallback = null , failCallback = null ) { let request = { } ; let self = this ; HttpUtil . Post ( "fight_alliance_boss" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback , true , false , null , null ) ; } ) ; } public daily_task_done ( task_progress_type , caller = null , succCallback = null , failCallback = null ) { let request = { } ; request . task_progress_type = task_progress_type ; let self = this ; HttpUtil . Post ( "daily_task_done" , request , function ( code , res ) { self . onRequestSucc ( code , res , caller , succCallback , failCallback ) ; } ) ; } }