Exemplo n.º 1
0
 public void message(s_message message)
 {
     if (message.m_type == "commit_play")
     {
         m_id = m_mi.id;
         protocol.game.cmsg_play_map msg = new protocol.game.cmsg_play_map();
         msg.id = m_id;
         net_http._instance.send_msg <protocol.game.cmsg_play_map>(opclient_t.OPCODE_PLAY_MAP, msg);
     }
     if (message.m_type == "player_select_gui_download")
     {
         protocol.game.cmsg_download_map msg = new protocol.game.cmsg_download_map();
         msg.id = m_mi.id;
         net_http._instance.send_msg <protocol.game.cmsg_download_map>(opclient_t.OPCODE_DOWNLOAD_MAP, msg);
     }
     if (message.m_type == "player_select_gui_br_drop")
     {
         protocol.game.cmsg_mission_continue msg = new protocol.game.cmsg_mission_continue();
         net_http._instance.send_msg <protocol.game.cmsg_mission_continue>(opclient_t.OPCODE_MISSION_DROP, msg);
     }
 }
Exemplo n.º 2
0
 void click(GameObject obj)
 {
     if (mario._instance.m_self.guide == 200)
     {
         if (obj.name != "big_sub")
         {
             mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_jxbs"));
             return;
         }
         int id = obj.GetComponent <play_select_big>().m_type;
         if (id != 200)
         {
             mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_jxbs"));
             return;
         }
     }
     if (mario._instance.m_self.guide == 201 && obj.name != "play")
     {
         mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_jxpl"));
         return;
     }
     if (obj.name == "close")
     {
         mario._instance.change_state(e_game_state.egs_login, 1, delegate() { Object.Destroy(this.gameObject); });
     }
     if (obj.name == "big_sub")
     {
         if (m_lan == 0)
         {
             int id = obj.GetComponent <play_select_big>().m_type;
             if (id >= 200)
             {
                 int clevel = obj.GetComponent <play_select_big>().m_clevel;
                 if (clevel > mario._instance.m_self.level)
                 {
                     s_t_view_title t_vt = game_data._instance.get_t_view_title(id);
                     string         s    = string.Format(game_data._instance.get_language_string("play_select_gui_ddjv"), clevel, t_vt.name);
                     mario._instance.show_tip(s);
                     return;
                 }
                 if (mario._instance.m_self.guide == 200)
                 {
                     obj.GetComponent <play_select_big>().hide_shou();
                     mario._instance.m_self.guide = 201;
                 }
                 protocol.game.cmsg_view_comment msg = new protocol.game.cmsg_view_comment();
                 msg.id = mario._instance.m_self.mapid;
                 net_http._instance.send_msg <protocol.game.cmsg_view_comment>(opclient_t.OPCODE_VIEW_COMMENT, msg);
             }
             else if (id == 1)
             {
                 change_first(true);
             }
             else if (id == 2)
             {
                 protocol.game.cmsg_mission_view msg = new protocol.game.cmsg_mission_view();
                 net_http._instance.send_msg <protocol.game.cmsg_mission_view>(opclient_t.OPCODE_MISSION_VIEW, msg);
             }
         }
     }
     if (obj.name == "first_sub")
     {
         if (m_lan == 1)
         {
             m_page_type = obj.GetComponent <play_select_sub>().m_type;
             m_page_up   = 0;
             m_page_down = 0;
             m_page_fx   = 0;
             protocol.game.cmsg_view_map msg = new protocol.game.cmsg_view_map();
             msg.index = 0;
             msg.type  = m_page_type;
             msg.ver   = game_data.m_self_map_ver;
             net_http._instance.send_msg <protocol.game.cmsg_view_map>(opclient_t.OPCODE_VIEW_MAP, msg);
         }
     }
     if (obj.name == "return")
     {
         if (m_lan == 2)
         {
             m_page_type = -1;
             change_first(false);
         }
         else if (m_lan == 1)
         {
             m_page_type = -1;
             change_big();
         }
         else
         {
             mario._instance.change_state(e_game_state.egs_login, 1, delegate() { Object.Destroy(this.gameObject); });
         }
     }
     if (obj.name == "small_sub")
     {
         protocol.game.map_show          ms  = obj.GetComponent <play_select_sub1>().m_ms;
         protocol.game.cmsg_view_comment msg = new protocol.game.cmsg_view_comment();
         msg.id = ms.id;
         net_http._instance.send_msg <protocol.game.cmsg_view_comment>(opclient_t.OPCODE_VIEW_COMMENT, msg);
     }
     if (obj.name == "play")
     {
         m_id = m_mi.id;
         protocol.game.cmsg_play_map msg = new protocol.game.cmsg_play_map();
         msg.id = m_id;
         net_http._instance.send_msg <protocol.game.cmsg_play_map>(opclient_t.OPCODE_PLAY_MAP, msg);
     }
     if (obj.name == "search")
     {
         if (m_lan == 0)
         {
             mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_zxsc"));
             return;
         }
         m_search.SetActive(true);
         m_search_text.GetComponent <UIInput>().value = "";
     }
     if (obj.name == "search_ok")
     {
         string name = m_search_text.GetComponent <UIInput>().value;
         if (name == "")
         {
             mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_gjzk"));
             return;
         }
         m_page_type = -1;
         protocol.game.cmsg_search_map msg = new protocol.game.cmsg_search_map();
         msg.name = name;
         net_http._instance.send_msg <protocol.game.cmsg_search_map>(opclient_t.OPCODE_SEARCH_MAP, msg);
     }
     if (obj.name == "search_close")
     {
         m_search.GetComponent <ui_show_anim>().hide_ui();
     }
     if (obj.name == "shc")
     {
         protocol.game.cmsg_favorite_map msg = new protocol.game.cmsg_favorite_map();
         msg.id = m_mi.id;
         net_http._instance.send_msg <protocol.game.cmsg_favorite_map>(opclient_t.OPCODE_FAVORITE_MAP, msg);
     }
     if (obj.name == "pl")
     {
         m_pinglun.SetActive(true);
         m_pinglun_text.GetComponent <UIInput>().value = "";
     }
     if (obj.name == "pinglun_ok")
     {
         string text = m_pinglun_text.GetComponent <UIInput>().value;
         if (text == "")
         {
             mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_plwk"));
             return;
         }
         protocol.game.cmsg_comment msg = new protocol.game.cmsg_comment();
         msg.id   = m_mi.id;
         msg.text = text;
         net_http._instance.send_msg <protocol.game.cmsg_comment>(opclient_t.OPCODE_COMMENT, msg);
     }
     if (obj.name == "pinglun_close")
     {
         m_pinglun.GetComponent <ui_show_anim>().hide_ui();
     }
     if (obj.name == "ph")
     {
         protocol.game.cmsg_view_map_point_rank msg = new protocol.game.cmsg_view_map_point_rank();
         msg.map_id = m_mi.id;
         net_http._instance.send_msg <protocol.game.cmsg_view_map_point_rank>(opclient_t.OPCODE_VIEW_MAP_POINT_RANK, msg);
     }
     if (obj.name == "touxiang")
     {
         look_player(m_mi.owner_id);
     }
     if (obj.name == "br_start")
     {
         protocol.game.cmsg_mission_start msg = new protocol.game.cmsg_mission_start();
         msg.hard = m_bhard;
         net_http._instance.send_msg <protocol.game.cmsg_mission_start>(opclient_t.OPCODE_MISSION_START, msg);
     }
     if (obj.name == "br_continue")
     {
         protocol.game.cmsg_mission_continue msg = new protocol.game.cmsg_mission_continue();
         net_http._instance.send_msg <protocol.game.cmsg_mission_continue>(opclient_t.OPCODE_MISSION_CONTINUE, msg);
     }
     if (obj.name == "download")
     {
         s_message mes = new s_message();
         mes.m_type = "player_select_gui_download";
         mario._instance.show_double_dialog_box(game_data._instance.get_language_string("play_select_gui_dself"), mes);
     }
     if (obj.name == "br_drop")
     {
         s_message mes = new s_message();
         mes.m_type = "player_select_gui_br_drop";
         mario._instance.show_double_dialog_box(game_data._instance.get_language_string("play_select_gui_br_drop"), mes);
     }
 }