/** * @return always returns 0. */ UINT LastCommonRouteFinder::RunInternal() { Pinger pinger; bool hasSucceededAtLeastOnce = false; while(doRun) { // wait for updated prefs prefsEvent->Lock(); bool enabled = m_enabled; // retry loop. enabled will be set to false in end of this loop, if to many failures (tries too large) while(doRun && enabled) { bool foundLastCommonHost = false; uint32 lastCommonHost = 0; uint32 lastCommonTTL = 0; uint32 hostToPing = 0; bool useUdp = false; hostsToTraceRoute.RemoveAll(); pingDelays.RemoveAll(); pingDelaysTotal = 0; pingLocker.Lock(); m_pingAverage = 0; m_lowestPing = 0; m_state = GetResString(IDS_USS_STATE_PREPARING); pingLocker.Unlock(); // Calculate a good starting value for the upload control. If the user has entered a max upload value, we use that. Otherwise 10 KBytes/s int startUpload = (maxUpload != _UI32_MAX)?maxUpload:10*1024; bool atLeastOnePingSucceded = false; while(doRun && enabled && foundLastCommonHost == false) { uint32 traceRouteTries = 0; while(doRun && enabled && foundLastCommonHost == false && (traceRouteTries < 5 || hasSucceededAtLeastOnce && traceRouteTries < _UI32_MAX) && (hostsToTraceRoute.GetCount() < 10 || hasSucceededAtLeastOnce)) { traceRouteTries++; lastCommonHost = 0; CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Try #%i. Collecting hosts..."), traceRouteTries); addHostLocker.Lock(); needMoreHosts = true; addHostLocker.Unlock(); // wait for hosts to traceroute newTraceRouteHostEvent->Lock(); CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Got enough hosts. Listing the hosts that will be tracerouted:")); POSITION pos = hostsToTraceRoute.GetStartPosition(); int counter = 0; while(pos != NULL) { counter++; uint32 hostToTraceRoute, dummy; hostsToTraceRoute.GetNextAssoc(pos, hostToTraceRoute, dummy); IN_ADDR stDestAddr; stDestAddr.s_addr = hostToTraceRoute; CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Host #%i: %s"), counter, ipstr(stDestAddr)); } // find the last common host, using traceroute CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Starting traceroutes to find last common host.")); // for the tracerouting phase (preparing...) we need to disable uploads so we get a faster traceroute and better ping values. SetUpload(2*1024); Sleep(SEC2MS(1)); if(m_enabled == false) { enabled = false; } bool failed = false; uint32 curHost = 0; for(uint32 ttl = 1; doRun && enabled && (curHost != 0 && ttl <= 64 || curHost == 0 && ttl < 5) && foundLastCommonHost == false && failed == false; ttl++) { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Pinging for TTL %i..."), ttl); useUdp = false; // PENDING: Get default value from prefs? curHost = 0; if(m_enabled == false) { enabled = false; } uint32 lastSuccedingPingAddress = 0; uint32 lastDestinationAddress = 0; uint32 hostsToTraceRouteCounter = 0; bool failedThisTtl = false; POSITION pos = hostsToTraceRoute.GetStartPosition(); while(doRun && enabled && failed == false && failedThisTtl == false && pos != NULL && ( lastDestinationAddress == 0 || lastDestinationAddress == curHost)) // || pingStatus.success == false && pingStatus.error == IP_REQ_TIMED_OUT )) { PingStatus pingStatus = {0}; hostsToTraceRouteCounter++; // this is the current address we send ping to, in loop below. // PENDING: Don't confuse this with curHost, which is unfortunately almost // the same name. Will rename one of these variables as soon as possible, to // get more different names. uint32 curAddress, dummy; hostsToTraceRoute.GetNextAssoc(pos, curAddress, dummy); pingStatus.success = false; for(int counter = 0; doRun && enabled && counter < 2 && (pingStatus.success == false || pingStatus.success == true && pingStatus.status != IP_SUCCESS && pingStatus.status != IP_TTL_EXPIRED_TRANSIT); counter++) { pingStatus = pinger.Ping(curAddress, ttl, true, useUdp); if(doRun && enabled && ( pingStatus.success == false || pingStatus.success == true && pingStatus.status != IP_SUCCESS && pingStatus.status != IP_TTL_EXPIRED_TRANSIT ) && counter < 3-1) { IN_ADDR stDestAddr; stDestAddr.s_addr = curAddress; CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Failure #%i to ping host! (TTL: %i IP: %s error: %i). Sleeping 1 sec before retry. Error info follows."), counter+1, ttl, ipstr(stDestAddr), (pingStatus.success)?pingStatus.status:pingStatus.error); pinger.PIcmpErr((pingStatus.success)?pingStatus.status:pingStatus.error); Sleep(1000); if(m_enabled == false) enabled = false; // trying other ping method useUdp = !useUdp; } } if(pingStatus.success == true && pingStatus.status == IP_TTL_EXPIRED_TRANSIT) { if(curHost == 0) curHost = pingStatus.destinationAddress; atLeastOnePingSucceded = true; lastSuccedingPingAddress = curAddress; lastDestinationAddress = pingStatus.destinationAddress; } else { // failed to ping this host for some reason. // Or we reached the actual host we are pinging. We don't want that, since it is too close. // Remove it. IN_ADDR stDestAddr; stDestAddr.s_addr = curAddress; if(pingStatus.success == true && pingStatus.status == IP_SUCCESS) { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Host was too close! Removing this host. (TTL: %i IP: %s status: %i). Removing this host and restarting host collection."), ttl, ipstr(stDestAddr), pingStatus.status); hostsToTraceRoute.RemoveKey(curAddress); } else if(pingStatus.success == true && pingStatus.status == IP_DEST_HOST_UNREACHABLE) { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Host unreacheable! (TTL: %i IP: %s status: %i). Removing this host. Status info follows."), ttl, ipstr(stDestAddr), pingStatus.status); pinger.PIcmpErr(pingStatus.status); hostsToTraceRoute.RemoveKey(curAddress); } else if(pingStatus.success == true) { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Unknown ping status! (TTL: %i IP: %s status: %i). Reason follows. Changing ping method to see if it helps."), ttl, ipstr(stDestAddr), pingStatus.status); pinger.PIcmpErr(pingStatus.status); useUdp = !useUdp; } else { if(pingStatus.error == IP_REQ_TIMED_OUT) { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Timeout when pinging a host! (TTL: %i IP: %s Error: %i). Keeping host. Error info follows."), ttl, ipstr(stDestAddr), pingStatus.error); pinger.PIcmpErr(pingStatus.error); if(hostsToTraceRouteCounter > 2 && lastSuccedingPingAddress == 0) { // several pings have timed out on this ttl. Probably we can't ping on this ttl at all failedThisTtl = true; } } else { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Unknown pinging error! (TTL: %i IP: %s status: %i). Reason follows. Changing ping method to see if it helps."), ttl, ipstr(stDestAddr), pingStatus.error); pinger.PIcmpErr(pingStatus.error); useUdp = !useUdp; } } if(hostsToTraceRoute.GetSize() <= 8) { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: To few hosts to traceroute left. Restarting host colletion.")); failed = true; } } } if(failed == false) { if(curHost != 0 && lastDestinationAddress != 0) { if(lastDestinationAddress == curHost) { IN_ADDR stDestAddr; stDestAddr.s_addr = curHost; CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Host at TTL %i: %s"), ttl, ipstr(stDestAddr)); lastCommonHost = curHost; lastCommonTTL = ttl; } else /*if(lastSuccedingPingAddress != 0)*/ { foundLastCommonHost = true; hostToPing = lastSuccedingPingAddress; CString hostToPingString = ipstr(hostToPing); if(lastCommonHost != 0) { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Found differing host at TTL %i: %s. This will be the host to ping."), ttl, hostToPingString); } else { CString lastCommonHostString = ipstr(lastDestinationAddress); lastCommonHost = lastDestinationAddress; lastCommonTTL = ttl; CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Found differing host at TTL %i, but last ttl couldn't be pinged so we don't know last common host. Taking a chance and using first differing ip as last commonhost. Host to ping: %s. Faked LastCommonHost: %s"), ttl, hostToPingString, lastCommonHostString); } } } else { if(ttl < 4) { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Could perform no ping at all at TTL %i. Trying next ttl."), ttl); } else { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Could perform no ping at all at TTL %i. Giving up."), ttl); } lastCommonHost = 0; } } } if(foundLastCommonHost == false && traceRouteTries >= 3) { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Tracerouting failed several times. Waiting a few minutes before trying again.")); SetUpload(maxUpload); pingLocker.Lock(); m_state = GetResString(IDS_USS_STATE_WAITING); pingLocker.Unlock(); prefsEvent->Lock(3*60*1000); pingLocker.Lock(); m_state = GetResString(IDS_USS_STATE_PREPARING); pingLocker.Unlock(); } if(m_enabled == false) { enabled = false; } } if(enabled) { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Done tracerouting. Evaluating results.")); if(foundLastCommonHost == true) { IN_ADDR stLastCommonHostAddr; stLastCommonHostAddr.s_addr = lastCommonHost; // log result CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Found last common host. LastCommonHost: %s @ TTL: %i"), ipstr(stLastCommonHostAddr), lastCommonTTL); IN_ADDR stHostToPingAddr; stHostToPingAddr.s_addr = hostToPing; CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Found last common host. HostToPing: %s"), ipstr(stHostToPingAddr)); } else { CGlobalVariable::QueueDebugLogLine(false,GetResString(IDS_USS_TRACEROUTEOFTENFAILED)); CGlobalVariable::QueueLogLine(true, GetResString(IDS_USS_TRACEROUTEOFTENFAILED)); enabled = false; pingLocker.Lock(); m_state = GetResString(IDS_USS_STATE_ERROR); pingLocker.Unlock(); // PENDING: this may not be thread safe thePrefs.SetDynUpEnabled(false); } } } if(m_enabled == false) { enabled = false; } if(doRun && enabled) { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Finding a start value for lowest ping...")); } // PENDING: prefsLocker.Lock(); uint64 lowestInitialPingAllowed = m_LowestInitialPingAllowed; prefsLocker.Unlock(); uint32 initial_ping = _I32_MAX; bool foundWorkingPingMethod = false; // finding lowest ping for(int initialPingCounter = 0; doRun && enabled && initialPingCounter < 10; initialPingCounter++) { Sleep(200); PingStatus pingStatus = pinger.Ping(hostToPing, lastCommonTTL, true, useUdp); if (pingStatus.success && pingStatus.status == IP_TTL_EXPIRED_TRANSIT) { foundWorkingPingMethod = true; if(pingStatus.delay > 0 && pingStatus.delay < initial_ping) { initial_ping = (UINT)max(pingStatus.delay, lowestInitialPingAllowed); } } else { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: %s-Ping #%i failed. Reason follows"), useUdp?_T("UDP"):_T("ICMP"), initialPingCounter); pinger.PIcmpErr(pingStatus.error); // trying other ping method if(!pingStatus.success && !foundWorkingPingMethod) { useUdp = !useUdp; } } if(m_enabled == false) { enabled = false; } } // Set the upload to a good starting point SetUpload(startUpload); Sleep(SEC2MS(1)); DWORD initTime = ::GetTickCount(); // if all pings returned 0, initial_ping will not have been changed from default value. // then set initial_ping to lowestInitialPingAllowed if(initial_ping == _I32_MAX) initial_ping = (UINT)lowestInitialPingAllowed; uint32 upload = 0; hasSucceededAtLeastOnce = true; if(doRun && enabled) { if(initial_ping > lowestInitialPingAllowed) { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Lowest ping: %i ms"), initial_ping); } else { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Lowest ping: %i ms. (Filtered lower values. Lowest ping is never allowed to go under %i ms)"), initial_ping, lowestInitialPingAllowed); } prefsLocker.Lock(); upload = m_CurUpload; if(upload < minUpload) { upload = minUpload; } if(upload > maxUpload) { upload = maxUpload; } prefsLocker.Unlock(); } if(m_enabled == false) { enabled = false; } if(doRun && enabled) { CGlobalVariable::QueueDebugLogLine(false, GetResString(IDS_USS_STARTING)); CGlobalVariable::QueueLogLine(true, GetResString(IDS_USS_STARTING) ); } pingLocker.Lock(); m_state = _T(""); pingLocker.Unlock(); // There may be several reasons to start over with tracerouting again. // Currently we only restart if we get an unexpected ip back from the // ping at the set TTL. bool restart = false; DWORD lastLoopTick = ::GetTickCount(); DWORD lastUploadReset = 0; while(doRun && enabled && restart == false) { DWORD ticksBetweenPings = 1000; if(upload > 0) { // ping packages being 64 bytes, this should use 1% of bandwidth (one hundredth of bw). ticksBetweenPings = (64*100*1000)/upload; if(ticksBetweenPings < 125) { // never ping more than 8 packages a second ticksBetweenPings = 125; } else if(ticksBetweenPings > 1000) { ticksBetweenPings = 1000; } } DWORD curTick = ::GetTickCount(); DWORD timeSinceLastLoop = curTick-lastLoopTick; if(timeSinceLastLoop < ticksBetweenPings) { //CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Sleeping %i ms, timeSinceLastLoop %i ms ticksBetweenPings %i ms"), ticksBetweenPings-timeSinceLastLoop, timeSinceLastLoop, ticksBetweenPings); Sleep(ticksBetweenPings-timeSinceLastLoop); } lastLoopTick = curTick; prefsLocker.Lock(); double pingTolerance = m_pingTolerance; uint32 pingToleranceMilliseconds = m_iPingToleranceMilliseconds; bool useMillisecondPingTolerance = m_bUseMillisecondPingTolerance; uint32 goingUpDivider = m_goingUpDivider; uint32 goingDownDivider = m_goingDownDivider; uint32 numberOfPingsForAverage = m_iNumberOfPingsForAverage; lowestInitialPingAllowed = m_LowestInitialPingAllowed; // PENDING uint32 curUpload = m_CurUpload; bool initiateFastReactionPeriod = m_initiateFastReactionPeriod; m_initiateFastReactionPeriod = false; prefsLocker.Unlock(); if(initiateFastReactionPeriod) { CGlobalVariable::QueueDebugLogLine(false, GetResString(IDS_USS_MANUALUPLOADLIMITDETECTED)); CGlobalVariable::QueueLogLine(true, GetResString(IDS_USS_MANUALUPLOADLIMITDETECTED) ); // the first 60 seconds will use hardcoded up/down slowness that is faster initTime = ::GetTickCount(); } DWORD tempTick = ::GetTickCount(); if(tempTick - initTime < SEC2MS(20)) { goingUpDivider = 1; goingDownDivider = 1; } else if(tempTick - initTime < SEC2MS(30)) { goingUpDivider = (UINT)(goingUpDivider * 0.25); goingDownDivider = (UINT)(goingDownDivider * 0.25); } else if(tempTick - initTime < SEC2MS(40)) { goingUpDivider = (UINT)(goingUpDivider * 0.5); goingDownDivider = (UINT)(goingDownDivider * 0.5); } else if(tempTick - initTime < SEC2MS(60)) { goingUpDivider = (UINT)(goingUpDivider * 0.75); goingDownDivider = (UINT)(goingDownDivider * 0.75); } else if(tempTick - initTime < SEC2MS(61)) { lastUploadReset = tempTick; prefsLocker.Lock(); upload = m_CurUpload; prefsLocker.Unlock(); } goingDownDivider = max(goingDownDivider, 1); goingUpDivider = max(goingUpDivider, 1); uint32 soll_ping = (UINT)(initial_ping*pingTolerance); if (useMillisecondPingTolerance) { soll_ping = pingToleranceMilliseconds; } else { soll_ping = (UINT)(initial_ping*pingTolerance); } uint32 raw_ping = soll_ping; // this value will cause the upload speed not to change at all. bool pingFailure = false; for(uint64 pingTries = 0; doRun && enabled && (pingTries == 0 || pingFailure) && pingTries < 60; pingTries++) { if(m_enabled == false) { enabled = false; } // ping the host to ping PingStatus pingStatus = pinger.Ping(hostToPing, lastCommonTTL, false, useUdp); if(pingStatus.success && pingStatus.status == IP_TTL_EXPIRED_TRANSIT) { if(pingStatus.destinationAddress != lastCommonHost) { // something has changed about the topology! We got another ip back from this ttl than expected. // Do the tracerouting again to figure out new topology CString lastCommonHostAddressString = ipstr(lastCommonHost); CString destinationAddressString = ipstr(pingStatus.destinationAddress); CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Network topology has changed. TTL: %i Expected ip: %s Got ip: %s Will do a new traceroute."), lastCommonTTL, lastCommonHostAddressString, destinationAddressString); restart = true; } raw_ping = (uint32)pingStatus.delay; if(pingFailure) { // only several pings in row should fails, the total doesn't count, so reset for each successful ping pingFailure = false; //CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Ping #%i successful. Continuing."), pingTries); } } else { raw_ping = soll_ping*3+initial_ping*3; // this value will cause the upload speed be lowered. pingFailure = true; if(m_enabled == false) { enabled = false; } else if(pingTries > 3) { prefsEvent->Lock(1000); } //CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: %s-Ping #%i failed. Reason follows"), useUdp?_T("UDP"):_T("ICMP"), pingTries); //pinger.PIcmpErr(pingStatus.error); } if(m_enabled == false) { enabled = false; } } if(pingFailure) { if(enabled) { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: No response to pings for a long time. Restarting...")); } restart = true; } if(restart == false) { if(raw_ping > 0 && raw_ping < initial_ping && initial_ping > lowestInitialPingAllowed) { CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: New lowest ping: %i ms. Old: %i ms"), max(raw_ping,lowestInitialPingAllowed), initial_ping); initial_ping = (UINT)max(raw_ping, lowestInitialPingAllowed); } pingDelaysTotal += raw_ping; pingDelays.AddTail(raw_ping); while(!pingDelays.IsEmpty() && (uint32)pingDelays.GetCount() > numberOfPingsForAverage) { uint32 pingDelay = pingDelays.RemoveHead(); pingDelaysTotal -= pingDelay; } uint32 pingAverage = Median(pingDelays); //(pingDelaysTotal/pingDelays.GetCount()); int normalized_ping = pingAverage - initial_ping; //{ // prefsLocker.Lock(); // uint32 tempCurUpload = m_CurUpload; // prefsLocker.Unlock(); // CGlobalVariable::QueueDebugLogLine(false, _T("USS-Debug: %i %i %i"), raw_ping, upload, tempCurUpload); //} pingLocker.Lock(); m_pingAverage = (UINT)pingAverage; m_lowestPing = initial_ping; pingLocker.Unlock(); // Calculate Waiting Time sint64 hping = ((int)soll_ping) - normalized_ping; // Calculate change of upload speed if(hping < 0) { //Ping too high acceptNewClient = false; // lower the speed sint64 ulDiff = hping*1024*10 / (sint64)(goingDownDivider*initial_ping); //CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Down! Ping cur %i ms. Ave %I64i ms %i values. New Upload %i + %I64i = %I64i"), raw_ping, pingDelaysTotal/pingDelays.GetCount(), pingDelays.GetCount(), upload, ulDiff, upload+ulDiff); // prevent underflow if(upload > -ulDiff) { upload = (UINT)(upload + ulDiff); } else { upload = 0; } } else if(hping > 0) { //Ping lower than max allowed acceptNewClient = true; if(curUpload+30*1024 > upload) { // raise the speed uint64 ulDiff = hping*1024*10 / (uint64)(goingUpDivider*initial_ping); //CGlobalVariable::QueueDebugLogLine(false,_T("UploadSpeedSense: Up! Ping cur %i ms. Ave %I64i ms %i values. New Upload %i + %I64i = %I64i"), raw_ping, pingDelaysTotal/pingDelays.GetCount(), pingDelays.GetCount(), upload, ulDiff, upload+ulDiff); // prevent overflow if(_I32_MAX-upload > ulDiff) { upload = (UINT)(upload + ulDiff); } else { upload = _I32_MAX; } } } prefsLocker.Lock(); if (upload < minUpload) { upload = minUpload; acceptNewClient = true; } if (upload > maxUpload) { upload = maxUpload; } prefsLocker.Unlock(); SetUpload(upload); if(m_enabled == false) { enabled = false; } } } } } // Signal that we have ended. threadEndedEvent->SetEvent(); return 0; }
void LogEntry1Data::ResumeSyncSend(void) { if (!SyncSendPaused) { return; } SyncSendPaused = FALSE; if (SyncNumber == CERROR) { return; } // We just unpaused and we're assigned a record number... tell everybody // else all about ourselves. GAINEXCLUSIVEACCESS(); char Buffer[256]; CopyStringToBuffer(Buffer, Name); SetName(Buffer); CopyStringToBuffer(Buffer, Initials); SetInitials(Buffer); CopyStringToBuffer(Buffer, Password); SetPassword(Buffer); CopyStringToBuffer(Buffer, Surname); SetSurname(Buffer); CopyStringToBuffer(Buffer, Title); SetTitle(Buffer); CopyStringToBuffer(Buffer, RealName); SetRealName(Buffer); CopyStringToBuffer(Buffer, PhoneNumber); SetPhoneNumber(Buffer); CopyStringToBuffer(Buffer, ForwardAddr); SetForwardAddr(Buffer); CopyStringToBuffer(Buffer, ForwardAddrNode); SetForwardAddrNode(Buffer); CopyStringToBuffer(Buffer, ForwardAddrRegion); SetForwardAddrRegion(Buffer); CopyStringToBuffer(Buffer, PromptFormat); SetPromptFormat(Buffer); CopyStringToBuffer(Buffer, DateStamp); SetDateStamp(Buffer); CopyStringToBuffer(Buffer, VerboseDateStamp); SetVerboseDateStamp(Buffer); CopyStringToBuffer(Buffer, Signature); SetSignature(Buffer); CopyStringToBuffer(Buffer, NetPrefix); SetNetPrefix(Buffer); CopyStringToBuffer(Buffer, MailAddr1); SetMailAddr1(Buffer); CopyStringToBuffer(Buffer, MailAddr2); SetMailAddr2(Buffer); CopyStringToBuffer(Buffer, MailAddr3); SetMailAddr3(Buffer); CopyStringToBuffer(Buffer, Alias); SetAlias(Buffer); CopyStringToBuffer(Buffer, LocID); SetLocID(Buffer); CopyStringToBuffer(Buffer, MorePrompt); SetMorePrompt(Buffer); CopyStringToBuffer(Buffer, Occupation); SetOccupation(Buffer); CopyStringToBuffer(Buffer, WhereHear); SetWhereHear(Buffer); CopyStringToBuffer(Buffer, LastRoom); SetLastRoom(Buffer); CopyStringToBuffer(Buffer, LastHall); SetLastHall(Buffer); CopyStringToBuffer(Buffer, DefaultRoom); SetDefaultRoom(Buffer); CopyStringToBuffer(Buffer, DefaultHall); SetDefaultHall(Buffer); CopyStringToBuffer(Buffer, TermType); SetTermType(Buffer); RELEASEEXCLUSIVEACCESS(); SetBirthDate(BirthDate); SetFirstOn(FirstOn); SetSex(Sex); SetNulls(Nulls); SetWidth(Width); SetLinesPerScreen(LinesPerScreen); SetAttribute(ATTR_NORMAL, attributes[ATTR_NORMAL]); SetAttribute(ATTR_BLINK, attributes[ATTR_BLINK]); SetAttribute(ATTR_REVERSE, attributes[ATTR_REVERSE]); SetAttribute(ATTR_BOLD, attributes[ATTR_BOLD]); SetAttribute(ATTR_UNDERLINE, attributes[ATTR_UNDERLINE]); SetNumUserShow(NumUserShow); SetDefaultProtocol(DefaultProtocol); SetCallTime(CallTime); SetCallNumber(CallNumber); SetTotalTime(TotalTime); SetCredits(Credits); SetLogins(Logins); SetPosted(Posted); SetRead(Read); SetPasswordChangeTime(PasswordChangeTime); SetCallsToday(CallsToday); SetCallLimit(CallLimit); SetLastMessage(LastMessage); SetDL_Bytes(DL_Bytes); SetUL_Bytes(UL_Bytes); SetDL_Num(DL_Num); SetUL_Num(UL_Num); SetPoopcount(Poopcount); SetDungeoned(IsDungeoned()); SetForwardToNode(IsForwardToNode()); SetAutoNextHall(IsAutoNextHall()); SetEnterBorders(IsEnterBorders()); SetVerified(IsVerified()); SetSurnameLocked(IsSurnameLocked()); SetDefaultHallLocked(IsDefaultHallLocked()); SetPsycho(IsPsycho()); SetViewTitleSurname(IsViewTitleSurname()); SetViewSubjects(IsViewSubjects()); SetViewSignatures(IsViewSignatures()); SetOldIBMGraph(IsOldIBMGraph()); SetOldIBMANSI(IsOldIBMANSI()); SetOldIBMColor(IsOldIBMColor()); SetTwirly(IsTwirly()); SetAutoVerbose(IsAutoVerbose()); SetPauseBetweenMessages(IsPauseBetweenMessages()); SetMinibin(IsMinibin()); SetClearScreenBetweenMessages(IsClearScreenBetweenMessages()); SetViewRoomInfoLines(IsViewRoomInfoLines()); SetViewHallDescription(IsViewHallDescription()); SetVerboseContinue(IsVerboseContinue()); SetViewCensoredMessages(IsViewCensoredMessages()); SetViewBorders(IsViewBorders()); SetOut300(IsOut300()); SetUserSignatureLocked(IsUserSignatureLocked()); SetHideMessageExclusions(IsHideMessageExclusions()); SetDownload(IsDownload()); SetUpload(IsUpload()); SetChat(IsChat()); SetPrintFile(IsPrintFile()); SetSpellCheckMode(GetSpellCheckMode()); SetMakeRoom(IsMakeRoom()); SetVerboseLogOut(IsVerboseLogOut()); SetConfirmSave(IsConfirmSave()); SetConfirmAbort(IsConfirmAbort()); SetConfirmNoEO(IsConfirmNoEO()); SetUsePersonalHall(IsUsePersonalHall()); SetYouAreHere(IsYouAreHere()); SetIBMRoom(IsIBMRoom()); SetWideRoom(IsWideRoom()); SetMusic(IsMusic()); SetCheckApostropheS(IsCheckApostropheS()); SetCheckAllCaps(IsCheckAllCaps()); SetCheckDigits(IsCheckDigits()); SetExcludeEncryptedMessages(IsExcludeEncryptedMessages()); SetViewCommas(IsViewCommas()); SetPUnPauses(IsPUnPauses()); SetRoman(IsRoman()); SetSuperSysop(IsSuperSysop()); SetInuse(IsInuse()); SetUpperOnly(IsUpperOnly()); SetLinefeeds(IsLinefeeds()); SetExpert(IsExpert()); SetAide(IsAide()); SetTabs(IsTabs()); SetOldToo(IsOldToo()); SetProblem(IsProblem()); SetUnlisted(IsUnlisted()); SetPermanent(IsPermanent()); SetSysop(IsSysop()); SetNode(IsNode()); SetNetUser(IsNetUser()); SetAccounting(IsAccounting()); SetMail(IsMail()); SetViewRoomDesc(IsViewRoomDesc()); }