Git Product home page Git Product logo

pvpgn-server's Introduction

Player vs Player Gaming Network - PRO

PvPGN is a free and open source cross-platform server software that supports Battle.net and and Westwood Online game clients. PvPGN-PRO is a fork of the official PvPGN project, whose development stopped in 2011, and aims to provide continued maintenance and additional features for PvPGN.

License (GPL version 2) Language (C++) Language (Lua) Github Releases (by Release)

Compiler (Microsoft Visual C++) Compiler (LLVM/Clang) Compiler (GCC)

Build Status Build status

Deleaker helps us find memory leaks.

Tracking

By default, tracking is enabled and is only used for the purpose of sending informational data (e.g. server description, homepage, uptime, amount of users) to tracking servers. To disable tracking, set track = 0 in conf/bnetd.conf.

Supported Clients

  • WarCraft 2: Battle.net Edition: 2.02a, 2.02b
  • WarCraft 3: Reign of Chaos*: 1.13a, 1.13b, 1.14a, 1.14b, 1.15a, 1.16a, 1.17a, 1.18a, 1.19a, 1.19b, 1.20a, 1.20b, 1.20c, 1.20d, 1.20e, 1.21a, 1.21b, 1.22a, 1.23a, 1.24a, 1.24b, 1.24c, 1.24d, 1.24e, 1.25b, 1.26a, 1.27a, 1.27b, 1.28, 1.28.1, 1.28.2, 1.28.4, 1.28.5
  • WarCraft 3: The Frozen Throne*: 1.13a, 1.13b, 1.14a, 1.14b, 1.15a, 1.16a, 1.17a, 1.18a, 1.19a, 1.19b, 1.20a, 1.20b, 1.20c, 1.20d, 1.20e, 1.21a, 1.21b, 1.22a, 1.23a, 1.24a, 1.24b, 1.24c, 1.24d, 1.24e, 1.25b, 1.26a, 1.27a, 1.27b, 1.28, 1.28.1, 1.28.2, 1.28.4, 1.28.5
  • StarCraft: 1.08, 1.08b, 1.09, 1.09b, 1.10, 1.11, 1.11b, 1.12, 1.12b, 1.13, 1.13b, 1.13c, 1.13d, 1.13e, 1.13f, 1.14, 1.15, 1.15.1, 1.15.2, 1.15.3, 1.16, 1.16.1, 1.17.0, 1.18.0
  • StarCraft: Brood War: 1.08, 1.08b, 1.09, 1.09b, 1.10, 1.11, 1.11b, 1.12, 1.12b, 1.13, 1.13b, 1.13c, 1.13d, 1.13e, 1.13f, 1.14, 1.15, 1.15.1, 1.15.2, 1.15.3, 1.16, 1.16.1, 1.17.0, 1.18.0
  • Diablo: 1.09, 1.09b
  • Diablo 2: 1.10, 1.11, 1.11b, 1.12a, 1.13c, 1.14a, 1.14b, 1.14c, 1.14d
  • Diablo 2: Lord of Destruction: 1.10, 1.11, 1.11b, 1.12a, 1.13c, 1.14a, 1.14b, 1.14c, 1.14d
  • Westwood Chat Client: 4.221
  • Command & Conquer: Win95 1.04a (using Westwood Chat)
  • Command & Conquer: Red Alert: Win95 2.00 (using Westwood Chat), Win95 3.03
  • Command & Conquer: Red Alert 2: 1.006
  • Command & Conquer: Tiberian Sun: 2.03 ST-10
  • Command & Conquer: Tiberian Sun Firestorm: 2.03 ST-10
  • Command & Conquer: Yuri's Revenge: 1.001
  • Command & Conquer: Renegade: 1.037
  • Nox: 1.02b
  • Nox Quest: 1.02b
  • Dune 2000: 1.06
  • Emperor: Battle for Dune: 1.09

* WarCraft 3 clients are unable to connect to PvPGN servers without a client-side modification, through tools such as W3L, to disable server signature verification. * StarCraft clients beginning with patch 1.18 will not be supported by PvPGN-PRO due to protocol changes. A 1.18.0 versioncheck entry is included for compatibility with bot software.

Support

Create an issue if you have any questions, suggestions, or anything else to say about PvPGN-PRO. Please note that D2GS is not part of the PvPGN project and is therefore unsupported here. Set loglevels = fatal,error,warn,info,debug,trace in bnetd.conf before obtaining logs and posting them.

Development

Submit pull requests to contribute to this project. Utilize C++11 features and adhere to the C++ Core Guidelines whenever possible.

Building

See docs/ports.md for operating systems and compilers that have been confirmed to work with PvPGN. Any operating system that supports WinAPI or POSIX, and any C++11 compliant compiler should be able to build PvPGN. The CMake files have been hardcoded to reject compilers older than Visual Studio 2015 and GCC 5.1.

Windows

Use Magic Builder.

Alternatively, use cmake to generate the .sln project and build it from Visual Studio.

cmake -g "Visual Studio 14 2015" -H./ -B./build

This will generate .sln in build directory.

Linux in general

Do not blindly run these commands. The main problem with older distributions is installing CMake 3.2.x and GCC 5, so external repositories are used in the examples.

apt-get install git install cmake make build-essential zlib1g-dev
apt-get install liblua5.1-0-dev #Lua support
apt-get install mysql-server mysql-client libmysqlclient-dev #MySQL support
cd /home
git clone https://github.com/pvpgn/pvpgn-server.git
cmake -D CMAKE_INSTALL_PREFIX=/usr/local/pvpgn -D WITH_MYSQL=true -D WITH_LUA=true ../
make
make install

Ubuntu 16.04, 18.04

sudo apt-get -y install build-essential git cmake zlib1g-dev
git clone https://github.com/pvpgn/pvpgn-server.git
cd pvpgn-server && cmake -G "Unix Makefiles" -H./ -B./build
cd build && make

Ubuntu 14.04

sudo apt-get -y install build-essential zlib1g-dev git
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get -y update
sudo apt-get -y install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
sudo add-apt-repository -y ppa:george-edison55/cmake-3.x
sudo apt-get update
sudo apt-get -y install cmake
git clone https://github.com/pvpgn/pvpgn-server.git
cd pvpgn-server && cmake -G "Unix Makefiles" -H./ -B./build
cd build && make

Debian 8 with clang compiler

sudo apt-get -y install build-essential zlib1g-dev clang libc++-dev git
wget https://cmake.org/files/v3.7/cmake-3.7.1-Linux-x86_64.tar.gz
tar xvfz cmake-3.7.1-Linux-x86_64.tar.gz
git clone https://github.com/pvpgn/pvpgn-server.git
cd pvpgn-server && CC=/usr/bin/clang CXX=/usr/bin/clang++ ../cmake-3.7.1-Linux-x86_64/bin/cmake -G "Unix Makefiles" -H./ -B./build
cd build && make

CentOS 7

sudo yum -y install epel-release centos-release-scl
sudo yum -y install git zlib-devel cmake3 devtoolset-4-gcc*
sudo ln -s /usr/bin/cmake3 /usr/bin/cmake
git clone https://github.com/pvpgn/pvpgn-server.git
cd pvpgn-server
CC=/opt/rh/devtoolset-4/root/usr/bin/gcc CXX=/opt/rh/devtoolset-4/root/usr/bin/g++ cmake -G "Unix Makefiles" -H./ -B./build
cd build && make

Fedora 25

sudo dnf -y install gcc-c++ gcc make zlib-devel cmake git
git clone https://github.com/pvpgn/pvpgn-server.git
cd pvpgn-server
cmake -G "Unix Makefiles" -H./ -B./build
cd build && make

FreeBSD 11

sudo pkg install -y git cmake
git clone https://github.com/pvpgn/pvpgn-server.git
cd pvpgn-server
cmake -G "Unix Makefiles" -H./ -B./build
cd build && make

Full instructions: Русский | English

Hosting on LAN or VPS with private IP address

Some VPS providers do not assign your server a direct public IP. If that is the case or you host at home behind NAT you need to setup the route translation in address_translation.conf. The public address is pushed as the route server address to game clients when seeking games. Failure to push the correct address to game clients results in players not being able to match and join games (long game search and error).

If your network interface is directly bound to public IP, PvPGN can figure it out on it's own and this step is not necessary.

License

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 (at your option) 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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

pvpgn-server's People

Contributors

aancw avatar acolchagoff avatar alexoundos avatar aloki avatar carlbennett avatar celetuiw avatar cen1 avatar d1zzy avatar harpywar avatar iltmpz avatar pelish avatar plisskenwat avatar relesgoe avatar shakar avatar u-238 avatar zakamurite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pvpgn-server's Issues

Tools directory

I suggest that there should be a tools directory to put binary programs in such as magic builder and bni icon builder.

No icon

With custom_icons = true in icons.conf, I don't receive any icons when I log in

Icons stash script

Create a script to update the icon stash in icons.conf by reading icons.bni using a command line version of BNI Icon Builder. The script should run when compiling and /rehash icons.

Error when making code on Mac

mp41:build H$ make
[ 8%] Built target compat
[ 8%] Building CXX object src/common/CMakeFiles/common.dir/fdwatch.o
In file included from /Users/H/Documents/gitprojects/pvpgn/src/common/fdwatch.cpp:29:
In file included from /Users/H/Documents/gitprojects/pvpgn/src/common/fdwatch_select.h:31:
/Users/H/Documents/gitprojects/pvpgn/src/common/fdwbackend.h:36:42: error: reference to type
'const std::string'
(aka 'const basic_string<char, char_traits, allocator >') could not bind to
an lvalue of type 'const char [1]'
explicit InitError(const std::string& str = "")
^ ~~
/Users/H/Documents/gitprojects/pvpgn/src/common/fdwbackend.h:36:42: note: passing argument to
parameter 'str' here
1 error generated.
make[2]: *** [src/common/CMakeFiles/common.dir/fdwatch.o] Error 1
make[1]: *** [src/common/CMakeFiles/common.dir/all] Error 2
make: *** [all] Error 2

this spits my terminal, any idea what caused this?

http://pvpgn.pro

is that ur website harpywar?
if yes, when u release this .
❤️

Quiz Flood, if many users use it

(17:02:42) -- Hint: Eni**a
(17:02:43) Callisto: enigma
(17:02:43) -- callisto is correct! The unswer is: Enigma (+2 points, 85 total) 0 sec ST_REmy: enigma
(17:02:43) -- st_remy is correct! The unswer is: Enigma (+2 points, 157 total) 0 sec Callisto: enigma
(17:02:45) -- callisto is correct! The unswer is: Enigma (+2 points, 87 total) 0 sec ST_REmy: enigma
(17:02:45) -- st_remy is correct! The unswer is: Enigma (+2 points, 159 total) 0 sec rudra: enigma
(17:02:45) -- rudra is correct! The unswer is: Enigma (+2 points, 18 total) 0 sec -- --------------------------------------------------------
(17:02:46) -- Ultimate: Darkness. (13 letters)
(17:02:47) kangenmantanJIR: PLAY
(17:02:47) Callisto: enigma
(17:02:47) ST_REmy: enigma
(17:02:49) kangenmantanJIR: YOK
(17:02:49) -- Hint: g *******
(17:02:50) -- Hint: g _l_
(17:02:50) -- [NOTE] Jangan Lupa ketik "!update" di Channel utama untuk mengupdate database status.
(17:02:51) ST_REmy: ayo
(17:02:52) kangenmantanJIR: YOK
(17:02:53) -- --------------------------------------------------------
(17:02:53) -- Hero Nicknames: Lucifer the DoomBringer. (4 letters)
(17:02:54) -- --------------------------------------------------------
(17:02:54) -- Hero Nicknames: Leviathan the Tidehunter. (4 letters)
(17:02:55) -- --------------------------------------------------------
(17:02:55) -- Hero Nicknames: Barathrum the Spiritbreaker. (2 letters)
(17:02:56) Callisto: cr8 lah
(17:02:56) rudra: doom
(17:02:56) -- --------------------------------------------------------
(17:02:56) -- Hero Nicknames: Akasha the Queen of Pain. (3 letters)
(17:02:57) kangenmantanJIR: -2
(17:02:57) -- --------------------------------------------------------
(17:02:57) -- Cost: Broadsword (4 letters)
(17:02:59) Callisto: doom
(17:03:00) ST_REmy: 1200
(17:03:00) -- st_remy is correct! The unswer is: 1200 (+4 points, 163 total) 0 sec Callisto: 1200
(17:03:01) -- callisto is correct! The unswer is: 1200 (+4 points, 91 total) 0 sec -- --------------------------------------------------------
(17:03:01) -- Hero Nicknames: King Leoric the Skeleton King. (3 letters)
(17:03:02) kangenmantanJIR: -2
(17:03:02) -- Hint: e

maybe make it, only 1 question 1 users can answers, then wait 10 seconds to ask new questons

/mute <username> [hours] [reason]

It's quicker and simpler to write /mute and /unmute instead of /muteacct and /unmuteacct
The number of hours to mute a user and a reason would be nice as well.

Localization

I'm wondering to localize hardcoded text messages in PvPGN. But different game clients have a different encoding.

  • Warcraft 3 client uses UTF8, and there is no problem with other languages.
  • I know that Starcraft uses conversion CP1252 -> UTF8 to display Russian text (I suppose, it covers Warcraft 2 and Diablo 1). I need an information about Korean, Polish and others.
  • Whats encoding for Diablo 2?
  • Can WWOL clients display different language text or not? (Tiberian Sun, RA2, etc).

UPDATE
Diablo 2 - UTF8
Starcraft (except Russian) - UTF8
WWOL - IRC encoding, it should not be localized

Object Oriented code

PvPGN could use some OOP to make it easier for some people to modify the source code

bnetd.exe no response

windows, compile using Visual Studio 2010
with LUA and MySQL Support

success compile but when i run it
the GUI just white screen, no show log

pvpgn

autounban not working

im already lock nick for 1 hours
/lock nick 1 tes ban

after 1 hours, it still banned..

Sex & Age fields

Which games support changing these? I know that SC doesn't so I suggest that /finger doesn't display these fields if the client doesn't support it.

Server clusters

Is it possible to make a server cluster(multiple servers that are connected together) currently?

Respect higher CGs

There aren't any checks for many commands to respect users with higher CGs than you. For example, you wouldn't want someone with CG3 to ip ban anyone with CG 4, 5, 6, 7, or 8.
Commands that need these checks:

/voice
/devoice
/chpass
/serverban
/ipban
/kill
/killsession
/lock
/lockacct
/unlock
/unlockacct
/mute
/muteacct
/unmute
/unmuteacct
/set
/commandgroups
/cg
/clearstats

Function to display help from bnhelp.conf.in

Many commands display a hardcoded help message if you don't add arguments to it such as /kick which would display "usage: /kick "
Instead of hardcoding all of these help messages, why not write a function to get the help from bnhelp.conf.in

Error after logging in

[error] pvpgn::bnetd::handle_init_packet: [572] client requested unknown class 0x98 (length 1) (closing connection)
image

0x19 MessageBox

image
Successful implementation of packet 0x19 for MessageBox

//packet.h
t_server_messagebox         server_messagebox;
//packet.cpp
case SERVER_MESSAGEBOX:
    return "SERVER_MESSAGEBOX";
//bnetprotocol.h
#define SERVER_MESSAGEBOX 0x19ff
    typedef struct
    {
        t_bnet_header h;
        bn_int        style;
        /* Text */
        /* Caption */
    } PACKED_ATTR() t_server_messagebox;
#define SERVER_MESSAGEBOX_OK    0x00000000
#define SERVER_MESSAGEBOX_OK_CANCEL 0x00000001
//Example code:
t_packet *rpacket;

if ((rpacket = packet_create(packet_class_bnet)))
{
    packet_set_size(rpacket, sizeof(t_server_messagebox));
    packet_set_type(rpacket, SERVER_MESSAGEBOX);
    bn_int_set(&rpacket->u.server_messagebox.style, SERVER_MESSAGEBOX_OK);
    packet_append_string(rpacket, "Text");
    packet_append_string(rpacket, "");
    conn_push_outqueue(c, rpacket);
    packet_del_ref(rpacket);
}

return 0;

In bn_int_set(&rpacket->u.server_messagebox.style, SERVER_MESSAGEBOX_OK);
SERVER_MESSAGEBOX_OK creates an Ok button while SERVER_MESSAGEBOX_OK_CANCEL creates an Ok and Cancel button for the client.
image
There is no purpose in having both Ok and Cancel buttons because the server will not know which button the user has pressed(and from my testing, you can ignore the messagebox and click other buttons such as Join and Create) so I've hardcoded SERVER_MESSAGEBOX_OK as the value.

Transliteration

Possibly have an option to transliterate text when the player's computer can't support it? For an example, SC on an american computer can't display cyrillic so when somebody writes in cyrillic, random letters are displayed.
Instead, the server can send transliterated text to users who enable the option(/transliterate) and the original text to users who don't enable it.

Quest for Windows build: compat.lib linker error

While working on #24 I encountered a linker error.

To reproduce (using VS 2010):
1.) Throw zconf.h, zlib.h, zlibwapi.lib and zlibwapi.dll from magic builder into pvpgn/zlib
2.) cmd
3.) C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat
4.) cmake -G "NMake Makefiles"
5.) nmake
6.)
[ 1%] Building CXX object src/compat/CMakeFiles/compat.dir/gettimeofday.obj
gettimeofday.cpp
C:\git\pvpgn\src\compat\gettimeofday.cpp(53) : warning C4244: '=' : conversion from 'time_t' to 'long', possible loss of data
[ 1%] Building CXX object src/compat/CMakeFiles/compat.dir/inet_aton.obj
inet_aton.cpp
[ 2%] Building CXX object src/compat/CMakeFiles/compat.dir/inet_ntoa.obj
inet_ntoa.cpp
[ 2%] Building CXX object src/compat/CMakeFiles/compat.dir/mmap.obj
mmap.cpp
[ 3%] Building CXX object src/compat/CMakeFiles/compat.dir/pdir.obj
pdir.cpp
C:\git\pvpgn\src\compat\pdir.cpp(163) : warning C4099: 'direct' : type name first seen using 'struct' now seen using 'class'
C:\git\pvpgn\src\win32/dirent.h(67) : see declaration of 'direct'
C:\git\pvpgn\src\compat\pdir.cpp(184) : warning C4018: '<' : signed/unsigned mismatch
[ 3%] Building CXX object src/compat/CMakeFiles/compat.dir/pgetopt.obj
pgetopt.cpp
[ 3%] Building CXX object src/compat/CMakeFiles/compat.dir/psock.obj
psock.cpp
[ 4%] Building CXX object src/compat/CMakeFiles/compat.dir/snprintf.obj
snprintf.cpp
[ 4%] Building CXX object src/compat/CMakeFiles/compat.dir/strcasecmp.obj
strcasecmp.cpp
[ 5%] Building CXX object src/compat/CMakeFiles/compat.dir/strdup.obj
strdup.cpp
[ 5%] Building CXX object src/compat/CMakeFiles/compat.dir/strerror.obj
strerror.cpp
[ 6%] Building CXX object src/compat/CMakeFiles/compat.dir/strncasecmp.obj
strncasecmp.cpp
[ 6%] Building CXX object src/compat/CMakeFiles/compat.dir/strsep.obj
strsep.cpp
[ 7%] Building CXX object src/compat/CMakeFiles/compat.dir/strtoul.obj
strtoul.cpp
[ 7%] Building CXX object src/compat/CMakeFiles/compat.dir/uname.obj
uname.cpp
[ 8%] Building CXX object src/compat/CMakeFiles/compat.dir/vsnprintf.obj
vsnprintf.cpp
Linking CXX static library compat.lib
c:\MinGW\bin\ld.exe: cannot find /lib: No such file or directory
c:\MinGW\bin\ld.exe: cannot find /nologo: No such file or directory
c:\MinGW\bin\ld.exe: cannot find /out:compat.lib: No such file or directory
NMAKE : fatal error U1077: 'c:\MinGW\bin\ld.exe' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.

Usage: /...

It looks cleaner if we remove "Usage: " and just write the syntax of the command when someone types /help [command]

Windows build fails due to ZLIB_WINAPI macro if zlibwapi.dll is NOT used

Since I don't like "magic" things I decided to build for Windows from source the regular way. The tutorial is here http://pvpgn.wikia.com/wiki/Windows_Source_Install and the problem lies in point 4.

Code in bnetd->anongames_info.cpp line 32 assumes that everyone building for windows will use prebuilt zlibwapi.dll library. This is different than normal zlib.lib/zlib.dll build which you get if you build zlib from source. The difference is described in zlib FAQ in points 6 and 7: http://www.zlib.net/DLL_FAQ.txt

The simple solution when using your own zlib is to simply comment out the macro but that's obviously not a solution. We would need a new global macro which you could define in cmake at build time to switch between the two calling conventions.

I didn't test this on your fork but I assume it's the same problem because I am guessing nobody in the past X years actually tried to build without magic builder. I checked the magic builder and as I thought it ships with zlibwapi.dll by default.

Bypass Flood Detection for SomeUser

harpywar can i request this,
i can give someid bypass flood detection,

i really need this.. maybe make it command

or user have CG 6 can bypass flood

for botchat purpose

suggestion

you could create a command similar to the following, but showing the cg online and offline.

static int _handle_cgonline_command(t_connection * c, char const *text)
{
unsigned int i;
t_elem const * curr;
t_connection * tc;
char const * nick;
t_channel * channel;
channel = conn_get_channel(c);

std::strcpy(msgtemp, "Admins command group's:");
i = std::strlen(msgtemp);
LIST_TRAVERSE_CONST(connlist(), curr)
{
    tc = (t_connection*)elem_get_data(curr);
    if (!tc)
        continue;
    if (!conn_get_account(tc))
        continue;
    if (account_get_command_groups(conn_get_account(tc)) == 255)

    if ((nick = conn_get_username(tc)))
    {
        if (i + std::strlen(nick) + 2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
            message_send_text(c, message_type_info, c, msgtemp);
            i = 0;
        }
        std::sprintf(&msgtemp[i], " %s [12345678] ", nick);
        i += std::strlen(&msgtemp[i]);
    }

    if (account_get_command_groups(conn_get_account(tc)) == 64)

    if ((nick = conn_get_username(tc)))
    {
        if (i + std::strlen(nick) + 2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
            message_send_text(c, message_type_info, c, msgtemp);
            i = 0;
        }
        std::sprintf(&msgtemp[i], " %s [1234567] ", nick);
        i += std::strlen(&msgtemp[i]);
    }
    if (account_get_command_groups(conn_get_account(tc)) == 32)

    if ((nick = conn_get_username(tc)))
    {
        if (i + std::strlen(nick) + 2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
            message_send_text(c, message_type_info, c, msgtemp);
            i = 0;
        }
        std::sprintf(&msgtemp[i], " %s [123456] ", nick);
        i += std::strlen(&msgtemp[i]);
    }
    if (account_get_command_groups(conn_get_account(tc)) == 16)

    if ((nick = conn_get_username(tc)))
    {
        if (i + std::strlen(nick) + 2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
            message_send_text(c, message_type_info, c, msgtemp);
            i = 0;
        }
        std::sprintf(&msgtemp[i], " %s [12345] ", nick);
        i += std::strlen(&msgtemp[i]);
    }
    if (account_get_command_groups(conn_get_account(tc)) == 8)

    if ((nick = conn_get_username(tc)))
    {
        if (i + std::strlen(nick) + 2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
            message_send_text(c, message_type_info, c, msgtemp);
            i = 0;
        }
        std::sprintf(&msgtemp[i], " %s [1234] ", nick);
        i += std::strlen(&msgtemp[i]);
    }
    if (account_get_command_groups(conn_get_account(tc)) == 4)

    if ((nick = conn_get_username(tc)))
    {
        if (i + std::strlen(nick) + 2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
            message_send_text(c, message_type_info, c, msgtemp);
            i = 0;
        }
        std::sprintf(&msgtemp[i], " %s [123] ", nick);
        i += std::strlen(&msgtemp[i]);
    }
    if (account_get_command_groups(conn_get_account(tc)) == 2)

    if ((nick = conn_get_username(tc)))
    {
        if (i + std::strlen(nick) + 2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
            message_send_text(c, message_type_info, c, msgtemp);
            i = 0;
        }
        std::sprintf(&msgtemp[i], " %s [12] ", nick);
        i += std::strlen(&msgtemp[i]);
    }
    else
    {
        std::sprintf(&msgtemp[i], " %s [1] ", nick);
        i += std::strlen(&msgtemp[i]);
    }
}

if (i>0)
    message_send_text(c, message_type_info, c, msgtemp);

return 0;

}

Greetings and thanks for your time

/summon <player>

static int _handle_summon_command(t_connection * c, char const *text)
{
    t_channel * channel;
    t_connection *  user;

    std::vector<std::string> args = split_command(text, 1);

    if (args[1].empty())
    {
        describe_command(c, args[0].c_str());
        return 0;
    }
    text = args[1].c_str(); // player to be summoned

    if (!accountlist_find_account(text))
    {
        message_send_text(c, message_type_error, c, localize(c, "Account {} does not exist.", text));
        return 0;
    }

    if (user = connlist_find_connection_by_accountname(text))
    {
        message_send_text(c, message_type_error, c, localize(c, "{} is not online.", text));
        return 0;
    }

    if (channel = conn_get_channel(user))
    {
        if (strcasecmp(channel_get_name(conn_get_channel(c)), channel_get_name(channel)) == 0)
        {
            message_send_text(c, message_type_info, c, localize(c, "{} is already in the same channel as you.", text));
            return 0;
        }

        conn_set_channel(user, channel_get_name(conn_get_channel(c)))

        if ((conn_get_clienttag(user) == CLIENTTAG_WARCRAFT3_UINT) || (conn_get_clienttag(user) == CLIENTTAG_WAR3XP_UINT))
            conn_update_w3_playerinfo(user);
        command_set_flags(user);

        message_send_text(c, message_type_info, c, localize(c, "{} has been summoned.", text));
    }
    else
    {
        message_send_text(c, message_type_error, c, localize(c, "{} is currently in a game.", text));
    }

    return 0;
}

Summons <player> to the same channel as you. This code is untested

Deprecate icons_STAR.bni?

We can keep icons.bni for all games except WC3 because WC3 will have icons_WAR3.bni which supports higher quality icons.

d2gs signal and command "/ clan"

Hello everyone! first above all excuse my English as I am using a translator because my native language is Spanish.

Well, I have two problems with PvPGN and D2GS.

First: When using the command "/clan" I have configured it to be 2 members declare an official clan has its own channel and the clan, that does not happen and the official channel Clan is never created.

Second: If the signal d2gs d2cs falls with no auto reconnects the same as it should be and you have to manually put a restart signal, in other versions is the opt. that if the signal is lost is fixed automatically.

Very good project! Greetings!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.