From ddd49c13d9b89e11c900657154e0504c8c8af2a9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 18 Jul 2017 00:05:26 +0300 Subject: Add permissions and commands fields into groups. For now not reading it from xml or using it in any way. --- src/CMakeLists.txt | 3 + src/Makefile.am | 3 + src/enums/resources/servercommandenable.h | 37 ++++ src/enums/resources/servercommandtype.h | 301 +++++++++++++++++++++++++++++ src/enums/resources/serverpermissiontype.h | 66 +++++++ src/resources/groupinfo.h | 17 +- 6 files changed, 421 insertions(+), 6 deletions(-) create mode 100644 src/enums/resources/servercommandenable.h create mode 100644 src/enums/resources/servercommandtype.h create mode 100644 src/enums/resources/serverpermissiontype.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9d056b3a5..dc43b891a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -669,6 +669,7 @@ SET(SRCS resources/db/horsedb.h resources/fboinfo.h resources/frame.h + resources/groupinfo.cpp resources/groupinfo.h resources/horseinfo.h resources/horseoffset.h @@ -750,6 +751,8 @@ SET(SRCS resources/questitemtext.h resources/questvar.h enums/resources/questtype.h + enums/resources/servercommandenable.h + enums/resources/servercommandtype.h resources/db/palettedb.cpp resources/db/palettedb.h resources/db/petdb.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 9c79c6169..e00af4684 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -452,6 +452,7 @@ BASE_SRC += events/actionevent.h \ resources/dye/dyepaletteptr.h \ resources/fboinfo.h \ resources/frame.h \ + resources/groupinfo.cpp \ resources/groupinfo.h \ resources/image/image.cpp \ resources/image/image.h \ @@ -485,6 +486,8 @@ BASE_SRC += events/actionevent.h \ resources/questitemtext.h \ resources/questvar.h \ enums/resources/questtype.h \ + enums/resources/servercommandenable.h \ + enums/resources/servercommandtype.h \ resources/resource.cpp \ resources/resource.h \ resources/resourcefunctiontypes.h \ diff --git a/src/enums/resources/servercommandenable.h b/src/enums/resources/servercommandenable.h new file mode 100644 index 000000000..575ebf944 --- /dev/null +++ b/src/enums/resources/servercommandenable.h @@ -0,0 +1,37 @@ +/* + * The ManaPlus Client + * Copyright (C) 2012-2017 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef ENUMS_RESOURCES_SERVERCOMMANDENABLE_H +#define ENUMS_RESOURCES_SERVERCOMMANDENABLE_H + +#include "enums/simpletypes/enumdefines.h" + +namespace ServerCommandEnable +{ + enum Type + { + No = 0, + Self = 1, + Other = 2, + Both = 3 + }; +} // namespace ServerCommandEnable + +#endif // ENUMS_RESOURCES_SERVERCOMMANDENABLE_H diff --git a/src/enums/resources/servercommandtype.h b/src/enums/resources/servercommandtype.h new file mode 100644 index 000000000..81ea79bf8 --- /dev/null +++ b/src/enums/resources/servercommandtype.h @@ -0,0 +1,301 @@ +/* + * The ManaPlus Client + * Copyright (C) 2012-2017 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef ENUMS_RESOURCES_SERVERCOMMANDTYPE_H +#define ENUMS_RESOURCES_SERVERCOMMANDTYPE_H + +#include "enums/simpletypes/enumdefines.h" + +enumStart(ServerCommandType) +{ +// Hercules commands + warp = 0, + where, + jumpto, + jump, + who, + who2, + who3, + whomap, + whomap2, + whomap3, + whogm, + save, + load, + speed, + storage, + guildstorage, + option, + hide, + jobchange, + kill, + alive, + kami, + kamib, + kamic, + lkami, + heal, + item, + item2, + itembound, + itembound2, + itemreset, + clearstorage, + cleargstorage, + clearcart, + blvl, + jlvl, + help, + pvpoff, + pvpon, + gvgoff, + gvgon, + model, + go, + monster, + monstersmall, + monsterbig, + killmonster, + killmonster2, + refine, + produce, + memo, + gat, + displaystatus, + stpoint, + skpoint, + zeny, + str, + agi, + vit, + int_, + dex, + luk, + glvl, + makeegg, + hatch, + petfriendly, + pethungry, + petrename, + recall, + night, + day, + doom, + doommap, + raise, + raisemap, + kick, + kickall, + allskill, + questskill, + lostskill, + spiritball, + party, + guild, + breakguild, + agitstart, + agitend, + mapexit, + idsearch, + broadcast, + localbroadcast, + recallall, + reloaditemdb, + reloadmobdb, + reloadskilldb, + reloadscript, + reloadatcommand, + reloadbattleconf, + reloadstatusdb, + reloadpcdb, + mapinfo, + dye, + hairstyle, + haircolor, + allstats, + block, + ban, + charban, + unblock, + charunban, + unban, + mount, + guildspy, + partyspy, + repairall, + guildrecall, + partyrecall, + nuke, + shownpc, + hidenpc, + loadnpc, + unloadnpc, + time, + jail, + unjail, + jailfor, + jailtime, + disguise, + undisguise, + email, + effect, + follow, + addwarp, + skillon, + skilloff, + killer, + npcmove, + killable, + dropall, + storeall, + skillid, + useskill, + displayskill, + snow, + sakura, + clouds, + clouds2, + fog, + fireworks, + leaves, + summon, + adjgroup, + trade, + send, + setbattleflag, + unmute, + clearweather, + uptime, + changesex, + mute, + refresh, + refreshall, + identify, + misceffect, + mobsearch, + cleanmap, + cleanarea, + npctalk, + pettalk, + users, + reset, + skilltree, + marry, + divorce, + sound, + undisguiseall, + disguiseall, + changelook, + autoloot, + alootid, + autoloottype, + mobinfo, + exp, + version, + mutearea, + rates, + iteminfo, + whodrops, + whereis, + mapflag, + me, + monsterignore, + fakename, + size, + showexp, + showzeny, + showdelay, + autotrade, + changegm, + changeleader, + partyoption, + invite, + duel, + leave, + accept, + reject, + clone, + slaveclone, + evilclone, + tonpc, + commands, + noask, + request, + homlevel, + homevolution, + hommutate, + makehomun, + homfriendly, + homhungry, + homtalk, + hominfo, + homstats, + homshuffle, + showmobs, + feelreset, + auction, + mail, + noks, + allowks, + cash, + points, + agitstart2, + agitend2, + skreset, + streset, + storagelist, + cartlist, + itemlist, + stats, + delitem, + charcommands, + font, + accinfo, + set, + reloadquestdb, + undisguiseguild, + disguiseguild, + sizeall, + sizeguild, + addperm, + rmvperm, + unloadnpcfile, + cart, + cashmount, + join, + channel, + fontcolor, + searchstore, + costume, + skdebug, + cddebug, + lang, + bodystyle, + setskill, + +// Evol commands + slide, + serverexit, + + Max +} +enumEnd(ServerCommandType); + +#endif // ENUMS_RESOURCES_SERVERCOMMANDTYPE_H diff --git a/src/enums/resources/serverpermissiontype.h b/src/enums/resources/serverpermissiontype.h new file mode 100644 index 000000000..bee1d2d37 --- /dev/null +++ b/src/enums/resources/serverpermissiontype.h @@ -0,0 +1,66 @@ +/* + * The ManaPlus Client + * Copyright (C) 2012-2017 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef ENUMS_RESOURCES_SERVERPERMISSIONTYPE_H +#define ENUMS_RESOURCES_SERVERPERMISSIONTYPE_H + +#include "enums/simpletypes/enumdefines.h" + +enumStart(ServerPermissionType) +{ +// Hercules permissions + can_trade = 0, + can_party, + all_skill, + all_equipment, + skill_unconditional, + join_chat, + kick_chat, + hide_session, + who_display_aid, + hack_info, + any_warp, + view_hpmeter, + view_equipment, + use_check, + use_changemaptype, + all_commands, + receive_requests, + show_bossmobs, + disable_pvm, + disable_pvp, + disable_commands_when_dead, + hchsys_admin, + can_trade_bound, + disable_pickup, + disable_store, + disable_exp, + disable_skill_usage, + +// Evol permissions + send_gm, + show_client_version, + + Max +} +enumEnd(ServerPermissionType); + +#endif // ENUMS_RESOURCES_SERVERPERMISSIONTYPE_H + diff --git a/src/resources/groupinfo.h b/src/resources/groupinfo.h index 973249d19..924c71b2d 100644 --- a/src/resources/groupinfo.h +++ b/src/resources/groupinfo.h @@ -23,19 +23,24 @@ #include "localconsts.h" +#include "enums/resources/servercommandenable.h" +#include "enums/resources/servercommandtype.h" +#include "enums/resources/serverpermissiontype.h" + +#include "enums/simpletypes/enable.h" + +#include "utils/cast.h" + #include struct GroupInfo final { - GroupInfo() : - name(), - longName(), - badge(), - showBadge(false) - { } + GroupInfo(); A_DEFAULT_COPY(GroupInfo) + ServerCommandEnable::Type mCommands[CAST_SIZE(ServerCommandType::Max)]; + Enable mPermissions[CAST_SIZE(ServerPermissionType::Max)]; std::string name; std::string longName; std::string badge; -- cgit v1.2.3-60-g2f50