Giter Club home page Giter Club logo

cuwo's Introduction

cuwo Build Status Build status

cuwo is an open server implementation for Cube World, written in Python and C++. It currently has the best protocol coverage among all the server projects out there, and has features like

  • Cross-platform support (Linux, Windows, Mac OS X, FreeBSD, what have you)
  • NPCs and mobs, just as in the regular server
  • File/console logging
  • MOTD message
  • Scripting (see the minimal welcome.py example)
  • Advanced configuration
  • Ban system
  • Commands (/kick, /say, /whereis, /setclock, /kill, /stun. etc.)
  • Rights management (/login password)
  • IRC bot
  • PvP script
  • DDoS prevention
  • Lower CPU requirements than normal server
  • Optimizations in C++
  • Master server on http://cuwo.org
  • Support for 40+ players
  • ... and much more!

Note that cuwo only supports x86 and x86-64, so it will not work on ARM.

Running

Windows

See the quick-start guide for a quick way to get started.

Alternatively, you can also build from source.

Source

Make sure you have Python >= 3.6, native compilers, and the following dependencies installed:

  • cython
  • pyrr

If you want IRC bot support, you will also need the irc3 package.

These packages can be installed with pip install cython pyrr irc3

To build cuwo, run python setup.py build_ext --inplace.

To run the server, run python -m cuwo.server.

For more information, see this guide.

Status

In terms of the protocol and features, the following has been implemented:

  • Player join/leave
  • Player movement and animations
  • Magic/arrows/etc. relay
  • Player hits on entities/other players
  • Item pickup/drop
  • Time management
  • Terrain generator
  • Interactive objects (doors, beds)
  • Preliminary support for Mobs and NPCs

A lot is still to be implemented gameplay-wise. Most importantly, NPCs and mobs have only recently been implemented, so expect some issues related to these.

Other features include

  • MITM proxy (for reverse-engineering)
  • Cube World/Qubicle model converter (tools/convertqmo.py)
  • Map viewer (tools/mapviewer.py)

FAQ

  • Q. I get ImportError: No module named 'cuwo.entity' when running cuwo.

  • A. See the instructions for running/building cuwo.

  • Q. How do I pronounce 'cuwo'?

  • A. 'coo-woo' (no, not 'kew-woh')

  • Q. I am not a programmer, and I can't reverse-engineer anything. How do I help?

  • A. We need people who can create end-user documentation as well! Have a look around, and see if anything is missing on the wiki.

  • Q. What is a MITM proxy?

  • A. A MITM proxy sits between your client and server, and can manipulate and inject packets. It's not really useful to the normal user, so use the regular cuwo server instead.

Special thanks

9th - help with RE
Andoryuuta - native RE
BLACKROCK - for help on passive packet
ChrisMiuchiz - native patches and RE
ColdMeekly - help with AMD 64bit troubleshooting
cs475x - website design
DRayX - encrypt.py and protocol RE
Endimmion - for his generous Pledgie donation
Favorlock - scripting and commands
Kainzo - testing
Kyle - master server JS
Lord_Nightmare - terraingen help and support with x86
MAT4DOR - cub model details
MazeXD - master server JS and design
Perl - protocol RE
Sarcen - help with protocol variables, scripting, anticheat
SLoW - scripting
Somer - help with some protocol variables
uwee - protocol variables
Xaymar - RE and character details
ZeZeene - web interface for master server

cuwo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cuwo's Issues

Timeout? [REOPENED]

Hello, I seem to be having an issue when I try to run this for extended amounts of time.
After about maybe 20min and a lot of connections it stops functioning. It is still running and I can try to connect to it but when I do then it returns "Server Error" or something to that effect.

This bug is still in effect with the 3rd commit.

Timeout?

Hello, I seem to be having an issue when I try to run this for extended amounts of time.
After about maybe 20min and a lot of connections it stops functioning. It is still running and I can try to connect to it but when I do then it returns "Server Error" or something to that effect.

Last packet ID: None

Last packet ID: None
Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 88, in callWithLogger
return callWithContext({"system": lp}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 73, in callWithContext
return context.call({ILogContext: newCtx}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
return func(args,*kw)
--- ---
File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 215, in doRead
return self._dataReceived(data)
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 221, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/home/core/cubeworld/anticheat/cuwo/server.py", line 88, in dataReceived
self.packet_handler.feed(data)
File "cuwo/packet.py", line 696, in feed
raise e
exceptions.KeyError: 1718838374

Can't connect

image
cat /proc/cpuinfo:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz
stepping : 7
microcode : 0x70a
cpu MHz : 1800.000
cache size : 20480 KB
physical id : 0
siblings : 1
core id : 4
cpu cores : 1
apicid : 8
initial apicid : 8
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc up rep_good nopl nonstop_tsc pni pclmulqdq ssse 3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes avx hypervisor la hf_lm
bogomips : 3600.00
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:

cat /proc/meminfo:
MemTotal: 604352 kB
MemFree: 222256 kB
Buffers: 11360 kB
Cached: 293512 kB
SwapCached: 0 kB
Active: 219436 kB
Inactive: 121080 kB
Active(anon): 35668 kB
Inactive(anon): 148 kB
Active(file): 183768 kB
Inactive(file): 120932 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 35672 kB
Mapped: 9668 kB
Shmem: 176 kB
Slab: 26216 kB
SReclaimable: 19796 kB
SUnreclaim: 6420 kB
KernelStack: 536 kB
PageTables: 2368 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 302176 kB
Committed_AS: 83744 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 7152 kB
VmallocChunk: 34359729008 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 637952 kB
DirectMap2M: 0 kB

cat /etc/issue:
Ubuntu 12.04.2 LTS \n \l

python --version:
Python 2.7.3

But windows(i have a m1.large instance) is working without a problem.

Stoping server

I see everywhere you mention how to start the server on windows and linux, and I know that on windows there is a 'q' command to quit the server. Is there any command that I can use to stop the server running in linux with the run_server.sh? This may be a good thing to add if the only way to stop it is the ctrl + C shortcut key.

IRC really needed in default package?

Why is there an IRC-script in this repository? I don't think that it should be included in the default package but instead it should be in the cuwo-scripts repository. Also I don't know anybody who is using IRC nowadays...

I also think that it is a risk when it comes in wrong hands because of spammers, hackers and such and it's difficult for many people to get protected against these.

Traffic usage is slightly higher than normal server

Just making a single issue for this. The reason for the higher traffic is due to the way entities are handled, as currently only full entity updates are sent. Need to check for changes to the entity, and only send changed attributes.

Unhandled Error Traceback

Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 221, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/usr/lib/python2.7/dist-packages/twisted/words/protocols/irc.py", line 2412, in dataReceived

File "/usr/lib/python2.7/dist-packages/twisted/protocols/basic.py", line 581, in dataReceived

File "/usr/lib/python2.7/dist-packages/twisted/words/protocols/irc.py", line 2420, in lineReceived

--- ---
File "/usr/lib/python2.7/dist-packages/twisted/words/protocols/irc.py", line 2464, in handleCommand

File "/usr/lib/python2.7/dist-packages/twisted/words/protocols/irc.py", line 1936, in irc_PRIVMSG

File "./scripts/irc.py", line 33, in new_func

File "./scripts/irc.py", line 106, in privmsg

File "./scripts/irc.py", line 119, in handle_command

File "./scripts/irc.py", line 233, in who

File "./scripts/irc.py", line 40, in encode_irc

exceptions.AttributeError: 'NoneType' object has no attribute 'encode

Unhandled Error Traceback

Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 88, in callWithLogger
return callWithContext({"system": lp}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 73, in callWithContext
return context.call({ILogContext: newCtx}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
return func(args,*kw)
--- ---
File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 215, in doRead
return self._dataReceived(data)
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 221, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/home/core/cubeworld/pvp/cuwo/server.py", line 86, in dataReceived
self.packet_handler.feed(data)
File "cuwo/packet.py", line 655, in feed
packet = read_packet(reader, self.table)
File "cuwo/packet.py", line 626, in read_packet
packet = tablepacket_id
exceptions.KeyError: 2344

'ascii' codec can't decode byte

exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 16: ordinal not in range(128)
Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 88, in callWithLogger
return callWithContext({"system": lp}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 73, in callWithContext
return context.call({ILogContext: newCtx}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
return func(_args,__kw)
--- ---
File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 215, in doRead
return self._dataReceived(data)
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 221, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/home/core/cubeworld/pvp/cuwo/server.py", line 86, in dataReceived
self.packet_handler.feed(data)
File "cuwo/packet.py", line 658, in feed
self.callback(packet)
File "/home/core/cubeworld/pvp/cuwo/server.py", line 117, in on_packet
handler(packet)
File "/home/core/cubeworld/pvp/cuwo/server.py", line 176, in on_hit_packet
self.call_scripts('on_kill', target)
File "/home/core/cubeworld/pvp/cuwo/server.py", line 228, in call_scripts
if call_handler(script, name, *arg, *_kw) is False:
File "/home/core/cubeworld/pvp/cuwo/server.py", line 45, in call_handler
ret = f(_arg, *_kw)
File "./scripts/pvp.py", line 28, in on_kill
target.name))
File "/home/core/cubeworld/pvp/cuwo/server.py", line 339, in send_chat
self.broadcast_packet(packet)
File "/home/core/cubeworld/pvp/cuwo/server.py", line 342, in broadcast_packet
data = write_packet(packet)
File "cuwo/packet.py", line 633, in write_packet
packet.write(writer)
File "cuwo/packet.py", line 565, in write
data = self.value.encode(ENCODING)

Cuwo bugs found on test server pvp.cubedworld.net

#1. Sometimes players will spawn in the air, chat may not work and they will be flying around.
#2. Sometimes you are trying to attack an enemy but they are a few meters away attacking the air but you lose HP and can't deal damage to them.
#3. Client crash's are very frequent until the seeds are reset.
#4. When a client reconnects, the entity is cloned, doing damage to that entity crash's the server.

That is all the errors I could find right now, will be glad to help more.

Can't chat

2013-07-24 10:42:43+0000 [CubeWorldConnection,0,183.178.254.88] Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 84 , in callWithLogger
return callWithContext({"system": lp}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 69 , in callWithContext
return context.call({ILogContext: newCtx}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", lin e 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", lin e 81, in callWithContext
return func(args,*kw)
--- ---
File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 586, in _doReadOrWrite
why = selectable.doRead()
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 199, in doRead
rval = self.protocol.dataReceived(data)
File "/root/cuwo-master/cuwo/server.py", line 98, in dataReceived
self.packet_handler.feed(data)
File "cuwo/packet.py", line 700, in feed
self.callback(packet)
File "/root/cuwo-master/cuwo/server.py", line 129, in on_packet
handler(packet)
File "/root/cuwo-master/cuwo/server.py", line 158, in on_chat_packet
message = self.on_chat(message)
File "/root/cuwo-master/cuwo/server.py", line 224, in on_chat
return event.messsage
exceptions.AttributeError: 'AttributeDict' object has no attribute 'mess sage'

2013-07-24 10:42:43+0000 [CubeWorldConnection,0,183.178.254.88] Player katetem_m age left
2013-07-24 10:42:43+0000 [CubeWorldConnection,0,183.178.254.88] Unhandled Error
Traceback (most recent call last):
File "/root/cuwo-master/cuwo/server.py", line 498, in main
reactor.run()
File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1169, in run
self.mainLoop()
File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1181, in mainLoop
self.doIteration(t)
File "/usr/lib/python2.7/dist-packages/twisted/internet/epollreactor.p y", line 198, in doPoll
log.callWithLogger(selectable, _drdw, selectable, fd, event)
--- ---
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 84 , in callWithLogger
return callWithContext({"system": lp}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 69 , in callWithContext
return context.call({ILogContext: newCtx}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", lin e 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", lin e 81, in callWithContext
return func(args,*kw)
File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 599, in _doReadOrWrite
self._disconnectSelectable(selectable, why, inRead)
File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 266, in _disconnectSelectable
selectable.connectionLost(failure.Failure(why))
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 277, in connectionLost
protocol.connectionLost(reason)
File "/root/cuwo-master/cuwo/server.py", line 117, in connectionLost
self.scripts.unload()
File "cuwo/script.py", line 97, in unload
script.unload()
File "cuwo/script.py", line 171, in unload
self.parent.scripts.remove(self)
exceptions.AttributeError: 'BanServer' object has no attribute 'scripts'

Still this problem is only for linux and works well in windows.

'InteractPacket' object has no attribute 'something5'

This happens when I use an item (press E on a droped item):

 File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 84, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 69, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 586, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 199, in doRead
    rval = self.protocol.dataReceived(data)
  File "/home/**/cuwo/cuwo/mitm.py", line 126, in dataReceived
    self.client_handler.feed(data)
  File "cuwo/packet.py", line 353, in feed
    self.callback(packet)
  File "/home/**/cuwo/cuwo/mitm.py", line 84, in on_client_packet
    self.relay_client.transport.write(write_packet(packet))
  File "cuwo/packet.py", line 328, in write_packet
    packet.write(writer)
  File "cuwo/packet.py", line 180, in write
    writer.write_uint8(self.something5)
exceptions.AttributeError: 'InteractPacket' object has no attribute 'something5'

Last packet ID: 7 | Unhandled Error Traceback

2013-07-22 11:46:42-0500 [CubeWorldConnection,4,151.229.171.67] Last packet ID: 7
2013-07-22 11:46:42-0500 [CubeWorldConnection,4,151.229.171.67] Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 88, in callWithLogger
return callWithContext({"system": lp}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 73, in callWithContext
return context.call({ILogContext: newCtx}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
return func(args,*kw)
--- ---
File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 215, in doRead
return self._dataReceived(data)
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 221, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/home/core/cubeworld/pvp/cuwo/server.py", line 89, in dataReceived
self.packet_handler.feed(data)
File "cuwo/packet.py", line 696, in feed
raise e
exceptions.KeyError: 1792

Add support for listing currently connected players

Idea: admin command /list which lists current players on the server, their levels, also echoes to console because the list can get too long for the client chatbox.

On start up, create dictionary set or use sqlite, this shouldn't be stored as a file.
On a player connect, grab their name, level, IP and slot it into an entry.
Each entry contains Name, Level, IP
On player disconnect, or timeout, their entry is removed.
Possible problems: Detecting when someone uses /name to change their name, and reflecting this change in the appropriate entry

Admin command /list uses script.protocol.send_chat() and print
Data of all entries is printed: (must have newlines, otherwise printed individually)
Name | Level | IP
N00b | Lv. 38 | 42.147.12.193 \n
Smoke | Lv. 83 | 39.121.74.124 \n
Grandmaster | Lv. 11 | 26.172.153.239 \n

Or scrap the concept of calling it from in-game and make it the (first?) console command.

Add docstrings, at least to important methods/classes

Could you add some documentation either on the wiki or in classes on how to use them and what they are used for? I'm learning Python as we speak for this exact project and I was just wondering if I could have a little help

Run server ,Players Fly in the sky ~~ can't down

Q:

  1. Player fly in the sky
  2. Player Client down
  3. Cmd not have Player leave log
  4. In config.py ,can't type Utf-8 code words
  5. just 10 players need more upstream than self.server
  6. I love u ! matpow2, u are great

Better work together

As you may have seen in my master branch I have done a lot of useful and additional changes and fixes like implementing use of SQLite database that holds database from file in memory and is using asynchronous updates for storing bans, 3D regions with grouping (also using virtual rtrees), player/login data and much more, It should be really fast because of optimizing pragma config parameters are set.

Also it is possible to store and load blobs directly to/from the database identified by keys without dealing with to many open files or high disk I/O.

Also I implemented basic anti cheating functionality in the core and made (better say begun doing) overall performance improvements.

At the moment, it is to far progressed to go back. So how we could better work together? I am feeling ignored by most other developers that are also working on cuwo and I fear that it wont come to the right result. Also some things are done in two or more other forges that do the same thing but are written differently.

Also it seems like some other developers are editing or adding something that don't really is needed nor makes sense yet in your master branch. But these are only a few and most of the commits are really great.

Protocol breakage

Some protocol breakage experienced in the wild. Will probably have to add exception handlers for PacketHandler that properly logs the circumstances

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 88, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 73, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 215, in doRead
    return self._dataReceived(data)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 221, in _dataReceived
    rval = self.protocol.dataReceived(data)
  File "/home/core/cubeworld/pvp/cuwo/server.py", line 86, in dataReceived
    self.packet_handler.feed(data)
  File "cuwo/packet.py", line 655, in feed
    packet = read_packet(reader, self.table)
  File "cuwo/packet.py", line 626, in read_packet
    packet = table[packet_id]()
exceptions.KeyError: 1941945327
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 88, in callWithLogger
return callWithContext({"system": lp}, func, args, **kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 73, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
return func(*args,*kw)
--- ---
File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 215, in doRead
return self._dataReceived(data)
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 221, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/home/core/cubeworld/pvp/cuwo/server.py", line 86, in dataReceived
self.packet_handler.feed(data)
File "cuwo/packet.py", line 655, in feed
packet = read_packet(reader, self.table)
File "cuwo/packet.py", line 626, in read_packet
packet = tablepacket_id
exceptions.KeyError: 2344

Handling of entities like doors, mobs, items etc.

I think it's a good idea to use the entities provided/sent by the clients and let the clients have control over them because also player data is stored clientside as far as I know and with some validity checks it should be secure enough.

Performance Concerns with CUWO

Server = pvp.herocube.net
Machine Specs = Xeonz 3.6ghz / 32GB ram / SSD with 1Gbps port.

Getting severe lag at times and the process for CUWO hits near 100%. I don't believe there is any multi-threading in at all and everything is being done on the main thread.

Just putting this out here because it is an issue and it is my due diligence to report :)

[Question] Update client entity info

tldr; This is probably painfully obvious so if someone could point me to an example or line of code that would accomplish updating an entity's values I would greatly appreciate it.

I'm trying to find out if it's possible to update the client's own entity values. I've managed to update the entity values for all connected users except the entity I'm modifying. For example, for a fast travel system I can set the position of an entity and they will appear to have moved to everyone except themselves.

zlib.error: Error -3 while decompressing data: unknown compression method

File "cuwo\packet.py", line 489, in feed
packet = read_packet(reader, self.table)
File "cuwo\packet.py", line 461, in read_packet
packet.read(reader)
File "cuwo\packet.py", line 78, in read
self.data = zlib.decompress(reader.read(size))
zlib.error: Error -3 while decompressing data: unknown compression method

Error by Chinese Client.Can decode All code to unicode and suport other language?

Error by Chinese Client.Can decode All code to unicode and suport other language?

Error:
File "D:\Server\CubeWrold\cuwo-master\cuwo\server.py", line 63, in send_packet

self.transport.write(write_packet(packet))

File "cuwo\packet.py", line 471, in write_packet
packet.write(writer)
File "cuwo\packet.py", line 73, in write
writer.write_uint32(self.seed)
File "cuwo\bytes.py", line 80, in write_uint32
self.write_struct(UINT32, value)
File "cuwo\bytes.py", line 62, in write_struct
self.write(format.pack(value))
struct.error: integer out of range for 'I' format code

exceptions.KeyError: 1718838374

Last packet ID: None
Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 88, in callWithLogger
return callWithContext({"system": lp}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 73, in callWithContext
return context.call({ILogContext: newCtx}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
return func(args,*kw)
--- ---
File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 215, in doRead
return self._dataReceived(data)
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 221, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/home/core/cubeworld/anticheat/cuwo/server.py", line 89, in dataReceived
self.packet_handler.feed(data)
File "cuwo/packet.py", line 696, in feed
raise e
exceptions.KeyError: 1718838374

zlib.error: Error -3 while decompressing data: incorrect header check

Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 88, in callWithLogger
return callWithContext({"system": lp}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 73, in callWithContext
return context.call({ILogContext: newCtx}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
return func(args,*kw)
--- ---
File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 215, in doRead
return self._dataReceived(data)
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 221, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/home/core/cubeworld/anticheat/cuwo/server.py", line 89, in dataReceived
self.packet_handler.feed(data)
File "cuwo/packet.py", line 691, in feed
packet = read_packet(reader, self.table)
File "cuwo/packet.py", line 660, in read_packet
packet.read(reader)
File "cuwo/packet.py", line 114, in read
self.data = zlib.decompress(reader.read(size))
zlib.error: Error -3 while decompressing data: incorrect header check

Kick Args Issue (Needs a catch)

Traceback (most recent call last):
File "cuwo/script.py", line 101, in on_command
ret = f(self, _args)
File "cuwo/script.py", line 54, in new_func
return func(script, *arg, *_kw)
TypeError: kick() takes exactly 2 arguments (5 given)
Yami: damn
Yami: you are good :D
Traceback (most recent call last):
File "cuwo/script.py", line 101, in on_command
ret = f(self, _args)
File "cuwo/script.py", line 54, in new_func
return func(script, *arg, *_kw)
TypeError: kick() takes exactly 2 arguments (7 given)
Traceback (most recent call last):
File "cuwo/script.py", line 101, in on_command
ret = f(self, _args)
File "cuwo/script.py", line 54, in new_func
return func(script, *arg, *_kw)
TypeError: kick() takes exactly 2 arguments (5 given)

Player Left Error

When Player left the Game this error appears.

2013-07-24 13:08:44+0200 [CubeWorldConnection,0,84.176.249.94] Player thomas joined
2013-07-24 13:10:19+0200 [CubeWorldConnection,0,84.176.249.94] Player thomas left
2013-07-24 13:10:19+0200 [CubeWorldConnection,0,84.176.249.94] Unhandled Error
Traceback (most recent call last):
File "/root/cube_linux/cuwo/cuwo/server.py", line 497, in main
reactor.run()
File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1169, in run
self.mainLoop()
File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1181, in mainLoop
self.doIteration(t)
File "/usr/lib/python2.7/dist-packages/twisted/internet/epollreactor.py", line 199, in doPoll
log.callWithLogger(selectable, _drdw, selectable, fd, event)
--- ---
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 84, in callWithLogger
return callWithContext({"system": lp}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 69, in callWithContext
return context.call({ILogContext: newCtx}, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, _args, *_kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
return func(args,*kw)
File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 599, in _doReadOrWrite
self._disconnectSelectable(selectable, why, inRead)
File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 263, in _disconnectSelectable
selectable.connectionLost(f)
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 277, in connectionLost
protocol.connectionLost(reason)
File "/root/cube_linux/cuwo/cuwo/server.py", line 117, in connectionLost
self.scripts.unload()
File "cuwo/script.py", line 97, in unload
script.unload()
File "cuwo/script.py", line 171, in unload
self.parent.scripts.remove(self)
exceptions.AttributeError: 'BanServer' object has no attribute 'scripts'

IOError: [Errno 24] Too many open files: './banlist.dat'

Traceback (most recent call last):
File "cuwo/script.py", line 101, in on_command
File "cuwo/script.py", line 54, in new_func
File "./scripts/ban.py", line 67, in ban
File "./scripts/ban.py", line 41, in ban
File "./scripts/ban.py", line 37, in save_bans
File "/home/core/cubeworld/pvp/cuwo/server.py", line 415, in save_data
with open(path, 'w') as fp:
IOError: [Errno 24] Too many open files: './banlist.dat'
Traceback (most recent call last):
File "cuwo/script.py", line 101, in on_command
File "cuwo/script.py", line 54, in new_func
File "./scripts/ban.py", line 67, in ban
File "./scripts/ban.py", line 41, in ban
File "./scripts/ban.py", line 37, in save_bans
File "/home/core/cubeworld/pvp/cuwo/server.py", line 415, in save_data
with open(path, 'w') as fp:
IOError: [Errno 24] Too many open files: './banlist.dat'

Player can't interact with objects like doors

I have the problem that I can't interact with doors or sleepingbags. Also I can't pick up things like heartflowers etc. I'm playing the ranger class and cuwo is running on Linux with Python 2.7.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.