Example #1
0
        /// <summary>
        /// Called when a new guild is created.
        /// </summary>
        /// <param name="response">Data associated with the response.</param>
        protected virtual void OnGuildCreated(GuildCreateResponse response)
        {
            Debug.Assert(response != null && response.Data != null, "Response data is null/missing");

            if (response is null || response.Data is null)
            {
                return;
            }

            this.log?.Info($"{RecInd} Created Guild: {response.Data.Name}");
            this.GuildCreated?.Invoke(this, response);
        }
Example #2
0
        private static void SendGuildCreateResponse(WorldClient Client, string Name, string Password,
                                                    bool AllowGuildWar, GuildCreateResponse Response)
        {
            using (var packet = new Packet(SH29Type.CreateGuildResponse))
            {
                packet.WriteUShort((ushort)Response);
                packet.WriteInt(Response == GuildCreateResponse.Success ? 32 : 0);

                packet.WriteString(Name, 16);
                packet.WriteString(Password, 8);
                packet.WriteBool(AllowGuildWar);
                Client.SendPacket(packet);
            }
        }
Example #3
0
 /// <summary>
 /// 收到创建公会响应
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="response"></param>
 private void OnGuildCreate(object sender, GuildCreateResponse response)
 {
     Debug.LogFormat("OnGuildCreateResponse: {0}", response.Result);
     if (OnGuildCreateResult != null)
     {
         this.OnGuildCreateResult(response.Result == Result.Success);
     }
     if (response.Result == Result.Success)
     {
         GuildManager.Instance.Init(response.guildInfo);
         MessageBox.Show(string.Format("{0} 公会创建成功", response.guildInfo.GuildName), "公会");
     }
     else
     {
         MessageBox.Show(string.Format("{0} 公会创建失败", response.guildInfo.GuildName), "公会");
     }
 }
Example #4
0
        private static void SendGuildCreateResponse(WorldClient Client, string Name, string Password, bool AllowGuildWar, GuildCreateResponse Response)
        {
            using (var packet = new Packet(SH29Type.CreateGuildResponse))
            {

                packet.WriteUShort((ushort)Response);
                packet.WriteInt((Response == GuildCreateResponse.Success ? 32 : 0));

                packet.WriteString(Name, 16);
                packet.WriteString(Password, 8);
                packet.WriteBool(AllowGuildWar);
                Client.SendPacket(packet);
            }
        }