public void OnClickCreate() { if (m_SpriteEmblem.isActiveAndEnabled == false || string.IsNullOrEmpty(m_Emblem) == true) { Tooltip.Instance.ShowMessageKey("ConfirmSelectGuildEmblem"); return; } if (string.IsNullOrEmpty(m_LabelGuildName.label.text) == true) { Tooltip.Instance.ShowMessageKey("CheckGuildName"); return; } if (Network.Instance.CheckGoods(pe_GoodsType.token_gem, GuildInfoManager.Config.CreateGuildCost) == false) { return; } C2G.GuildCreate packet = new C2G.GuildCreate(); packet.guild_emblem = m_Emblem; packet.guild_limit_level = m_JoinLevelLimit; packet.guild_name = m_LabelGuildName.label.text; packet.guild_intro = m_LabelGuildIntro.label.text; packet.guild_notification = m_LabelGuildNotification.label.text; packet.is_auto = m_ToggleAuto.value; #if DEBUG //packet.account_idx = 1;//for test #endif Network.GameServer.JsonAsync <C2G.GuildCreate, C2G.GuildAck>(packet, OnGuildCreate); }
////////////////////////////////////////////////////////////////////////// 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; } }