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


All times are GMT -4. The time now is 21:49.

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