Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Internet Gambling > Software
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 09-05-2007, 10:00 PM
jukofyork jukofyork is offline
Senior Member
 
Join Date: Sep 2004
Location: Leeds, UK.
Posts: 2,551
Default Re: V1.07

Wow, I just realized this works with Party and just looking at it now - looks great!

[ QUOTE ]
Missing panels fix attempts. These are attempts to fix a bug I very rarely see - when some player panels appear on a table but others don't. It will not solve the your problem if you don't see any stat panels at all. In that case it's more likely the site folders are incorrectly set up.

In the Preferences->Table Display menu there is a group of 3 different fixes. "Sleep" pauses the program in between creating each panel. "Top-most" creates the panels as "Top-most windows" i.e. windows that are above any non-Top-most windows and Redraw redraws the panels every second until you activate the table by selecting it by double clicking the table name in the Realtime window list. None of these fixes are optimal and each will slow the program down.

If you have this problem please try each fix in turn. Quit the poker site and restart Realtime. Set the checkbox for the fix and then start the site up again. If you find one of the fixes solves the problem (and you were conssitently experiencing the problem without the fix), I'd like to know so I can incorporate it into later builds.

[/ QUOTE ]
I have a feeling this is the same problem as I ran into when making my HUD class a while back.

I'm not sure what method you are using to keep the HUD panels above the table, but if it involves changing the z-order then I found that sometimes (perhaps 1/10000 times and only on some PCs) windows just decides it isn't gonna comply... I even tried detecting this and then attempting to force the table behind the display panel, but this doesn't work either. The solution I came up with was to have the HUD class's thread detect when this was happening and restart itself (thus freeing the HWND, etc and recreating everything on thread re-initialization). Here is the code snippet:

<font class="small">Code:</font><hr /><pre> // Lets move to keep up with the Parent.
// NOTE: Only bother if we have the show flag set...
if (ParentWH!=NULL &amp;&amp; ShowState==true) {

// First lets try and get the window that is infront of our parent table.
HWND WH;
if ((WH=GetWindow(ParentWH,GW_HWNDPREV))!=NULL) {

// If we are not dirrectly infront of it, then lets make it so we are.
if (GetHwnd()!=WH) {

// If we have failed to change the z-order 5 times now, then lets see if the WH of the parent has chnaged.
if (ZOrderChangeCount==5) {
Error(WARNING,"Z-Order change failed 5 times... Exiting thread for main app to restart...");
QuitFlag=true; // We want to exit the thread and start again.
continue; // Go back to top of code, so we can try again.
}

// Try again.
SetWindowPos(GetHwnd(),WH,0,0,0,0,SWP_NOACTIVATE|S WP_NOMOVE|SWP_NOSIZE);
ZOrderChangeCount++; // We tried one more time now.
}

// Lets reset the count then.
else {
ZOrderChangeCount=0; // We are above table, so all ok.
}

}

// If we can't find a window infront of the parent, then we will just have force table below us instead.
// NOTE: This might cause random table z-order changes...
else {

// If we have failed to change the z-order 5 times now, then lets see if the WH of the parent has chnaged.
if (ZOrderChangeCount==5) {
Error(WARNING,"Attempt to force HUD behind failed 5 times... Exiting thread for main app to restart...");
QuitFlag=true; // We want to exit the thread and start again.
continue; // Go back to top of code, so we can try again.
}

// Try to force behind.
SetWindowPos(ParentWH,GetHwnd(),0,0,0,0,SWP_NOACTI VATE|SWP_NOMOVE|SWP_NOSIZE);
ZOrderChangeCount++; // We tried one more time now.

}

// Lets position the window over the table.
// NOTE: We use client coords now...
RECT PR;
GetClientRect(ParentWH,&amp;PR);
POINT PP;
PP.x=PR.left;
PP.y=PR.top;
ClientToScreen(ParentWH,&amp;PP);

// NOTE: Only does this if we need to actually move the window.
if (PP.x+OffsetX!=m_x || PP.y+OffsetY!=m_y)
MoveWindow(GetHwnd(),PP.x+OffsetX,PP.y+OffsetY,Wid th,Height,TRUE);

// Lets show the window then.
ShowWindow(GetHwnd(),SW_SHOW);

}

// Ledts make sure the window is hidden then.
else {
ShowWindow(GetHwnd(),SW_HIDE);
}
</pre><hr />

If it is this then it should be pretty easy to debug by getting the user to trigger a dump of each panel's z-order in relation to the table they are supposed to be following.

Hope this helps - Juk [img]/images/graemlins/smile.gif[/img]

[i]PS: The other problem with Party's own hand histories isn't realated to buffering is it? Along time ago I had problems with Party refusing to flush the buffers of the ".hhf" files it generates. It turns out that you can use kernel-level code to gain a handle to a locked file in "inpection mode" and get it to flush that way. Not sure if this will work for all OSes, but here is the snippet:

<font class="small">Code:</font><hr /><pre> HANDLE H = CreateFile(PartyLogs[LogIndex].Path,
0, // Inspection only mode.
FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE , // Still share all.
NULL,
OPEN_EXISTING, // Open exiting only.
FILE_ATTRIBUTE_NORMAL, // Only normal files.
NULL);
if (H==INVALID_HANDLE_VALUE) {
sprintf(TempBuffer,"Could not flush file. Error#=%d\0",GetLastError());
MessageBox(GetDesktopWindow(),TempBuffer,"Error... ",
MB_OK|MB_ICONERROR);
exit(1);
}
FlushFileBuffers(H); // Cause an OS level flush.
CloseHandle(H); // Close the handle.
</pre><hr />
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.