Skip to content

Commit 41b9b14

Browse files
authored
Add [CNetChan/CBaseClient]:GetRemoteFramerate (RaphaelIT7#122)
* Add CNetChan/CBaseClient:GetRemoteFramerate * whitespace is dead * Document GetRemoteFramerate
1 parent d61a834 commit 41b9b14

File tree

2 files changed

+87
-55
lines changed

2 files changed

+87
-55
lines changed

README.md

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ Returns `true` on success.<br>
379379
> [!NOTE]
380380
> This function does normally **not** directly set the SignOnState.<br>
381381
> Instead it calls the responsible function for the given SignOnState like for `SIGNONSTATE_PRESPAWN` it will call `SpawnPlayer` on the client.<br>
382-
> Set the `rawSet` to `true` if you want to **directly** set the SignOnState.
382+
> Set the `rawSet` to `true` if you want to **directly** set the SignOnState.
383383
384384
#### (Experimental - 32x safe only) HolyLib.ExitLadder(Player ply)
385385
Forces the player off the ladder.<br>
@@ -458,7 +458,7 @@ hook.Add("HolyLib:PostEntityConstructor", "Example_ServerSide_Lights", function(
458458
if class == "light" then
459459
-- Return true makes these entities serverside only since they do not need networking at all
460460
-- This is because they use the lightstyle stringtable for networking / use the IVEngineServer::LightStyle binding
461-
return true
461+
return true
462462
end
463463
end)
464464
```
@@ -488,7 +488,7 @@ Example usage:
488488
```lua
489489
hook.Add("HolyLib:OnMapChange", "HelloThere", function(levelName, landmarkName)
490490
print("Next level name: " .. levelName)
491-
print("Using landmark: " .. landmarkName)
491+
print("Using landmark: " .. landmarkName)
492492
end)
493493
```
494494

@@ -769,46 +769,46 @@ If you try to get multiple values from the lua table, just use `INetworkStringTa
769769
Returns the lua table of this object.<br>
770770
You can store variables into it.<br>
771771

772-
#### string INetworkStringTable:GetTableName()
772+
#### string INetworkStringTable:GetTableName()
773773
Returns the name of the stringtable<br>
774774

775-
#### number INetworkStringTable:GetTableId()
775+
#### number INetworkStringTable:GetTableId()
776776
Returns the id of the stringtable<br>
777777

778-
#### number INetworkStringTable:GetNumStrings()
778+
#### number INetworkStringTable:GetNumStrings()
779779
Returns the number of strings this stringtable has<br>
780780

781-
#### number INetworkStringTable:GetMaxStrings()
781+
#### number INetworkStringTable:GetMaxStrings()
782782
Returns the maximum number of string this stringtable has<br>
783783

784-
#### number INetworkStringTable:GetEntryBits()
784+
#### number INetworkStringTable:GetEntryBits()
785785
ToDo: I have no idea<br>
786786

787-
#### INetworkStringTable:SetTick(number tick)
787+
#### INetworkStringTable:SetTick(number tick)
788788
number tick - The tick to set the stringtable to<br>
789789

790790
The current tick to used for networking
791791

792-
#### bool INetworkStringTable:ChangedSinceTick(number tick)
792+
#### bool INetworkStringTable:ChangedSinceTick(number tick)
793793
number tick - The tick to set the stringtable to<br>
794794

795795
Returns whether or not the stringtable changed since that tick.<br>
796796

797-
#### number INetworkStringTable:AddString(string value, bool isServer = true)
797+
#### number INetworkStringTable:AddString(string value, bool isServer = true)
798798
string value - The string to add<br>
799799
bool isServer - Weather or not the server is adding this value? (Idk, added it so you have more control.)<br>
800800

801801
Returns the index of the added string.<br>
802802

803-
#### string INetworkStringTable:GetString(number index)
803+
#### string INetworkStringTable:GetString(number index)
804804
number index - The index to get the string from<br>
805805

806806
Returns the string from that index<br>
807807

808-
#### table INetworkStringTable:GetAllStrings()
808+
#### table INetworkStringTable:GetAllStrings()
809809
Returns a table containing all the strings.<br>
810810

811-
#### number INetworkStringTable:FindStringIndex(string value)
811+
#### number INetworkStringTable:FindStringIndex(string value)
812812
string value - The string to find the index of<br>
813813

814814
Returns the index of the given string.<br>
@@ -1013,7 +1013,7 @@ This should always be the case after a full update.<br>
10131013
> [!NOTE]
10141014
> Only use this function inside the `HolyLib:[Pre/Post]CheckTransmit` hook!<br>
10151015
1016-
> [!IMPORTANT]
1016+
> [!IMPORTANT]
10171017
> This function was removed since I can't get it to work / It would be a bit more complicated than first anticipated.<br>
10181018
10191019
#### pvs.SetPreventTransmitBulk(Entity ent / table ents / EntityList list, Player ply / table plys / RecipientFilter filter, bool notransmit)
@@ -1219,7 +1219,7 @@ File: `cfg/game.cfg`<br>
12191219
Path: `GAME`<br>
12201220
becomes:<br>
12211221
File: `cfg/game.cfg`<br>
1222-
Path: `CONTENT_CONFIGS`
1222+
Path: `CONTENT_CONFIGS`
12231223

12241224
This will reduce the amount of searchpaths it has to go through which improves performance.<br>
12251225

@@ -1371,7 +1371,7 @@ Returns `nil` on failure.<br>
13711371

13721372
#### string util.DecompressLZ4(string data)
13731373
Decompresses the given data using [LZ4](https://github.com/lz4/lz4)<br>
1374-
Returns `nil` on failure.
1374+
Returns `nil` on failure.
13751375

13761376
#### util.AsyncTableToJSON(table tbl, function callback, bool pretty = false)
13771377
callback = `function(json) end`
@@ -1947,7 +1947,7 @@ Returns the size of the data in bytes.<br>
19471947
Returns the current position/bit.<br>
19481948

19491949
> [!NOTE]
1950-
> This is only available for the 32x!
1950+
> This is only available for the 32x!
19511951
19521952
#### bool bf_read:IsOverflowed()
19531953
Returns `true` if the buffer is overflowed.<br>
@@ -1964,30 +1964,30 @@ Reads and Angle.<br>
19641964
#### number bf_read:ReadBitCoord()
19651965

19661966
> [!NOTE]
1967-
> This is only available for the 32x!
1967+
> This is only available for the 32x!
19681968
19691969
#### number bf_read:ReadBitCoordBits()
19701970

19711971
> [!NOTE]
1972-
> This is only available for the 32x!
1972+
> This is only available for the 32x!
19731973
19741974
#### number bf_read:ReadBitCoordMP(bool integral = false, bool lowPrecision = false)
19751975

19761976
> [!NOTE]
1977-
> This is only available for the 32x!
1977+
> This is only available for the 32x!
19781978
19791979
#### number bf_read:ReadBitCoordMPBits(bool integral = false, bool lowPrecision = false)
19801980

19811981
> [!NOTE]
1982-
> This is only available for the 32x!
1982+
> This is only available for the 32x!
19831983
19841984
#### number bf_read:ReadBitFloat()
19851985

19861986
#### number bf_read:ReadBitLong(number bits, bool signed = false)
19871987
Reads a number with the given number of bits.<br>
19881988

19891989
> [!NOTE]
1990-
> This is only available for the 32x!
1990+
> This is only available for the 32x!
19911991
19921992
#### number bf_read:ReadBitNormal()
19931993

@@ -2313,7 +2313,7 @@ Called when our Steam server loses connection to steams servers.<br>
23132313
#### HolyLib:OnSteamConnect()<br>
23142314
Called when our Steam server successfully connected to steams servers.<br>
23152315

2316-
#### bool HolyLib:OnNotifyClientConnect(number nextUserID, string ip, string steamID64, number authResult)
2316+
#### bool HolyLib:OnNotifyClientConnect(number nextUserID, string ip, string steamID64, number authResult)
23172317
authResult - The steam auth result, `0` if steam accepts the client.<br>
23182318

23192319
| authResult | Description |
@@ -2745,12 +2745,12 @@ concommand.Add("play_me", function(ply)
27452745
return
27462746
end
27472747

2748-
voiceIdx = voiceIdx + 1
2748+
voiceIdx = voiceIdx + 1
27492749
local voiceData = voiceTbl[ply][voiceIdx]
27502750
-- We play it back in the exact same tick delays we received it in to not speed it up affect it in any way.
2751-
if voiceData then
2751+
if voiceData then
27522752
voicechat.ProcessVoiceData(player.GetBots()[1], voiceData)
2753-
end
2753+
end
27542754
end)
27552755
end)
27562756
```
@@ -3482,7 +3482,7 @@ bass.PlayFile("data/exampleSong.wav", "decode", function(channel, a, b)
34823482
g_Channel = channel -- Prevent gc from hitting while were processing it
34833483
local flags = bit.bor(0x40000, 0x20000) -- BASS_ENCODE_AUTOFREE | BASS_ENCODE_PCM
34843484
print("Did the job manage to start?", channel:EncodeToDisk("exampleSong.mp3", flags, function(success, errMsg)
3485-
print("Did it work?", success, errMsg)
3485+
print("Did it work?", success, errMsg)
34863486
end, true))
34873487
end)
34883488
```
@@ -4284,7 +4284,7 @@ hook.Add("HolyLib:ProcessConnectionlessPacket", "ProcessResponse", function(bf,
42844284
elseif status == 1 then
42854285
print("Created our net channel to " .. ip)
42864286
end
4287-
4287+
42884288
return true
42894289
end)
42904290

@@ -4363,7 +4363,7 @@ Reconnects the client.
43634363
Prints the given message into the client's console.<br>
43644364

43654365
> [!NOTE]
4366-
> It **won't** add `\n` to the end, you have to add it yourself.
4366+
> It **won't** add `\n` to the end, you have to add it yourself.
43674367
43684368
#### bool CBaseClient:IsValid()
43694369
Returns `true` if the client is still valid.<br>
@@ -4407,6 +4407,8 @@ Disconnects the client.<br>
44074407

44084408
#### number CBaseClient:GetRate()
44094409

4410+
#### number, number CBaseClient:GetRemoteFramerate()
4411+
44104412
#### CBaseClient:SetUpdateRate(number rate)
44114413

44124414
#### number CBaseClient:GetUpdateRate()
@@ -4565,7 +4567,7 @@ concommand.Add("nukechannel", function(ply)
45654567
net.WriteString(string)
45664568
net.Broadcast()
45674569
gameserver.GetClient(ply:EntIndex()-1):Transmit() -- Forces the message to be transmitted directly avoiding a overflow.
4568-
end
4570+
end
45694571
end)
45704572
```
45714573

@@ -4788,6 +4790,8 @@ Sets the callback function for when a connection has crashed.<br>
47884790
#### function CNetChan:GetConnectionCrashedCallback()
47894791
Returns the current connection crashed callback function.<br>
47904792

4793+
#### number, number CNetChan:GetRemoteFramerate()
4794+
47914795
### Hooks
47924796

47934797
#### bool HolyLib:OnSetSignonState(CGameClient client, number state, number spawnCount)
@@ -5099,7 +5103,7 @@ Blocks or unblocks the given file from being autorefreshed.
50995103
Resets autorefresh.<br>
51005104
Useful when you added/removed folders.
51015105

5102-
####
5106+
####
51035107

51045108
### Hooks
51055109

@@ -5110,7 +5114,7 @@ Called before a Lua file is being refreshed. If `true` is returned it will deny
51105114
```lua
51115115
hook.Add("HolyLib:PreLuaAutoRefresh", "ExamplePreAutoRefresh", function(filePath, fileName)
51125116
print("[BEFORE] FileChanged: " .. filePath .. filename)
5113-
5117+
51145118
if filename == "bogus" then
51155119
print("Denying Refresh")
51165120
return true -- prevent refresh
@@ -5119,7 +5123,7 @@ end)
51195123
```
51205124

51215125
#### HolyLib:PostLuaAutoRefresh(string filePath, string fileName)
5122-
Called after a Lua file is refreshed.
5126+
Called after a Lua file is refreshed.
51235127
Note that if a refresh is being denied by PreLuaAutorefresh or DenyLuaAutoRefresh, this hook won't be called.
51245128
```lua
51255129
hook.Add("HolyLib:PostLuaAutoRefresh", "ExamplePostAutoRefresh", function(filePath, fileName)
@@ -5262,7 +5266,7 @@ local gcList = luagc.GetAllGCObjects(gcHead)
52625266
table.remove(gcList, 1) -- remove the gcList table from itself since it included as the first entry.
52635267

52645268
for _, gcObject in ipairs(gcList) do
5265-
print("object: " .. tostring(gcObject) .. " (type: " .. type(gcObject) .. ")")
5269+
print("object: " .. tostring(gcObject) .. " (type: " .. type(gcObject) .. ")")
52665270
end
52675271
```
52685272

@@ -5412,7 +5416,7 @@ https://github.com/Facepunch/garrysmod-requests/issues/1323<br>
54125416
https://github.com/Facepunch/garrysmod-requests/issues/1472<br>
54135417
(Maybe)https://github.com/Facepunch/garrysmod-requests/issues/2129<br>
54145418
(Maybe)https://github.com/Facepunch/garrysmod-requests/issues/1962<br>
5415-
(Maybe)https://github.com/Facepunch/garrysmod-requests/issues/1699
5419+
(Maybe)https://github.com/Facepunch/garrysmod-requests/issues/1699
54165420

54175421
# Some things for later
54185422

0 commit comments

Comments
 (0)