Coder Social home page Coder Social logo

jxsl13 / zcatch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from teelevision/zcatch

13.0 2.0 5.0 98.24 MB

zCatch is a server modification for the retro multiplayer shooter Teeworlds. It is a last man standing instagib gamemode.

Home Page: https://zcat.ch

License: Other

Lua 1.17% Python 5.64% Batchfile 0.01% C 13.76% C++ 76.43% Shell 0.01% Objective-C 0.45% CMake 2.44% Objective-C++ 0.09%
teeworlds teeworlds-server teeworlds-mod cpp

zcatch's Introduction

Teeworlds zCatch Build

Description

zCatch is a game server modification for the retro-multiplayergame Teeworlds. It is written for Teeworlds 0.7. If you hit someone, the player is caught and will be spectating you, until you die or win the round. The last player standing will win the game and might earn some score points in the rankings.

Introduced new server commands

Command default min max Description
sv_weapon_mode 3 0 6 0: Hammer 1: Gun 2: Shotgun 3: Grenade Launcher 4: Laser Rifle 5: Ninja 6: Everything
sv_db_type "" ""(no ranking), "redis" or "sqlite"
sv_db_sqlite_file "ranking.db" Relative path to the sqlite3 database file.
sv_warmup_autostart 1 0 1 Whether warmup should automatically start if there are not enough players to end a round.

More commands can be found in the example configuration file in the wiki.

Downloads

Currently there are two build variants: One is a stable long term release which can be found here: Releases
The second variant are nightly builds that can be found here: Nightlies
For a nightly build you search for the top most operating system that you are looking for with a successful build. Click on it and look for the Artifacts dropdown menu(top right). Click there and download the latest version.

Contributors

bleeding - giant thanks for fixing the Windows build!

Teeworlds

Teeworlds is a free online multiplayer game, available for all major operating systems. Battle with up to 16 players in a variety of game modes, including Team Deathmatch and Capture The Flag. You can even design your own maps!

License

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. See license.txt for full license text including copyright information.

Please visit https://www.teeworlds.com/ for up-to-date information about the game, including new versions, custom maps and much more.

Originally written by Magnus Auvinen.

This modification has been created by jxsl13.
Please provide the apropriate credits if you want to modify this source code.

Building on Linux or macOS

Requirements:

gcc >= 8.10 (supporting C++17) / macOS usually ships with the latest clang version.  

It might also be necessary to add these two lines to your .bashrc/.zshrc etc.

export PATH=/usr/local/gcc-8.10/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/gcc-8.10/lib64:$LD_LIBRARY_PATH

Installing dependencies

# Debian/Ubuntu
sudo apt install build-essential cmake git libfreetype6-dev libsdl2-dev libpnglite-dev libwavpack-dev python3

# Fedora
sudo dnf install @development-tools cmake gcc-c++ git freetype-devel mesa-libGLU-devel pnglite-devel python3 SDL2-devel wavpack-devel

# Arch Linux (doesn't have pnglite in its repositories)
sudo pacman -S --needed base-devel cmake freetype2 git glu python sdl2 wavpack

# macOS
brew install cmake freetype sdl2

Downloading repository

git clone https://github.com/jxsl13/zcatch.git
cd zcatch

# Checkout the 0.7.x branch with:
git checkout zCatch-0.7.x

# In order to download all external libraries, execute:
git submodule update --init --recursive

Building

mkdir -p build
cd build
cmake ..
make -j4 zcatch_srv

# depending on the number of CPU cores your computer has
# you can change the -j4 to -j<cpu cores> 

If your latest GCC version has been installed in a non-default path, 
you can set take that into account by using instead of "cmake .."
something like "cmake .. -DCMAKE_CXX_COMPILER=g++-8.10 -DCMAKE_CC_COMPILER=gcc-8.10"

On subsequent builds, you only have to repeat the make step.

You can then run the client with ./teeworlds and the server with ./zcatch_srv.

Build options

The following options can be passed to the cmake .. command line (between the cmake and ..) in the "Building" step above.

-GNinja: Use the Ninja build system instead of Make. This automatically parallizes the build and is generally faster. (Needs sudo apt install ninja-build on Debian, sudo dnf install ninja-build on Fedora, and sudo pacman -S --needed ninja on Arch Linux.)

-DDEV=ON: Enable debug mode and disable some release mechanics. This leads to faster builds.

-DCLIENT=OFF: Disable generation of the client target. Can be useful on headless servers which don't have graphics libraries like SDL2 installed.

Building on Windows with Visual Studio

Download and install some version of Microsoft Visual Studio (as of writing, MSVS Community 2017) with the following components:

  • Desktop development with C++ (on the main page)
  • Python development (on the main page)
  • Git for Windows (in Individual Components → Code tools)

Run Visual Studio. Open the Team Explorer (View → Team Explorer, Ctrl+^, Ctrl+M). Click Clone (in the Team Explorer, Connect → Local Git Repositories). Enter https://github.com/teeworlds/teeworlds into the first input box. Wait for the download to complete (terminals might pop up).

Wait until the CMake configuration is done (watch the Output windows at the bottom).

Select teeworlds.exe in the Select Startup Item… combobox next to the green arrow. Wait for the compilation to finish.

For subsequent builds you only have to click the button with the green arrow again.

Building on Windows with MinGW

Download and install MinGW with at least the following components:

  • mingw-developer-toolkit-bin
  • mingw32-base-bin
  • mingw32-gcc-g++-bin
  • msys-base-bin

Also install Git (for downloading the source code), Python and CMake.

Open CMake ("CMake (cmake-gui)" in the start menu). Click "Browse Source" (first line) and select the directory with the Teeworlds source code. Next, click "Browse Build" and create a subdirectory for the build (e.g. called "build"). Then click "Configure". Select "MinGW Makefiles" as the generator and click "Finish". Wait a bit (until the progress bar is full). Then click "Generate".

You can now build Teeworlds by executing mingw32-make in the build directory.

zcatch's People

Contributors

assassintee avatar axblk avatar chillerdragon avatar cinaera avatar datag avatar dune-jr avatar fokkonaut avatar fstd avatar fudgyking avatar heinrich5991 avatar joeldevahl avatar jxsl13 avatar larsfu avatar learath2 avatar lordsk avatar msiglreith avatar mydopefish avatar nheir avatar oy avatar phobos99 avatar rexim avatar robyt3 avatar serpis avatar shereef avatar sonix- avatar sushitee avatar swick avatar teetow avatar xalduin avatar zatline avatar

Stargazers

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

Watchers

 avatar  avatar

zcatch's Issues

Cooldown for mapvotes

When someone votes for a new map to play, a lot of the time people instantly reverse vote for the previous map. Then they vote for the new map again, it ends up in an endless loop and eventually people will try to kickvote other players. To avoid this, I suggest a mapvote cooldown of around 10 minutes for everybody after a mapvote succeeded.

add spam/spray definitions to /help

Spam := Shooting an excessive amount of grenades, often without properly aiming.
Spam := Chat spam - sending an excessive amount of chat messages, often the same message.

Spray := Shooting one or more grenades without seeing a player's position or predicting his position, often random shooting in order to hit someone that might luckily pass by. Forward facing boost fades are considered as spraying, if they hit a target without hitting the speeding player at the same time. Backwards facing boost nades are not considered as spraying.

create a generic message queue handler

locking push_back
either TryProcess with registered callbacks, not Processing the queue, if it's being filled
or tryProcess with a callback passed as function pointer.

The tryprocess is being used in the main tw thread.
the processed type should be generic.

add nick name banning

Allow for nicknames to be banned, read from file, written to file with remaining ban (time?)

Windows Build doesn't work

Sadly the windows build does not work, it seems to have some namespace conflicts with windows' own IStorage interface or something like that.

don't force respawn immediatly

basically you need to wait for 0.5 seconds after you dies before you can respawn.

Currently a play is directly respawned after they were released.
the forced respawn should be moved into a time frame of 3 to 60 seconds, in which the player can manually decide, when to spawn.
has this oeriod passed, the player is forcibly respawned.

ranking system modification

Nowadays ranking system of Simple zCatch shows the total score of each player depending on amount of tees that were killed each round. The most successful players have now a lot of points, but this summary of points means just itself without any sense.

In my opinion, the ranking could be much funnier if there were some levels, depending on score of random player. For example, there're could be military ranking bound with amount of points in way like:
0-10 points - recruit
11-20 points - corporal
...
>200 points - colonel
and so on.

This ranking model could motivate players to play better and enhance their gamer skills.

Of course this model of ranking isn't the only solution for improving the existing ranking system, but it has to be modified to became more challenging and joyful.

bug regarding being caught by an (invalid) player ID causing a crash on leaving


    frame #1: 0x00005555555a26c8 zcatch_srv`std::vector<int, std::allocator<int> >::end(this=0x0000000000000270) + 50 at stl_vector.h:567
    frame #2: 0x00005555555a163a zcatch_srv`CPlayer::RemoveFromCaughtPlayers(this=0x0000000000000000, ID=0, reason=5) + 88 at player.cpp:764
    frame #3: 0x00005555555a1779 zcatch_srv`CPlayer::BeSetFree(this=0x0000555555808040, reason=5) + 95 at player.cpp:788
    frame #4: 0x000055555559d07e zcatch_srv`CGameControllerZCATCH::OnPlayerDisconnect(this=0x0000555555a19d30, pPlayer=0x0000555555808040) + 114 at zcatch.cpp:270
    frame #5: 0x000055555558fadd zcatch_srv`CGameContext::OnClientDrop(this=0x000055555587ceb0, ClientID=0, pReason="") + 113 at gamecontext.cpp:724
    frame #6: 0x000055555557d9db zcatch_srv`CServer::DelClientCallback(ClientID=0, pReason="", pUser=0x00007ffff61d3010) + 353 at server.cpp:698
    frame #7: 0x00005555555c9302 zcatch_srv`CNetServer::Drop(this=0x00007ffff68da6e8, ClientID=0, pReason="") + 68 at network_server.cpp:68
    frame #8: 0x00005555555c94d9 zcatch_srv`CNetServer::Update(this=0x00007ffff68da6e8) + 421 at network_server.cpp:89
    frame #9: 0x00005555555802c4 zcatch_srv`CServer::PumpNetwork(this=0x00007ffff61d3010) + 54 at server.cpp:1182
    frame #10: 0x000055555558146d zcatch_srv`CServer::Run(this=0x00007ffff61d3010) + 2659 at server.cpp:1440
    frame #11: 0x000055555558310f zcatch_srv`main(argc=1, argv=0x00007fffffffe1f8) + 1173 at server.cpp:1874
    frame #12: 0x00007ffff6b7e2e1 libc.so.6`__libc_start_main + 241
    frame #13: 0x000055555557a7aa zcatch_srv`_start + 42

Joining issue on too many players

People sometimes can't join when the server was full and now space is avaible!
Happened to me, you have to rejoin to join the game.

People who join spec automatically when the server is full DON'T ADD to the top players caught people, making it possible to rejoin even when you are caught and thus you have to rekill players.

These are two bugs <.<

make laser only visible for spectating admins

in order to prevent admins from cheating themselves, it'd be best to only allow spectating admins to be able to see other player's cursor position, as it may occur that you can see enemies pretty well before they do.

crash bug

* thread #1, name = 'zcatch_srv', stop reason = signal SIGSEGV
  * frame #0: 0x000056249f9b7da4 zcatch_srv`CProjectile::Tick(this=0x00005624a0c9df00) at projectile.cpp:74
    frame #1: 0x000056249fa119a2 zcatch_srv`std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (CRedisRankingServer::*)(), CRedisRankingServer*> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (CRedisRankingServer::*)(), CRedisRankingServer*> >, void> >, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(this=0x897d0d6381826100, __ti=0x00003a9800013880) at shared_ptr_base.h:549
    frame #2: 0x000056249f9bc842 zcatch_srv`CGameContext::SwapTeams(this=0x0000000000000000) at gamecontext.cpp:524
    frame #3: 0x000056249f9ac405 zcatch_srv`CServer::Run(this=0x00007f16173f5010) at server.cpp:1498
    frame #4: 0x000056249f9ae293 zcatch_srv`main(argc=3, argv=0x00007ffe73f81f88) at server.cpp:1959
    frame #5: 0x00007f1617da1b97 libc.so.6`__libc_start_main + 231
    frame #6: 0x000056249f9a53aa zcatch_srv`_start + 42
  thread #2, stop reason = signal 0
    frame #0: 0x00007f1617e649d0 libc.so.6`nanosleep + 64
    frame #1: 0x00007f1617e97877 libc.so.6`usleep + 87
    frame #2: 0x000056249fa5a7c0 zcatch_srv`sha_done(md=0x000056249fa5a7c0, out=0x0000000000000000) at hash_libtomcrypt.c:174
    frame #3: 0x000056249fa45272 zcatch_srv`::BubbleSort(ppList=0x00005624a0a82a00, Size=32534) at huffman.cpp:45
    frame #4: 0x000056249fa5a69d zcatch_srv`sha_process(md=0x00005624a0a83260, src=0x0000000000000000, inlen=22052) at hash_libtomcrypt.c:138
    frame #5: 0x00007f16185166db libpthread.so.0`start_thread + 219
    frame #6: 0x00007f1617ea188f libc.so.6`clone + 63

Concept for a Voteserver/ encapsulated personal vote option handler.

std::vector<std::pair<int, Msg>> - receiving id; List of messages, that represent the votelist updates
alternatively std::vector<std::pair<int, std::vector>>

might need to test performance

Basically we have the default vote list, that can be manipulated by the admin and below or above that we want to have the personalized vote options.

We need to have some container to save each player's personal votes. Might use a map [string] : <string,string> where the first mapped string is the vote description and the second the command, that is associated with the description.

(Normal votes are to be checked first and then the invoked vote description is to be matched against the mapped description.)

Vote updates should be able to directly modify the stecific vote command.

std::map<std::string, std::pairstd::string,std::string>[64]
<Identifying keyword, <description, command>
Each map needs to have a reset mechanism, when a player leaves and an initializer when je joins.

remove catching system from player.h/cpp

Removing the catching stuff from the player into one central hot array within the zcatch.h/cpp might improve performance(L1/2 cache) and might make the catching system less complex.
(Might be more complex than just an array, tho)

release the latest version as a new tagged release bedore changing the catching system.

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.