Author |
Topic  |
dayve
Forum Moderator
    
USA
5820 Posts |
Posted - 25 September 2002 : 22:55:21
|
I implemented the Loadave Panic error checking as well:
If strAllTeamStats = "<h3>Loadave panic! short-circuiting CGI</h3>" Then
intTeamTotal = -1
Else
intTeamTotal = CInt(Replace(Replace(Replace(strAllTeamStats,"<b>",""),"""",""),"<td align=center>",""))
End If
and then..
strLine5 = "Team Contribution: " & strTeamContribution
If intTeamTotal <> -1 Then
strLine5 = strLine5 & " (" & FormatNumber((100 * strTeamContribution / intTeamTotal), 2) & "%)"
End If
and..
If intTeamTotal <> -1 Then
If bTeamTotal Then
strOutputText = strOutputText & strLine8 & vbNewLine
End If
End If
|
|
 |
|
BWJM
Junior Member
 
Canada
193 Posts |
Posted - 25 September 2002 : 23:00:47
|
dayve: I must have missed something... What is this panic stuff? I've been offline most of today. |
 |
 |
|
BWJM
Junior Member
 
Canada
193 Posts |
Posted - 25 September 2002 : 23:05:45
|
OK, you two (eggy and Gremlin) have been added to my mailing list Also, if any of you have AOL IM, ICQ or Y! IM, let me know and I'll add you to my contact list. |
 |
 |
|
dayve
Forum Moderator
    
USA
5820 Posts |
Posted - 25 September 2002 : 23:11:36
|
there is a page that comes up on the stats page at Project Dolphin occasionally that states:
Loadave panic! short-circuiting CGI
Jeepaholic added an error trap for it and I implemented it into your code, but I'm not quite convinced that this error is trappable every time. I've seen some failures still. |
|
 |
|
Bookie
Average Member
  
USA
856 Posts |
Posted - 25 September 2002 : 23:19:38
|
Dayve, Can I use this? I just changed the ID to mine. Or do you want me to come up with my own thing and host it myself?

Matt |
Participate in my nonsense |
 |
|
eggyfarts
Junior Member
 
New Zealand
200 Posts |
Posted - 25 September 2002 : 23:21:36
|
I have MSN Messenger, email address eggyfarts2000_@_hotmail.com (remove the two underscores)
Just a note to say this is the 200th post fo this topic  |
Cheers, WeeVaa.
|
 |
|
eggyfarts
Junior Member
 
New Zealand
200 Posts |
Posted - 25 September 2002 : 23:24:07
|
Aww, no it isn't . It was while I was typing it though, but we must have been typing at the same time . |
Cheers, WeeVaa.
|
 |
|
Bookie
Average Member
  
USA
856 Posts |
Posted - 25 September 2002 : 23:25:58
|
Sorry to steal your thunder, eggyfarts. My bad. If I had known you were typing, I would have waited for you to post first. |
Participate in my nonsense |
 |
|
eggyfarts
Junior Member
 
New Zealand
200 Posts |
Posted - 25 September 2002 : 23:28:07
|
No problem , I dont care 'bout it anyway, just though ppl might like to know, so congrats to you  |
Cheers, WeeVaa.
|
 |
|
BWJM
Junior Member
 
Canada
193 Posts |
Posted - 25 September 2002 : 23:29:33
|
Dayve, instead of what you posted, I am making the following changes in my main code:
If strFullTeamStats = "<h3>Loadave panic! short-circuiting CGI</h3>" Then
lngTeamTotal = -1
Else
lngTeamTotal = CLng(Replace(Replace(Replace(strFullTeamStats,"<b>",""),"""",""),"<td align=center>",""))
End If and
'### Define each substring
strLine1 = "Team Name: " & UCase(strTeamName)
strLine2 = "Member Name: " & strAccountName
strLine3 = "Since: " & strDateJoined & " (" & CStr(intNumDays) & " days)"
strLine4 = "Total Keys Pressed: " & strTotalKeyCount
If lngTeamTotal <> -1 Then
strLine5 = "Team Contribution: " & strTeamContribution & " (" & FormatNumber((100 * strTeamContribution / lngTeamTotal), 2) & "%)"
Else
strLine5 = "Team Contribution: " & strTeamContribution
End If
strLine6 = "Average Keystrokes / Day: " & strAvgKeysPerDay
strLine7 = "Rank: " & strRank & " | Team Rank: " & strTeamRank
If lngTeamTotal <> -1 Then
strLine8 = "Team Total: " & FormatNumber(lngTeamTotal, 0, , , TriState.True) & " | # of Members: " & intNumTeamMembers
Else
strLine8 = "Team Total: n/a | # of Members: " & intNumTeamMembers
End If and
'### Concatenate Main String
Dim strOutputText As String = ""
If bTeamName Then
strOutputText = strOutputText & strLine1 & vbNewLine
End If
If bMemberName Then
strOutputText = strOutputText & strLine2 & vbNewLine
End If
If bSince Then
strOutputText = strOutputText & strLine3 & vbNewLine
End If
If bTotalKeys Then
strOutputText = strOutputText & strLine4 & vbNewLine
End If
If bTeamContribution Then
strOutputText = strOutputText & strLine5 & vbNewLine
End If
If bAverage Then
strOutputText = strOutputText & strLine6 & vbNewLine
End If
If bRanks Then
strOutputText = strOutputText & strLine7 & vbNewLine
End If
If bTeamTotal Then
strOutputText = strOutputText & strLine8 & vbNewLine
End If
I have yet to see one of these errors face-to-face so I don't know much about it, but what I do know tells me that the above should work. (Assuming it is only generated from the CGI script and not the PHPs.) |
 |
Edited by - BWJM on 25 September 2002 23:33:00 |
 |
|
dayve
Forum Moderator
    
USA
5820 Posts |
Posted - 25 September 2002 : 23:39:30
|
here's the funny thing, we're spending an awful lot of time on playing with this and I can see us all logging on to our computers tomorrow to find that Project Dolphin shut down or change their way of retrieving stats!!! That would just be wrong 
Anyway, I put an Anti-Leech routine as well. Figured only Broken Machine team members should be able to link to the script running directly off of my server so I added these simple lines:
'### Concatenate Main String
Dim strOutputText As String = ""
If strTeamID = 1839 then ' Reserved for Team BROKEN MACHINE
If bTeamName Then
strOutputText = strOutputText & strLine1 & vbNewLine
End If
If bMemberName Then
strOutputText = strOutputText & strLine2 & vbNewLine
End If
If bSince Then
strOutputText = strOutputText & strLine3 & vbNewLine
End If
If bTotalKeys Then
strOutputText = strOutputText & strLine4 & vbNewLine
End If
If bTeamContribution Then
strOutputText = strOutputText & strLine5 & vbNewLine
End If
If bAverage Then
strOutputText = strOutputText & strLine6 & vbNewLine
End If
If bRanks Then
strOutputText = strOutputText & strLine7 & vbNewLine
End If
If lngTeamTotal <> -1 Then
If bTeamTotal Then
strOutputText = strOutputText & strLine8 & vbNewLine
End If
End If
Else
strOutputText = "Reserved for Team BROKEN MACHINE"
End If
|
|
 |
|
BWJM
Junior Member
 
Canada
193 Posts |
Posted - 25 September 2002 : 23:47:34
|
I like that anti-leech test. I think I'll do something similar. |
 |
 |
|
Bookie
Average Member
  
USA
856 Posts |
Posted - 25 September 2002 : 23:50:13
|
quote: Originally posted by BWJM
I like that anti-leech test. I think I'll do something similar.
That's kind of ironic... leeching an anti-leech test. I shouldn't talk. |
Participate in my nonsense |
 |
|
BWJM
Junior Member
 
Canada
193 Posts |
Posted - 26 September 2002 : 00:07:26
|
Bookie: lol
OK, here's my code: It'll be included next time I email it out (not anymore tonight)
Case "M Total"
strTotalKeyCount = FormatNumber(Mid(Item, 17), 0, , , TriState.True)
End Select
Next
'### ANTI-LEECH TEST - Users MUST be a member of TEAM BROKEN MACHINE
If strTeamID = 1839 Then
'### Get Data from Website - Team Rank
HTTPGet.Open("GET", "http://project-dolphin.net/api/teamrank.php?TeamID=" & strTeamID, False)
HTTPGet.Send and
If bTeamTotal Then
strOutputText = strOutputText & strLine8 & vbNewLine
End If
'### ANTI-LEECH TEST - Users MUST be a member of TEAM BROKEN MACHINE
Else
strOutputText = "Unauthorized user!" & vbNewLine & vbNewLine & _
"Statistics Withheld!"
intFontSize = 12
bBold = True
drawFormat.Alignment = StringAlignment.Center
objFontColour = Brushes.Red
objBgColour = Color.White
objEdgeColour = Color.Black
End If
With this version, the Team ID is checked immediately and if it fails, all the rest of the statistics are not gathered or computed and it immediately outputs a nasty red on white error message. I might make the wording a bit harsher later but this is fine for now. |
 |
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 26 September 2002 : 00:16:27
|
do y'all know if an image could be read by the script and then inserted before the final image is output?
something like this:
TEXT
IMAGE
TEXT TEXT TEXT |
 |
|
Topic  |
|