Skip to content

Conversation

@Emistry
Copy link
Member

@Emistry Emistry commented Apr 14, 2019

Pull Request Prelude

Changes Proposed

  • deprecated *debugmes script command.
  • added *consolemes script command which display the console message based on type.
  • allow map-server console to auto logging into text file depend on type of message in the setting.

Currently, the st->rid and st->oid values, i keep it in both ShowWarning() and ShowError(). Should we still remain it in ShowDebug()? any advice?

Issues addressed:
debugmes has hardcoded string script debug .... seem unnecessary most of the time, and tend to ignored it.
Sometime we use debugmes to display info, which aren't really "debugging" just purely for information display, so its more appropriate to use other like ShowInfo, ShowStatus etc.

Preview :

Details
List of available <type> are:
	CONSOLEMES_DEBUG   = 0
	CONSOLEMES_ERROR   = 1
	CONSOLEMES_WARNING = 2
	CONSOLEMES_INFO    = 3
	CONSOLEMES_STATUS  = 4
	CONSOLEMES_NOTICE  = 5
prontera,155,181,5	script	sample	4_F_KAFRA1,{
	
	for (.@i = CONSOLEMES_DEBUG; .@i <= CONSOLEMES_NOTICE; .@i++)
		consolemes( .@i, "sample string message ("+strcharinfo(0)+")");
	end;
	
	OnInit:
		sleep 2000;
		for (.@i = CONSOLEMES_DEBUG; .@i <= CONSOLEMES_NOTICE; .@i++)
			consolemes( .@i, "sample string message (OnInit)");
		end;
}

pic

@Emistry Emistry added type:enhancement Issue describes an enhancement or feature that should be implemented component:core:scriptengine Affecting the script engine or the script commands component:documentation Affecting the documentation in the doc/ folder labels Apr 14, 2019
@HerculesWSAPI
Copy link
Contributor

This change is Reviewable

@bWolfie
Copy link
Contributor

bWolfie commented Apr 15, 2019

nice. will mean lots of updates for custom script is needed, but much better!

warp $QW_SP_WarpMap$, $QW_SP_WarpX, $QW_SP_WarpY;
close2;
debugmes "Please check your special warp menu settings on the Warpra.";
consolemes(CONSOLEMES_INFO, "Please check your special warp menu settings on the Warpra.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a warning too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

src/map/script.c Outdated
ShowDebug("consolemes: %s\n", StrBuf->Value(&buf));
break;
case CONSOLEMES_ERROR:
ShowError("consolemes: (st->rid:%d) (st->oid:%d) %s\n", st->rid, st->oid, StrBuf->Value(&buf));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please put a space after :, eg (st->oid: %d)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

src/map/script.c Outdated
ShowError("consolemes: (st->rid:%d) (st->oid:%d) %s\n", st->rid, st->oid, StrBuf->Value(&buf));
break;
case CONSOLEMES_WARNING:
ShowWarning("consolemes: (st->rid:%d) (st->oid:%d) %s\n", st->rid, st->oid, StrBuf->Value(&buf));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please put a space after :, eg (st->oid: %d)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@hemagx
Copy link
Contributor

hemagx commented Apr 28, 2019

Also please change your target branch to master, it's impossible to merge right now as it's target stable branch.

- deprecated `*debugmes` script command.
- added `*consolemes` script command which display the console message based on `type`.
- allow map-server console to auto logging into text file depend on type of message.
@Emistry Emistry force-pushed the scriptcommand_consolemes branch from 212c762 to 9f6ffd2 Compare April 28, 2019 16:45
@Emistry Emistry changed the base branch from stable to master April 28, 2019 16:45
@hemagx hemagx merged commit e7585e1 into HerculesWS:master Apr 29, 2019
@MishimaHaruna MishimaHaruna added this to the Release v2019.05.05 milestone May 6, 2019
@Emistry Emistry deleted the scriptcommand_consolemes branch June 1, 2019 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:core:scriptengine Affecting the script engine or the script commands component:documentation Affecting the documentation in the doc/ folder type:enhancement Issue describes an enhancement or feature that should be implemented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants