Code: Show/Hide if (pp->ship != SHIP_Spectator && botInfo.db->noisySpectator) { if (time - pp->lastPositionUpdate > 100) if (time - lastSpec > 20) { // Request position if we've lost him pp->lastPositionUpdate = time; spectate(pp); } } |
Code: Show/Hide else if (Me->ship == SHIP_Spectator) { // Spectating Uint32 limit = settings.SendPositionDelay; if (time - lastPosition > limit) { // Cycle player spectated if (Me->ship == SHIP_Spectator) spectateNext(); sendPosition(false); } } |
50% Packetloss wrote: |
it will lag your zone once the population reaches a certain point. |
Code: Show/Hide (Mr. Ekted)>shouldn't really be doing it at all, but if you have to
(Mr. Ekted)>as slowly as possible (Mr. Ekted)>you know how much extra b/w it adds when you do that? (Mr. Ekted)>bot sends spec, server acks, server tells client it's being specced, client acks, client sends large version of pos packet (Mr. Ekted)>bot sends spec to another client, server acks, server tells old client to stop being specced, client acks, server tells client it's being specced, client acks, client sends large version of pos packet :Mr. Ekted:but it is possible to get all of the weapons in an area if it sits still :Mr. Ekted:not in spec? (Mr. Ekted)>only if the entire map fits in bot's radar :Mr. Ekted:do you have an idea on a minimum jump limit to have a decent refresh rate of pos? (Mr. Ekted)>pos only gets sent every 100ms, so no faster than that, but that means with 40 players, you get updates every 4 seconds minimim (Mr. Ekted)>junky was able to bring EG to its knees trying to spec really fast |
Code: Show/Hide //To start the timer: UINT hTimer; hTimer = SetTimer(NULL,0,101,TimerProc); // (101 is the timer interval (milliseconds)) // (TimerProc is the callback that will be called when interval expires) --------------------------------------------------------- //To stop the timer: KillTimer(NULL,hTimer); --------------------------------------------------------- //The callback function VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime) { //Put your code here // ... return; } |
Code: Show/Hide class DirClient
{ protected: void OnDisconnected(void *clos); static void OnDisconnected_(void *self, void *clos); }; ... net->SetDisconnectFunc(OnDisconnected_, (void*)this, NULL); ... void DirClient::OnDisconnected(void *clos) { ... } void DirClient::OnDisconnected_(void *self_, void *clos) { DirClient *self = (DirClient*)self_; self->OnDisconnected(clos); } |
Maverick wrote: |
what should be the name of the CALLBACK TimerProc() function be if I want it to be part of the botInfo:: class ? Or isn't that possible? |
Cyan~Fire wrote: |
Without a message loop, how exactly does the timer notification get to your code? |
Quote: |
Someone from another forum pointed out that when using settimer the called function must have code on its own to execute - if you want to have it call functions from other classes you have to fiddle around with threads etc. |