Exemplo n.º 1
0
    //Used to send events to other clients. If in single player, the event just get immedaitely received.
    public void SendEvent(BaseEntityEvent bee)
    {
        if (!connectedToHost)
        {
            DeliverEvent(bee);
        }

        //Do other stuff if connected
    }
Exemplo n.º 2
0
    //Used to take raw bytes and create a packet. Logic will be determined later.
    public void ReconstructEvent(byte[] bytes)
    {
        BaseEntityEvent bee = null;

        //Change later
        EVENT_TYPE type = EVENT_TYPE.MESSAGE;

        switch (type)
        {
        case EVENT_TYPE.MESSAGE:
            break;
        }

        if (bee != null)
        {
            DeliverEvent(bee);
        }
    }
Exemplo n.º 3
0
 //Invoke event upon reception
 public void DeliverEvent(BaseEntityEvent bee)
 {
     bee.InvokeEvent();
 }