| Mirage Source http://miragesource.net/forums/ |
|
| Dont Regen When Full http://miragesource.net/forums/viewtopic.php?f=210&t=2320 |
Page 1 of 1 |
| Author: | William [ Sat Jul 21, 2007 4:13 pm ] |
| Post subject: | Dont Regen When Full |
You Must add this! Difficult: 1/5 Currently the server send the regen hp, mp and sp each 10 seconds, even if you have max in all of them. This means that each minute you send 18 packets which are not used. Just consider if that was the case and there were 10 players online, 180 packets/min to waste. And dont think about the hour: 10800packets! So do this quick thing and feel proud today. Find this in the server: Code: Sub CheckGiveHP() Dim i As Long, n As Long If GetTickCount > GiveHPTimer + 10000 Then For i = 1 To MAX_PLAYERS If IsPlaying(i) Then Call SetPlayerHP(i, GetPlayerHP(i) + GetPlayerHPRegen(i)) Call SendHP(i) Call SetPlayerMP(i, GetPlayerMP(i) + GetPlayerMPRegen(i)) Call SendMP(i) Call SetPlayerSP(i, GetPlayerSP(i) + GetPlayerSPRegen(i)) Call SendSP(i) End If DoEvents Next i GiveHPTimer = GetTickCount End If End Sub Replace it with: Code: Sub CheckGiveHP() Dim i As Long, n As Long If GetTickCount > GiveHPTimer + 10000 Then For i = 1 To MAX_PLAYERS If IsPlaying(i) Then If GetPlayerHP(i) <> GetPlayerMaxHP(i) Then Call SetPlayerHP(i, GetPlayerHP(i) + GetPlayerHPRegen(i)) Call SendHP(i) End If If GetPlayerMP(i) <> GetPlayerMaxMP(i) Then Call SetPlayerMP(i, GetPlayerMP(i) + GetPlayerMPRegen(i)) Call SendMP(i) End If If GetPlayerSP(i) <> GetPlayerMaxSP(i) Then Call SetPlayerSP(i, GetPlayerSP(i) + GetPlayerSPRegen(i)) Call SendSP(i) End If End If DoEvents Next i GiveHPTimer = GetTickCount End If End Sub You could also change 10000 to 20000 so instead of sending the packet each 10 seconds it sends it with 20, less packets |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|