NotaPublicado: 03 Sep 2010 23:30
por laureanocabj
Cuando qiero poner en mi server el siguiente aporte de maTih.- : Sistema DarOro y Sistema viajes , y cuando compilo el Server me tira ... Error de compilacion: Referencia no válida o sin calificar.
En la siguiente linea: Call buffer.CopyBuffer(.incomingData)

Y otra pregunta: Me puede tiar algun error por tener la version Portable del Visual Basic 6.0?

Saludos y gracias de antemano.

PD:(Yo solo pongo el codigo de daroro xq el de viajes no me sirve).

NotaPublicado: 03 Sep 2010 23:33
por ArzenaTh
Arriba de esa línea escribí:



Y sí, el VB 6 portable te puede traer problemas con las licencias de ciertos *.ocx

NotaPublicado: 03 Sep 2010 23:34
por Elaine
Declaraste¿?
Call outgoingData.WriteByte(ClientPacketID.daroro)

NotaPublicado: 04 Sep 2010 00:06
por laureanocabj
Si ArzenaTh me re sirvio lo pude compilar bien , pero sigoo teniendo problemas siempre con lo mismo... cuando pongo /daroro "nick" 4444 ; me empiesa a poner usuario offline usuario offline usuario offline usuario offline usuario offline usuario offline y se me cierra el juego... me pasa ultimamente con todos los comandos qe qiero ponerr me kiero matarr!! no le puedo implementar ningun comando xq siempre me pasa eso :S

NotaPublicado: 04 Sep 2010 00:09
por ArzenaTh
laureanocabj escribió:Si ArzenaTh me re sirvio lo pude compilar bien , pero sigoo teniendo problemas siempre con lo mismo... cuando pongo /daroro "nick" 4444 ; me empiesa a poner usuario offline usuario offline usuario offline usuario offline usuario offline usuario offline y se me cierra el juego... me pasa ultimamente con todos los comandos qe qiero ponerr me kiero matarr!! no le puedo implementar ningun comando xq siempre me pasa eso :S

¿Me pasás el link? Creo que hay un exit sub mal ubicado.

NotaPublicado: 04 Sep 2010 00:27
por laureanocabj
Cual link? el del servidor? pero mira q tiene modificaciones no esta desde 0.

NotaPublicado: 04 Sep 2010 00:34
por ArzenaTh
laureanocabj escribió:Cual link? el del servidor? pero mira q tiene modificaciones no esta desde 0.

El del código que implementaste.

NotaPublicado: 04 Sep 2010 00:34
por -.AnDy.-
#NotaEste post ha sido eliminado por Franeg95 en 04 Sep 2010 11:32.
Razón: Offtopic, respuesta sin relación con la tematica

NotaPublicado: 04 Sep 2010 00:41
por laureanocabj

NotaPublicado: 04 Sep 2010 14:04
por ArzenaTh
Tomá, reemplazalo por este:
  1. Private Sub HandleSistemaDarOro(ByVal userindex As Integer)
  2. '***************************************************
  3. Rem writter@MATÍAS EZEQUIEL
  4. Rem date@06/08/10
  5. Rem Sistema de /DARORO NICK CANTIDAD
  6. '***************************************************
  7.     If UserList(userindex).incomingData.length < 3 Then
  8.         Err.raise UserList(userindex).incomingData.NotEnoughDataErrCode
  9.         Exit Sub
  10.     End If
  11.    
  12. On Error GoTo Errhandler
  13.          'This packet contains strings, make a copy of the data to prevent losses if it's not complete yet...
  14.         Dim buffer As New clsByteQueue
  15.         Call buffer.CopyBuffer(.incomingData)
  16.        
  17.         'Remove packet ID
  18.         Call buffer.ReadByte
  19.        
  20.         Dim UserName As String
  21.         Dim tUser As Integer
  22.         Dim oroAdar As Long
  23.         UserName = buffer.ReadASCIIString()
  24.         oroAdar = buffer.ReadLong()
  25.          
  26.             tUser = NameIndex(UserName)
  27.            
  28.             If tUser <= 0 Then
  29.                 Call WriteConsoleMsg(userindex, "Usuario offline.", FontTypeNames.FONTTYPE_INFO)
  30.                 Call FlushBuffer(UserIndex)
  31.                 Exit Sub
  32.             End If
  33.            
  34.             If UserList(userindex).Stats.GLD < oroAdar Then
  35.              Call WriteConsoleMsg(userindex, "No puedes dar más oro del que tienes", FontTypeNames.FONTTYPE_CITIZEN)
  36.              Call FlushBuffer(UserIndex)
  37.              Exit Sub
  38.             End If
  39.            
  40.             UserList(userindex).Stats.GLD = UserList(userindex).Stats.GLD - oroAdar
  41.             UserList(tUser).Stats.GLD = UserList(tUser).Stats.GLD + oroAdar
  42.            
  43.             Call WriteConsoleMsg(userindex, "Le has dado " & oroAdar & " monedas de oro a " & UserList(tUser).name & " se te han descontado las monedas de oro", FONTTYPE_CENTINELA)
  44.             Call WriteConsoleMsg(tUser, "El usuario " & UserList(userindex).name & " te ha dado " & oroAdar & " monedas de oro.", FONTTYPE_CENTINELA)
  45.        
  46.         'If we got here then packet is complete, copy data back to original queue
  47.         Call .incomingData.CopyBuffer(buffer)
  48.  
  49. Errhandler:
  50.     Dim error As Long
  51.     error = Err.Number
  52. On Error GoTo 0
  53.    
  54.     'Destroy auxiliar buffer
  55.     Set buffer = Nothing
  56.    
  57.     If error <> 0 Then _
  58.         Err.raise error
  59. End Sub

Como dije, Exit Sub mal puesto :P

NotaPublicado: 04 Sep 2010 18:05
por laureanocabj
No no me sirvio me sigue tirando muchos usuarios offline usuarios offline usuarios offline usuarios offline.....

NotaPublicado: 04 Sep 2010 21:28
por ArzenaTh
Probá así:
  1. Private Sub HandleSistemaDarOro(ByVal userindex As Integer)
  2. '***************************************************
  3. Rem writter@MATÍAS EZEQUIEL
  4. Rem date@06/08/10
  5. Rem Sistema de /DARORO NICK CANTIDAD
  6. '***************************************************
  7.     If UserList(userindex).incomingData.length < 3 Then
  8.         Err.raise UserList(userindex).incomingData.NotEnoughDataErrCode
  9.         Exit Sub
  10.     End If
  11.    
  12. On Error GoTo Errhandler
  13.          'This packet contains strings, make a copy of the data to prevent losses if it's not complete yet...
  14.         Dim buffer As New clsByteQueue
  15.         Call buffer.CopyBuffer(.incomingData)
  16.        
  17.         'Remove packet ID
  18.         Call buffer.ReadByte
  19.        
  20.         Dim UserName As String
  21.         Dim tUser As Integer
  22.         Dim oroAdar As Long
  23.         UserName = buffer.ReadASCIIString()
  24.         oroAdar = buffer.ReadLong()
  25.          
  26.             tUser = NameIndex(UserName)
  27.            
  28.             If tUser <= 0 Then
  29.                 Call WriteConsoleMsg(userindex, "Usuario offline.", FontTypeNames.FONTTYPE_INFO)          
  30.             ElseIf UserList(userindex).Stats.GLD < oroAdar Then
  31.                 Call WriteConsoleMsg(userindex, "No puedes dar más oro del que tienes", FontTypeNames.FONTTYPE_CITIZEN)
  32.             Else          
  33.                   UserList(userindex).Stats.GLD = UserList(userindex).Stats.GLD - oroAdar
  34.                    UserList(tUser).Stats.GLD = UserList(tUser).Stats.GLD + oroAdar
  35.            
  36.                      Call WriteConsoleMsg(userindex, "Le has dado " & oroAdar & " monedas de oro a " & UserList(tUser).name & " se te han descontado las monedas de oro", FONTTYPE_CENTINELA)
  37.                     Call WriteConsoleMsg(tUser, "El usuario " & UserList(userindex).name & " te ha dado " & oroAdar & " monedas de oro.", FONTTYPE_CENTINELA)
  38.              End If
  39.        
  40.         'If we got here then packet is complete, copy data back to original queue
  41.         Call .incomingData.CopyBuffer(buffer)
  42.  
  43. Errhandler:
  44.     Dim error As Long
  45.     error = Err.Number
  46. On Error GoTo 0
  47.    
  48.     'Destroy auxiliar buffer
  49.     Set buffer = Nothing
  50.    
  51.     If error <> 0 Then _
  52.         Err.raise error
  53. End Sub

Acordate de haber cerrado el bloque with,

NotaPublicado: 04 Sep 2010 23:36
por laureanocabj
Huuuu chabon sos un genio ahora me anda de 10!!! ^^ me tira un solo usuario offline y qeda perfecto el server.

Gracias y disculpas por las molestias!! ^^ ^^