Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: shout on July 30, 2004, 12:43 PM

Title: C# Events
Post by: shout on July 30, 2004, 12:43 PM
I am trying to create an event that is triggerd by reciving a packet but it does not work.


     #region Recive Packet Event Group

     protected virtual void OnRecivePacket(BnetPacketArgs e)
     {
        if (BnetSocket.Available != 0)
        {
           RecivePacket(this, e);
        }
     }

     public delegate void BnetPacketHandler(object sender, BnetPacketArgs e);

     public event BnetPacketHandler RecivePacket;

     private void bnetSocket_RecivePacket(object sender, BnetPacketArgs e)
     {
        PS.AddPacket(e.inBuffer);
     }
     #endregion



And this is in the constructor:

this.RecivePacket += new BnetPacketHandler(bnetSocket_RecivePacket);



Could someone tell me what I am doing wrong?
Title: Re:C# Events
Post by: ChR0NiC on July 30, 2004, 02:48 PM
Although I doubt this is relevant, you misspelled "Receive" you spelled it "Recive"
Title: Re:C# Events
Post by: MyndFyre on July 30, 2004, 07:34 PM
Please avoid double-posts.  This question was correctly asked on the .NET Platform forum, and does not belong here.