vbGore Free Online RPG Engine

Revolutionizing Visual Basic ORPG Development
It is currently Fri May 24, 2013 10:09 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 40 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject:
PostPosted: Mon Mar 17, 2008 2:30 am 
=^.^= Kitty =^.^=

Joined: Mon Jan 28, 2008 6:03 pm
Posts: 1545
Location: Behind you...
Okay, im such an idiot, when you say open my vbgore, i dont have your update client in the vbgore folder! It was in a diffrent folder that I told you. Next when compiling it gives me
Compile: Error
Variable not defined on this peice of code:
Code:
AddressOf GOREsock_WndProc)


From this bigger peice of code:
Code:
Public Sub GOREsock_Hook() ' WinSock is told to send it's messages to the Sox Control, but we need to intercept these messages!

    If Portal.GOREsock_WndProc = 0 Then ' If it's already hooked to our WindowProc function, we could have problems, this will make sure we've UnHooked before
        Let Portal.GOREsock_WndProc = apiSetWindowLong(WindowhWnd, GWL_GOREsock_WndProc, AddressOf GOREsock_WndProc)
    End If

End Sub


Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 17, 2008 3:03 am 
(>^_^)>Kirby<(^_^<)

Joined: Sun May 20, 2007 10:34 am
Posts: 851
Typically this happens when I accidentily delete a variable. Open a clean copy and look for all instances of that value, and see if it is different from your modified copy.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 17, 2008 7:40 am 
=^.^= Kitty =^.^=

Joined: Sat Nov 03, 2007 4:33 am
Posts: 958
@human: lol now we're getting complicated, right? ^^


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 17, 2008 8:26 am 
Slave to the BB

Joined: Tue Jul 31, 2007 8:45 am
Posts: 3273
Location: United Kingdom
Post the whole declarations block where you added the code.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 17, 2008 4:41 pm 
=^.^= Kitty =^.^=

Joined: Mon Jan 28, 2008 6:03 pm
Posts: 1545
Location: Behind you...
Code:
Option Explicit

Private Const BufferSize As Long = 8192

Private WindowhWnd As Long
Public Loaded As Byte   'Whether the socket is loaded or not

Private Type typPortal 'Class specific variables
    GOREsock_WndProc As Long 'Pointer to the origional WindowProc of our window (We need to give control of ALL messages back to it before we destroy it)
    Sockets As Long 'How many Sockets are comming through the Portal, Actually hold the Socket array count. NB - MUST change with Redim of Sockets
End Type

Private Type typHOSTENT
    hName As Long
    hAliases As Long
    hAddrType As Integer
    hLength As Integer
    hAddrList As Long
End Type

Private Type WSADATA
    wversion As Integer
    wHighVersion As Integer
    szDescription(0 To 255) As Byte
    szSystemStatus(0 To 127) As Byte
    iMaxSockets As Integer
    iMaxUdpDg As Integer
    lpszVendorInfo As Long
End Type

Public Enum enmSoxState
    soxDisconnected = 0&
    soxListening = 1&
    soxConnecting = 2&
    soxIdle = 3&
    soxSend = 4&
    soxRecv = 5&
    soxClosing = 6& ' Necessary so we don't try to Send on this Socket (Because apiShutDown says so!)
    soxBound = 10& ' The socket has been bound to its current GOREsock_Port and GOREsock_Address
    soxERROR = -1&
End Enum
#If False Then
Private soxDisconnected, soxListening, soxConnecting, soxIdle, soxSend, soxRecv, soxClosing, soxBound, soxERROR
#End If

Public Enum enmSoxOptions
    soxSO_BROADCAST = &H20& 'BOOL Allow transmission of broadcast messages on the GOREsock_
    soxSO_DEBUG = &H1& 'BOOL Record debugging information.
    soxSO_DONTROUTE = &H10& 'BOOL Do not route: send directly to interface.
    soxSO_KEEPALIVE = &H8& 'BOOL Send keepalives
    soxSO_LINGER = &H80& 'struct LINGER  Linger on close if unsent data is present.
    soxSO_OOBINLINE = &H100& 'BOOL Receive out-of-band data in the normal data stream. (See section DECnet Out-Of-band data for a discussion of this topic.)
    soxSO_RCVBUF = &H1002& 'int Specify the total per-socket buffer space reserved for receives. This is unrelated to SO_MAX_MSG_SIZE or the size of a TCP window.
    soxSO_REUSEADDR = &H4& 'BOOL Allow the socket to be bound to an address that is already in use. (See bind.)
    soxSO_SNDBUF = &H1001& 'int Specify the total per-socket buffer space reserved for sends. This is unrelated to SO_MAX_MSG_SIZE or the size of a TCP window.
    soxSO_TCP_NODELAY = Not &H1& 'BOOL Disables the Nagle algorithm for send coalescing.
    soxSO_USELOOPBACK = &H40& 'bypass hardware when possible
    soxSO_ACCEPTCONN = &H2& 'BOOL Socket is listening.
    soxSO_ERROR = &H1007& 'int Retrieve error status and clear.
    soxSO_TYPE = &H1008& 'Get Socket Type (From FTP - Experimental) (Seems to always returns 1 for a valid TCP socket, -1 for a closed socket)
End Enum
#If False Then
Private soxSO_BROADCAST, soxSO_DEBUG, soxSO_DONTROUTE, soxSO_KEEPALIVE, soxSO_LINGER, soxSO_OOBINLINE, soxSO_RCVBUF, soxSO_REUSEADDR, soxSO_SNDBUF, _
        soxSO_TCP_NODELAY, soxSO_USELOOPBACK, soxSO_ACCEPTCONN, soxSO_ERROR, soxSO_TYPE
#End If

Public Enum enmSoxTypes ' Basically, soxSERVER means the Sox number was 'accepted' by a listening connection, and soxCLIENT means we used connect to connect to a Server (on the other side, our connection will be soxSERVER)
    soxSERVER = 4026& ' This indicates that the Socket is either a Listening Socket, or was created from a Listening Socket, either way, our machine is acting as a Sox Server
    soxCLIENT = 4027& ' This indicates that the Socket is a connection we established to another computer/server, therefore our machine is acting as a Sox Client on this Socket
End Enum
#If False Then
Private soxSERVER, soxCLIENT
#End If

'API Defined
Private Const SOCKADDR_SIZE As Long = 16
Private Type typSocketAddr
    sin_family As Integer
    sin_port As Integer
    sin_addr As Long
    sin_zero(7) As Byte
End Type

'Class module Defined
Private Type typSocket
    Socket As Long ' The actual WinSock API socket number
    SocketAddr As typSocketAddr ' Info about the connection
    GOREsock_State As enmSoxState
    GOREsock_uMsg As Long ' Server (-1) / Client (0) Socket (Server = A Socket that has a connection to the Server / Client = A Socket that was created in GOREsock_Accept that connected to us)
End Type

Private Type typBuffer ' The advantage of using this is if we sent exactly 8K on the other side, when we receive 8K, FD_READ will not be sent again so we won't get an error like when we use a loop
    Size As Long ' Array Size (To check if there is incomming data, we can check the size of this variable, if -1 then we are not receiving anything)
    Pos As Long
    buffer() As Byte
End Type

Private Type typWSAData
    wversion As Integer
    wHighVersion As Integer
    szDescription(0 To 255) As Byte
    szSystemStatus(0 To 127) As Byte
    iMaxSockets As Integer
    iMaxUdpDg As Integer
    lpVendorInfo As Long
End Type

Private Const INVALID_SOCKET As Long = -1& ' Indication of an Invalid Socket
Private Const GOREsock_ERROR As Long = -1&
Private Const INADDR_NONE As Long = &HFFFFFFFF 'Was FFFF (Confirmed) ... Returned address is an error

Private Const AF_INET As Integer = 2
Private Const SOCK_STREAM As Long = 1    'stream socket
Private Const SOL_SOCKET As Long = &HFFFF& 'Officially the only option for socket level
Private Const FD_READ As Long = &H1
Private Const FD_WRITE As Long = &H2
Private Const FD_ACCEPT As Long = &H8
Private Const FD_CONNECT As Long = &H10
Private Const FD_CLOSE As Long = &H20
Private Const SD_SEND As Long = &H1
Private Const IPPROTO_TCP As Long = 6 'tcp
Private Const GWL_GOREsock_WndProc As Long = (-4)

'Combinations of flags (process it as a const instead of real-time - slightly (oh so slightly) faster)
Private Const FD_CLOSEREADWRITE As Long = FD_CLOSE Or FD_READ Or FD_WRITE
Private Const FD_CONNECTLISTEN As Long = FD_ACCEPT Or FD_CLOSE Or FD_CONNECT Or FD_READ Or FD_WRITE

Private Declare Function apiWSAStartup Lib "WS2_32" Alias "WSAStartup" (ByVal wVersionRequired As Long, lpWSADATA As typWSAData) As Long
Private Declare Function apiWSACleanup Lib "WS2_32" Alias "WSACleanup" () As Long
Private Declare Function apiSocket Lib "WS2_32" Alias "socket" (ByVal af As Long, ByVal s_type As Long, ByVal protocol As Long) As Long
Private Declare Function apiCloseSocket Lib "WS2_32" Alias "closesocket" (ByVal s As Long) As Long
Private Declare Function apiBind Lib "WS2_32" Alias "bind" (ByVal s As Long, addr As typSocketAddr, ByVal namelen As Long) As Long
Private Declare Function apiListen Lib "WS2_32" Alias "listen" (ByVal s As Long, ByVal backlog As Long) As Long
Private Declare Function apiConnect Lib "WS2_32" Alias "connect" (ByVal s As Long, name As typSocketAddr, ByVal namelen As Long) As Long
Private Declare Function apiAccept Lib "WS2_32" Alias "accept" (ByVal s As Long, addr As typSocketAddr, addrlen As Long) As Long
Private Declare Function apiWSAAsyncSelect Lib "WS2_32" Alias "WSAAsyncSelect" (ByVal s As Long, ByVal hWnd As Long, ByVal wMsg As Long, ByVal lEvent As Long) As Long
Private Declare Function apiRecv Lib "WS2_32" Alias "recv" (ByVal s As Long, buf As Any, ByVal buflen As Long, ByVal flags As Long) As Long
Private Declare Function apiSend Lib "WS2_32" Alias "send" (ByVal s As Long, buf As Any, ByVal buflen As Long, ByVal flags As Long) As Long
Private Declare Function apiGetSockOpt Lib "WS2_32" Alias "getsockopt" (ByVal s As Long, ByVal Level As Long, ByVal optname As Long, optval As Any, optlen As Long) As Long
Private Declare Function apiSetSockOpt Lib "WS2_32" Alias "setsockopt" (ByVal s As Long, ByVal Level As Long, ByVal optname As Long, optval As Any, ByVal optlen As Long) As Long
Private Declare Function apiHToNS Lib "WS2_32" Alias "htons" (ByVal hostshort As Long) As Integer 'Host To Network Short
Private Declare Function apiNToHS Lib "WS2_32" Alias "ntohs" (ByVal netshort As Long) As Integer 'Network To Host Short
Private Declare Function apiIPToNL Lib "WS2_32" Alias "inet_addr" (ByVal cp As String) As Long
Private Declare Function apiNLToIP Lib "WS2_32" Alias "inet_ntoa" (ByVal inn As Long) As Long
Private Declare Function apiShutDown Lib "WS2_32" Alias "shutdown" (ByVal s As Long, ByVal how As Long) As Long
Private Declare Function apiCallWindowProc Lib "User32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function apiSetWindowLong Lib "User32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function apiLStrLen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As Any) As Long
Private Declare Function apiLstrCpy Lib "kernel32" Alias "lstrcpyA" (ByVal lpString1 As String, ByVal lpString2 As Long) As Long
Private Declare Sub apiCopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long)

Private WSADATA As typWSAData 'Stores WinSock data on initialization of WinSock 2
Private Portal As typPortal ' Sorta used for general variables (The word Portal came from my use in previous versions of a STATIC window, do you know what that is? :)
Private Sockets() As typSocket
Private Recv() As typBuffer ' Receive Buffer
Private Send() As typBuffer ' Send Buffer
Private Declare Sub apiCopyMemory2 Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, ByVal hpvSource As Long, ByVal cbCopy As Long)
Private Declare Function apiGetHostByName Lib "wsock32" Alias "gethostbyname" (ByVal HostName As String) As Long
Private Declare Function WSACleanup Lib "wsock32" () As Long
Private Declare Function WSAStartup Lib "wsock32" (ByVal VersionReq As Long, WSADataReturn As WSADATA) As Long


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 21, 2008 12:58 pm 
=^.^= Kitty =^.^=

Joined: Mon Jan 28, 2008 6:03 pm
Posts: 1545
Location: Behind you...
So is anything wrong with that code?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 25, 2008 1:13 pm 
Slave to the BB

Joined: Tue Jul 31, 2007 8:45 am
Posts: 3273
Location: United Kingdom
I really can't see anything wrong with it, sorry. Run it again (Start with full compile, at menu at top) and see what happens...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 20, 2008 7:25 am 
Aleron Coder

Joined: Fri Jan 05, 2007 5:36 am
Posts: 2964
Location: Germany
hmm it catches itself in an endless loop if someone has a "wrong" Grh file? (.png)
*FIXED*
Link is HERE


Top
 Profile  
 
 Post subject: Re:
PostPosted: Thu Jun 05, 2008 7:24 pm 
=^.^= Kitty =^.^=

Joined: Tue Jun 03, 2008 11:01 pm
Posts: 963
Location: In Koredai
Christoph680 wrote:
gutterpunk wrote:
yes... you are. what you need to do is stop what you are doing entirely and find a vb tutorial already. clicking a file menu and clicking on make isnt rocket science. go find some extreme basics tutorials, it's covered in the first like 5 seconds. then you wont have to keep asking.


from now on that's the basic answer for all noob questions xD


You guys should have a button next to Reply and Quote that says Noob. Click the button, and it quotes the noob in question AND displays this default response. 8)


Top
 Profile  
 
 Post subject: Re: Reuploaded that guy's "Better" updater
PostPosted: Thu Jun 05, 2008 7:32 pm 
=^.^= Kitty =^.^=

Joined: Tue Mar 20, 2007 10:46 pm
Posts: 1821
Location: Sydney Australia
sounds simple :p

GOREsock_WndProc should be either a function or a sub, if its not defined then its not there unless its Private - it also should be in a module.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 40 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 8 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group