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


C# PacketIn.GetUint32R方法代码示例

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


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

示例1: HandlePacket

        public static void HandlePacket(BaseClient client, PacketIn packet)
        {
            LobbyClient cclient = client as LobbyClient;

            byte freeslot = Program.CharMgr.GetFreeSlot(cclient.Account.Id);

            if (freeslot == 0 || cclient.CreateChar == null)
                ANS_CHARACTER_CREATE.Send(cclient);
            else
            {
                cclient.CreateChar.SlotId = freeslot;
                cclient.CreateChar.Faction = packet.GetUint8();
                cclient.CreateChar.Gender = packet.GetUint8();
                cclient.CreateChar.Version = (int)packet.GetUint32R();
                cclient.CreateChar.Seconds = (int)packet.GetUint32R();

                byte[] Custom = new byte[packet.Length - packet.Position];
                packet.Read(Custom, 0, Custom.Length);

                cclient.CreateChar.Custom = BitConverter.ToString(Custom);

                Program.CharMgr.CreateCharacter(cclient.CreateChar);
                ANS_CHARACTER_CREATE.Send(cclient);
            }
        }
开发者ID:Novo,项目名称:apbprivateserver,代码行数:25,代码来源:ASK_CHARACTER_CREATE.cs

示例2: OnReceive

        protected override void OnReceive(byte[] Packet)
        {
            lock (this)
            {
                PacketIn packet = new PacketIn(Packet, 0, Packet.Length);
                packet.Size = packet.GetUint32R();
                packet = DeCrypt(packet);
                packet.Opcode = packet.GetUint32R();

                Server.HandlePacket(this, packet);
            }
        }
开发者ID:Novo,项目名称:apbprivateserver,代码行数:12,代码来源:WorldClient.cs

示例3: HandlePacket

        public static void HandlePacket(BaseClient client, PacketIn packet)
        {
            LobbyClient cclient = (LobbyClient)client;

            UInt32 WorldUid = packet.GetUint32R();
            string Name = packet.GetUnicodeString();

            PacketOut Out = new PacketOut((UInt32)Opcodes.ANS_CHARACTER_NAME_CHECK);

            if (CheckName(Name) == 0)
            {
                cclient.CreateChar = new DBCharacter();
                cclient.CreateChar.AcctId = cclient.Account.Id;
                cclient.CreateChar.Name = Name;

                if (cclient.Account.WorldId != WorldUid)
                    Program.CharMgr.SetAccountWorld(cclient.Account.Id, (int)WorldUid);

                Out.WriteUInt32(0);
            }
            else
            {
                cclient.CreateChar = null;
                Out.WriteUInt32(1);
            }

            cclient.SendTCP(Out);
        }
开发者ID:Novo,项目名称:apbprivateserver,代码行数:28,代码来源:ASK_CHARACTER_NAME_CHECK.cs

示例4: HandlePacket

        public static void HandlePacket(BaseClient client, PacketIn packet)
        {
            LobbyClient cclient = (LobbyClient)client;

            byte FileId = packet.GetUint8();
            UInt32 Version = packet.GetUint32R();

            byte[] File = new byte[packet.Length - packet.Position];
            packet.Read(File, 0, File.Length);

            File = ZlibMgr.Decompress(File);

            Log.Debug("ConfigSave", "Config saved : fileid=" + FileId + ", Version=" + Version + ",Size=" + File.Length);

            Program.FileMgr.SaveInfo(cclient.Account.Id, FileId, File);

            PacketOut Out = new PacketOut((UInt32)Opcodes.ANS_CONFIGFILE_SAVE);
            Out.WriteUInt32R(0);
            Out.WriteByte(FileId);
            Out.Write(File, 0, File.Length);
            cclient.SendTCP(Out);
        }
开发者ID:Novo,项目名称:apbprivateserver,代码行数:22,代码来源:ASK_CONFIGFILE_SAVE.cs

示例5: HandlePacket

        public static void HandlePacket(BaseClient client, PacketIn packet)
        {
            WorldClient cclient = (WorldClient)client;
            UInt32 AcctId = packet.GetUint32R();

            Log.Debug("AskWorldEnter", "New client, Account = " + AcctId);

            cclient.Account = Program.CharMgr.GetAccount((int)AcctId);
            cclient.Character = Program.CharMgr.GetInfoForEnter((int)AcctId);

            PacketOut Out = new PacketOut((UInt32)Opcodes.ANS_WORLD_ENTER);

            if (cclient.Account == null || cclient.Character == null)
                Out.WriteInt32R(1);
            else
            {
                Out.WriteInt32R(0);
                Out.WriteInt32R(cclient.Character.Character.Id);
                Out.WriteInt32R(cclient.Account.Points); // Points
                Out.WriteByte(1);
                Out.WriteInt64R(TCPManager.GetTimeStamp());
                Out.WriteFloat(5.00f); // fMarketPlaceMinimumBidPct
                Out.WriteByte(0); // GroupPublic
                Out.WriteByte(0); // GroupInvite

                Out.WriteInt32R(Program.FileMgr.GetFileVersion(cclient.Account.Id, 1, false, Program.Config.WorldName, cclient.Character.Character.Name)); // ConfigFileVersion
                Out.WriteInt32R(Program.FileMgr.GetFileVersion(cclient.Account.Id, 2, false, Program.Config.WorldName, cclient.Character.Character.Name));
                Out.WriteInt32R(Program.FileMgr.GetFileVersion(cclient.Account.Id, 3, false, Program.Config.WorldName, cclient.Character.Character.Name));
                Out.WriteInt32R(Program.FileMgr.GetFileVersion(cclient.Account.Id, 4, false, Program.Config.WorldName, cclient.Character.Character.Name));
                Out.WriteInt32R(Program.FileMgr.GetFileVersion(cclient.Account.Id, 5, false, Program.Config.WorldName, cclient.Character.Character.Name));

                Out.WriteByte(1); // Tutorial Complete
                Out.WriteByte(0); // lookInForGroup
            }

            cclient.SendTCP(Out);
        }
开发者ID:Novo,项目名称:apbprivateserver,代码行数:37,代码来源:ASK_WORLD_ENTER.cs


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