Raised This Month: $51 Target: $400
 12% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 10-03-2012 , 10:43   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #31

Quote:
Originally Posted by Thrawn2 View Post
Thanks for the 1.1 update, makes things prettier in the Wamp framework.

A rather critical bug:
Sometimes i receive truncated/erroneous messages.

When sending the same message repeatedly
[x,"sm:chat",["WAMP","hello"]]
(with x increasing by one every call)
Oh, i see. ASCII control characters messed up the unmasked payload. strcopy seems to stop at \x00 - \x31 or something.
__________________
Peace-Maker is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 10-03-2012 , 11:39   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #32

Quote:
Originally Posted by Peace-Maker View Post
Oh, i see. ASCII control characters messed up the unmasked payload. strcopy seems to stop at \x00 - \x31 or something.
Yupp, fix is working. Thanks.
__________________
einmal mit profis arbeiten. einmal.
Thrawn2 is offline
Crytiqal
Junior Member
Join Date: Jan 2013
Old 01-06-2013 , 07:38   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #33

I can't get this to work for my CS:GO servers, are they not supported?
I receive [object Error] in the text window of the webpage.

Any instructions would be appreciated.
Crytiqal is offline
Crytiqal
Junior Member
Join Date: Jan 2013
Old 01-17-2013 , 09:10   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #34

I also receive this error using css servers.

Any installation instructions available?
Crytiqal is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 01-17-2013 , 10:20   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #35

This is a drag&drop installation. The plugin itself doesn't do anything on it's own. You need some other plugin which opens the server and processes the data in some way.

You'd need to provide your JavaScript and plugin code to get help.
__________________
Peace-Maker is offline
Crytiqal
Junior Member
Join Date: Jan 2013
Old 01-20-2013 , 06:31   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #36

1) I downloaded the socket extension 3.0.1 from http://forums.alliedmods.net/showthread.php?t=67640
2) unzipped and placed in the sourcemod folder

3) I downloaded the websocket.smx and placed in the sourcemod plugins folder
4) I downloaded the websocket_sourcetv2d.sp and placed in the sourcemod scripting folder
5) I downloaded the sourcetv2d.zip
6) unzipped and placed in my webfolder, edited the index.html to my ip

7) Loaded game server
Loaded webbrowser

Opening connection to 192.168.0.190:12346
Socket reported error!
Disconnected - readyState: 3 Code: 1006. Reason: - wasClean: false

Last edited by Crytiqal; 01-20-2013 at 13:11.
Crytiqal is offline
Crytiqal
Junior Member
Join Date: Jan 2013
Old 01-27-2013 , 04:30   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #37

I opened the port 12346 on my gameserver and changed the ip to the external ip, but I still get the same error when opening the webpage on my own pc.

Please help
Crytiqal is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 01-27-2013 , 09:39   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #38

Quote:
Originally Posted by Crytiqal View Post
I opened the port 12346 on my gameserver and changed the ip to the external ip, but I still get the same error when opening the webpage on my own pc.

Please help
This thread is about the websocket server. The sourcetv2d is just an example i never finished and didn't plan to support. It's a plug&play installation. Make sure the plugins are loaded. It's only tested on CS:S.
__________________
Peace-Maker is offline
Crytiqal
Junior Member
Join Date: Jan 2013
Old 01-31-2013 , 15:41   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #39

I have the plugin working, it seemed after compiling I had to copy and paste the newly created .smx over to the plugins folder instead of having it stay in the compiled folder.

Now that it is working, is there a way to have it run on the gameserver port? Or at least on a variable port so multiple server can be watched?

EDIT:

I found it out myself and made a slight adjustment in the script:

Code:
 
public OnAllPluginsLoaded()
{
decl String:sServerIP[40];
new longip = GetConVarInt(FindConVar("hostip")), pieces[4];
pieces[0] = (longip >> 24) & 0x000000FF;
pieces[1] = (longip >> 16) & 0x000000FF;
pieces[2] = (longip >> 8) & 0x000000FF;
pieces[3] = longip & 0x000000FF;
FormatEx(sServerIP, sizeof(sServerIP), "%d.%d.%d.%d", pieces[0], pieces[1], pieces[2], pieces[3]);
new dport = GetConVarInt( FindConVar( "tv_port" ) );
if(g_hListenSocket == INVALID_WEBSOCKET_HANDLE)
g_hListenSocket = Websocket_Open(sServerIP, dport, OnWebsocketIncoming, OnWebsocketMasterError, OnWebsocketMasterClose);
}
Any plans on making this compatible for csgo?
Would that require a rewrite of the sockets? websockets? or the websockets_sourcetv2d?

Last edited by Crytiqal; 02-02-2013 at 12:17.
Crytiqal is offline
Crytiqal
Junior Member
Join Date: Jan 2013
Old 02-26-2013 , 12:57   Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
Reply With Quote #40

I got it working for csgo
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 11:59.


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