HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
Making threads to link to banned members content grants an automatic ban
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 Add more ranks to your game [Code]

View previous topic View next topic Go down 
AuthorMessage

Very Helpful
Very Helpful


Male Posts : 314
Join date : 2013-07-21
Age : 16

PostSubject: Add more ranks to your game [Code]   Sun Feb 15, 2015 7:09 pm

Considering how requested this was and how kind I am  I see myself in the need of share you all my knowledge in this code that I only used to share completely with friends or trust people.

♣️I will not help you with source general issues(if doesn't want build, show another errors and such).


♣️This is intended to ADVANCED Users, if you haven't past experiences with C++, go away and find someone else to build it for you.


♣️Going update.


♣️I Appreciate credits for help always Smile.




MAKE SURE TO SAVE A COPY OF THE SOURCE IF YOU GET SOMETHING WRONG ON IT.Oh, and it only will include for you teleport skill for this new rank, feels free to contact me for any other skill

like spawn, unblock-able, eartquake, etc.


Green: Add
Red: Remove
Purple: Modify to your needs
{Open your Solution/Source

{Open GameConfig.h
{Find for "//STANDARD TEXTS" it should be like this:
Quote :
// STANDARD TEXTS
#define USER_ADMIN_TEXT "ADMIN"
#define USER_MOD_TEXT "MOD"
#define USER_VIP_TEXT "VIP"

{Open ChatManager.h
{Find for "//PREFIX" it should be like this:
Quote :
//Prefix
String tLine = "";
if(sayer!="" && !isPostfixLength)
{
if(type==CHAT_ADMIN)tLine += "(" USER_ADMIN_TEXT ")";
else if(type==CHAT_MOD)tLine += "(" USER_MOD_TEXT ")";
else if(type==CHAT_VIP)tLine += "(" USER_VIP_TEXT ")";
if(type==CHAT_ACTION||type==CHAT_PARTYACTION||type==CHAT_LOCALACTION)tLine += sayer + " ";
else if(type==CHAT_PRIVATE)tLine += "((" + sayer + ")) ";
else if(type==CHAT_EVENT||type==CHAT_LOCALEVENT||type==CHAT_PARTYEVENT)tLine += "[" + sayer + " ";
else tLine += "<" + sayer + "> ";
}
{Scroll up and find around lines 21, you will find this:
Quote :
#define CHAT_INVALID 0
#define CHAT_GENERAL 1
#define CHAT_PRIVATE 2
#define CHAT_PARTY 3
#define CHAT_ADMIN 4
#define CHAT_ACTION 5
#define CHAT_PARTYACTION 6
#define CHAT_COMMAND 7
#define CHAT_LOCAL 8
#define CHAT_LOCALACTION 9
#define CHAT_EVENT 10
#define CHAT_LOCALEVENT 11
#define CHAT_MOD 12
#define CHAT_LIPSYNC 13
#define CHAT_PARTYEVENT 14
#define CHAT_VIP 15
Use any number that's not took by 14 or under, since these are already defined.
{Open MagixExternalDefinition.h
{Find for "public:" parameter, it should look like this:
Quote :
public:
bool isAdmin;
bool isVIP;
bool isMod;
bool isModOn;
ColourValue adminAuraColour;
bool hasVertexProgram;
bool hasFragmentProgram;
bool pagedGeometryOn;
bool pagedGeometryForced;
Real viewDistance;
unsigned short maxHeads;
unsigned short maxManes;
unsigned short maxTails;
unsigned short maxWings;
unsigned short maxTufts;
unsigned short maxBodyMarks;
unsigned short maxHeadMarks;
unsigned short maxTailMarks;
vector<String>::type headMesh;
vector<String>::type maneMesh;
vector<String>::type tailMesh;
vector<String>::type wingMesh;
vector<String>::type tuftMesh;
unsigned short maxEmotes;
vector<String>::type emoteName;
vector<String>::type emoteAnims;
vector<Real>::type emoteEyelidState;
unsigned short maxItems;
vector<String>::type itemMesh;
vector<String>::type itemBone;
vector<String>::type itemName;
vector<bool>::type itemIsPrivate;
vector<bool>::type itemHasOffset;
vector<bool>::type itemHasAltAnim;
vector<String>::type itemParticle;
vector<String>::type itemParticleOffset;
vector<bool>::type itemParticleOnNode;
vector<const Attack>::type attackList;
vector<const Critter>::type critterList;

{Find for MagixExternalDefinitions()
Quote :
{
lastBioName = "";
isAdmin = false;
isVIP = false;
isMod = false;
isModOn = false;
adminAuraColour = ColourValue(1,1,1);
pagedGeometryOn = false;
pagedGeometryForced = false;
viewDistance = 1;
hasVertexProgram = false;
hasFragmentProgram = false;
maxHeads = 0;
maxManes = 0;
maxTails = 0;
maxWings = 0;
maxTufts = 0;
maxBodyMarks = 0;
maxHeadMarks = 0;
maxTailMarks = 0;
maxEmotes = 0;
maxItems = 0;
}

{Open MagixGUI.h
{Find for if(mInputManager->getInputBox()==mBoxText[GUI_TEXTINPUT])
Quote :
if(mInputManager->getInputBox()==mBoxText[GUI_TEXTINPUT])
{
String tCaption = mInputManager->getInputText();
unsigned char tType = CHAT_GENERAL;
if(mDef->isAdmin)tType = CHAT_ADMIN;
else if(mDef->isMod && mDef->isModOn)tType = CHAT_MOD;
else if (mDef->isVIP)tType =CHAT_VIP;
String tParam = "";

mChatManager->processInput(tCaption,tType,tParam);
if(tType == CHAT_INVALID)return;
//Command

{Find for else if(tParam==COMMAND_COMMANDS)
Quote :
else if(tParam==COMMAND_COMMANDS)
{
mChatManager->message("--Home Commands--");
mChatManager->message("/sethome");
mChatManager->message("/gohome");
mChatManager->message("/resethome");
mChatManager->message("--Friend/Block Commands--");
mChatManager->message("/friend [name]");
mChatManager->message("/unfriend [name]");
mChatManager->message("/block [name]");
mChatManager->message("/unblock [name]");
mChatManager->message("--Pet Commands--");
mChatManager->message("/releasepet");
mChatManager->message("/petfollow");
mChatManager->message("--Party Commands--");
mChatManager->message("/party [name]");
mChatManager->message("--Other Commands--");
mChatManager->message("/position");
mChatManager->message("/roll");
mChatManager->message("/clearall");
mChatManager->message("/clear");
mChatManager->message("/lipsync [message]");
mChatManager->message("/savechat [filename]");
if(mDef->isAdmin)
{
mChatManager->message("/createitem [name]");
mChatManager->message("/godspeak [message]");
mChatManager->message("/ban [name];[num days] (Use as last resort)");
}
if(mDef->isMod)
{
mChatManager->message("/modon");
mChatManager->message("/modoff");
mChatManager->message("/ban [name] (Use as last resort)");
}
if(mDef->isAdmin||mDef->isMod)
{
mChatManager->message("/kick [name]");
mChatManager->message("/goto [map]:[x] [y] [z]");
mChatManager->message("/where [name]");
mChatManager->message("/whois [playertoken]");
mChatManager->message("/massblock [name]");
}
if(mDef->isVIP)
{
mChatManager->message("/goto [map]:[x] [y] [z]");
}
Oh, this can be also modified by your own adding/removing "mChatManager->message" 's.
The parts quoted(between " ") can be altered to show any message to your a ranked user who uses the command "/?".
For example:
Code:
                  if(mDef->isAdmin)
                  {
                     mChatManager->message("***USE YOUR POWERS WISELY***");
                                                  mChatManger->message("Rev is 'ur god, 'right?");
                  }
P:
{Open MagixHandler.h
{Find for else if(tCommand==COMMAND_GOTO)

Quote :
else if(tCommand==COMMAND_GOTO)
{
if(!mDef->isAdmin && !mDef->isMod && !mDef->isVIP)return;
const vector<String>::type tPart = StringUtil::split(tParam,":",1);
if(tPart.size()<=0)return;
const String tMap = tPart[0];
OKAY, HERE GOES THE DIRTY AND MORE TIME TAKING ON EDIT PART
{Open MagixNetworkManager.h
{Find for tBitStream.Read(tSuccess);
Quote :
tBitStream.Read(tSuccess);
if(tSuccess)
{
char tBuffer[512] = "";
bool tIsAdmin = false;
bool tIsMod = false;
bool tIsVIP = false;
StringCompressor::Instance()->DecodeString(tBuffer,512,&tBitStream);
tBitStream.Read(tIsAdmin);
tBitStream.Read(tIsMod);
                       tBitStream.Read(tIsVIP);
for(int i=0;i<MAX_EQUIP;i++)mUnitManager->unequipItem(mUnitManager->getPlayer(),i);
mCharScreenManager->updateChar(String(tBuffer));
mDef->isAdmin = tIsAdmin;
mDef->isMod = tIsMod;
mDef->isVIP = tIsVIP;
if(tIsAdmin)
{
char tAdminColour[16];
StringCompres
sor::Instance()->DecodeString(tAdminColour,16,&tBitStream);
mDef->adminAuraColour = StringConverter::parseColourValue(String(tAdminColour));
mUnitManager->createAdminAura(mUnitManager->getPlayer(),mDef->adminAuraColour);
}
if(tIsMod)mDef->isModOn = false;
           if(tIsVIP)mDef->isVIP = false;


{Find for char tAdminToken[8] = "";
Quote :
char tAdminToken[8] = "";
StringCompressor::Instance()->DecodeString(tAdminToken,8,&tBitStream);
tUnit->isAdmin = (String(tAdminToken)=="ok.");
tUnit->isMod = (String(tAdminToken)=="mod");
tUnit->isVIP = (String(tAdminToken)=="vip_1");

Notice well what you put quoted here, because, that will be the code you will use for rank user.
{Find for if(tUnit->isAdmin) and mod's one as well
Quote :
if(tUnit->isAdmin)
{
tAddMessage = " (" USER_ADMIN_TEXT ")";
tUnit->isHidden = false;
tUnit->isBlocked = false;
char tAdminColour[16];
StringCompressor::Instance()->DecodeString(tAdminColour,16,&tBitStream);
mUnitManager->createAdminAura(tUnit,StringConverter::parseColourValue(String(tAdminColour)));
}
if(tUnit->isMod)
{
tUnit->isHidden = false;
tUnit->isBlocked = false;
bool tIsModOn = false;
tBitStream.Read(tIsModOn);
if(tIsModOn)mUnitManager->createParticleOnUnit(tUnit,"RisingShards",-1,true);
}
if(tUnit->isVIP)
{
tAddMessage = " (" USER_VIP_TEXT ")";
tUnit->isHidden = false;
tUnit->isBlocked = false;
}


EXTRA:If you wish make Mods show their text modify their unit to:
Code:
      if(tUnit->isMod)
      {
                                                tAddMessage = " (" USER_MOD_TEXT ")";
         tUnit->isHidden = false;
         tUnit->isBlocked = false;
         bool tIsModOn = false;
         tBitStream.Read(tIsModOn);
         if(tIsModOn)mUnitManager->createParticleOnUnit(tUnit,"RisingShards",-1,true);
      }

{
{Find StringCompressor::Instance()->EncodeString(mDef->isAdmin?"ok.":(mDef->isMod?"mod":"nil"),8,&tBitStream); and add:
   
Quote :
       StringCompressor::Instance()->EncodeString(mDef->isVIP?"vip_1":(mDef->isAdmin?"ok.":(mDef->isMod?"mod":"nil")),8,&tBitStream);
if(mDef->isAdmin)StringCompressor::Instance()->EncodeString(StringConverter::toString(mDef->adminAuraColour).c_str(),16,&tBitStream);
if(mDef->isMod)tBitStream.Write(mDef->isModOn);
                               if(mDef->isVIP)tBitStream.Write(mDef->isVIP);

mPeer->Send(&tBitStream, HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true);
}
{Open MagixUnitManager.h
{Find for "public:"
Quote :
public:
bool hasMarker;
bool isFriend;
bool isBlocked;
bool isAdmin;
bool isVIP;
bool isMod;
bool isWounded;
MagixIndexedUnit(const unsigned short &i, MagixIndexedUnit *prev)
{
mPrevUnit = prev;
index = i;
hasMarker = false;
isFriend = false;
isBlocked = false;
isAdmin = false;
isMod = false;
              isVIP = false;
isWounded = false;
}


{Open MagixMainServer.cpp (in loginserver build/folder)

{Find "//Write player data"

Quote :
StringCompressor::Instance()->EncodeString(tData,512,&tBitStream);
const bool tIsAdmin = (strlen(tAdminToken)>=3 && string(tAdminToken).erase(2)=="ok");
const bool tIsMod = (strlen(tAdminToken)>=3 && string(tAdminToken)=="mod");
const bool tIsVIP = (strlen(tAdminToken)>=3 && string(tAdminToken)=="vip_1");
tBitStream.Write(tIsAdmin);
tBitStream.Write(tIsMod);
tBitStream.Write(tIsVIP);
if(tIsAdmin)StringCompressor::Instance()->EncodeString(string(tAdminToken).erase(0,3).c_str(),16,&tBitStream);

Pink: This also affects on the player data(how you rank up the user), put anything you will use to make this user "VIP", "DT" or whatever.

46.BUILD IT.

That's it!

Let me know if something appears underlined in Red or can't compile properly!


PM me for things like shards, auras with the "admin" style, commands, and such and two or more ranks than only a new one.[/code]


Last edited by Revaen on Sun Mar 01, 2015 3:54 am; edited 6 times in total
Back to top Go down
GlaciaTheWolf
®
®
avatar

Game username : Glacia, GlaciaIceWolf, GlaciaTheWolf
Server : Canis lupus (Owner/creator) DD (member)
Female Posts : 977
Join date : 2013-12-09
Age : 21
Location : Ohio

PostSubject: Re: Add more ranks to your game [Code]   Sun Feb 15, 2015 7:21 pm

I remember when i got this on skype...OH...MY....GOD..... it takes time to figure out
Back to top Go down
Witacha
3D Modeler
3D Modeler
avatar

Game username : Witacha
Server : Land Of The Wolves(Owner)
Female Posts : 1198
Join date : 2012-06-15
Age : 18
Location : France

PostSubject: Re: Add more ranks to your game [Code]   Sun Feb 15, 2015 7:44 pm

Oh my gosh thank you so much Rev'
Back to top Go down
http://witacha-asukata.deviantart.com/
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2575
Join date : 2011-07-24
Age : 30

PostSubject: Re: Add more ranks to your game [Code]   Sun Feb 15, 2015 9:43 pm

Thanks and please use [code.]

________________________________
Retired
Back to top Go down

Very Helpful
Very Helpful


Male Posts : 314
Join date : 2013-07-21
Age : 16

PostSubject: Re: Add more ranks to your game [Code]   Sun Feb 15, 2015 9:54 pm

You all are welcome

And yeah, going to update it massively but for now I am in another things. :3
Back to top Go down
-INACTIVE-
Texture Artist
Texture Artist


Male Posts : 447
Join date : 2014-05-03

PostSubject: Re: Add more ranks to your game [Code]   Mon Feb 16, 2015 9:01 pm

Just...yes.This will help us a lot,thank you very much Revaen (:


Last edited by Cyris ßlack♥ on Mon Aug 03, 2015 5:52 pm; edited 1 time in total
Back to top Go down
Skyia

avatar

Game username : Skyia
Server : Royal Elements
Female Posts : 144
Join date : 2014-09-14
Age : 16
Location : In your mind

PostSubject: Re: Add more ranks to your game [Code]   Tue Feb 24, 2015 10:38 pm

Step 30. Is that step still in the MagixGUI?

Also, the words in bold are my line 927. When I do it, it gives me "2 succeeded, 1 failed" Im so lost and need help Dx

Code:
case ID_CREATECHAR:
 {
 printf("ID_CREATECHAR from %s\n", p->systemAddress.ToString());

---> RakNet::BitStream tReceiveBit(p->data, p->length, false);   <---
 const bool tIsHelper = (strlen(tAdminToken)>=3 && string(tAdminToken)=="helper");
 MessageID tMessage;
 char tUsername[16] = "";
 char tName[32] = "";
 char tData[512] = "";
 tReceiveBit.Read(tMessage);
 stringCompressor->DecodeString(tUsername,16,&tReceiveBit);
 stringCompressor->DecodeString(tName,32,&tReceiveBit);
 stringCompressor->DecodeString(tData,512,&tReceiveBit);

 bool tCreateSuccess = false;

 bool tNameUsed = true;
 while(tNameUsed)
 {
Back to top Go down

Very Helpful
Very Helpful


Male Posts : 314
Join date : 2013-07-21
Age : 16

PostSubject: Re: Add more ranks to your game [Code]   Wed Feb 25, 2015 1:38 am

Skyia wrote:
Step 30. Is that step still in the MagixGUI?

Also, the words in bold are my line 927. When I do it, it gives me "2 succeeded, 1 failed" Im so lost and need help Dx

Code:
case ID_CREATECHAR:
 {
 printf("ID_CREATECHAR from %s\n", p->systemAddress.ToString());

---> RakNet::BitStream tReceiveBit(p->data, p->length, false);   <---
 const bool tIsHelper = (strlen(tAdminToken)>=3 && string(tAdminToken)=="helper");
 MessageID tMessage;
 char tUsername[16] = "";
 char tName[32] = "";
 char tData[512] = "";
 tReceiveBit.Read(tMessage);
 stringCompressor->DecodeString(tUsername,16,&tReceiveBit);
 stringCompressor->DecodeString(tName,32,&tReceiveBit);
 stringCompressor->DecodeString(tData,512,&tReceiveBit);

 bool tCreateSuccess = false;

 bool tNameUsed = true;
 while(tNameUsed)
 {
Read carefully:
21.Open MagixNetworkManager.h


This was the last order to move to a new part of the compile before step 30.
Back to top Go down
Skyia

avatar

Game username : Skyia
Server : Royal Elements
Female Posts : 144
Join date : 2014-09-14
Age : 16
Location : In your mind

PostSubject: Re: Add more ranks to your game [Code]   Wed Feb 25, 2015 2:04 pm

Thanks Rev
Back to top Go down

Very Helpful
Very Helpful


Male Posts : 314
Join date : 2013-07-21
Age : 16

PostSubject: Re: Add more ranks to your game [Code]   Sun Mar 01, 2015 3:37 am

UPDATED.
Made it more practic as user-friendly.

Enjoy.
Back to top Go down
ЩΛЯ

avatar

Game username : ThisIsWar
Server : Eclipse
Female Posts : 373
Join date : 2015-03-02
Age : 17

PostSubject: Re: Add more ranks to your game [Code]   Sun Apr 10, 2016 4:34 pm

Not meaning to Necro-threading but I cant find MagixMainServer.cpp
Back to top Go down
Jayx

avatar

Game username : Jayx
Server : Royal Elements
Female Posts : 340
Join date : 2012-03-19
Age : 19

PostSubject: Re: Add more ranks to your game [Code]   Sun Apr 10, 2016 5:49 pm

ЩΛЯ wrote:
Not meaning to Necro-threading but I cant find MagixMainServer.cpp
Use CTRL+F to find certain words. Then look at the surrounding words to make sure its in the correct place it should bring you to where that bit of code is.
Back to top Go down
ЩΛЯ

avatar

Game username : ThisIsWar
Server : Eclipse
Female Posts : 373
Join date : 2015-03-02
Age : 17

PostSubject: Re: Add more ranks to your game [Code]   Sun Apr 10, 2016 6:21 pm

Jayx wrote:
ЩΛЯ wrote:
Not meaning to Necro-threading but I cant find MagixMainServer.cpp
Use CTRL+F to find certain words. Then look at the surrounding words to make sure its in the correct place it should bring you to where that bit of code is.

That was the first thing I did before posting, I CTRL+F for certain code anyway.
Back to top Go down
Jayx

avatar

Game username : Jayx
Server : Royal Elements
Female Posts : 340
Join date : 2012-03-19
Age : 19

PostSubject: Re: Add more ranks to your game [Code]   Sun Apr 10, 2016 6:35 pm

ЩΛЯ wrote:
Jayx wrote:
ЩΛЯ wrote:
Not meaning to Necro-threading but I cant find MagixMainServer.cpp
Use CTRL+F to find certain words. Then look at the surrounding words to make sure its in the correct place it should bring you to where that bit of code is.

That was the first thing I did before posting, I CTRL+F for certain code anyway.
Oh, well, if you can't find the bit you're looking for still than I'm not sure, my apologies. Razz
Back to top Go down
Nakti
®
®
avatar

Game username : Nakti
Server : World of Pandora
Female Posts : 164
Join date : 2012-08-24
Age : 22
Location : black celebration

PostSubject: Re: Add more ranks to your game [Code]   Mon Apr 11, 2016 7:09 am

Files are listed in the "solution explorer"; if you cannot find the solution explorer, try finding it in "view" menu. "MagixMainServer.cpp" (if you have the newest source, it's LoginServer.cpp) is in the project MagixMainServer (or LoginServer).
Try searching the code with "Entire Solution" option.
Back to top Go down
ЩΛЯ

avatar

Game username : ThisIsWar
Server : Eclipse
Female Posts : 373
Join date : 2015-03-02
Age : 17

PostSubject: Re: Add more ranks to your game [Code]   Mon Apr 11, 2016 4:09 pm

Nakti wrote:
Files are listed in the "solution explorer"; if you cannot find the solution explorer, try finding it in "view" menu. "MagixMainServer.cpp" (if you have the newest source, it's LoginServer.cpp) is in the project MagixMainServer (or LoginServer).
Try searching the code with "Entire Solution" option.

Oh okay. Thank you I didn't realise it was called LoginServer.cpp in the newest source. I gotta redo it all now, derp.
Back to top Go down
 
Add more ranks to your game [Code]
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: DOWNLOADABLE CONTENT :: Programming Features-
Jump to: