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

[ANY] ASteambot - Redirect


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Plugin ID:
6144
Plugin Version:
1.0
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Redirect players to new server upon request
    Old 05-29-2018 , 14:03   [ANY] ASteambot - Redirect
    Reply With Quote #1

    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.



    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.


    • Friendly menus
    • Fast
    • I don't know man...



    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/



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



    None



    Nothing, feel free to ask.



    None found yet



    None, yet.



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

    Enjoy !

    Logs :
    Spoiler
    __________________

    Last edited by Arkarr; 05-02-2019 at 11:12.
    Arkarr is offline
    DarkDeviL
    SourceMod Moderator
    Join Date: Apr 2012
    Old 05-29-2018 , 14:52   Re: [ANY] ASteambot - Redirect
    Reply With Quote #2

    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;
                } 
    ?
    __________________
    Mostly known as "DarkDeviL".

    Dropbox FastDL: Public folder will no longer work after March 15, 2017!
    For more info, see the [SRCDS Thread], or the [HLDS Thread].
    DarkDeviL is offline
    Arkarr
    Veteran Member
    Join Date: Sep 2012
    Location: Just behind my PC screen
    Old 05-29-2018 , 15:18   Re: [ANY] ASteambot - Redirect
    Reply With Quote #3

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

    Last edited by Arkarr; 05-29-2018 at 15:31.
    Arkarr is offline
    DarkDeviL
    SourceMod Moderator
    Join Date: Apr 2012
    Old 05-30-2018 , 11:38   Re: [ANY] ASteambot - Redirect
    Reply With Quote #4

    Quote:
    Originally Posted by Arkarr View Post
    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. :-)
    __________________
    Mostly known as "DarkDeviL".

    Dropbox FastDL: Public folder will no longer work after March 15, 2017!
    For more info, see the [SRCDS Thread], or the [HLDS Thread].
    DarkDeviL is offline
    Arkarr
    Veteran Member
    Join Date: Sep 2012
    Location: Just behind my PC screen
    Old 05-30-2018 , 15:22   Re: [ANY] ASteambot - Redirect
    Reply With Quote #5

    Quote:
    Originally Posted by arne1288 View Post
    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.
    __________________
    Arkarr is offline
    Mikado
    Senior Member
    Join Date: Nov 2012
    Location: don't know where :/
    Old 06-02-2018 , 20:57   Re: [ANY] ASteambot - Redirect
    Reply With Quote #6

    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 ;)

    Last edited by Mikado; 06-02-2018 at 20:58.
    Mikado is offline
    Arkarr
    Veteran Member
    Join Date: Sep 2012
    Location: Just behind my PC screen
    Old 06-03-2018 , 05:35   Re: [ANY] ASteambot - Redirect
    Reply With Quote #7

    Quote:
    Originally Posted by Mikado View Post
    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 is offline
    Arkarr
    Veteran Member
    Join Date: Sep 2012
    Location: Just behind my PC screen
    Old 07-09-2018 , 13:37   Re: [ANY] ASteambot - Redirect
    Reply With Quote #8

    https://forums.alliedmods.net/showpo...&postcount=743
    __________________
    Arkarr is offline
    SHOUBI
    Junior Member
    Join Date: Aug 2017
    Old 07-12-2018 , 12:16   Re: [ANY] ASteambot - Redirect
    Reply With Quote #9

    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"
    SHOUBI is offline
    Arkarr
    Veteran Member
    Join Date: Sep 2012
    Location: Just behind my PC screen
    Old 07-12-2018 , 14:03   Re: [ANY] ASteambot - Redirect
    Reply With Quote #10

    Quote:
    Originally Posted by SHOUBI View Post
    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
    __________________

    Last edited by Arkarr; 07-12-2018 at 14:05.
    Arkarr is offline
    Reply


    Thread Tools
    Display Modes

    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 09:29.


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