Ejemplo n.º 1
0
    public static PacketDistributed CreatePacket(MessageID packetID)
    {
        PacketDistributed packet = null;

        switch (packetID)
        {
        case MessageID.GCErrorBack: { packet = new GCErrorBack(); } break;

        case MessageID.CGheartbeatClientSend: { packet = new CGheartbeatClientSend(); } break;

        case MessageID.GCheartbeatServerBack: { packet = new GCheartbeatServerBack(); } break;

        case MessageID.GCServerMsg: { packet = new GCServerMsg(); } break;

        case MessageID.OptionEvent: { packet = new OptionEvent(); } break;

        case MessageID.FrameOpts: { packet = new FrameOpts(); } break;

        case MessageID.LogicFrame: { packet = new LogicFrame(); } break;

        case MessageID.NextFrameOpts: { packet = new NextFrameOpts(); } break;

        case MessageID.GamePlayerInfo: { packet = new GamePlayerInfo(); } break;

        case MessageID.EnterGame: { packet = new EnterGame(); } break;
        }
        if (null != packet)
        {
            packet.packetID = packetID;
        }
        //netActionTime = DateTime.Now.ToFileTimeUtc();
        return(packet);
    }
Ejemplo n.º 2
0
    public static void Execute(object p)
    {
        GCheartbeatServerBack msg = p as GCheartbeatServerBack;

        NetMsgManager.Instance.HandleMessage(MessageID.GCheartbeatServerBack, msg);
    }