AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [DEV] WebSocket Server - Direct connection between webbrowser and gameserver (https://forums.alliedmods.net/showthread.php?t=182615)

imdawe 09-05-2013 23:23

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
Please update this plugin, it does not worked for me on css.

I have modified these lines, i just specified a protocol. so it works now in motd
Quote:

iSubStrings = MatchRegex(g_hRegExProtocol, receiveData, iRegexError);
new String:sProtocol[256];
if(iSubStrings != -1)
{
if(!GetRegexSubString(g_hRegExProtocol, 1, sProtocol, sizeof(sProtocol)))
{
Format(sProtocol, sizeof(sProtocol), "sm");
// It's not required to specify a subprotocol!
/*LogError("Failed to extract sub protocols.");
CloseChildSocket(iIndex);
return;*/
}
}

Peace-Maker 09-06-2013 20:04

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
I haven't tried to use the motd browser to connect to a websocket server created with this plugin.
What's the error? Does the client reject the connection when lacking a sub protocol?

imdawe 09-07-2013 09:58

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
Uhm, i don't remember, but adding protocol will solve the problem.

Dr. McKay 09-13-2013 17:11

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
Not sure if it's supposed to support SSL, but when connecting via wss:// I get this:

Code:

[websocket.smx] Failed to extract security key.

n___ 11-10-2013 01:02

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
I get the same error as above when attempting to connect with NodeJS and socket.io
Not familiar with sp, any pointers on where I might be going wrong?

The client.html.txt code works to send messages to the server, but not the following node code

Code:

var io = require('socket.io-client'),
        socket = io.connect('myhost.com', {
            port: 12345
        });


socket.on('connect', function() {
    socket.send("Hello Websockets from Node!");
});


Dr. McKay 11-10-2013 01:40

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
Quote:

Originally Posted by n___ (Post 2059006)
I get the same error as above when attempting to connect with NodeJS and socket.io
Not familiar with sp, any pointers on where I might be going wrong?

The client.html.txt code works to send messages to the server, but not the following node code

Code:

var io = require('socket.io-client'),
        socket = io.connect('myhost.com', {
            port: 12345
        });


socket.on('connect', function() {
    socket.send("Hello Websockets from Node!");
});


If you're trying to communicate with the server using anything besides a web browser (in this case, it looks like you're trying to facilitate communication between a game server and a Node.js program?), you should really use plain sockets.

n___ 11-10-2013 09:03

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
I understand that, it was mainly for experimental purposes. There is a node module called node-ssq, which I guess uses datagram to connect to a source server.

Code:

var ssq = require('node-ssq');

ssq.info('myhost.com', 27015, function (err, data) {
    if (err)
        console.log("Error", err);
    else
        console.log(data);
});

Gives me
Error [Error: SSQ Request timed out.]

I guess I could start playing with it and try to find out why it's not working.

n___ 11-10-2013 09:16

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
--- IGNORE--- Had to remove the portion that sets the timeout and clears it in node-ssq/ssq.js, after doing so, it queries the server fine.


I'm ashamed to admit this lol, but my source server wasn't running. :(

Internet Bully 05-12-2014 20:08

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
I got it up and running on CSGO to the point where I can draw players on a radar image. How does one get the information from the .txt file (offsets, zoom, etc)? csgo\resource\overviews has txt files with similar-ish information, but fails to work.

Right now I'm just guessing and it's working well enough, but it'd be nice to automate it.

Crytiqal 05-13-2014 05:40

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
Is it possible to implement a tv_delay on the websocket?

I can ghost all I want. I was trying to get it to connect to a delayed relay server but it seems I cannot open a socket connection to it so that wont work...

Also, connecting it to the tv_port from a gameserver with a tv_delay set doesn't matter as the socket sends the data instantly to the browser regardless.


All times are GMT -4. The time now is 13:48.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.