コード例 #1
0
ファイル: paihang_gui.cs プロジェクト: dqchess/mario
 public void net_message(s_net_message message)
 {
     if (message.m_opcode == opclient_t.OPCODE_VIEW_VIDEO)
     {
         m_vv = true;
     }
 }
コード例 #2
0
 public void net_message(s_net_message message)
 {
     if (message.m_opcode == opclient_t.OPCODE_MAP_LIKE)
     {
         m_like.SetActive(false);
         m_ydz.SetActive(true);
     }
 }
コード例 #3
0
ファイル: net_http.cs プロジェクト: dqchess/mario
    private void onRecMsg(opclient_t opcode, int res, byte[] msg)
    {
        s_net_message _message = new s_net_message();

        _message.m_byte   = msg;
        _message.m_opcode = opcode;
        _message.m_res    = res;
        cmessage_center._instance.add_net_message(_message);
    }
コード例 #4
0
ファイル: edit_gui.cs プロジェクト: dqchess/mario
 public void net_message(s_net_message message)
 {
     if (message.m_opcode == opclient_t.OPCODE_SAVE_MAP)
     {
         if (m_return)
         {
             mario._instance.change_state(e_game_state.egs_edit_select, 1, delegate() { Object.Destroy(this.gameObject); });
         }
     }
     if (message.m_opcode == opclient_t.OPCODE_COMPLETE_GUIDE)
     {
         mario._instance.m_self.guide = 200;
         s_message mes = new s_message();
         mes.m_type = "jx_5";
         mario._instance.show_xsjx_dialog_box(game_data._instance.get_language_string("edit_gui_wcjx"), mes);
     }
 }
コード例 #5
0
ファイル: cmessage_center.cs プロジェクト: dqchess/mario
    void net_message()
    {
        while (m_net_messages.Count > 0)
        {
            s_net_message _message = m_net_messages[0] as s_net_message;
            m_net_messages.RemoveAt(0);
            for (int i = 0; i < m_handles.Count; i++)
            {
                IMessage _handles = (IMessage)m_handles[i];

                if (_handles != null)
                {
                    _handles.net_message(_message);
                }
            }
        }
    }
コード例 #6
0
    public void net_message(s_net_message message)
    {
        if (message.m_opcode == opclient_t.OPCODE_LOGIN ||
            message.m_opcode == opclient_t.OPCODE_LOGIN_ANDROID ||
            message.m_opcode == opclient_t.OPCODE_CHANGE_ACCOUNT ||
            message.m_opcode == opclient_t.OPCODE_REGISTER)
        {
            if (message.m_res == -1)
            {
                mario._instance.show_single_dialog_box(game_data._instance.get_language_string("login_gui_feif"), null);
                return;
            }
            protocol.game.smsg_login _msg = net_http._instance.parse_packet <protocol.game.smsg_login> (message.m_byte);

            player pl = new player(_msg);
            if (mario._instance.m_self != null)
            {
                pl.m_review = mario._instance.m_self.m_review;
            }
            mario._instance.m_self = pl;
            game_data._instance.m_save_data.openid  = _msg.openid;
            game_data._instance.m_save_data.openkey = _msg.openkey;
            game_data._instance.save_native();

            if (pl.nationality != "")
            {
                string ccs = game_data._instance.get_t_guojia(pl.nationality);
                m_zc_cc.GetComponent <UISprite>().spriteName    = ccs;
                m_zc_ccn.GetComponent <UILabel>().text          = pl.nationality;
                m_cname_cc.GetComponent <UISprite>().spriteName = ccs;
                m_cname_ccn.GetComponent <UILabel>().text       = pl.nationality;
            }

            if (message.m_opcode == opclient_t.OPCODE_LOGIN)
            {
                m_user.SetActive(true);
                m_main.SetActive(true);
                m_icon_panel.SetActive(true);
                mario._instance.show_tip(game_data._instance.get_language_string("login_gui_dlcg"));
                pl.m_review = _msg.review;
            }
            else if (message.m_opcode == opclient_t.OPCODE_LOGIN_ANDROID)
            {
                if (pl.visitor == 1)
                {
                    m_cname.SetActive(true);
                }
                else
                {
                    m_user.SetActive(true);
                    m_main.SetActive(true);
                    m_icon_panel.SetActive(true);
                    mario._instance.show_tip(game_data._instance.get_language_string("login_gui_dlcg"));
                }
            }
            else if (message.m_opcode == opclient_t.OPCODE_CHANGE_ACCOUNT)
            {
                m_qiehuan.GetComponent <ui_show_anim>().hide_ui();
                m_main.SetActive(true);
                mario._instance.show_tip(game_data._instance.get_language_string("login_gui_qhcg"));
            }
            else if (message.m_opcode == opclient_t.OPCODE_REGISTER)
            {
                m_zhuce.GetComponent <ui_show_anim>().hide_ui();
                m_main.SetActive(true);
                mario._instance.show_tip(game_data._instance.get_language_string("login_gui_wscg"));
            }
            reset_user();
        }
        if (message.m_opcode == opclient_t.OPCODE_CHANGE_NAME)
        {
            string nc = m_cn_nc.GetComponent <UIInput>().value;
            string gj = m_cname_ccn.GetComponent <UILabel>().text;
            mario._instance.m_self.name        = nc;
            mario._instance.m_self.head        = m_index;
            mario._instance.m_self.nationality = gj;
            mario._instance.m_self.visitor     = 0;
            m_cname.GetComponent <ui_show_anim>().hide_ui();
            m_user.SetActive(true);
            m_main.SetActive(true);
            m_icon_panel.SetActive(true);
            mario._instance.show_tip(game_data._instance.get_language_string("login_gui_wscg"));
            reset_user();
        }
        if (message.m_opcode == opclient_t.OPCODE_LIBAO)
        {
            protocol.game.smsg_libao _msg = net_http._instance.parse_packet <protocol.game.smsg_libao> (message.m_byte);
            string s = string.Format(game_data._instance.get_language_string("login_gui_gtlb"), _msg.life);
            mario._instance.show_tip(s);
            m_lbm.GetComponent <ui_show_anim>().hide_ui();
        }
    }
コード例 #7
0
    public void net_message(s_net_message message)
    {
        if (message.m_opcode == opclient_t.OPCODE_COMPLETE_MAP)
        {
            protocol.game.smsg_complete_map _msg = net_http._instance.parse_packet <protocol.game.smsg_complete_map> (message.m_byte);
            if (m_win == 0)
            {
                bool next = false;
                if (_msg.mapid != 0)
                {
                    mario._instance.m_self.mapid   = _msg.mapid;
                    mario._instance.m_self.support = _msg.support;
                    int level = game_data._instance.get_zm(_msg.support);
                    if (level > 0 && level <= mario._instance.m_self.level)
                    {
                        next = true;
                    }
                }
                mario._instance.m_self.add_exp(_msg.exp + _msg.extra_exp);
                if (mario._instance.m_self.m_review == 0)
                {
                    this.gameObject.SetActive(false);
                    mario._instance.show_clear_gui(_msg.exp, _msg.extra_exp, _msg.rank, _msg.testify, next);
                }
                else
                {
                    mario._instance.change_state(e_game_state.egs_play_select, 1, delegate() { this.gameObject.SetActive(false); });
                }
            }
            else
            {
                m_play_lose.SetActive(true);
            }
        }
        if (message.m_opcode == opclient_t.OPCODE_REPLAY_MAP)
        {
            if (message.m_res == -1)
            {
                mario._instance.show_tip(game_data._instance.get_language_string("play_gui_tlbz"));
                protocol.game.msg_life_error _msg1 = net_http._instance.parse_packet <protocol.game.msg_life_error> (message.m_byte);
                mario._instance.m_self.set_reset_time(_msg1.server_time, _msg1.life_time);
                return;
            }
            mario_tool._instance.onRaid(game_data._instance.m_map_id.ToString(), 1);
            m_play_pause.GetComponent <ui_show_anim>().hide_ui();
            m_play_lose.GetComponent <ui_show_anim>().hide_ui();
            mario._instance.show_play_mask(delegate() { play_mode._instance.reload(); m_time_up.SetActive(false); });

            mario._instance.play_mus_ex(game_data._instance.get_map_music(0), true, 1 - game_data._instance.m_map_data.no_music);
        }
        if (message.m_opcode == opclient_t.OPCODE_UPLOAD_MAP)
        {
            mario._instance.show_tip(game_data._instance.get_language_string("play_gui_sccg"));
            mario._instance.m_self.add_job_exp(100);
            mario._instance.m_self.upload++;
            mario._instance.change_state(e_game_state.egs_edit_select, 1, delegate() { this.gameObject.SetActive(false); });
        }
        if (message.m_opcode == opclient_t.OPCODE_MISSION_FAIL)
        {
            if (message.m_res == -1)
            {
                mario._instance.m_self.m_finish      = net_http._instance.parse_packet <protocol.game.smsg_mission_finish> (message.m_byte);
                mario._instance.m_self.m_finish_type = 1;
                mario._instance.m_self.br_start      = 0;
                mario._instance.m_self.set_br(0, "", "", "");
                mario._instance.change_state(e_game_state.egs_br_end, 1, delegate() { this.gameObject.SetActive(false); });
            }
            else
            {
                m_brplay_lose.SetActive(true);
            }
        }
        if (message.m_opcode == opclient_t.OPCODE_MISSION_REPLAY)
        {
            mario._instance.m_self.br_life--;
            mario._instance.m_start_type = 1;
            mario._instance.change_state(e_game_state.egs_br_start, 1, delegate() { this.gameObject.SetActive(false); });
        }
        if (message.m_opcode == opclient_t.OPCODE_MISSION_SUCCESS)
        {
            if (message.m_res == -1)
            {
                mario._instance.m_self.m_finish      = net_http._instance.parse_packet <protocol.game.smsg_mission_finish> (message.m_byte);
                mario._instance.m_self.m_finish_type = 0;
                mario._instance.m_self.br_start      = 2;
                mario._instance.m_self.set_br(0, "", "", "");
                mario._instance.show_clear_gui(false);
                this.gameObject.SetActive(false);
            }
            else
            {
                protocol.game.smsg_mission_play _msg = net_http._instance.parse_packet <protocol.game.smsg_mission_play> (message.m_byte);
                mario._instance.m_self.set_br(_msg.user_head, _msg.user_country, _msg.user_name, _msg.map_name);
                game_data._instance.load_mission(-1, _msg.map_data, _msg.x, _msg.y);
                mario._instance.m_self.br_index++;
                mario._instance.m_start_type = 2;
                mario._instance.show_clear_gui(true);
                this.gameObject.SetActive(false);
            }
        }
    }
コード例 #8
0
ファイル: player_select_gui.cs プロジェクト: dqchess/mario
    public void net_message(s_net_message message)
    {
        if (message.m_opcode == opclient_t.OPCODE_VIEW_MAP)
        {
            protocol.game.smsg_view_map _msg = net_http._instance.parse_packet <protocol.game.smsg_view_map> (message.m_byte);
            m_max_page = _msg.page;
            if (m_page_fx == 0)
            {
                clear_second();
            }
            add_second(_msg, m_page_fx);
            change_second();
        }
        if (message.m_opcode == opclient_t.OPCODE_VIEW_COMMENT)
        {
            protocol.game.smsg_view_comment _msg = net_http._instance.parse_packet <protocol.game.smsg_view_comment> (message.m_byte);
            show_map(_msg.infos);
            reset_pinlun(_msg.comments);
            m_right_view.GetComponent <UIScrollView>().ResetPosition();
            for (int i = 0; i < m_second.Count; ++i)
            {
                if (m_second[i].GetComponent <play_select_sub1>().m_ms.id == _msg.infos.id)
                {
                    m_second[i].GetComponent <play_select_sub1>().reset(_msg.infos.finish, _msg.infos.pas, _msg.infos.amount, _msg.infos.like);
                }
            }
            mario._instance.m_self.set_per(_msg.infos.head, _msg.infos.country, _msg.infos.owner_name, _msg.infos.name);
        }
        if (message.m_opcode == opclient_t.OPCODE_PLAY_MAP)
        {
            if (mario._instance.m_self.guide == 201)
            {
                mario._instance.m_self.guide = 202;
            }
            if (message.m_res == -1)
            {
                mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_tlbz"));
                protocol.game.msg_life_error _msg1 = net_http._instance.parse_packet <protocol.game.msg_life_error> (message.m_byte);
                mario._instance.m_self.set_reset_time(_msg1.server_time, _msg1.life_time);
                return;
            }
            protocol.game.smsg_play_map _msg = net_http._instance.parse_packet <protocol.game.smsg_play_map> (message.m_byte);
            mario_tool._instance.onRaid(m_id.ToString(), 1);
            bool flag = game_data._instance.load_mission(m_id, _msg.map_data, _msg.x, _msg.y);
            if (!flag)
            {
                return;
            }
            mario._instance.change_state(e_game_state.egs_play, 2, delegate()
            {
                if (this.gameObject.activeSelf)
                {
                    this.gameObject.SetActive(false);
                }
                else
                {
                    mario._instance.hide_clear_gui();
                }
            });
        }
        if (message.m_opcode == opclient_t.OPCODE_FAVORITE_MAP)
        {
            protocol.game.smsg_favorite_map _msg = net_http._instance.parse_packet <protocol.game.smsg_favorite_map> (message.m_byte);
            m_mi.favorite = _msg.num;
            m_mi.collect  = 1 - m_mi.collect;
            show_map(m_mi);
        }
        if (message.m_opcode == opclient_t.OPCODE_COMMENT)
        {
            mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_fbpl"));
            m_pinglun.GetComponent <ui_show_anim>().hide_ui();
            protocol.game.smsg_comment _msg = net_http._instance.parse_packet <protocol.game.smsg_comment> (message.m_byte);
            m_comments.Insert(0, _msg.comment);
            if (m_comments.Count > 10)
            {
                m_comments.RemoveAt(m_comments.Count - 1);
            }
            reset_pinlun(m_comments);
        }
        if (message.m_opcode == opclient_t.OPCODE_SEARCH_MAP)
        {
            m_search.GetComponent <ui_show_anim>().hide_ui();
            protocol.game.smsg_view_map _msg = net_http._instance.parse_packet <protocol.game.smsg_view_map> (message.m_byte);
            if (_msg.infos.Count == 0)
            {
                mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_mzdt"));
                return;
            }
            clear_second();
            add_second(_msg, 0);
            change_second();
        }
        if (message.m_opcode == opclient_t.OPCODE_VIEW_MAP_POINT_RANK)
        {
            protocol.game.smsg_view_map_point_rank _msg = net_http._instance.parse_packet <protocol.game.smsg_view_map_point_rank> (message.m_byte);
            mario._instance.show_paihang_gui(_msg, m_mi.id);
        }
        if (message.m_opcode == opclient_t.OPCODE_VIEW_VIDEO)
        {
            protocol.game.smsg_view_video _msg = net_http._instance.parse_packet <protocol.game.smsg_view_video> (message.m_byte);
            bool flag = game_data._instance.load_mission(m_mi.id, _msg.map_data, null, null);
            if (!flag)
            {
                return;
            }
            game_data._instance.load_inputs(_msg.video_data);
            mario._instance.change_state(e_game_state.egs_review, 2, delegate() { this.gameObject.SetActive(false); mario._instance.hide_paihang_gui(); });
        }
        if (message.m_opcode == opclient_t.OPCODE_VIEW_PLAYER)
        {
            protocol.game.smsg_view_player _msg = net_http._instance.parse_packet <protocol.game.smsg_view_player> (message.m_byte);
            mario._instance.show_player_gui(_msg);
        }
        if (message.m_opcode == opclient_t.OPCODE_MISSION_VIEW)
        {
            protocol.game.smsg_mission_view _msg = net_http._instance.parse_packet <protocol.game.smsg_mission_view> (message.m_byte);
            mario._instance.m_self.br_life  = _msg.life;
            mario._instance.m_self.br_index = _msg.index;
            mario._instance.m_self.br_start = _msg.start;
            mario._instance.m_self.br_hard  = _msg.hard;
            mario._instance.m_self.br_max   = _msg.br_max;

            m_back.SetActive(false);
            m_back1.SetActive(false);
            m_back2.SetActive(true);
            show_br();
        }
        if (message.m_opcode == opclient_t.OPCODE_MISSION_START || message.m_opcode == opclient_t.OPCODE_MISSION_CONTINUE)
        {
            if (message.m_opcode == opclient_t.OPCODE_MISSION_START)
            {
                mario._instance.m_self.br_index = 0;
                mario._instance.m_self.br_life  = 100;
                mario._instance.m_self.br_start = 1;
                mario._instance.m_self.br_hard  = m_bhard;
                mario._instance.m_start_type    = 0;
            }
            else
            {
                mario._instance.m_start_type = 2;
            }
            protocol.game.smsg_mission_play _msg = net_http._instance.parse_packet <protocol.game.smsg_mission_play> (message.m_byte);
            mario._instance.m_self.set_br(_msg.user_head, _msg.user_country, _msg.user_name, _msg.map_name);
            game_data._instance.load_mission(-1, _msg.map_data, _msg.x, _msg.y);
            mario._instance.change_state(e_game_state.egs_br_road, 2, delegate() { this.gameObject.SetActive(false); });
        }
        if (message.m_opcode == opclient_t.OPCODE_DOWNLOAD_MAP)
        {
            mario._instance.m_self.download_num++;
            mario._instance.show_tip(game_data._instance.get_language_string("play_select_gui_dlok"));
        }
        if (message.m_opcode == opclient_t.OPCODE_MISSION_DROP)
        {
            mario._instance.m_self.br_start = 0;
            show_br();
        }
    }
コード例 #9
0
 public void net_message(s_net_message message)
 {
 }
コード例 #10
0
ファイル: cmessage_center.cs プロジェクト: dqchess/mario
 public void add_net_message(s_net_message message)
 {
     m_net_messages.Add(message);
 }
コード例 #11
0
ファイル: edit_select_gui.cs プロジェクト: dqchess/mario
 public void net_message(s_net_message message)
 {
     if (message.m_opcode == opclient_t.OPCODE_VIEW_EDIT)
     {
         protocol.game.smsg_view_edit _msg = net_http._instance.parse_packet <protocol.game.smsg_view_edit> (message.m_byte);
         m_ed = _msg.infos;
         for (int i = 0; i < _msg.infos.Count; ++i)
         {
             protocol.game.edit_data ed = _msg.infos[i];
             if (ed.id != 0)
             {
                 m_clips[i].transform.FindChild("name").GetComponent <UILabel>().text             = ed.name;
                 m_clips[i].transform.FindChild("Texture").GetComponent <UITexture>().mainTexture = game_data._instance.mission_to_texture(ed.url);
                 if (ed.upload == 1)
                 {
                     m_clips[i].transform.FindChild("state").gameObject.SetActive(true);
                 }
             }
         }
         mario._instance.m_self.job_level = _msg.level;
         mario._instance.m_self.job_exp   = _msg.exp;
         reset_exp();
         if (mario._instance.m_self.guide == 200)
         {
             s_message mes = new s_message();
             mes.m_type = "jx_6";
             mario._instance.show_xsjx_dialog_box(game_data._instance.get_language_string("edit_gui_pljx"), mes);
         }
     }
     if (message.m_opcode == opclient_t.OPCODE_CREATE_MAP)
     {
         protocol.game.smsg_create_map _msg = net_http._instance.parse_packet <protocol.game.smsg_create_map> (message.m_byte);
         m_ed[m_index] = _msg.map;
         reset_index();
         m_info.SetActive(true);
     }
     if (message.m_opcode == opclient_t.OPCODE_PLAY_EDIT_MAP)
     {
         protocol.game.smsg_play_edit_map _msg = net_http._instance.parse_packet <protocol.game.smsg_play_edit_map> (message.m_byte);
         bool flag = game_data._instance.load_mission(m_ed[m_index].id, _msg.mapdata, null, null);
         if (!flag)
         {
             return;
         }
         if (m_player_type == 0)
         {
             mario._instance.change_state(e_game_state.egs_edit, 1, delegate() { this.gameObject.SetActive(false); });
         }
         else if (m_player_type == 1)
         {
             mario._instance.change_state(e_game_state.egs_edit_play, 2, delegate() { this.gameObject.SetActive(false); });
         }
         else if (m_player_type == 2)
         {
             mario._instance.change_state(e_game_state.egs_edit_upload, 2, delegate() { this.gameObject.SetActive(false); });
         }
     }
     if (message.m_opcode == opclient_t.OPCODE_DELETE_MAP)
     {
         m_ed[m_index].id = 0;
         reset_index();
     }
     if (message.m_opcode == opclient_t.OPCODE_CHANGE_MAP_NAME)
     {
         m_cn.GetComponent <ui_show_anim>().hide_ui();
         m_ed[m_index].name = m_cname;
         reset_index();
     }
     if (message.m_opcode == opclient_t.OPCODE_VIEW_EDIT_SINGLE)
     {
         protocol.game.smsg_view_edit_single _msg = net_http._instance.parse_packet <protocol.game.smsg_view_edit_single> (message.m_byte);
         m_ed[m_index] = _msg.info;
         reset_index();
     }
 }
コード例 #12
0
ファイル: net_http.cs プロジェクト: dqchess/mario
 void IMessage.net_message(s_net_message message)
 {
 }
コード例 #13
0
 public void net_message(s_net_message message)
 {
     if (message.m_opcode == opclient_t.OPCODE_SHOP_BUY || message.m_opcode == opclient_t.OPCODE_GOOGLE_PAY)
     {
         s_t_shop t_shop = game_data._instance.get_t_shop(m_buy_id);
         if (t_shop.type != 1)
         {
             mario._instance.m_self.jewel -= t_shop.price;
             mario_tool._instance.onJewelConsume(t_shop.desc, t_shop.price);
         }
         mario._instance.show_tip(game_data._instance.get_language_string("user_gui_hd") + t_shop.name);
         if (t_shop.type == 1)
         {
             mario._instance.m_self.jewel += t_shop.def;
             mario_tool._instance.onJewelGet(t_shop.desc, t_shop.def);
         }
         else if (t_shop.type == 2)
         {
         }
         else if (t_shop.type == 3)
         {
             mario._instance.m_self.testify = t_shop.def;
         }
         else if (t_shop.type == 4)
         {
             if (mario._instance.m_self.exp_time > timer.now())
             {
                 mario._instance.m_self.exp_time += (ulong)t_shop.def * 86400000;
             }
             else
             {
                 mario._instance.m_self.exp_time = timer.now() + (ulong)t_shop.def * 86400000;
             }
         }
         for (int i = 0; i < m_shop_items.Count; ++i)
         {
             m_shop_items[i].GetComponent <shop_sub>().reset();
         }
     }
     if (message.m_opcode == opclient_t.OPCODE_PAY)
     {
         if (message.m_res == -1)
         {
                             #if UNITY_ANDROID
             m_pay_time = 5;
             mario._instance.wait(true);
                             #elif UNITY_WEBPLAYER || UNITY_STANDALONE_WIN
             s_message mes = new s_message();
             mes.m_type = "recharge_web";
             mario._instance.show_double_dialog_box(game_data._instance.get_language_string("user_gui_wzfdd"), mes, null);
                             #endif
         }
         else
         {
             protocol.game.smsg_pay _msg = net_http._instance.parse_packet <protocol.game.smsg_pay> (message.m_byte);
             mario._instance.show_tip(string.Format(game_data._instance.get_language_string("user_gui_hdzs"), _msg.jewel));
             mario._instance.m_self.jewel += _msg.jewel;
             mario_tool._instance.onJewelGet("安卓支付", _msg.jewel);
         }
     }
 }