Add Discord to Gunz

Results 1 to 5 of 5
  1. #1
    Apprentice Jason Demon is offline
    MemberRank
    Jul 2013 Join Date
    PerúLocation
    16Posts

    cool Add Discord to Gunz


    Well, 'm bored, and idk when I will open a new server, so.., I decided to release this code and files(that you can download searching google by yourself or download on my video), this is really easy to implementate, first, I need tell you that i wont support anyone, maybe you can do more efficient my code. PD: suscribe my youtube channel for more releases.Well, Imma let the steps by numbers.
    1- we need a Discord Application, so, you should watch a tutorial of how to create one or watch my video, i gift it to you below.
    2- Copy all files and directories in files archive that you should download(link on video) and paste in your Gunz source directory.
    3- Open your Gunz source, and right clic in to:


    PHP Code:
    Gunz->Settings->VC++ directories->Files directories includes 
    add

    PHP Code:
    Gunz/Discord/include 
    and
    PHP Code:
    Gunz/Discord/src 



    4- Now you should create filters on your source, go to:


    PHP Code:
    Gunz->Add->New Filter->Discord 
    4.1- Now new sub filters:

    PHP Code:
    Discord->Add->New Filter->DiscordClass 
    PHP Code:
    Discord->Add->New Filter->DiscordSDK 
    5- We should add Existents Elements to these filters:


    PHP Code:
    DiscordClass->Add Existents Elements->Discord.and Discord.cpp 
    PHP Code:
    DiscordSDK->Add Existents Elements->backoff.h/connection_win.cpp/discord_register_win.cpp/discord_rpc.cpp/dllmain.cpp/msg_queue.h/rpc_connection.cpp/rpc_connection.h/serialization.cpp/serialization.
    6- Now we should compilate with no errors, and open main.cpp and add on top:

    PHP Code:
    #include "Discord.h"
    Discordg_Discord
    7- find

    PHP Code:
    mlog("InitialLoading 
    and add below

    PHP Code:
    g_Discord->Initialize();
    g_Discord->Update();
    mlog("Discord Initialized"); 
    Well, this is all for add Discord to the source, now you need to edite the code for your discord app.

    8- open Discord.cpp and you will see something like this




    PHP Code:
    void Discord::Initialize(){
        
    DiscordEventHandlers Handle;
        
    memset(&Handle0sizeof(Handle));
        
    Discord_Initialize("ID", &Handle1NULL); //api key
    }
    void Discord::Update() {
        
    DiscordRichPresence discordPresence;
        
    memset(&discordPresence0sizeof(discordPresence));
        
    discordPresence.state "Playing Solo";
        
    discordPresence.details "xTremeGunz is FUN!";
        
    discordPresence.largeImageKey "xtremegunz";
        
    discordPresence.largeImageText "Playing XTREMEGUNZ";
        
    discordPresence.smallImageKey "23130950_1446117188819976_4953181561936402594_n1";
        
    discordPresence.smallImageText "Server 1 - All Players";
        
    discordPresence.partyId "PARTY ID";
        
    discordPresence.partySize 1;    discordPresence.partyMax 0;
        
    discordPresence.joinSecret "JOIN SECRET";
        
    Discord_UpdatePresence(&discordPresence);




    and you will replace ID, PARTY ID and JOIN SECRET with your discord app info, all the other info you will need yo replace with your app info too.In video i will show you how to make an "dynamic" discord state for gunz, if you want to learn more, there is the video. :)
    MERRY CHRISTMAS FOR ALL YOU :)
    Last edited by Jason Demon; 2 Weeks Ago at 06:56 AM.


  2. #2
    The forgotten memory NesuxGxx is offline
    MemberRank
    May 2014 Join Date
    ZERONISLocation
    262Posts
    Obviously to scale this you have to create a complete class for it. I tried several times but what lazyYes indeed. If you create an OnUpdate function to update the content you can use the GetState which defines what state the Lobby place is in. stage. game. In the OnUpdate function, they must maintain two variables so that the OnUpdate that works at FPS cycles. This is sorely lacking. That's why the two variables to save the last state and buy it with the new one and if they are different, update, but of course, and at the end of that update, update the old one with the new one in case it does not go into an infinite cycle and use CPU to the clouds

    - - - Updated - - -

    Code:
    https://github.com/ZER0NIS/GUNZDiscordGaming
    You can review that code as an example. It's not finished. I think that was my first try. I'm going to publish it in git in case someone wants to contribute a git and make this code free for everyone at onceYou can start from ZAplicaction and the init as such from main. and that depends on face one. In my case, as my server has different systems, I created a special OnUpdate limited to 25 and 60 FPS to avoid drops.
    Last edited by NesuxGxx; 2 Weeks Ago at 05:02 PM.

  3. #3
    Apprentice Jason Demon is offline
    MemberRank
    Jul 2013 Join Date
    PerúLocation
    16Posts
    Quote Originally Posted by NesuxGxx View Post
    Obviously to scale this you have to create a complete class for it. I tried several times but what lazyYes indeed. If you create an OnUpdate function to update the content you can use the GetState which defines what state the Lobby place is in. stage. game. In the OnUpdate function, they must maintain two variables so that the OnUpdate that works at FPS cycles. This is sorely lacking. That's why the two variables to save the last state and buy it with the new one and if they are different, update, but of course, and at the end of that update, update the old one with the new one in case it does not go into an infinite cycle and use CPU to the clouds
    well, it really needs the upgrade for scale all the app, but i released the base, so great servers can scalate this, this gonna make servers some "juicy".

  4. #4
    Infraction Banned jorklenis2 is offline
    MemberRank
    Oct 2011 Join Date
    PanamáLocation
    878Posts
    I think I can do it in the best way, something similar to this.
    show character status
    staff level
    Channel which is the entered character
    Game mode
    Room
    Map (showing the map image)

    You can do many things really.

    But I suspect that this was taken from some code of mine that may have leaked...

    example
    Last edited by jorklenis2; 2 Weeks Ago at 09:46 PM.

  5. #5
    Apprentice Jason Demon is offline
    MemberRank
    Jul 2013 Join Date
    PerúLocation
    16Posts
    Quote Originally Posted by jorklenis2 View Post
    I think I can do it in the best way, something similar to this.
    show character status
    staff level
    Channel which is the entered character
    Game mode
    Room
    Map (showing the map image)

    You can do many things really.

    But I suspect that this was taken from some code of mine that may have leaked...

    example
    all code are on google, i just implementate this to gunz, this can run on a simple calculator if you want, it really can be upgrade with gunz states, but i dont wanna releases that, if someone wants to do that, fine :)



Advertisement