#include #include #include "proboard.hpp" void user_online::write() { memset(this,0,sizeof(*this)); File f(FN_ONLINE_PRO,fmode_rw); if(!f.opened()) { f.open(FN_ONLINE_PRO,fmode_create | fmode_rw); for(int i=0;i=0) { sleep(1); continue; } switch(req) { case UO_CHATTING: setstatus(UO_CHATTING); return 0; default: return 2; } } return 1; } int user_online::check_chat() { int x=getstatus(); return (x>0)?x:0; } void user_online::read(int node) { File f(FN_ONLINE_PRO); if(!f.opened()) return; if(!node) node=node_number; f.seek(long(node-1)*sizeof(*this)); f.read(this,sizeof(*this)); }