Ejemplo n.º 1
0
    void OnGuildRequest(C2G.GuildRequest packet, C2G.GuildAck ack)
    {
        switch (ack.result)
        {
        case pe_GuildResult.Success:
            if (ack.guild_info != null)
            {
                GuildManager.Instance.SetGuildInfo(ack.guild_info);
                Network.ChatServer.JoinGuildChannel();
                GameMain.Instance.ChangeMenu(GameMenu.Guild);
                return;
            }
            m_SelectedGuild.SetRequeted(true);
            AddRequest(m_SelectedGuild.GuildInfo.info);
            UpdateBtns();
            break;

        case pe_GuildResult.GuildRequestCountMax:
            Tooltip.Instance.ShowMessageKey("GuildRequestErrorGuildRequestCount");
            break;

        case pe_GuildResult.RequestCountMax:
            Tooltip.Instance.ShowMessageKey("GuildRequestErrorRequestCount");
            break;

        case pe_GuildResult.GuildJoinTimeDelay:
            Tooltip.Instance.ShowMessageKey("GuildJoinTimeDelay");
            break;

        case pe_GuildResult.LimitLevel:
            Tooltip.Instance.ShowMessageKeyFormat("GuildCreateAtLeast", GuildInfoManager.Config.AtLeastPlayerLevel);
            break;
        }
    }
Ejemplo n.º 2
0
 private void SendRequest(bool confirm = true)
 {
     if (confirm == false)
     {
         return;
     }
     C2G.GuildRequest packet = new C2G.GuildRequest();
     packet.guild_idx = m_SelectedGuild.GuildInfo.info.guild_idx;
     Network.GameServer.JsonAsync <C2G.GuildRequest, C2G.GuildAck>(packet, OnGuildRequest);
 }