当前位置: 首页>>代码示例>>C#>>正文


C# Client.Send方法代码示例

本文整理汇总了C#中Bunny.Core.Client.Send方法的典型用法代码示例。如果您正苦于以下问题:C# Client.Send方法的具体用法?C# Client.Send怎么用?C# Client.Send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bunny.Core.Client的用法示例。


在下文中一共展示了Client.Send方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ResponseChannelList

        public static void ResponseChannelList(Client client, List<Channel> channels)
        {
            using (var packet = new PacketWriter(Operation.ChannelList, CryptFlags.Decrypt))
            {
                packet.Write(channels.Count, 88);

                Int16 index = 0;
                foreach (var c in channels)
                {
                    var traits = c.GetTraits();
                    packet.Write(traits.ChannelId);
                    packet.Write(++index);
                    packet.Write((Int16)traits.Playerlist.Count);
                    packet.Write((Int16)traits.MaxUsers);
                    packet.Write((Int16)traits.MinLevel);
                    packet.Write((Int16)traits.MaxLevel);
                    packet.Write((byte)traits.Type);
                    packet.Write(traits.ChannelName, 64);
                    packet.Write(false);
                    packet.Write(0);
                }

                client.Send(packet);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:25,代码来源:ChannelPackets.cs

示例2: ResponseCharacterItemList

        public static void ResponseCharacterItemList(Client client)
        {
            using (var packet = new PacketWriter(Operation.MatchResponseCharacterItemList, CryptFlags.Decrypt))
            {
                packet.Write(client.GetCharacter().Bp);

                packet.Write(17, 8);
                for (var i = 0; i < 17; ++i)
                {
                    packet.Write(0);
                    packet.Write(client.GetCharacter().EquippedItems[i].ItemCid);
                }

                packet.Write(client.GetCharacter().Items.Count, 24);
                foreach (var i in client.GetCharacter().Items)
                {
                    packet.Write(0);
                    packet.Write(i.ItemCid);
                    packet.Write(i.ItemId);
                    packet.Write(i.RentHour);
                    packet.Write(0);
                    packet.Write(i.Quantity);
                }
                packet.Write(0, 12);

                client.Send(packet);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:28,代码来源:Match.cs

示例3: ResponseAllPlayerList

        public static void ResponseAllPlayerList(Client client, List<Client> clients, Muid channelId)
        {
            using (var packet = new PacketWriter(Operation.ChannelResponseAllPlayerList, CryptFlags.Encrypt))
            {
                packet.Write(channelId);
                packet.Write(clients.Count, 73);

                foreach (var c in clients)
                {
                    packet.Write(c.GetMuid());
                    packet.Write(c.GetCharacter().Name, 32);
                    packet.Write(c.GetCharacter().ClanName, 16);
                    packet.Write((byte)c.GetCharacter().Level);
                    packet.Write((byte)c.GetCharacter().DuelRank);//dagger for duel tourney.
                    packet.Write((Int32)c.ClientPlayer.PlayerLocation);
                    packet.Write((byte)c.ClientPlayer.PlayerAccount.Access);
                    packet.Write((byte)2);
                    packet.Write(c.GetCharacter().ClanId);
                    packet.Write(0);//unknown.
                    packet.Write((byte)3);//unknown
                }

                client.Send(packet);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:25,代码来源:ChannelPackets.cs

示例4: ClanInfo

        public static void ClanInfo(Client client, string clanName)
        {
            var player = client.ClientPlayer;
            var info = new ClanInfo();
            var clanId = Globals.GunzDatabase.GetClanId(clanName);

            Globals.GunzDatabase.GetClanInfo(clanId, ref info);

            if (info == null)
                return;

            info.ConnectedMembers = Convert.ToInt16(TcpServer.GetClanMembers(clanId).Count);

            using (var packet = new PacketWriter(Operation.MatchClanResponseClanInfo, CryptFlags.Encrypt))
            {
                packet.Write(1, 78);

                packet.Write(info.Name, 16);
                packet.Write(info.Level);
                packet.Write(info.Points);
                packet.Write(info.TotalPoints);
                packet.Write(info.Ranking);
                packet.Write(info.Master, 32);
                packet.Write(info.Wins);
                packet.Write(info.Losses);
                packet.Write(info.MemberCount);
                packet.Write(info.ConnectedMembers);
                packet.Write(info.ClanId);
                packet.Write(info.EmblemChecksum);

                client.Send(packet);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:33,代码来源:ClanPackets.cs

示例5: ReserveStageToAgent

 public static void ReserveStageToAgent(Client client, Muid stageId)
 {
     using (var packet = new PacketWriter(Operation.AgentStageReserve, CryptFlags.Encrypt))
     {
         packet.Write(stageId);
         client.Send(packet);
     }
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:8,代码来源:AgentPackets.cs

示例6: ResponseBuyItem

 public static void ResponseBuyItem(Client client, Results results)
 {
     using (var packet = new PacketWriter(Operation.MatchResponseBuyItem, CryptFlags.Decrypt))
     {
         packet.Write((Int32)results);
         client.Send(packet);
     }
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:8,代码来源:Match.cs

示例7: ExpelMemberNotAllowed

 public static void ExpelMemberNotAllowed(Client client)
 {
     using (var expelMember = new PacketWriter(Operation.MatchClanAdminResponseLeaveMember, CryptFlags.Encrypt))
     {
         expelMember.Write((Int32)Results.ClanNotAuthorized);
         client.Send(expelMember);
     }
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:8,代码来源:ClanPackets.cs

示例8: Notify

 public static void Notify(Client client, Int32 error)
 {
     using (var packet = new PacketWriter(Operation.MatchNotify, CryptFlags.Encrypt))
     {
         packet.Write(error);
         client.Send(packet);
     }
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:8,代码来源:Match.cs

示例9: ResponsePeerRelay

 public static void ResponsePeerRelay(Client client, Muid playerId)
 {
     using (var packet = new PacketWriter(Operation.MatchResponsePeerRelay, CryptFlags.Encrypt))
     {
         packet.Write(playerId);
         client.Send(packet);
     }
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:8,代码来源:AgentPackets.cs

示例10: AgentError

 public static void AgentError(Client client, Int32 error)
 {
     using (var packet = new PacketWriter(Operation.AgentError, CryptFlags.Encrypt))
     {
         packet.Write(error);
         client.Send(packet);
     }
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:8,代码来源:AgentPackets.cs

示例11: ResponseLiveCheckk

        public static void ResponseLiveCheckk(Client client, Int32 timeStamp)
        {
            using (var packet = new PacketWriter(Operation.MatchAgentResponseLiveCheck, CryptFlags.Encrypt))
            {
                packet.Write(timeStamp);

                client.Send(packet);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:9,代码来源:AgentPackets.cs

示例12: ResponseBridgePeer

        public static void ResponseBridgePeer(Client client)
        {
            using (var packet = new PacketWriter(Operation.BridgeResponse, CryptFlags.Decrypt))
            {
                packet.Write(client.GetMuid());
                packet.Write((Int32)Results.Accepted);

                client.Send(packet);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:10,代码来源:Match.cs

示例13: LadderPrepare

        public static void LadderPrepare(Client client, int teamNumber)
        {
            using (var packet = new PacketWriter(Operation.LadderPrepare, CryptFlags.Encrypt))
            {
                packet.Write(client.GetMuid());
                packet.Write(teamNumber);

                client.Send(packet);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:10,代码来源:StagePackets.cs

示例14: RelayPeer

        public static void RelayPeer(Client client, Bunny.Utility.Tuple<Muid,Muid,Muid> uids)
        {
            using (var packet = new PacketWriter(Operation.AgentRelayPeer, CryptFlags.Encrypt))
            {
                packet.Write(uids.First);
                packet.Write(uids.Second);
                packet.Write(uids.Third);

                client.Send(packet);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:11,代码来源:AgentPackets.cs

示例15: AgentLocateToClient

        public static void AgentLocateToClient(Client client, Muid agentId)
        {
            using (var packet = new PacketWriter(Operation.AgentLocateToClient, CryptFlags.Encrypt))
            {
                packet.Write(agentId);
                packet.Write(Globals.Config.Agent.RemoteIp);
                packet.Write((Int32)Globals.Config.Agent.TcpPort);
                packet.Write((Int32)Globals.Config.Agent.UdpPort);

                Log.Write("Telling client to locate to: {0}:{1}:{2}", Globals.Config.Agent.RemoteIp,
                          Globals.Config.Agent.TcpPort, Globals.Config.Agent.UdpPort);
                client.Send(packet);
            }
        }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:14,代码来源:AgentPackets.cs


注:本文中的Bunny.Core.Client.Send方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。