Comments (3)
I think its the PacketHandler in packet.py. Rewriting it could help. This is what I have done now (not tested). Would be great if someone could make suggestions how to make it better:
def feed(self, data):
try:
self.data += data
reader = ByteReader(self.data)
while True:
pos = reader.tell()
if pos >= len(self.data):
break
packet = read_packet(reader, self.table)
self.last_packet_id = packet.packet_id
self.callback(packet)
self.data = self.data[pos:]
except (OutOfData, KeyError):
pass
For comparisation here is the old source (looks buggy and unperformant because also the try is used within a while loop):
def feed(self, data):
self.data += data
reader = ByteReader(self.data)
while True:
pos = reader.tell()
if pos >= len(self.data):
break
try:
packet = read_packet(reader, self.table)
except OutOfData:
break
except KeyError, e:
print 'Last packet ID:', self.last_packet_id
raise e
self.last_packet_id = packet.packet_id
self.callback(packet)
self.data = self.data[pos:]
from cuwo.
No - that's not how it works. What you have provided above will break the framing.
Also, this is a duplicate of #25
from cuwo.
Why it should not work with my code change?
from cuwo.
Related Issues (20)
- Respawning and duplication HOT 1
- Spikes
- Spawnkilling HOT 2
- Server not starting
- server is crashing after terraingen is turned off
- sim_add_zone: Zone already exists HOT 1
- Windows fatal exception: access violation HOT 5
- problem with running run_server.sh HOT 1
- A big problem on my end here, terrain gen keeps crashing! HOT 2
- Error when player disconnect HOT 2
- About the map
- Teleport instruction format?
- UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9c in position 46: invalid start byte HOT 1
- Update discord.py
- Fatal Python error: Illegal instruction HOT 1
- vector.py:110
- Artifacts on ci was deleted
- Login HOT 1
- Item duplicate?
- ModuleNotFoundError HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cuwo.