void OnGuildStateChange(C2G.GuildStateChange packet, C2G.GuildAck ack) { switch (ack.result) { case pe_GuildResult.Success: m_Info.member_state = packet.member_state; if (m_Info.member_state == 0) { GuildManager.Instance.SetGuildMaster(m_Info.nickname); if (GuildManager.Instance.State.member_state == 0) { GuildManager.Instance.State.member_state = 1; } } Init(); GameMain.Instance.UpdateMenu(); break; } }
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); } } }