• Welcome to Valhalla Legends Archive.
 

Socks & Codewarrior for OSX

Started by NetNX, January 13, 2005, 09:33 AM

Previous topic - Next topic

NetNX

how do i use socks in OSX on Codewarrior's C++ im looking for an example on how to do it to get my started :-/

dyslexify

i assume you mean the code warrior IDE
http://www.metrowerks.com/MW/Develop/CodeWarrior

I've not done much OSX programming, but i'd assume that it's not that much IDE specific.

UserLoser.

Quote from: Mephisto on January 13, 2005, 01:57 PM
What?
Didn't read it the first time? Here:

Quote from: NetNX on January 13, 2005, 09:33 AM
how do i use socks in OSX on Codewarrior's C++ im looking for an example on how to do it to get my started :-/

warz

Wait, now I missed it. I didn't catch it the first or second time. What'd he say?

warz

Quote from: Mephisto on January 14, 2005, 12:06 AM
Just sounded like a really stupid question at first.  Never heard of CodeWarrior before so I assumed he was an idiot (oh well); and I never made the connection of OSX to Macintosh.

Well now who is the idiot? Jumped to conclusions on topics you didn't even know about, without searching before commenting.

NetNX

<3 warz... I don't really care what people think of me aslong as i get my question answered :-/ if they wanna sit there and call me an idiot thats their waste of time...

just trying to learn something new :)

Mephisto

Quote from: NetNX on January 14, 2005, 09:15 AM
<3 warz... I don't really care what people think of me aslong as i get my question answered :-/ if they wanna sit there and call me an idiot thats their waste of time...

just trying to learn something new :)

I never called you an idiot; and regardless of the comment I posted foolishly, I still think your question is aloof because I don't think you can program well enough to go onto socket programming; but prove me wrong by all means.

NetNX


Private Sub sckAccept_DataArrival(Index As Integer, ByVal bytesTotal As Long)
    Dim i As Integer
    Dim b As String
    Dim c As String
    Dim sData As String
    Dim pByte As String
    Dim cData As String
    Dim a() As String
    sckAccept(Index).GetData sData
    Do Until sData = ""
    If InStr(sData, vbCrLf) = 0 Then
        cData = sData
        sData = ""
    Else
        a() = Split(sData, vbCrLf, 2)
        sData = a(1)
        cData = a(0)
    End If
        'DebugText "Processing:" & cData
       
        pByte = Left(cData, 1)
        cData = Right(cData, Len(cData) - 1)
        Select Case pByte
            Case Chr(0)
                If Len(cData) > 12 Then
                    DebugText "Man i think nigglets try'n hack u! Lets IP them :-X Winsock.Connect 'useast.battle.net',6112 repeat 12x times yaya :)"
                    modServer.sUSER(Index) = ""
                Else
                    DebugText "Username Recieved!"
                    modServer.sUSER(Index) = cData
                End If
                sckAccept(Index).SendData Chr(2) & vbCrLf
            Case Chr(1)
                If Len(cData) > 12 Then
                    DebugText "DAMN THESE NIGGERS IPBAN FOR U!"
                    sckAccept(Index).SendData Chr(4) & vbCrLf
                    DoEvents
                    Call sckAccept_Close(Index)
                ElseIf cData = "" Then
                    sckAccept(Index).SendData Chr(4) & vbCrLf
                    DoEvents
                    Call sckAccept_Close(Index)
                ElseIf sUSER(Index) = "" Then
                    sckAccept(Index).SendData Chr(4) & vbCrLf
                    DoEvents
                    Call sckAccept_Close(Index)
                Else
                    On Error GoTo fh1
                    DebugText App.Path & "\accounts\" & sUSER(Index) & ".txt"
                    Open App.Path & "\accounts\" & sUSER(Index) & ".txt" For Input As #1
                        Input #1, b
                        Input #1, c
                    Close #1
                    If cData <> b Then
                        sckAccept(Index).SendData Chr(4) & vbCrLf
                        DoEvents
                        Call sckAccept_Close(Index)
                    Else
                        If c = "3" Then
                            sACC(Index) = "3"
                        End If
                       
                        DebugText "Password Recieved!"
                        sckAccept(Index).SendData Chr(3) & vbCrLf
                        Open App.Path & "\accounts\" & sUSER(Index) & "\Log.txt" For Append As #1
                        Print #1, "-"
                        Print #1, "-"
                        Print #1, "-LoggedOn @ " & Now
                        Close #1
                    End If
                End If
                GoTo fh2
fh1:
    DebugText "Erronious File:" & err.Description & err.Number
    err.Clear
    Resume Next
   
fh2:
            Case Chr(2)
                If Len(cData) > 20 Then GoTo FH3
                lPC(Index) = lPC(Index) + 1
                If sACC(Index) = 3 Then GoTo FH3
                If lSta(Index) = LIST_PROXY Then
                    Open App.Path & "\accounts\" & sUSER(Index) & "\Log.txt" For Append As #1
                        Print #1, cData
                    Close #1
                Else
                    Open App.Path & "\accounts\" & sUSER(Index) & "\Log.txt" For Append As #1
                        Print #1, "-"
                        Print #1, "-Listing Proxys...."
                        Print #1, cData
                    Close #1
                    lSta(Index) = LIST_PROXY
                End If
FH3:
            Case Chr(3)
                If Len(cData) > 40 Then GoTo FH4
                lCK(Index) = lCK(Index) + 1
                If sACC(Index) = 3 Then GoTo FH4
                If lSta(Index) = LIST_CDKEY Then
                    Open App.Path & "\accounts\" & sUSER(Index) & "\Log.txt" For Append As #1
                        Print #1, cData
                    Close #1
                Else
                    Open App.Path & "\accounts\" & sUSER(Index) & "\Log.txt" For Append As #1
                        Print #1, "-"
                        Print #1, "-Listing Cdkeys...."
                        Print #1, cData
                    Close #1
                    lSta(Index) = LIST_CDKEY
                End If
FH4:
            Case Chr(4)
           ' On Error GoTo FH5
'taken out
            GoTo FH6
FH5:
            DoEvents
            Call sckAccept_Close(Index)
FH6:
            Else
                DoEvents
                Call sckAccept_Close(Index)
            End If
        End Select
    Loop
End Sub


eh... my code gota love them bd servers... im just trying to figure out the whole C++ thing in general.... and socks is where id like to start...

Mephisto

You know nothing about C++ and you want to learn about sockets first?  Needless to say that's a stupid idea.  If you're just starting, here's a good place: http://www.gametutorials.com.

NetNX

ill try it... but if u know where i could find a socks example for codewarrior that would help also ~_^ thanks for not being a complete penis like the rest of this forum's members...

Banana fanna fo fanna

NetNX: http://developer.apple.com/documentation/Porting/Conceptual/win32porting/Articles/networking.html

BUT: that code you posted in VB is terrible (sry). Too many gotos; go read online about how you should really structure your code, and buy a book. You should really learn basic programming concepts and techniques before delving into a larger project.

Mephisto: you're a friggin retard, and to cover it up you decided to use the word "aloof"

Mephisto

I could say the same thing about you.

warz

Quote from: Mephisto on January 17, 2005, 11:55 AM
I could say the same thing about you.

True come back of a retard.

Banana fanna fo fanna

Quote from: Mephisto on January 17, 2005, 11:55 AM
I could say the same thing about you.

i know you are but what am i

Zakath

$t0rm is a proven programmer, his expertise (if not always his personality) well-respected by many in this community (and a friend of mine besides).

Let's keep the flames clear of the topic, gentlemen.
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.