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)

Peace-Maker 10-03-2012 10:43

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

Originally Posted by Thrawn2 (Post 1811738)
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.

Thrawn2 10-03-2012 11:39

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

Originally Posted by Peace-Maker (Post 1811794)
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.

Crytiqal 01-06-2013 07:38

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
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 01-17-2013 09:10

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
I also receive this error using css servers.

Any installation instructions available?

Peace-Maker 01-17-2013 10:20

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
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.

Crytiqal 01-20-2013 06:31

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
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
8) Loaded webbrowser

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

Crytiqal 01-27-2013 04:30

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
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 :(

Peace-Maker 01-27-2013 09:39

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

Originally Posted by Crytiqal (Post 1881570)
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.

Crytiqal 01-31-2013 15:41

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
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?

Crytiqal 02-26-2013 12:57

Re: [DEV] WebSocket Server - Direct connection between webbrowser and gameserver
 
I got it working for csgo :)


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

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