示例#1
0
 public void OnClickJoinCancel()
 {
     C2G.GuildJoin packet = new C2G.GuildJoin();
     packet.guild_idx          = m_SelectedGuild.GuildInfo.info.guild_idx;
     packet.member_account_idx = SHSavedData.AccountIdx;
     packet.refuse             = true;
     Network.GameServer.JsonAsync <C2G.GuildJoin, C2G.GuildAck>(packet, OnGuildJoinCancel);
 }
示例#2
0
 //////////////////////////////////////////////////////////////////////////
 void OnGuildJoinCancel(C2G.GuildJoin packet, C2G.GuildAck ack)
 {
     switch (ack.result)
     {
     case pe_GuildResult.Success:
         m_RequestGuilds.RemoveAll(e => e.guild_info.guild_idx == packet.guild_idx);
         InitGuildList();
         break;
     }
 }
示例#3
0
 void OnGuildJoinCancel(C2G.GuildJoin packet, C2G.GuildAck ack)
 {
     switch (ack.result)
     {
     case pe_GuildResult.Success:
         RequestGuilds.RemoveAll(e => e.guild_idx == packet.guild_idx);
         m_SelectedGuild.SetRequeted(false);
         UpdateRequestCount();
         UpdateBtns();
         break;
     }
 }
示例#4
0
 public void OnClickRefuse()
 {
     if (Selected.Count == 0)
     {
         Tooltip.Instance.ShowMessageKey("GuildRequestRefuseSelect");
         return;
     }
     C2G.GuildJoin packet = new C2G.GuildJoin();
     packet.guild_idx          = GuildManager.Instance.GuildIdx;
     packet.member_account_idx = Selected[0].account_idx;
     packet.refuse             = true;
     Network.GameServer.JsonAsync <C2G.GuildJoin, C2G.GuildAck>(packet, OnGuildRefuse);
 }
示例#5
0
 void OnGuildRefuse(C2G.GuildJoin packet, C2G.GuildAck ack)
 {
     Selected.RemoveAll(e => e.account_idx == packet.member_account_idx);
     Requested.RemoveAll(e => e.account_idx == packet.member_account_idx);
     if (Selected.Count > 0)
     {
         OnClickRefuse();
     }
     else
     {
         InitGuildRequest();
     }
 }
示例#6
0
    void OnGuildAllow(C2G.GuildJoin packet, C2G.GuildAck ack)
    {
        var requested_info = Selected.Find(e => e.account_idx == packet.member_account_idx);

        Selected.RemoveAll(e => e.account_idx == packet.member_account_idx);
        Requested.RemoveAll(e => e.account_idx == packet.member_account_idx);
        switch (ack.result)
        {
        case pe_GuildResult.Success:
        {
            pd_GuildMemberInfoDetail member = new pd_GuildMemberInfoDetail();
            member.account_idx        = requested_info.account_idx;
            member.last_login_at      = requested_info.last_login_at;
            member.leader_creature    = requested_info.leader_creature;
            member.nickname           = requested_info.nickname;
            member.player_level       = requested_info.player_level;
            member.member_state       = 2;
            member.give               = 0;
            member.attend_daily_index = 0;
            member.created_at         = Network.Instance.ServerTime;
            member.updated_at         = Network.Instance.ServerTime;

            GuildManager.Instance.AddGuildMember(member);
        }
        break;

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

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

        case pe_GuildResult.GuildJoinTimeDelay:
            Tooltip.Instance.ShowMessageKey("ERRORJoinAnotherGuild");
            break;
        }
        if (Selected.Count > 0)
        {
            OnClickAllow();
        }
        else
        {
            InitGuildRequest();
            InitGuildMember();
        }
    }
示例#7
0
 public void OnClickAllow()
 {
     if (GuildManager.Instance.GuildMemberCount == GuildManager.Instance.GuildMemberMax)
     {
         Tooltip.Instance.ShowMessageKey("GuildErrorMemberLimit");
         return;
     }
     if (GuildManager.Instance.GuildMemberCount + Selected.Count > GuildManager.Instance.GuildMemberMax)
     {
         Tooltip.Instance.ShowMessageKey("GuildErrorMemberLimitExceed");
         return;
     }
     if (Selected.Count == 0)
     {
         Tooltip.Instance.ShowMessageKey("GuildRequestAllowSelect");
         return;
     }
     C2G.GuildJoin packet = new C2G.GuildJoin();
     packet.guild_idx          = GuildManager.Instance.GuildIdx;
     packet.member_account_idx = Selected[0].account_idx;
     packet.refuse             = false;
     Network.GameServer.JsonAsync <C2G.GuildJoin, C2G.GuildAck>(packet, OnGuildAllow);
 }