Giter VIP home page Giter VIP logo

pyenet's People

Contributors

aresch avatar daichifukui avatar edwardbetts avatar kajob-dev avatar notafile avatar novark avatar noway avatar whbdupree avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pyenet's Issues

Unable to send packets?

Hi, it's me again. I finally have had some time to try and mess with this some more. The following code, however, fails to work properly. Know of any reason as to why this gives me so many issues?

settings

hello, how do i set enet_host_compress_with_range_coder and enet_crc32 in my code? trying to recreate a Growtopia 'proxy' in python.

what is enet_host_destroy in pyenet?

Maybe im a little dumb or what, but i really need your help guys.
So i make a new function:

def disconnect():
    # enet_host_destroy(server)
    exit()

so my question is, is there any method like enet_host_destroy in this package? if there's any, where i should find it?

Thanks

Support for intercept callback

The enet library has support for setting a function to use to intercept incoming packets before enet processes them (see this commit).

Would it be possible to support this in pyenet?

CheckSum

Hello, I'm trying to convert c++ project to python project. There is something called checksum in enet. But I didnt found any in this project. I'm just looking a way to set host checksum to enet_crc_32. Any ideas what I can do?

Using pyenet in repl.it will just stay in the connecting state.

When using pyenet in a python project on repl.it a peer will stay connecting forever.

import enet
host = enet.Host(None, 1, 0, 0, 0)
peer = host.connect(enet.Address(b"35-225-183-118.noodlecakegames.net", 42775), 1)
while 1:
    event = host.service(1000)
    print(f"Is still connecting: {peer.state == enet.PEER_STATE_CONNECTING}")
    if event.type == enet.EVENT_TYPE_CONNECT:
        print("%s: CONNECT" % event.peer.address)
        host.service(0)
        break

I have tested this locally on my mac and the output would be (as expected)
Is still connecting: False
35.225.183.118:42775: CONNECT

However when attempting to run in repl.it you would get this forever:
Is still connecting: True
Is still connecting: True
Is still connecting: True

Here is a repl you can run the code on yourself: https://replit.com/@theblakiemon/ENET-Test#main.py

I think this is a bug, but if I'm doing something wrong then what? Why won't it work? Is it because the repl.it environment doesn't have needed dependencies?

Server not working properly?

#Client code import enet host = enet.Host(None, 1, 0, 0, 0) peer = host.connect(enet.Address(b"localhost", 54301), 1) while 1: event = host.service(1000) if event.type == enet.EVENT_TYPE_CONNECT: print("%s: CONNECT" % event.peer.address) break #server code
import enet
host = enet.Host(enet.Address(b"localhost", 54301), 10, 0, 0, 0)
while 1:
# Wait 1 second for an event
event = host.service(1000)
if event.type == enet.EVENT_TYPE_CONNECT:
print("%s: CONNECT" % event.peer.address)
break

Linux and Windows build error - _ENetPeer struct

I've tried building on both Windows 10 and a fresh Linux (Ubuntu 20.04.2.0 x64) install, and got the same error on both platforms.

Have I missed something here? Any help would be appreciated. Thanks in advance.

Linux build output follows:

python3 setup.py build
running build
running build_ext
cythoning enet.pyx to enet.c
/home/Novark/.local/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/Novark/.local/lib/python3.8/site-packages/pyenet/enet.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
building 'enet' extension
creating build
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/enet
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAS_POLL -DHAS_FCNTL -DHAS_MSGHDR_FLAGS -DHAS_SOCKLEN_T -DHAS_GETHOSTBYNAME_R -DHAS_GETHOSTBYADDR_R -Ienet/include/ -I/usr/include/python3.8 -c enet.c -o build/temp.linux-x86_64-3.8/enet.o -O3
enet.c: In function ‘__pyx_pf_4enet_4Peer_13needsDispatch___get__’:
enet.c:11053:62: error: ‘ENetPeer’ {aka ‘struct _ENetPeer’} has no member named ‘needsDispatch’
11053 |     __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_enet_peer->needsDispatch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error)
      |                                                              ^~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

upload wheels to Pypi

Hi,

I just looked at this as someone asked me for help setting up a Python coding environment, and it doesn't appear that there's any wheels on Pypi. What are the chances of getting at least Windows wheels?

If it's helpful, I can probably script the process for you via the Python 3 launcher, but obviously I can't upload them as I'm not the package owner.

He's going to need 3 packages. This, Pyglet/Pygame, and my audio library. The latter two aren't a problem, but getting someone new to Python set up to build C packages is somewhat troublesome. I'll probably build one for him and do it that way, but it would be useful if I didn't have to in future.

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.