void OnGuildLeave(C2G.GuildLeave packet, C2G.GuildAck ack) { switch (ack.result) { case pe_GuildResult.Success: HeroPrefabManager.Clear(); parent.Close(true, true); if (packet.member_account_idx == SHSavedData.AccountIdx) { GuildManager.Instance.LeaveGuild(); GameMain.Instance.BackMenu(); } else { if (m_Info.member_state == 0) { GuildManager.Instance.State.member_state = 0; } GuildManager.Instance.RemoveMember(packet.member_account_idx); //GuildManager.Instance.SetGuildInfo(ack.guild_info); //GuildManager.Instance.SetGuildMembers(ack.guild_members); GameMain.Instance.UpdateMenu(); } break; } }
void OnLeaveGuild(bool is_confirm) { if (is_confirm) { C2G.GuildLeave packet = new C2G.GuildLeave(); packet.guild_idx = GuildManager.Instance.GuildIdx; packet.member_account_idx = m_Info.account_idx; Network.GameServer.JsonAsync <C2G.GuildLeave, C2G.GuildAck>(packet, OnGuildLeave); } }
void OnChangeState(short state) { if (m_Info.member_state != state) { if (state == 3) { C2G.GuildLeave packet = new C2G.GuildLeave(); packet.guild_idx = GuildManager.Instance.GuildIdx; packet.member_account_idx = m_Info.account_idx; Network.GameServer.JsonAsync <C2G.GuildLeave, C2G.GuildAck>(packet, OnGuildLeave); } else { C2G.GuildStateChange packet = new C2G.GuildStateChange(); packet.guild_idx = GuildManager.Instance.GuildIdx; packet.member_account_idx = m_Info.account_idx; packet.member_state = state; Network.GameServer.JsonAsync <C2G.GuildStateChange, C2G.GuildAck>(packet, OnGuildStateChange); } } }