huytd / node-js-game-server Goto Github PK
View Code? Open in Web Editor NEWEasy to use Multiplayer Game Server based on Node.JS. Suitable with HTML5 Websocket, Unity3D (Web/PC, Android, iOS,...), Flash, C++/OpenGL/DirectX, XNA clients,...
Easy to use Multiplayer Game Server based on Node.JS. Suitable with HTML5 Websocket, Unity3D (Web/PC, Android, iOS,...), Flash, C++/OpenGL/DirectX, XNA clients,...
Wow this is nice... i try it out, but have some trouble with sending and reciving data.
Nothing just firebug:
GET http://myURL.net:8888/socket.io/?EIO=2&transport=polling&t=1483716781741-2
and then loading till timeout
And Server terminal say:
[i] Data received: player-2 said: GET /socket.io/?EIO=2&transport=polling&t=1483716849971-1 HTTP/1.1
Host: myURL.net:8888
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:50.0) Gecko/20100101 Firefox/50.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: de,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: http://myURL.net/lobby/
Origin: http://myURL.net
DNT: 1
Connection: keep-alive
[!] player-1 disconnected!
[!] player-2 disconnected!
So can u help out with some example, maybe a html file to create a connection and one command, like get Roomlist...
I tryed this:
<script src="https://cdn.socket.io/socket.io-1.0.0.js"></script>
<script>
var socket = io('http://myURL.net:8888');;
socket.on('connect', function(){ console.log("connect"); });
socket.on('event', function(data){ console.log("event"); });
socket.on('disconnect', function(){ console.log("disconnect"); })
socket.on('data', function (data)
{
console.log("wow! there are something: "+data);
});
function sendMessage()
{
console.log("sendMessage");
socket.emit("data","[CHATROOM;Hallo World]");
}
function getRooms()
{
console.log("getRooms");
socket.emit("data", "[GETROOMLIST]");
}
...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.