Advertisement
Luciano_fuentes

Untitled

Apr 20th, 2017
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.40 KB | None | 0 0
  1. Option Explicit
  2.  
  3. '####################################################
  4. 'Autor: Luciano (G Toyz)
  5. 'Creación: 18/04/2017
  6. 'Aclaración: -
  7. 'Ultima modificación: -
  8. '
  9. '####################################################
  10.  
  11. Private Type tUsuario
  12. UsuarioIndex As Integer
  13. Pos As WorldPos
  14. End Type
  15.  
  16. Private Type tEquipos
  17. Usuarios() As tUsuario
  18. Rondas As Byte
  19. End Type
  20.  
  21. Private Type tArenas
  22. EquipoIndex As Byte
  23. Conteo As Integer
  24. Pos As WorldPos
  25. End Type
  26.  
  27. Private Type tEsperas
  28. EquipoIndex As Byte
  29. Pos As WorldPos
  30. End Type
  31.  
  32. Private Type tManejo
  33. Oro As Long
  34. Objetos() As Obj
  35. End Type
  36.  
  37. Public Type tDatosGenerales
  38. Cupos As Byte
  39. CaenObjetos As Boolean
  40. Inscripcion As tManejo
  41. CuposTotales As Byte
  42. NombreEvento As String
  43. ConteoInicioCupos As Integer
  44. EventoArmado As Boolean
  45. CuposAbiertos As Boolean
  46. EventoIniciado As Boolean
  47. End Type
  48.  
  49. Private Type tGeneral
  50. Arenas() As tArenas
  51. Esperas() As tEsperas
  52. Equipos() As tEquipos
  53. Datos As tDatosGenerales
  54. End Type
  55.  
  56. Private Eventos() As tGeneral
  57. ''
  58. '
  59. Public Sub Carga()
  60.  
  61. '*********************************************************************************
  62. 'Autor: Luciano (G Toyz)
  63. 'Creación: 18/04/2017
  64. 'Aclaración: -
  65. 'Ultima modificación: 19/04/2017
  66. '
  67. '*********************************************************************************
  68.  
  69. Dim Leer As New clsIniReader, cantidadEventos As Byte, LoopC As Long, cantidadArenas As Byte, cantidadEsperas As Byte
  70.  
  71. Call Leer.Initialize(App.Path & "\Dat\Eventos\INIT.dat")
  72.  
  73. cantidadEventos = CByte(Leer.GetValue("INIT", "EventosTotales"))
  74.  
  75. ReDim Eventos(1 To cantidadEventos) As tGeneral
  76.  
  77. For LoopC = 1 To cantidadEventos
  78. cantidadArenas = CByte(Leer.GetValue("EVENTO" & LoopC, "ArenasTotales"))
  79. cantidadEsperas = CByte(Leer.GetValue("EVENTO" & LoopC, "EsperasTotales"))
  80. With Eventos(LoopC)
  81. .Datos.CuposTotales = CByte(Leer.GetValue("EVENTO" & LoopC, "CuposTotales"))
  82. .Datos.NombreEvento = Leer.GetValue("EVENTO" & LoopC, "NombreEvento")
  83. Call CargarPosiciones(.Datos.NombreEvento, "Arena", .Arenas.Pos, cantidadArenas)
  84. Call CargarPosiciones(.Datos.NombreEvento, "Espera", .Esperas.Pos, cantidadEsperas)
  85. End With
  86. Next LoopC
  87.  
  88. End Sub
  89. ''
  90. '
  91. Private Sub CargarPosiciones(ByVal NombreEvento As String, ByVal DataFile As String, _
  92. ByRef Pos As WorldPos, CantidadTotal As Byte)
  93.  
  94. '*********************************************************************************
  95. 'Autor: Luciano (G Toyz)
  96. 'Creación: 18/04/2017
  97. 'Aclaración: -
  98. 'Ultima modificación: 19/04/2017
  99. '
  100. '*********************************************************************************
  101.  
  102. Dim Leer As New clsIniReader, LoopC As Long
  103.  
  104. Call Leer.Initialize(App.Path & "\Dat\Eventos\" & NombreEvento & "\" & DataFile & ".dat")
  105.  
  106. For LoopC = 1 To CantidadTotal
  107. Pos.Map = CInt(Leer.GetValue("Espera" & LoopC, "MAPA"))
  108. Pos.X = CByte(Leer.GetValue("Espera" & LoopC, "X"))
  109. Pos.Y = CByte(Leer.GetValue("Espera" & LoopC, "Y"))
  110. Next LoopC
  111.  
  112. End Sub
  113. ''
  114. '
  115. Public Sub ArmarEvento(ByVal UsuarioIndex As Integer, ByVal EventoIndex As Byte, ByRef Datos As tDatosGenerales)
  116.  
  117. '*********************************************************************************
  118. 'Autor: Luciano (G Toyz)
  119. 'Creación: 19/04/2017
  120. 'Aclaración: -
  121. 'Ultima modificación: -
  122. '
  123. '*********************************************************************************
  124.  
  125. With Eventos(EventoIndex)
  126. .Datos = Datos
  127. Call SendData(SendTarget.ToAll, 0, PrepareMessageConsoleMsg(.Datos.NombreEvento & ">> En " & .Datos.ConteoInicioCupos & " empezará el evento. (Inicializado por " & UserList(UsuarioIndex).name, FontTypeNames.FONTTYPE_GUILD))
  128. End With
  129. End Sub
  130. ''
  131. '
  132. Public Sub EntrarEvento(ByVal UsuarioIndex As Integer, ByVal EventoIndex As Byte)
  133.  
  134. '*********************************************************************************
  135. 'Autor: Luciano (G Toyz)
  136. 'Creación: 19/04/2017
  137. 'Aclaración: -
  138. 'Ultima modificación: -
  139. '
  140. '*********************************************************************************
  141.  
  142. If Not PuedeEntrarEvento(UsuarioIndex, EventoIndex) Then Exit Sub
  143.  
  144. Dim EquipoIndex As Byte, ParticipanteIndex As Byte
  145.  
  146. Call DameIndexs(EventoIndex, EquipoIndex, ParticipanteIndex)
  147.  
  148. '@@ chequeo de que si es 0 inicie el evento.
  149.  
  150.  
  151.  
  152. End Sub
  153. ''
  154. '
  155. Private Function PuedeEntrarEvento(ByVal UsuarioIndex As Integer, ByVal EventoIndex As Byte) As Boolean
  156.  
  157. '*********************************************************************************
  158. 'Autor: Luciano (G Toyz)
  159. 'Creación: 19/04/2017
  160. 'Aclaración: -
  161. 'Ultima modificación: -
  162. '
  163. '*********************************************************************************
  164. End Function
  165.  
  166. Private Function DameIndexs(ByVal EventoIndex As Byte, ByRef EquipoIndex As Byte, ByRef UsuarioIndex As Byte)
  167.  
  168. '*********************************************************************************
  169. 'Autor: Luciano (G Toyz)
  170. 'Creación: 19/04/2017
  171. 'Aclaración: -
  172. 'Ultima modificación: -
  173. '
  174. '*********************************************************************************
  175.  
  176. Dim LoopC As Long
  177.  
  178. With Eventos(EventoIndex)
  179.  
  180. End With
  181. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement