13-05-2008, 12:50 AM
Well Ive moved onto server loops and need some more advice..
I think that certain events arent important enough to check every loop, such as the respawning of map objects (ex/ trees, ore, etc)
SOoo.. I just through this together in a minute:
Serverloop:
This would reduce checking certain unimportant procedures, thereby lightening up on the serverloop. Idk I just pieced this together off the top of my head, you can harrass me now.
I think that certain events arent important enough to check every loop, such as the respawning of map objects (ex/ trees, ore, etc)
SOoo.. I just through this together in a minute:
Serverloop:
Code:
If GetTickCount > SecondTimer + 1000 Then
Call CheckTempTree
SecondTimer = GetTickCount
End If
Code:
Sub CheckTempTree()
Dim x As Long
'RespawnTreeID records current temp trees, and handles the timer and respawn
Do while x -1
If RespawnTreeID(x) = -1
x = -1
Else
If GetTickCount > RespawnTreeID(x).Timer + 20000 Then
RespawnTree(RespawnTreeID(x))
RemoveTreeID(x)
End If
End If
Do Events
Loop
End Sub