Coder Social home page Coder Social logo

mvdevs / jk2mv Goto Github PK

View Code? Open in Web Editor NEW
105.0 105.0 34.0 15.4 MB

JK2MV - improved, modernized JK2 client and server

Home Page: https://jk2mv.org

License: GNU General Public License v2.0

SourcePawn 0.15% Shell 0.03% C++ 37.00% C 61.94% CMake 0.74% Objective-C 0.07% Assembly 0.03% Batchfile 0.04%
jedi-outcast jk2 linux linux-game macos star-wars windows

jk2mv's Issues

Add unique ID to mv.sp

Leaving it without one makes it default to 0. This confuses noob modders like myself who register their own strip files without ID and they overwrite each other in stri.cpp:SP_ListByID.

I'd suggest setting it to something other than 0, as this may break some legacy mods who got it wrong too.

external url support for http downloads

so servers can use a seperate webserver to provide http downloads rather then the builtin one.
Some admins can't open up another port or are not allowed by their provider.
Also, multiple servers could use one single source.

Minimizer crash

Some people report their game crashes when minimizing it or shortly after.

Improve bots filter check

I suggest to change this:

if (ping == 0) {

because local players also can have ping 0, the current "ping == 0" filter is interpreting real players with ping 0 as bots in the server list, i suggest to change it for something like the remoteAddress.type == NA_BOT, so u need to parse a client info for that i think... or checking if the client has the "skill" field in his info (that is only from bots) but i think is unsafe. idk what is better 😋

detect macosx steam version automatically

jk2mv automatically detects the appstore version of jk2 and loads the assets file from within the package. This should also be the case for the steam version (which seems to be the same in a different directory)

Clang/GCC warnings

Here is a list of remaining Clang/GCC warnings that need resolution. They mostly indicate minor bugs that may, or may not float up in the runtime. Please don't just silence them unless you're 100% sure they don't indicate a real bug.

  • /home/witold/src/jk2mv/src/server/sv_client.cpp:1257:18: warning: illegal character encoding in string literal [-Winvalid-source-encoding] (VALIDNAMECHARS constant)
    Apparently Clang supports only UTF-8 encoding in source files and extended ASCII is not valid UTF-8 Someone should figure out what characters are valid again and write them either as a range or numbers. I failed to reproduce original exploit.
  • /home/witold/src/jk2mv/src/ghoul2/G2_bones.cpp:216:11: warning: enumeration value 'ORIGIN' not handled in switch [-Wswitch] switch (up) etc.
    Indeed it's not handled and it theoretically can happen as up, forward etc. can come from modules. What should we do when it's ORIGIN?
  • /home/witold/src/jk2mv/src/qcommon/RoffSystem.cpp:953:6: warning: variable 'originTrajectory' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (roff_ent->mIsClient) etc.
    When DEDICATED is enabled these don't get initialized. This indicates that larger parts of code in RoffSystem.cpp should be disabled in dedicated server build.
  • /home/witold/src/jk2mv/src/qcommon/strip.cpp: In function ‘void SP_Unload(unsigned char)’: /home/witold/src/jk2mv/src/qcommon/strip.cpp:1587:16: warning: deleting object of polymorphic class type ‘cStringPackageSingle’ which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor] delete (*i).second;
    Indeed.
  • /home/witold/src/jk2mv/src/client/FxScheduler.cpp: In member function ‘void CFxScheduler::PlayEffect(int, CFxBoltInterface*)’: /home/witold/src/jk2mv/src/client/FxScheduler.cpp:1245:19: warning: the address of ‘origin’ will always evaluate as ‘true’ [-Waddress] if ( origin )
    Origin is a variable and it doesn't get initialized. This is a major bug in PlayEffect(int, CFxBoltInterface*), it's only referenced by CG_FX_PLAY_BOLTED_EFFECT_ID syscall and fortunatelly it's not used by original cgame, although someone tried in cg_players.c:
    //FIXME: Due to the horrible inefficiency involved in the current effect bolt process an effect with as many particles as this won't
    //work too happily. It also doesn't look a lot better due to the lag between origin updates with the effect bolt. If those issues
    //are ever resolved it should be switched over to BoltedEffect.
    //trap_FX_PlayBoltedEffectID(trap_FX_RegisterEffect("force/confusion.efx"), &fxObj);
  • /home/witold/src/jk2mv/src/client/cl_main.cpp: In function ‘void CL_ServerStatusResponse(netadr_t, msg_t*)’: /home/witold/src/jk2mv/src/client/cl_main.cpp:3445:10: warning: enumeration value ‘PROTOCOL_UNDEF’ not handled in switch [-Wswitch] switch (prot) /home/witold/src/jk2mv/src/client/cl_main.cpp:3472:11: warning: enumeration value ‘PROTOCOL_UNDEF’ not handled in switch [-Wswitch] switch ( prot )
  • /home/witold/src/jk2mv/src/renderer/tr_shade_calc.cpp: In function ‘void RB_CalcFogTexCoords(float*)’: /home/witold/src/jk2mv/src/renderer/tr_shade_calc.cpp:879:14: warning: ‘fogDepthVector[0]’ may be used uninitialized in this function [-Wmaybe-uninitialized] t = DotProduct( v, fogDepthVector ) + fogDepthVector[3];
    It is unitialized when fog->hasSurface == qfalse. Perhaps fixing this can make a572eed obsolete. Added assertion in f5fe524. Let me know if you catch it.
  • /jk2mv/src/sys/con_tty.cpp:126:31: warning: ignoring return value of 'ssize_t write(int, const void*, size_t)', declared with attribute warn_unused_result [-Wunused-result] write(STDOUT_FILENO, &key, 1);

Sane homePath on linux

Setting default "homePath" to $HOME/jk2mv is wrong. It should be classic $HOME/.jkii or $HOME/.jk2mv. I'd use first one, as there is no "official" jk2 client for linux and resource files are all compatible afaik.
Modern approach would be using XDG specs but it's not worth it in this case.

Serverlist not updating correctly

I'm not 100% sure about this one, but sometimes when I update the serverlist some servers aren't shown at all. I know that these servers reporting to all the master servers of ouned, jk2master.ravensoft and jkhub.
When I add these servers to the favourites list, they aren't updated correctly and cannot be joined although they work perfectly fine with original JK2.

For example the server: 46.38.237.114:28070 "-BT3-". (1.02, it runs NT mod)

Client being able to permanently decline specific files

We should add an option for the client to permanently decline the download of specific files, so they're not asked to download the same file every time they join a server offering the file they don't want. Some kind of clientside "blacklist".

Plenty of exploits and fixes missing from OpenJK/ioquake3

When I have time to crawl through more, I can start showing which things exactly.

  • Challenge spoofing from servers to redirect clients to proxy servers
  • Client side download code workaround for larger downloads
  • Cheat cvars aren't protected as well as in OpenJK and ioquake3 (on client connect)
  • sv_cheats can just be initialized to 1 in the engine and reset to 1 upon server disconnect on the client as well. This allows clients to use cheat cvars during demo playback instead of the current workaround.
  • Is there any particular reason why systeminfo cvars aren't protected better on the client like this? - https://github.com/JACoders/OpenJK/blob/master/codemp/client/cl_parse.cpp#L467-L489
  • Not all cases of dir traversal appear fixed
  • LACKING BUFFER SAFETY EVERYWHERE with vsprintf/sprintf instead of Q_vsnprintf/Com_sprintf can't fix broken mods still using it either and non-use of "%s" before printing strings in several areas.
  • Servers can send download packets to clients who don't even request
  • Rcon code doesn't work with quotes and spaces properly on client or server
  • Rcon code is not buffer safe on client
  • Anyone can send print packets to clients
  • Missing fix for hosting listen server with non-4:3 res causing crash

Create autocompletion API for modules

Ability to autocomplete command arguments, eg. callvote or tell would be particularly useful (latter could probably go straight to JK2MV). Should we allow mods to override autocompletion functions defined by JK2MV?

I hope I can make it before next release, but I wouldn't make it a milestione as there are enough changes by now.

change the name for "mv_nameShadow"

I think this cvar need to be changed to something like "mv_coloredShadow", because the "nick name" is not the only thing affected by an colored shadow, all of strings texts marked as ITEM_TEXTSTYLE_SHADOWED can have a "colored shadow"... anyways, is an suggestion 😄

Widescreen/Eyefinity Support

We've talked a bit about this in the forums, but i want to leave here too.

Basically this fix is for the 2D render (not the 3D), actually the current code just stretch all 2D from 640x480. Both games has this problem (jk2 and jk3),i discussed this with some guys attemped to fix this... huds are easy to fix (editing all cgs.widthRatioCoef), but there are some texts or fonts which would require modified renderer... same with the jk2 menus i think.

Current: http://i.imgur.com/OraXC70.jpg?1
Fixed: http://i.imgur.com/ju9LqD9.jpg?1
Changes: http://i.imgur.com/t0CNBdA.jpg?1

Demo playback broken on unix

A demo recorded in a 1.02 server with JK2MV(b3) cannot be played. With original JK2 the demo recored with JK2MV works fine and can be played. The name of the demo reads "demo01.dm_15". The error message reads: "Error: Couldn't open demos/DEMO01.DM_15".

mv_fixbrokenmodels shouldn't affect team games

Because the "broken" models can only be triggered in non-team games (skins are forced to either blue or red in team games on the clientside).
The problem is that if you enter "team_model morgan" in a team game when mv_fixbrokenmodels is enabled, you get kyle skin. There are some people like me who use the team_model command and rather not have to write "morgan/red" instead of morgan. Huge issue, I know. 😸

I suggest changing

if (mv_fixbrokenmodels->integer) {

to

if (mv_fixbrokenmodels->integer && g_gametype->integer < GT_TEAM) {

No continuous sound during Absorb, Protect, Rage and Speed

Steps to Reproduce

  • Start any version
  • Apply any skill rank of the force powers in question
  • Activate any of the corresponding force powers

Actual Results

  • Initial sound for triggering the force plays properly
  • After activation of the force power there no sound cue despite the force still being activated

Expected Results

  • Continuous sound during the entire duration of the force

Protect, Rage and Speed can be perceived visually but Absorb is only visible upon affection of a force and thus it is important for it be audible.

unknown UI script

unknown UI script interface
unknown UI script button1
unknown UI script wav

It happens when you go into Setup > More Video > Show driver info

Documentation

  • reflists
  • API
  • clientside cvars
  • external http downloads
  • dynamic glow shaders
  • MVAPI_LOCATE_GAME_DATA
  • ui_menulevel
  • ingame_setup_modoptions
  • ent's recording options (all cmds and cvars are documented already)
  • MVF_NOSPEC, MVF_SPECONLY
  • MVAPI_DISABLE_STRUCT_CONVERSION

Can't input colorcodes on unix

Typing e.g. ^2 to create a green text doesn't work on unix platforms, it creates what it actually should "²"

This needs a workaround.

Updated menus

Menu patchfiles should be updated to show the client cvars in the menu.

  • download popup
  • download blacklist file removal list
  • cvars (?)
  • recording options (for easy access of @entdark's work)
  • move dynamic glow setting to graphic settings in ingame menu

[regression] Ctrl-v doesn't work anymore

Commit 8084729 introduced a regression, ctrl-v and few other shortcuts in Field_CharEvent don't work anymore. On the other hand, Issue #7 it was supposed to fix doesn't happen when I remove converting chars to uppercase code on current HEAD (can't simply revert because it was overwritten).

Tbh I can't see where is there a requirement for upper-case characters in ui code or why it would work on windows.

Few suggestions

  • sv_minRate cvar (default 1000 or whatever is the hardcoded limit by default), can be set to for example 10000 so new players won't get a bad experience because they play with 20 snaps and 4000 rate (similarly, sv_minSnaps could be an idea for a new cvar. As could sv_maxSnaps, and it would be interesting to see how game feeling would change if snaps higher than 30 were allowed. But maybe that's taking it too far. )
  • Tab completion for demo names (/demo , and it will bring a list of demos)
  • this isn't strictly necessary, but I like the idea and I'm using it myself - tab completion for /model and /team_model commands
  • The "savannah" bug seems to happen once in a while. I noticed it happen when a guy with "..." name connected, on a server running mv 1.0rc2. The bug where people can't move / taunt for a short second when someone connects. I don't know exactly how this bug works, though.
  • Linux: sound from jk2 continues playing when game is minimized. This can be fixed by checking value of the cvar "com_minimized" before playing sound a given frame (in function S_Update in snd_dma.cpp).
  • Demo playback: when pressing any key, it brings up the ingame menu. While this is better than dropping to the main menu, it's still an annoyance. People should be free to press any key and have the game do the default action for that key. This is for allowing people to switch timescale during demo playback - e.g. bind j timescale 2, bind k timescale 0.5, etc.
    Having the ingame menu brought up when pressing ESC is sufficient.
    oh, and while we're at demo playback - I suggest removing cvar cheat protection during demo playback. In particular to allow for changing timescale value.

Error messages spamming console

Version: JK2MV b3 / 1.02
I noticed following error / warning messages spamming the console:

  • "Sys_QueEvent: overflow (event type 3)"

And when playing on specific servers (not every server):

  • "WARNING: refusing to create relative path ..."
  • "Couldn't write ..."

Raw Mouse Input

Every now and then people ask about raw mouse input and some players who got issues with their mouse on jk2mp, jamp, etc. say that they don't have issues on OpenJK when they use raw mouse input.

Maybe we should add support for raw mouse input, too?

OpenJK references:
JACoders/OpenJK#202
JACoders/OpenJK#215

Add console font before 1.2 release.

Code New Roman is ready and can be downloaded from there: https://jk2.info/viewtopic.php?f=34&p=4000#p4000

I'm haven't added it yet to avoid trashing repository in case somethings changes. I think this is a good practice. Maybe we should keep these binary files in a separate repo until release or keep them as git submodule? The problem is that git hasn't been made for binary blobs and each update permanently increases repository size without any delta compression.

API Level 1

  • connectionless packets processing / sending
  • ability to disable fixes and apply better ones inside the qvm
  • botfilter
  • get current game version
  • definitions in a single header

Multiversion QVMs

@Daggolin is working on Multiversion QVMs which will be part of the mvsdk he is working on.
JK2MV 1.2 will ship with bugfixed, improved but still mostly basejk versions of them.

jpeg errors cause the game to quit

The jpeg code currently calls "exit(EXIT_FAILURE)", when it encounters issues reading a file. This leads to the game quitting on some maps that used to load in jk2mp. Adding a custom error handler could solve the problem.

DynamicGlow is slow on MacOSX

On MacOSX FPS drops down to 20~30FPS when r_dynamicglow is enabled.
I guess that's because of some missing opengl extension, or we are using an extension which is software implemented on osx.

Command completion on pressing enter

For example, if you input
"cl_maxpa 100"
in the console and press ENTER, the command won't complete to cl_maxpackets even if it's the only thing it can complete to. It seems like it won't complete anything when an argument is supplied, which is contrary to basejk behavior.

So for the above to work as wanted, one must first write "cl_maxpa", press TAB so it completes to cl_maxpackets, and finally write the value. Is this intended? I remember seeing some bugs when I ported the ioquake3 command completion code to my own jk2 binary, but in the end I found some workarounds if you need inspiration.

Oh, and I suggest removing the green color for the completion stuff - looks bad in my opinion. Either go with white or make some special color for it like grey. Maybe it's just me 😄

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.