示例#1
0
            void client_UseCardCompleted(object sender, RookieCard.UseCardCompletedEventArgs e)
            {
                PacketStream packet = new PacketStream();

                RookieCardContext context = (RookieCardContext)e.UserState;

                packet.WriteUInt32(0);

                packet.WriteUInt32(Packet.WIS_2_GS_USE_ROOKIE_CARD_RESULT);

                packet.WriteUInt32(context.playerId);

                packet.WriteByte((byte)e.Result);

                packet.WriteUInt32(e.itemTemplate);

                packet.WriteString(context.charName);

                uint len = packet.GetLength();

                packet.Seek(0);

                packet.WriteUInt32(len);

                FSession.SendPacket(packet);
            }
示例#2
0
            public void OnPacket(byte[] data, int bytes)
            {
                PacketStream packet = new PacketStream(data, 0, bytes);

                UInt32 packetBytes = packet.ReadUInt32();

                UInt32 id = packet.ReadUInt32();

                if (FHandlers.ContainsKey(id) == false)
                {

                    OnUnhandledPacket(id, packetBytes);

                    return;

                }

                PacketHandler handler = FHandlers[id];

                if (handler != null)
                {

                    handler(packet);

                }
            }
示例#3
0
 void OnKeepAlive(PacketStream packet)
 {
 }
示例#4
0
            void OnRookieCard(PacketStream packet)
            {
                UInt32 playerId = packet.ReadUInt32();

                string code = packet.ReadString();

                string charName = packet.ReadString();

                RookieCard.RookieCardSoapClient client = new RookieCard.RookieCardSoapClient();

                client.UseCardCompleted += new EventHandler<WIS.RookieCard.UseCardCompletedEventArgs>(client_UseCardCompleted);

                RookieCardContext context = new RookieCardContext();
                context.playerId = playerId;
                context.charName = charName;

                client.UseCardAsync(code, -1, -1, context);
            }
示例#5
0
文件: GSSession.cs 项目: lythm/orb3d
 void SendPacket(PacketStream packet)
 {
     SendData(packet.GetBytes(), (int)packet.GetLength());
 }