Raised This Month: $32 Target: $400
 8% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
imdawe
BANNED
Join Date: Aug 2011
Old 09-05-2013 , 23:23   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #41

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;*/
}
}
imdawe is offline
Send a message via MSN to imdawe
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 09-06-2013 , 20:04   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #42

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?
__________________
Peace-Maker is offline
imdawe
BANNED
Join Date: Aug 2011
Old 09-07-2013 , 09:58   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #43

Uhm, i don't remember, but adding protocol will solve the problem.
imdawe is offline
Send a message via MSN to imdawe
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 09-13-2013 , 17:11   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #44

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.
__________________
Dr. McKay is offline
n___
Junior Member
Join Date: Nov 2013
Old 11-10-2013 , 01:02   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #45

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!");
});

Last edited by n___; 11-10-2013 at 01:02.
n___ is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 11-10-2013 , 01:40   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #46

Quote:
Originally Posted by n___ View Post
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.
__________________
Dr. McKay is offline
n___
Junior Member
Join Date: Nov 2013
Old 11-10-2013 , 09:03   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #47

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___ is offline
n___
Junior Member
Join Date: Nov 2013
Old 11-10-2013 , 09:16   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #48

--- 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.

Last edited by n___; 11-10-2013 at 09:20.
n___ is offline
Internet Bully
Member
Join Date: Apr 2014
Old 05-12-2014 , 20:08   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #49

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.

Last edited by Internet Bully; 05-12-2014 at 20:55.
Internet Bully is offline
Crytiqal
Junior Member
Join Date: Jan 2013
Old 05-13-2014 , 05:40   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #50

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.

Last edited by Crytiqal; 05-13-2014 at 05:57.
Crytiqal is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:20.


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