Comments (6)
We have another answer here to confirm :
https://stackoverflow.com/questions/19727606/how-to-differentiate-tcp-udp-when-programming-sockets
from haunted-chronicles.
Currently, both our clients and server sockets are using socket.SOCK_STREAM
(a.k.a TCP) in their constructor.
We just have to replace it with socket.SOCK_DGRAM
(a.k.a UDP) !
from haunted-chronicles.
Problem : listen and accept do not exist for UDP sockets.
Need for a central socket (MAINSOCKET) to process clients inputs and share them to the server, which will then use a predefined socket to send data back.
On the client side, may need to have two sockets : one for listening and one for sending. (But not sure it is required)
from haunted-chronicles.
Good improvements today.
Yet, still need to stop the dissociation between new connections and old clients.
In the future, only two threads will be necessary : the socket one and the server management one.
from haunted-chronicles.
Still need to improve the way our UDP works :
Client side :
- A thread permanently listens for state of the game which is sent periodically after periodically moving players.
- Another thread send inputs only when there is inputs to send. Remove "." input which certainly floods the server a lot !
from haunted-chronicles.
Tried to implement two threads on the client side. WIP and need improvements.
Yet periodically moving players is a good improvement and need to be improved. Same for stopping sending "." for no reason and still having feedback from the server !
I'm not sure threads really are necessary on the client side.
from haunted-chronicles.
Related Issues (15)
- Find a real name HOT 7
- May need to use json interpreter HOT 2
- Fix issue with the deaf command on the server side (Branch Socket_Optimization) HOT 1
- Add a max number of players.
- Use sockets to identify players. HOT 1
- In the future block multiple connections from the same ip
- Make a first hide and seek game playable
- Compatibility Windows/Linux
- Make the movements smoother HOT 2
- δΈζε
- Use real logs with python logging
- Update README
- Decrease ping
- Deploy the game on the remote server
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 haunted-chronicles.