AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ANY] ASteambot - Redirect (https://forums.alliedmods.net/showthread.php?t=307895)

Arkarr 05-29-2018 14:03

[ANY] ASteambot - Redirect
 
ASteambot Redirect




Before anything, read this :
You will need ASteambot to run this plugin.
You need at least the version V 3.7.2.
You need to open at least 1 port.

https://puu.sh/rooCC/910797c17e.png

First of all, I didn't do this plugin, h3bus did.
This is his plugin (https://forums.alliedmods.net/showthread.php?t=255675), I just made a module. That's it.

So, as you may have already understand, player's can be redirected through steam chat to another server upon request.

https://puu.sh/rooCG/944b44999e.png
  • Friendly menus
  • Fast
  • I don't know man...

https://puu.sh/rooCK/066043be6c.png

Download and run ASteambot, it can be downloaded [here]

Install [ANY] Server Redirect - A full featured server listing/hoper :

https://forums.alliedmods.net/showthread.php?t=255675

Install ASteambot_Core :

If you already have installed ASteambot_Core, update it.

0) Install socket extension
1) Grab ASteambot_Core from [here]
2) Put in your plugins folder : addons/sourcemod/plugins
3) DOWNLOAD AND EDIT THE CONFIGURATION FILE AND PUT IT IN [SERVER PATH]/cfg/asteambot/asteambot_core.cfg !!!
4) Restart your server

Install ASteambot_Redirect :

1) Grab the smx file (ASteambot_Redirect) on github, [here]
2) Put the smx file in your plugins folder : addons/sourcemod/plugins
3) Grab redirect.phrases.txt and put it in the addons/sourcemod/translation folder. [here]
4) Restart your server.
5) Done !

All files on github :
https://github.com/Arkarr/SourcemodASteambot/

https://puu.sh/rooCt/e894d3eab4.png

None - It's activated / deactived by putting it or not in the plugins folder.

https://puu.sh/rooAd/55c1dba974.png

None

https://puu.sh/rooCU/f0cc0f7c77.png

Nothing, feel free to ask.

https://puu.sh/rooCk/5e5ba6f955.png

None found yet

https://puu.sh/rooCN/00e99ea989.png

None, yet.

http://puu.sh/rNitX/6e8e51b58d.png

All files are on Github : https://github.com/Arkarr/SourcemodASteambot/

Enjoy !

Logs :
Spoiler

DarkDeviL 05-29-2018 14:52

Re: [ANY] ASteambot - Redirect
 
ASteambot_Redirect.sp#L74-L78:

Do the proper "boolean return value" checking, and replace:

PHP Code:

            GetClientAuthId(iAuthId_Steam2clientSteamIDsizeof(clientSteamID));
            if (
StrEqual(clientSteamIDsteamID))
            {
                return 
i;
            } 

with

PHP Code:

            if (GetClientAuthId(iAuthId_Steam2clientSteamIDsizeof(clientSteamID)) && StrEqual(clientSteamIDsteamID))
            {
                return 
i;
            } 

8) ?

Arkarr 05-29-2018 15:18

Re: [ANY] ASteambot - Redirect
 
Okay, yeah. But I don't think it's extremly important, is it ? (As in, I didn't do anything wrong, did I ?)
Anyway, updated.

DarkDeviL 05-30-2018 11:38

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by Arkarr (Post 2594431)
Okay, yeah. But I don't think it's extremly important, is it ? (As in, I didn't do anything wrong, did I ?)
Anyway, updated.

Didn't do anything wrong? That depends; having it this way avoids the checking of identical Steam ID's when the GetClientAuthId returns false (e.g. if that one returns false, the StrEqual won't be executed at all), and would avoid the issue(s) similar to the one you described in STOP_IGNORING_RET_VAL warning.

You could then argue with the "performance" while doing StrEqual wouldn't be much (CPU resources and such), and that there probably wouldn't be much waste here. For the past 5 years, GetClientAuthId when introduced, and the previous GetClientAuthString had been a boolean with the documentation saying that it would return FALSE if it didn't get a proper Steam ID, there is no reasons not to check it. After all, it's only takes 6 extra characters and one to two spaces (depending on your coding "style"), to do it right. :-)

Arkarr 05-30-2018 15:22

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by arne1288 (Post 2594542)
Didn't do anything wrong? That depends; having it this way avoids the checking of identical Steam ID's when the GetClientAuthId returns false (e.g. if that one returns false, the StrEqual won't be executed at all), and would avoid the issue(s) similar to the one you described in STOP_IGNORING_RET_VAL warning.

You could then argue with the "performance" while doing StrEqual wouldn't be much (CPU resources and such), and that there probably wouldn't be much waste here. For the past 5 years, GetClientAuthId when introduced, and the previous GetClientAuthString had been a boolean with the documentation saying that it would return FALSE if it didn't get a proper Steam ID, there is no reasons not to check it. After all, it's only takes 6 extra characters and one to two spaces (depending on your coding "style"), to do it right. :-)

Okay, yeah. Well, thanks for the precisions, it was fixed yesterday.
Thanks for pointing this out.

Mikado 06-02-2018 20:57

Re: [ANY] ASteambot - Redirect
 
Sorry for the late feedback lol.

Thank's mate, it's working well the bot instantly sends your the message.
But if the bot isn't friend with you, nothing happend nothing returned on the chat... if you want, i suggest you to add something like, if the bot isn't friend automatically send a friend request, or return a chat message like: "Please, use !friend to add the bot to use this fonction" ...

Keep it up (y) you are doing well ;)

Arkarr 06-03-2018 05:35

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by Mikado (Post 2594979)
Sorry for the late feedback lol.

Thank's mate, it's working well the bot instantly sends your the message.
But if the bot isn't friend with you, nothing happend nothing returned on the chat... if you want, i suggest you to add something like, if the bot isn't friend automatically send a friend request, or return a chat message like: "Please, use !friend to add the bot to use this fonction" ...

Keep it up (y) you are doing well ;)

Well, it's already sending friend request when the bot can't send any messages (and that the user who tried to get redirected is in game) :

PHP Code:

public ASteambot_Message(AS_MessageType MessageTypechar[] msg, const int msgSize)
{
    if(
MessageType == AS_SIMPLE)
    {
        
SetFailState(msg);
    }
    else if(
MessageType == AS_NOT_FRIENDS)
    {
        
int client FindClientBySteamID(msg);
        if(
client != -1)
        {
            
ASteambot_SendMesssage(AS_FRIEND_INVITEmsg);
            
CPrintToChat(client"{green}%s{default} You are not friend with me and I can't send you steam messages. I sent you a friend invite."MODULE_NAME);
        }
    }



Arkarr 07-09-2018 13:37

Re: [ANY] ASteambot - Redirect
 
https://forums.alliedmods.net/showpo...&postcount=743

SHOUBI 07-12-2018 12:16

Re: [ANY] ASteambot - Redirect
 
redirect steambot message status report since v4.9:

Starting TCP server on port 4765
Error while creating socket ! It may be because of the port being already usued! Use another TCP port number.
System.Net.Sockets.SocketException (0x80004005): Address already in use
at System.Net.Sockets.Socket.Bind (System.Net.EndPoint localEP) [0x00043] in <fc308f916aec4e4283e0c1d4b761760a>:0
at ASteambot.Networking.AsynchronousSocketListen er.StartListening () [0x0002a] in <f1f0db46e124422993e88bc87cda3884>:0



Translation file (steamchattexts.xml) can't be found or is corrupted ! Bot won't respond to user message. Presse a key to continue...
More infos here :
Could not find file "/home/insserver/steamchattexts.xml"

Arkarr 07-12-2018 14:03

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by SHOUBI (Post 2603160)
redirect steambot message status report since v4.9:

Starting TCP server on port 4765
Error while creating socket ! It may be because of the port being already usued! Use another TCP port number.
System.Net.Sockets.SocketException (0x80004005): Address already in use
at System.Net.Sockets.Socket.Bind (System.Net.EndPoint localEP) [0x00043] in <fc308f916aec4e4283e0c1d4b761760a>:0
at ASteambot.Networking.AsynchronousSocketListen er.StartListening () [0x0002a] in <f1f0db46e124422993e88bc87cda3884>:0



Translation file (steamchattexts.xml) can't be found or is corrupted ! Bot won't respond to user message. Presse a key to continue...
More infos here :
Could not find file "/home/insserver/steamchattexts.xml"

It means that the TCP port (in config.cfg) is already used, change it to like 4766 or 4769...

Also make sure you have downloaded the whole thing, you are missing steamchattexts.xml.

EDIT :
You can get last release here : https://github.com/Arkarr/ASteambot/releases/latest

SHOUBI 08-03-2018 09:30

Re: [ANY] ASteambot - Redirect
 
thx a lot, i ve manually updated to v5.0 since it s linux server, but all is working but after several days seems plugin is off, does admin_sql,.. prefetch and all that stuff are needed? they are put in disable folder when i first install SM does your module requires them?

Arkarr 08-03-2018 11:46

Re: [ANY] ASteambot - Redirect
 
I don't think so, no. But do you have any logs or crash ?

SHOUBI 08-07-2018 14:59

Re: [ANY] ASteambot - Redirect
 
STEAM_1:0:9523700/steam://connect/96.78.12.29:27015/
L 08/07/2018 - 20:44:40: [redirect_askconnect_steambot.smx] Socket error 3, 111
567dcavieg-1)3|ARE_YOU_ALIVE <EOF>
>>> 567dcavieg-1)3|ARE_YOU_ALIVE <EOF>

L 08/07/2018 - 19:29:41: [SM] Fatal error encountered parsing translation file "ASteambot.serveroffer.phrases.txt"
L 08/07/2018 - 19:29:41: [SM] Error (line 30, column 48 ): Line contained too many invalid tokens




[ANY] CallAdmin - Extended Report Mod (steam chat module enable) may be interfering you think?



could be neat to check this together using teamviewer or discord shared screen.

my steam: https://steamcommunity.com/id/SHOUBI/

Arkarr 08-08-2018 04:23

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by SHOUBI (Post 2608971)
STEAM_1:0:9523700/steam://connect/96.78.12.29:27015/
L 08/07/2018 - 20:44:40: [redirect_askconnect_steambot.smx] Socket error 3, 111
567dcavieg-1)3|ARE_YOU_ALIVE <EOF>
>>> 567dcavieg-1)3|ARE_YOU_ALIVE <EOF>

L 08/07/2018 - 19:29:41: [SM] Fatal error encountered parsing translation file "ASteambot.serveroffer.phrases.txt"
L 08/07/2018 - 19:29:41: [SM] Error (line 30, column 48 ): Line contained too many invalid tokens




[ANY] CallAdmin - Extended Report Mod (steam chat module enable) may be interfering you think?



could be neat to check this together using teamviewer or discord shared screen.

my steam: https://steamcommunity.com/id/SHOUBI/

Nah, there is an error in translation file Asteambot.serveroffer.phrases.txt

SHOUBI 08-20-2018 08:07

Re: [ANY] ASteambot - Redirect
 
2 Attachment(s)
**Log file (SEND_TO_ARKARR.log) generated ! Send it to Arkarr !!
[ERROR] FATAL UNHANDLED EXCEPTION: System.Net.WebException: The operation has timed out.
at System.Net.HttpWebRequest+<RunWithTimeoutWork er>d__244`1[T].MoveNext () [0x000ba] in <fc308f916aec4e4283e0c1d4b761760a>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Net.HttpWebRequest.GetResponse () [0x00013] in <fc308f916aec4e4283e0c1d4b761760a>:0
at ASteambot.Program.Request (System.String url, System.String method, System.Collections.Specialized.NameValueColle ction data, System.Boolean ajax, System.String referer, System.Boolean fetchError) [0x001e9] in <520ae9461916481c91443701d929fe77>:0
at ASteambot.Program.Fetch (System.String url, System.String method, System.Collections.Specialized.NameValueColle ction data, System.Boolean ajax, System.String referer, System.Boolean fetchError) [0x00000] in <520ae9461916481c91443701d929fe77>:0
at ASteambot.Program.SendLocation () [0x0006c] in <520ae9461916481c91443701d929fe77>:0
at ASteambot.Program.Main (System.String[] args) [0x0006c] in <520ae9461916481c91443701d929fe77>:0



all i did was fix phrases.txt removing ' by "

Arkarr 08-20-2018 12:25

Re: [ANY] ASteambot - Redirect
 
Thank you for the bug report. V5.1 fix that issue. Also, don't forget to add redirect.phrases.txt in your translation folder ! (See installation part of OP !)

SHOUBI 09-17-2018 13:35

Re: [ANY] ASteambot - Redirect
 
2 Attachment(s)
Hi v5.3 working like a charm, i was just wondering is it possible to disable some parts of the steambot like trade offer , vip , .. or we are forced to use the whole bundle since it s how has been designed the module?

Arkarr 09-17-2018 15:03

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by SHOUBI (Post 2615570)
Hi v5.3 working like a charm, i was just wondering is it possible to disable some parts of the steambot like trade offer , vip , .. or we are forced to use the whole bundle since it s how has been designed the module?

Oh yeah! Sure ! Simply don't install the smx. That's it!

mdmanl 12-24-2018 11:13

Re: [ANY] ASteambot - Redirect
 
The link it sends on steam is not clickable for me?

Arkarr 12-24-2018 11:14

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by mdmanl (Post 2630798)
The link it sends on steam is not clickable for me?

It should be, check your steam settings.

mdmanl 12-24-2018 12:44

Re: [ANY] ASteambot - Redirect
 
I did, I also logged in the account of the bot in my browser, and there are the links also not clickable.

It looks like Steam doesn't support such links anymore. Since the ts3server:// links are also not clickable anymore.

I also sent the link to some friends, they appear also non clickable for them.

Rale 12-24-2018 15:25

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by mdmanl (Post 2630808)
I did, I also logged in the account of the bot in my browser, and there are the links also not clickable.

It looks like Steam doesn't support such links anymore. Since the ts3server:// links are also not clickable anymore.

I also sent the link to some friends, they appear also non clickable for them.

Same here.

mdmanl 12-26-2018 12:51

Re: [ANY] ASteambot - Redirect
 
Would be nice if this can be fixed or Valve changes it back, since the plugin is pretty useless now sadly :(

Arkarr 12-27-2018 02:38

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by mdmanl (Post 2631101)
Would be nice if this can be fixed or Valve changes it back, since the plugin is pretty useless now sadly :(

Yep, make sense. I'll find a fix.

mdmanl 01-17-2019 14:52

Re: [ANY] ASteambot - Redirect
 
I was thinking about an simple php redirect script and send the server you want to connect to via a HTTP Get variable.
For example: http://example.com/?s=127.0.0.1

However I had some difficulties with the dots in the IP (I dont know if you can support dots in a GET variable trough the htaccess file)

But anyways, redirecting to a steam:// url from php works!


Edit:
PHP file should be something like this:
<?php
$server = $_GET["s"];
header('Location: steam://connect/{$server}/');
exit();
?>


Sorry for my broken English, I hope it made sense to you.

Arkarr 01-18-2019 05:33

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by mdmanl (Post 2635202)
I was thinking about an simple php redirect script and send the server you want to connect to via a HTTP Get variable.
For example: http://example.com/?s=127.0.0.1

However I had some difficulties with the dots in the IP (I dont know if you can support dots in a GET variable trough the htaccess file)

But anyways, redirecting to a steam:// url from php works!


Edit:
PHP file should be something like this:
<?php
$server = $_GET["s"];
header('Location: steam://connect/{$server}/');
exit();
?>


Sorry for my broken English, I hope it made sense to you.

Yeah, I mean, it could work. But I have no use of this, since the messages are sent through Steam interface, so it would still be an unclickable link... ?

mdmanl 01-18-2019 20:43

Re: [ANY] ASteambot - Redirect
 
No, what the bot sends you would be an normal http:// link then.
To a php file on a webserver. So if you click it, your steambrowser will open the "webpage", and the php script in that webpage would redirect you instantly to the steam:// url.

The PHP script will now where to redirect, because the redirect plugin will add the server IP in the url as a variable.
So for exampe you have the PHP file on arkarr.com, then the steambot needs to send you an link with http://arkarr.com/?s=SERVERIP:PORT and thats clickable!

So you never have to click the steam:// url, only the http:// (wich still works) one, and the php script will do the rest.

Hope I make more sense now

Arkarr 01-19-2019 04:04

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by mdmanl (Post 2635398)
No, what the bot sends you would be an normal http:// link then.
To a php file on a webserver. So if you click it, your steambrowser will open the "webpage", and the php script in that webpage would redirect you instantly to the steam:// url.

The PHP script will now where to redirect, because the redirect plugin will add the server IP in the url as a variable.
So for exampe you have the PHP file on arkarr.com, then the steambot needs to send you an link with http://arkarr.com/?s=SERVERIP:PORT and thats clickable!

So you never have to click the steam:// url, only the http:// (wich still works) one, and the php script will do the rest.

Hope I make more sense now

Yeah, it does... But that would mean the one running this plugin has to have a webserver. Or I could actually implement that to ASteambot... Hold on.

mdmanl 01-21-2019 12:16

Re: [ANY] ASteambot - Redirect
 
Yes that was what I was thinking. Like most server owners I have a webserver as well, but for the ones that doesn't have one, you can host it since I guess you already have a webserver as well.

If you are gonna host it, and if you want, I can host it as well, so we can setup like a fail over or something for it for maximum uptime :)

Arkarr 01-22-2019 05:29

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by mdmanl (Post 2635789)
Yes that was what I was thinking. Like most server owners I have a webserver as well, but for the ones that doesn't have one, you can host it since I guess you already have a webserver as well.

If you are gonna host it, and if you want, I can host it as well, so we can setup like a fail over or something for it for maximum uptime :)

Nah, I was thinking, ASteambot would be the webserver. So no need to setup anything else.
I could programm that.

EDIT: In exams period right now, so much less effective right now.

mdmanl 01-23-2019 10:00

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by Arkarr (Post 2635920)
Nah, I was thinking, ASteambot would be the webserver. So no need to setup anything else.
I could programm that.

EDIT: In exams period right now, so much less effective right now.

Oh now I see what you mean, that's genius!

Good luck with your exams!

Arkarr 01-23-2019 10:23

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by mdmanl (Post 2636187)
[...]
Good luck with your exams!

Thanks.

I'll try to implement that tonight.

Mask 02-13-2019 13:13

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by Arkarr (Post 2636192)
Thanks.

I'll try to implement that tonight.

Any news on this one?

Arkarr 02-13-2019 14:37

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by Mask (Post 2639496)
Any news on this one?

Oh snap.. I'll try tomorrow.

NickischLP 04-25-2019 12:58

Re: [ANY] ASteambot - Redirect
 
I get [ASTEAMBOT-Core] Error: Module not found

Arkarr 04-25-2019 15:15

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by NickischLP (Post 2648901)
I get [ASTEAMBOT-Core] Error: Module not found

It means that the module (Asteambot_redirect) failed to load or load AFTER Asteambot_Core.

Try this :
1) sm plugins reload ASteambot_Core
2) sm plugins reload ASteambot_Redirect
3) try again using the command sm_redirect

NickischLP 04-25-2019 22:00

Re: [ANY] ASteambot - Redirect
 
Is normal that the steam browser protocol is not working anymore on steam chat?
Because the links I got from my bot is just text and not formated as url?

Arkarr 04-26-2019 07:34

Re: [ANY] ASteambot - Redirect
 
Quote:

Originally Posted by NickischLP (Post 2648955)
Is normal that the steam browser protocol is not working anymore on steam chat?
Because the links I got from my bot is just text and not formated as url?

So it means that it is working ? Good.

EDIT:
No, it's not normal. I think Valve remove that functionality. I'm working on it.

Arkarr 04-27-2019 08:49

Re: [ANY] ASteambot - Redirect
 
I have remade the redirect links :
https://i.imgur.com/L5vYdgE.png

NickischLP 05-11-2019 17:14

Re: [ANY] ASteambot - Redirect
 
1 Attachment(s)
https://forums.alliedmods.net/attach...1&d=1557609224
Doesnt work!
Only a part is marked as url.


All times are GMT -4. The time now is 19:11.

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