X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMain.cc;h=277cc3dde45eaa7642c79cc1d61b3a4aa196f252;hp=fc84ceb38fcc3171743faec7eeca3a6c750f7f78;hb=41f8dd670e963aad94527ce2be0486268993a477;hpb=90b2c7fb10b244b781b84965a0d36f1f323ee94d diff --git a/src/Main.cc b/src/Main.cc index fc84ceb..277cc3d 100644 --- a/src/Main.cc +++ b/src/Main.cc @@ -40,8 +40,6 @@ Main::Main(Mf::Settings& settings, Mf::Video& video) : mNewContextDispatch = dispatch.addTarget("video.newcontext", boost::bind(&Main::setupGL)); setupGL(); - - addChild(TitleLayer::alloc()); } @@ -49,9 +47,10 @@ void Main::update(Mf::Scalar t, Mf::Scalar dt) { if (children().size() == 0) { - Mf::logWarning("main view has no children"); - stop(); - return; + //Mf::logWarning("main view has no children"); + //stop(); + //return; + addChild(TitleLayer::alloc()); } Mf::View::update(t, dt); @@ -222,11 +221,18 @@ void Main::printInfo(int argc, char* argv[]) } std::cout << " Executable: " << argv[0] << std::endl +#ifdef YOINK_GITHEAD + << " Commit: "YOINK_GITHEAD << std::endl +#endif << " Version: "VERSION << std::endl << " Built: " << COMPILE_TIME << std::endl << " Compiler: "COMPILER_STRING << std::endl << " Assets: " << assets << std::endl << "Build options: " +#ifndef HAVE_CLOCK_GETTIME + << "-" +#endif + << "clock_gettime " #ifdef NDEBUG << "-" #endif @@ -270,8 +276,70 @@ void goodbye() } +#include + int main(int argc, char* argv[]) { + Mf::ResolverTask task("compy", "4950", SOCK_DGRAM); + task.run(); + + int i = task.wait(); + Mf::logWarning << "task ended with code: " << i << std::endl; + + std::vector::const_iterator it; + for (it = task.addresses().begin(); it != task.addresses().end(); ++it) + { + Mf::SocketAddress addr = *it; + + Mf::logInfo << "address: " << addr.name() << ":" << addr.port() + << " (" << addr.type() << ")" << std::endl; + } + + Mf::SocketAddress addr("www.apple.com", "80", SOCK_DGRAM); + + Mf::logInfo << "address: " << addr.name() << ":" << addr.port() + << " (" << addr.type() << ")" << std::endl; + + Mf::Packet packet(1000000); + packet << (uint16_t)45; + Mf::logInfo << "packet size: " << packet.size() << std::endl; + packet << (int64_t)-1234567890123456789; + Mf::logInfo << "packet size: " << packet.size() << std::endl; + + packet << true << false << false << true << false << true << true; + Mf::logInfo << "packet size: " << packet.size() << std::endl; + + std::vector hi; + hi.push_back(34); + hi.push_back(-12345); + hi.push_back(7734); + + for (int a = 0; a < 15900; a++) + { + hi.push_back(a); + } + + packet << hi; + Mf::logInfo << "packet size: " << packet.size() << std::endl; + + packet << "hello world"; + Mf::logInfo << "packet size: " << packet.size() << std::endl; + + packet << false << false << false << true << false; + Mf::logInfo << "packet size: " << packet.size() << std::endl; + + + for (it = task.addresses().begin(); it != task.addresses().end(); ++it) + { + Mf::SocketAddress addr = *it; + Mf::Socket sock(addr); + sock.write(packet); + } + + + return 0; + + if (argc > 1) { std::string arg(argv[1]);