Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReadTick()

void Terraria.Social.WeGame.WeGameP2PReader.ReadTick ( )
inline

Definition at line 109 of file WeGameP2PReader.cs.

110 {
111 //IL_0072: Unknown result type (might be due to invalid IL or missing references)
112 //IL_0079: Expected O, but got Unknown
113 //IL_00a1: Unknown result type (might be due to invalid IL or missing references)
114 //IL_00a7: Invalid comparison between Unknown and I4
115 if (!IsValid())
116 {
117 return;
118 }
120 {
121 while (_deletionQueue.Count > 0)
122 {
124 }
125 uint size;
126 while (IsPacketAvailable(out size))
127 {
128 byte[] array = ((_bufferPool.Count != 0) ? _bufferPool.Dequeue() : new byte[Math.Max(size, 4096u)]);
129 RailID val = new RailID();
130 bool flag;
131 lock (RailLock)
132 {
133 flag = (int)rail_api.RailFactory().RailNetworkHelper().ReadData(GetLocalPeer(), val, array, size) == 0;
134 }
135 if (!flag)
136 {
137 continue;
138 }
139 if (_readEvent == null || _readEvent(array, (int)size, val))
140 {
142 {
144 }
145 _pendingReadBuffers[val].Enqueue(new ReadResult(array, size));
146 }
147 else
148 {
150 }
151 }
152 }
153 }
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
static byte Max(byte val1, byte val2)
Definition Math.cs:738
Dictionary< RailID, Queue< ReadResult > > _pendingReadBuffers

References Terraria.Social.WeGame.WeGameP2PReader._bufferPool, Terraria.Social.WeGame.WeGameP2PReader._deletionQueue, Terraria.Social.WeGame.WeGameP2PReader._pendingReadBuffers, Terraria.Social.WeGame.WeGameP2PReader._readEvent, System.array, System.Collections.Generic.Dictionary< TKey, TValue >.ContainsKey(), System.Collections.Generic.Queue< T >.Count, System.Collections.Generic.Queue< T >.Dequeue(), System.Collections.Generic.Queue< T >.Enqueue(), Terraria.Social.WeGame.WeGameP2PReader.GetLocalPeer(), Terraria.Social.WeGame.WeGameP2PReader.IsPacketAvailable(), Terraria.Social.WeGame.WeGameP2PReader.IsValid(), System.Math.Max(), Terraria.Social.WeGame.WeGameP2PReader.RailLock, and System.Collections.Generic.Dictionary< TKey, TValue >.Remove().

Referenced by Terraria.Social.WeGame.NetSocialModule.Initialize().