Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Add Discord to Gunz

Initiate Mage
Joined
Jul 25, 2013
Messages
18
Reaction score
9

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:
Gunz->Settings->VC++ directories->Files directories includes

add

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

Jason Demon - Add Discord to Gunz - RaGEZONE Forums



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


PHP:
Gunz->Add->New Filter->Discord

4.1- Now new sub filters:

PHP:
Discord->Add->New Filter->DiscordClass
PHP:
Discord->Add->New Filter->DiscordSDK

5- We should add Existents Elements to these filters:


PHP:
DiscordClass->Add Existents Elements->Discord.h and Discord.cpp
PHP:
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.h

6- Now we should compilate with no errors, and open main.cpp and add on top:

PHP:
#include "Discord.h"
Discord* g_Discord;
7- find

PHP:
mlog("InitialLoading

and add below

PHP:
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:
void Discord::Initialize(){
    DiscordEventHandlers Handle;
    memset(&Handle, 0, sizeof(Handle));
    Discord_Initialize("ID", &Handle, 1, NULL); //api key
}
void Discord::Update() {
    DiscordRichPresence discordPresence;
    memset(&discordPresence, 0, sizeof(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);
}

Jason Demon - Add Discord to Gunz - RaGEZONE Forums



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:
Experienced Elementalist
Joined
May 12, 2014
Messages
259
Reaction score
61
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



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:
Initiate Mage
Joined
Jul 25, 2013
Messages
18
Reaction score
9
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".
 
I'm retired, I'm already
Banned
Joined
Oct 3, 2011
Messages
832
Reaction score
155
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
LefMNcK - Add Discord to Gunz - RaGEZONE Forums
 
Last edited:
Initiate Mage
Joined
Jul 25, 2013
Messages
18
Reaction score
9
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
LefMNcK - Add Discord to Gunz - RaGEZONE Forums

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 :)
 
Back
Top