• Welcome to Valhalla Legends Archive.
 

C# Events

Started by shout, July 30, 2004, 12:43 PM

Previous topic - Next topic

shout

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?

ChR0NiC

Although I doubt this is relevant, you misspelled "Receive" you spelled it "Recive"

MyndFyre

Please avoid double-posts.  This question was correctly asked on the .NET Platform forum, and does not belong here.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.