Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Request) IW7-Mod Support #355

Open
BoTwiii opened this issue Dec 30, 2024 · 2 comments
Open

(Request) IW7-Mod Support #355

BoTwiii opened this issue Dec 30, 2024 · 2 comments

Comments

@BoTwiii
Copy link

BoTwiii commented Dec 30, 2024

Hi there i have been trying to implement iw4madmin on iw7-mod client which isnt officially been released or supported that much i was trying to implement it for fun and probablly alot of people would love to have IW4M-Admin on thier server i have been able to connect it to my server but alot of functionality is broken need fixing the pluigin parses most likely i dont have alot knowledge in this area so if someone wants to do it it would be great !
Screenshot 2024-12-30 230500

@BoTwiii
Copy link
Author

BoTwiii commented Jan 1, 2025

(Update) i did a plugin for iw7-mod but had to add additonal commands on the current build to make iw4madmin to work as intented but the webfront is broken may be due to game not supported yet i will share my plugin and what i had to edit on iw7-mod project

ParserIW7MOD.js

 
var rconParser;
var eventParser;

var plugin = {
    author: 'khf2',
    version: 0.2,
    name: 'IW7-Mod Parser',
    isParser: true,

    onEventAsync: function(gameEvent, server) {},

    onLoadAsync: function(manager) {
        rconParser = manager.GenerateDynamicRConParser(this.name);
        eventParser = manager.GenerateDynamicEventParser(this.name);

        rconParser.Configuration.CommandPrefixes.Kick = 'kickClient {0} "{1}"';
        rconParser.Configuration.CommandPrefixes.Ban = 'kickClient {0} "{1}"';
        rconParser.Configuration.CommandPrefixes.TempBan = 'kickClient {0} "{1}"';
        rconParser.Configuration.CommandPrefixes.Tell = 'tellraw {0} "{1}"';
        rconParser.Configuration.CommandPrefixes.Say = 'sayraw "{0}"';
        rconParser.Configuration.CommandPrefixes.RConResponse = '\xff\xff\xff\xffprint';
        rconParser.Configuration.CommandPrefixes.RConGetStatus = '\xff\xff\xff\xffstatus';   
        rconParser.Configuration.Dvar.Pattern = '^ *\\"(.+)\\" is: \\"(.+)?\\" default: \\"(.+)?\\"';
        rconParser.Configuration.Status.Pattern = '^ *([0-9]+) +-?([0-9]+) +(Yes|No) +((?:[A-Z]+|[0-9]+)) +((?:[a-z]|[0-9]){8,32}|(?:[a-z]|[0-9]){8,32}|bot[0-9]+|(?:[0-9]+)) *(.{0,32}) +(\\d+\\.\\d+\\.\\d+.\\d+\\:-*\\d{1,5}|0+.0+:-*\\d{1,5}|loopback|unknown|bot) +(-*[0-9]+) *$';
        rconParser.Configuration.StatusHeader.Pattern = 'num +score +bot +ping +guid +name +address +qport *';
        rconParser.Configuration.Status.AddMapping(102, 4);
        rconParser.Configuration.Status.AddMapping(103, 5);
        rconParser.Configuration.Status.AddMapping(104, 6);
        rconParser.Configuration.WaitForResponse = false;
        rconParser.Configuration.DefaultRConPort = 27016;

        eventParser.Configuration.GameDirectory = '';
        eventParser.Configuration.LocalizeText = '\x1f';

        rconParser.Version = 'IW7 13a06c1-dirty build Dec 26 2024 15:36:23 win64';
        rconParser.GameName = 14; //IW7
        eventParser.Version = 'IW7 13a06c1-dirty build Dec 26 2024 15:36:23 win64';
        eventParser.GameName = 14; // IW7
    },

    onUnloadAsync: function() {},

    onTickAsync: function(server) {},
};

And the file that i added the commands in the iw7-mod client is

Party.cpp

			//////////////////////////////////////////////////////////////////////////////////////////

			command::add("sayraw", [](const command::params& params)
				{
					if (params.size() < 2)
					{
						return;
					}

					const auto message = params.join(1);

					game::SV_GameSendServerCommand(-1, game::SV_CMD_CAN_IGNORE,
						utils::string::va("%c \"%s\"", 84, message.data()));
					console::info("%s\n", message.data());
				});



			command::add("tellraw", [](const command::params& params)
				{
					if (params.size() < 3)
					{
						return;
					}

					const auto client_num = atoi(params.get(1));
					const auto message = params.join(2);

					game::SV_GameSendServerCommand(client_num, game::SV_CMD_CAN_IGNORE,
						utils::string::va("%c \"%s\"", 84, message.data()));
					console::info("%i: %s\n", client_num, message.data());
				});




			//////////////////////////////////////////////////////////////////////////////////////////

@BoTwiii
Copy link
Author

BoTwiii commented Jan 1, 2025

but still needs improvements idk if iw7-mod developers gonna continue on the project hopefully they do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant