[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
hldj.org • View topic - Creating your own HLDJ commands
Page 1 of 1

Creating your own HLDJ commands

PostPosted: Wed Nov 24, 2010 9:12 pm
by Renegade

Re: Creating your own HLDJ commands

PostPosted: Sun Nov 28, 2010 5:19 pm
by jxl180
So, our commands must be hard-coded into the hldj files? We cannot just call upon the functions in our own programs?

Re: Creating your own HLDJ commands

PostPosted: Mon Nov 29, 2010 7:56 pm
by Renegade
At this point it's the easiest way, but I can add hooks to call custom handlers that you pass in. Let me know if this would be easier for you.

Re: Creating your own HLDJ commands

PostPosted: Mon Nov 29, 2010 9:02 pm
by jxl180
Don't go by me because I won't be attempting to make any modifications anytime soon (busy with uni. work); however, I think hooks will make it a lot easier because mods can be distributed without having to redistribute hldj files. Also, what if a user wants to apply multiple mods to hldj that they did not create? Also, if hooks are used in this fashion, HLDJ can be used as an engine, as well.

Re: Creating your own HLDJ commands

PostPosted: Tue Nov 30, 2010 9:06 am
by Renegade
Yep, it's been in the for a while; a full engine (probably a rewrite too) would be ideal, in the meantime I can make smaller modifications, but I'm trying to gauge the time spent based on interest/use.

Re: Creating your own HLDJ commands

PostPosted: Tue Dec 21, 2010 9:21 pm
by jxl180
How do I ensure the message (assuming HLDJM is HLDJ message) has a unique id? I mean I guess I can increment it (the next would be 0x08), but how can I ensure uniqueness? For example, if many people start adding 3rd party commands, how do we make sure there will be no conflicts? Just use a really random hex number (sort of like randomly assigning a port number and hoping for the best)?

Re: Creating your own HLDJ commands

PostPosted: Wed Dec 22, 2010 2:03 am
by Renegade
For now incrementing is ok (but give some room for HLDJ commands to grow). Ideally with a plugin system, it will query each plugin for a list of commands and handlers/callbacks. Let me know if you're actually starting to add your commands to HLDJ now, I'll bump the plugin system to the head of the TODO list.

Re: Creating your own HLDJ commands

PostPosted: Wed Dec 22, 2010 2:11 am
by jxl180
Yeah, I've been playing around with the api for a few hours and learning c from your code as I progress lol. I'm writing a command hldj_local <0/1>. If players in the server are annoyed by the sounds being broadcast, enabling this will turn HLDJ into a personal music player. Only the hldj user can hear the sound. hldj_local 0 (default) will enable broadcasting (now that I think of it, hldj_broadcast seems more appropriate).

I am having trouble finding out how to get the arguments (again, I'm very new to c). Would it be cmd, cmd[1], *p, or am I completely off?

Should I just do two seperate aliases: hldj_broadcast_on and hldj_broadcast_off to toggle it?

Re: Creating your own HLDJ commands

PostPosted: Wed Dec 22, 2010 2:56 am
by Renegade

Re: Creating your own HLDJ commands

PostPosted: Wed Dec 22, 2010 3:05 am
by jxl180
My plan was to use the play command; however it will play what ever is currently loaded (by executing "play '..\..\voice_input.wav" I intend to do this in HLDJ for practice and so that the same bind key can be used to play songs.

EDIT: Also, It will allow the user to still use the microphone (unless maybe hldj_muteall/hldj_unmuteall is called, or something similar).

Re: Creating your own HLDJ commands

PostPosted: Wed Dec 22, 2010 11:26 pm
by Renegade