aboutsummaryrefslogtreecommitdiff
path: root/src/connection.h
Commit message (Expand)AuthorAge
* Cleanup client init states by bumping protocol versionsapier2014-04-08
* Add the option to bind to a specific addressShadowNinja2014-02-05
* Add propper client initializationsapier2014-01-31
* Fixed minetest reliable udp implementation (compatible to old clients)sapier2014-01-10
* Replace SimpleThread by JThread now implementing same featuressapier2013-12-15
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
* Fix server getting completely choked up on even a little of DoSPerttu Ahola2013-08-04
* Add support for IPv6proller2013-06-23
* Migrate to STL containers/algorithms.Ilya Zhuravlev2013-03-11
* Update Copyright YearsSfan52013-02-24
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
* Add congestion control settings to minetest.confPerttu Ahola2012-11-29
* Optimize headersPerttu Ahola2012-06-17
* Properly and efficiently use split utility headersPerttu Ahola2012-06-17
* Switch the license to be LGPLv2/later, with small parts still remaining as GP...Perttu Ahola2012-06-05
* Proper handling of failing to bind server socketPerttu Ahola2012-03-11
* Make Connection::Receive return the data via a SharedBuffer reference, so the...Kahrl2011-11-07
* utility.h: Change Buffer's interface to be more compatible with SharedBuffer'...Kahrl2011-11-07
* Improve Connection with threading and some kind of congestion controlPerttu Ahola2011-10-20
* Cleaned networking code a bit (had this one on the to-do list for like 4 mont...Perttu Ahola2011-05-21
* Players are left on server while server is running. No passwords yet.Perttu Ahola2011-01-15
* tinkering aroundPerttu Ahola2010-12-25
* disconnect method to connection to be used instead of just timing outPerttu Ahola2010-12-24
* license stuffPerttu Ahola2010-11-29
* Initial filesPerttu Ahola2010-11-27
>, IMenuManager *menumgr): IGUIElement(gui::EGUIET_ELEMENT, env, parent, id, core::rect<s32>(0,0,100,100)) { //m_force_regenerate_gui = false; m_menumgr = menumgr; m_allow_focus_removal = false; m_screensize_old = v2u32(0,0); setVisible(true); Environment->setFocus(this); m_menumgr->createdMenu(this); } virtual ~GUIModalMenu() { m_menumgr->deletingMenu(this); } void allowFocusRemoval(bool allow) { m_allow_focus_removal = allow; } bool canTakeFocus(gui::IGUIElement *e) { return (e && (e == this || isMyChild(e))) || m_allow_focus_removal; } void draw() { if(!IsVisible) return; video::IVideoDriver* driver = Environment->getVideoDriver(); v2u32 screensize = driver->getScreenSize(); if(screensize != m_screensize_old /*|| m_force_regenerate_gui*/) { m_screensize_old = screensize; regenerateGui(screensize); //m_force_regenerate_gui = false; } drawMenu(); } /* This should be called when the menu wants to quit. WARNING: THIS DEALLOCATES THE MENU FROM MEMORY. Return immediately if you call this from the menu itself. */ void quitMenu() { allowFocusRemoval(true); // This removes Environment's grab on us Environment->removeFocus(this); this->remove(); } void removeChildren() { const core::list<gui::IGUIElement*> &children = getChildren(); core::list<gui::IGUIElement*> children_copy; for(core::list<gui::IGUIElement*>::ConstIterator i = children.begin(); i != children.end(); i++) { children_copy.push_back(*i); } for(core::list<gui::IGUIElement*>::Iterator i = children_copy.begin(); i != children_copy.end(); i++) { (*i)->remove(); } } virtual void regenerateGui(v2u32 screensize) = 0; virtual void drawMenu() = 0; virtual bool OnEvent(const SEvent& event) { return false; }; protected: //bool m_force_regenerate_gui; v2u32 m_screensize_old; private: IMenuManager *m_menumgr; // This might be necessary to expose to the implementation if it // wants to launch other menus bool m_allow_focus_removal; }; #endif