Results 1 to 6 of 6
  1. #1
    UrbanNaga's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Posts
    99
    Reputation
    10
    Thanks
    9
    My Mood
    Bored

    Developing Admin/Ranks [FSOD]

    So I am honestly brand new to the entire ROTMG PSERVER and im curious as to how i can give myself admin commands and set different ranks for individuals as i please.

    I used visual studio to implement the following line for code into player.cs and i set my rank to 10 in heidisql

    switch(psr.Account.Rank)
    {
    case 0:
    Name = "[Player]" + psr.Account.Name;
    break;
    case 1:
    default:
    Name = "[Admin]" + psr.Account.Name;
    break;

    }

    My issue is that after I go to use admin commands or /admin it tells me i have no permissions. Im looking for some in depth help with other information as well if anyone is kind enough to take the time! Thank you!!!

  2. #2
    HappyMen's Avatar
    Join Date
    Dec 2016
    Gender
    male
    Location
    Hard-coded in your PC.
    Posts
    66
    Reputation
    10
    Thanks
    3
    My Mood
    Flirty
    I personally don't know much about coding, but I'm assuming the issue could possibly be from another code error elsewhere in the code.

    Again, I don't know much about code, just suggesting

  3. #3
    Anime's Avatar
    Join Date
    Jul 2017
    Gender
    male
    Posts
    988
    Reputation
    42
    Thanks
    170
    Quote Originally Posted by HappyMen View Post
    I personally don't know much about coding, but I'm assuming the issue could possibly be from another code error elsewhere in the code.

    Again, I don't know much about code, just suggesting
    Not quite.
    Also, can you please send me your commands.cs @UrbanNaga

    I'll respond with an updated code that should work. Also did you rebuild your solution?

  4. #4
    ShotPT12's Avatar
    Join Date
    Jan 2017
    Gender
    male
    Posts
    57
    Reputation
    10
    Thanks
    9
    Try to change your rank to 3,it should work

  5. #5
    Devwarlt's Avatar
    Join Date
    Oct 2016
    Gender
    male
    Posts
    28
    Reputation
    10
    Thanks
    8
    My Mood
    Inspired
    Quote Originally Posted by UrbanNaga View Post
    So I am honestly brand new to the entire ROTMG PSERVER and im curious as to how i can give myself admin commands and set different ranks for individuals as i please.

    I used visual studio to implement the following line for code into player.cs and i set my rank to 10 in heidisql

    switch(psr.Account.Rank)
    {
    case 0:
    Name = "[Player]" + psr.Account.Name;
    break;
    case 1:
    default:
    Name = "[Admin]" + psr.Account.Name;
    break;

    }

    My issue is that after I go to use admin commands or /admin it tells me i have no permissions. Im looking for some in depth help with other information as well if anyone is kind enough to take the time! Thank you!!!
    # [Tutorial] Setting up different ranks to by-pass a command.

    ## Language used:
    - C#.

    ## Software used:
    #### Microsoft Visual Studio Community:
    - [x] **Windows**: download link [**here**](https://go.microsof*****m/fwlink/?Lin...78&clcid=0x409).

    ## Game Source used:
    #### Realm of the Mad God 27.3.2 Server:
    - [x] Download link [**here**].


    ***


    # Adding `public` variables to compare on another file.

    ### 1) Navigate on your server solution and go to "_wServer > Program.cs_";
    ### 2) At "_Program.cs_" bellow scope of static class add these public variables for reference:
    > ...

    > namespace wServer

    > {

    > internal static class Program

    > {
    > public const int server_Owner = 7;
    > public const int server_Co_Owner = 6;
    > public const int server_Admin = 5;
    > public const int server_Dev = 4;
    > public const int server_Yt = 3;
    > public const int server_Vip = 2;
    > public const int server_Player = 1;
    > public const int server_Null = 0;
    > public static readonly List<int> server_Ranks = new List<int> {
    > server_Null, server_Player, server_Vip,
    > server_Yt, server_Dev, server_Admin,
    > server_Co_Owner, server_Owner
    > };
    > ...

    ### 3) At `region` scope import this library, `System.Collections.Generic`:
    > ...

    > using System.Collections.Generic;

    > namespace wServer

    > {

    > internal static class Program
    > {
    > public const int server_Owner = 7;
    > public const int server_Co_Owner = 6;
    > public const int server_Admin = 5;
    > public const int server_Dev = 4;
    > public const int server_Yt = 3;
    > public const int server_Vip = 2;
    > public const int server_Player = 1;
    > public const int server_Null = 0;
    > public static readonly List<int> server_Ranks = new List<int> {
    > server_Null, server_Player, server_Vip,
    > server_Yt, server_Dev, server_Admin,
    > server_Co_Owner, server_Owner
    > };
    > ...

    ### 4) Navigate on your server solution and go to "_wServer > realm > commands> WorldCommand.cs_";
    ### 5) At "_WorldCommand.cs_" bellow scope of static class add these internal functions:
    > ...

    > namespace wServer.realm.commands

    > {

    > //Unique command to do different actions for each rank.
    > internal class Firstcommand : Command

    > {
    > public Firstcommand() : base("firstcommand") { }
    > protected override bool Process(Player player, RealmTime time, string[] args)

    > {
    > int PlayerRank = player.Client.Account.Rank;
    > switch(PlayerRank)

    > {
    > case Program.server_Owner:
    > player.SendInfo("I'm an owner.");
    > return true;
    > case Program.server_Co_Owner:
    > player.SendInfo("I'm a co-owner.");
    > return true;
    > case Program.server_Admin:
    > player.SendInfo("I'm an administrator.");
    > return true;
    > case Program.server_Dev:
    > player.SendInfo("I'm a developer.");
    > return true;
    > case Program.server_Yt:
    > player.SendInfo("I'm a youtuber.");
    > return true;
    > case Program.server_Vip:
    > player.SendInfo("I'm a very important person.");
    > return true;
    > case Program.server_Player:
    > player.SendInfo("I'm a player.");
    > return true;
    > case Program.server_Null:
    > player.SendInfo("I don't rank rank.");
    > return true;
    > default:
    > player.SendError("An error occured, contact administrator.");
    > return true;

    > }

    > }

    > }

    > //Unique command to by-pass rank greater than specific rank
    > //You could adapt it to by-pass greater-equal than, lesser-equal than or whatever
    > internal class SecondCommand : Command

    > {
    > public SecondCommand() : base("secondcommand") { }
    > protected override bool Process(Player player, RealmTime time, string[] args)

    > {
    > int PlayerRank = player.Client.Account.Rank;
    > if (PlayerRank > Program.server_Player)

    > {
    > player.SendInfo("Rank lesser than 'player' cannot use this command.");
    > return true;

    > } else

    > {
    > player.SendHelp("You don't have enough rights to use this command.");
    > return true;

    > }

    > }

    > }

    > //Unique command to by-pass rank into between specific array values
    > internal class ThirdCommand : Command

    > {
    > public ThirdCommand() : base("thirdcommand") { }
    > protected override bool Process(Player player, RealmTime time, string[] args)
    > {

    > int PlayerRank = player.Client.Account.Rank;
    > if ((Program.server_Ranks.Contains(PlayerRank))
    > && (PlayerRank > Program.server_Ranks[Program.server_Player - 1])
    > && (PlayerRank <= Program.server_Ranks[Program.server_Admin -1]))
    > {

    > player.SendInfo(@"Rank lesser than 'player' and greater than 'admin'
    > cannot use this command.");
    > return true;
    > } else

    > {

    > player.SendHelp("You don't have enough rights to use this command.");
    > return true;

    > }

    > }

    > }

    > ...


    ***


    # Understanding by-pass and usages.

    ### Many alternative RotMG projects aim to have their own ranking differentiation mechanism and thus limit commands that only specific members will have access to. However, it's necessary to program this mechanism manually. As mentioned earlier, this by-pass system limits some ranks in having access to some commands or even a single command performing several different functions depending on the user rank.

    ### The examples shown above are 3 options to perform a by-pass per user rank, however you can adapt them the way you want. Functions such as `foreach` and `switch` can be used to customize a better by-pass verification mechanism too.



    **Credits:**
    - _@Devwarlt_ for tutorial;
    - _@Fabian_ for Server source.

    - - - Updated - - -

    You could replace that Linq usage to enum list, similar as PacketIDs.
    Last edited by Ahlwong; 08-04-2017 at 10:00 PM. Reason: removed GitHub links


    Do you need help or support in your RotMG Private Server? I could help you, leave a private message to me, contact bellow:

    https://******.com/Devwarlt

  6. #6
    BurgerLoverMx's Avatar
    Join Date
    Jan 2014
    Gender
    male
    Location
    Québec
    Posts
    411
    Reputation
    23
    Thanks
    843
    My Mood
    Relaxed
    Quote Originally Posted by Devwarlt View Post
    # [Tutorial] Setting up different ranks to by-pass a command.
    Pretty sure ****** links aren't allowed so might wanna edit that...

Similar Threads

  1. [Solved] how to Change admin rank
    By awesomediamond in forum Realm of the Mad God Private Servers Help
    Replies: 0
    Last Post: 06-24-2017, 04:09 PM
  2. [Solved] I need help with getting admin on FSoD private server
    By Linards17 in forum Realm of the Mad God Private Servers Help
    Replies: 7
    Last Post: 09-16-2016, 11:25 AM
  3. [Help Request] Admin Rank?
    By Saxitus in forum Realm of the Mad God Private Servers Help
    Replies: 2
    Last Post: 07-06-2015, 10:25 AM
  4. DAVE PLEASE GIVE ME ADMIN RANK!!
    By max1612 in forum Spammers Corner
    Replies: 0
    Last Post: 08-10-2014, 08:24 AM
  5. [Info] Free admin rank for cracked server [Semi Working]
    By iyoutuber in forum Minecraft Tutorials
    Replies: 12
    Last Post: 09-15-2013, 03:47 AM