Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Project Dolphin - Team Broken Machine
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 23

dayve
Forum Moderator

USA
5820 Posts

Posted - 25 September 2002 :  22:55:21  Show Profile  Visit dayve's Homepage
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

Go to Top of Page

BWJM
Junior Member

Canada
193 Posts

Posted - 25 September 2002 :  23:00:47  Show Profile
dayve: I must have missed something... What is this panic stuff? I've been offline most of today.

Go to Top of Page

BWJM
Junior Member

Canada
193 Posts

Posted - 25 September 2002 :  23:05:45  Show Profile
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.

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 25 September 2002 :  23:11:36  Show Profile  Visit dayve's Homepage
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.

Go to Top of Page

Bookie
Average Member

USA
856 Posts

Posted - 25 September 2002 :  23:19:38  Show Profile  Visit Bookie's Homepage  Send Bookie an AOL message  Send Bookie a Yahoo! Message
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
Go to Top of Page

eggyfarts
Junior Member

New Zealand
200 Posts

Posted - 25 September 2002 :  23:21:36  Show Profile
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.

Go to Top of Page

eggyfarts
Junior Member

New Zealand
200 Posts

Posted - 25 September 2002 :  23:24:07  Show Profile
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.

Go to Top of Page

Bookie
Average Member

USA
856 Posts

Posted - 25 September 2002 :  23:25:58  Show Profile  Visit Bookie's Homepage  Send Bookie an AOL message  Send Bookie a Yahoo! Message
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
Go to Top of Page

eggyfarts
Junior Member

New Zealand
200 Posts

Posted - 25 September 2002 :  23:28:07  Show Profile
No problem , I dont care 'bout it anyway, just though ppl might like to know, so congrats to you

Cheers,
WeeVaa.

Go to Top of Page

BWJM
Junior Member

Canada
193 Posts

Posted - 25 September 2002 :  23:29:33  Show Profile
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
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 25 September 2002 :  23:39:30  Show Profile  Visit dayve's Homepage
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

Go to Top of Page

BWJM
Junior Member

Canada
193 Posts

Posted - 25 September 2002 :  23:47:34  Show Profile
I like that anti-leech test. I think I'll do something similar.

Go to Top of Page

Bookie
Average Member

USA
856 Posts

Posted - 25 September 2002 :  23:50:13  Show Profile  Visit Bookie's Homepage  Send Bookie an AOL message  Send Bookie a Yahoo! Message
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
Go to Top of Page

BWJM
Junior Member

Canada
193 Posts

Posted - 26 September 2002 :  00:07:26  Show Profile
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.

Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 26 September 2002 :  00:16:27  Show Profile
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
Go to Top of Page
Page: of 23 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07