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 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; } }
////////////////////////////////////////////////////////////////////////// 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; } }
////////////////////////////////////////////////////////////////////////// void OnGuildMemberGet(C2G.GuildMemberGet packet, C2G.GuildAck ack) { GuildManager.Instance.SetGuildInfo(ack.guild_info); GuildManager.Instance.SetGuildMembers(ack.guild_members.Select(e => new pd_GuildMemberInfoDetail(e)).ToList()); InitGuildMembers(); UpdateGuildInfo(GuildManager.Instance.GuildInfo); parent.AddManagementTab(); }
void OnGuildSetting(C2G.GuildSetting packet, C2G.GuildAck ack) { switch (ack.result) { case pe_GuildResult.Success: GuildManager.Instance.SetGuildInfo(ack.guild_info); GameMain.Instance.UpdateMenu(); base.OnClose(); break; } }
static void OnGuildAttend(C2G.GuildAttend packet, C2G.GuildAck ack) { switch (ack.result) { case pe_GuildResult.Success: GuildManager.Instance.Attend(); GuildManager.Instance.SetGuildInfo(ack.guild_info); GameMain.Instance.UpdateMenu(); Tooltip.Instance.ShowMessageKey("GuildAttendComplete"); break; } }
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; } }
void OnGuildGoldGive(C2G.GuildGoldGive packet, C2G.GuildAck ack) { switch (ack.result) { case pe_GuildResult.Success: Network.PlayerInfo.UseGoods(ack.use_goods); GameMain.Instance.UpdatePlayerInfo(); GuildManager.Instance.SetGuildInfo(ack.guild_info); GameMain.Instance.UpdateMenu(); base.OnClose(); break; } }
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(); } }
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(); } }
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 OnGuildSearchHandler(C2G.GuildSearch packet, C2G.GuildAck ack) { switch (ack.result) { case pe_GuildResult.Success: if (ack.guild_info == null) { Tooltip.Instance.ShowMessageKey("NotExistGuildForSearch"); return; } base.OnClose(); if (OnSearchComplete != null) { OnSearchComplete(ack.guild_info); } break; case pe_GuildResult.NotExistGuild: Tooltip.Instance.ShowMessageKey("NotExistGuildForSearch"); break; } }
////////////////////////////////////////////////////////////////////////// void OnGuildCreate(C2G.GuildCreate packet, C2G.GuildAck ack) { switch (ack.result) { case pe_GuildResult.Success: Network.PlayerInfo.UseGoods(ack.use_goods); GuildManager.Instance.SetGuildInfo(ack.guild_info); Network.ChatServer.JoinGuildChannel(); GameMain.Instance.ChangeMenu(GameMenu.Guild); break; case pe_GuildResult.SameGuildName: Tooltip.Instance.ShowMessageKey("AlreadyUseGuildName"); break; case pe_GuildResult.GuildJoinTimeDelay: Tooltip.Instance.ShowMessageKey("GuildJoinTimeDelay"); break; default: Tooltip.Instance.ShowMessageKey("UnknownErrorGuildCreate"); break; } }
void OnGuildRefuseAll(C2G.GuildRefuseAll packet, C2G.GuildAck ack) { Selected.Clear(); Requested.Clear(); InitGuildRequest(); }