Bug #460

sqf coderay issues

Added by Spooner over 6 years ago. Updated about 5 years ago.

Status:Closed Start date:03/15/2009
Priority:Low Due date:
Assignee:- % Done:

0%

Category:Syntax Highlighting
Target version:-
Close Reason: NGUrl:
BIForumURL: WIKIurl:

Description

Current coderay is coderay-0.8.312, which works fine with my scanners/sqf.rb and the small change required to encoders/html.rb.

In updating RM, you seem to have rolled back to coderay-0.7.6.227 which does seem to splutter a bit (showing an old error which was fixed last time you updated to the latest coderay):

frog && fish > 5

becomes:

1 frog && fish > 5

History

Updated by kju over 6 years ago

good job tracking it down!

code tag seems to be a problem too at times.

Updated by Spooner over 6 years ago

Yes, there seems to be an occasional issue with the biki links too. Again, this is something that runs fine on the latest version locally so I'm hoping this will be resolved too by a quick update.

Updated by Sickboy over 6 years ago

I don't think we've used any other version from CodeRay at Redmine as of yet, though my memory might be playing tricks.
looking into 0.8

Updated by Sickboy over 6 years ago

Should be resolved! Removed Coderay 0.7 from the plugins, using system gem version now.

Updated by Sickboy over 6 years ago

  • Status changed from Assigned to Resolved

Updated by Spooner over 6 years ago

The issue isn't resolved in the initial post, even though you updated. I know we had this problem before and I thought that updating sorted it out. At least, I know my local ruby running the latest coderay gem +changes works fine, so I'm not at all sure why the server version is fubar.

Updated by kju over 6 years ago

  • Status changed from Resolved to Feedback

test

 1 _wp_array = _wp_array + [[_x1, _y1, (if (ari_type == "he") then {_height + random 50} else {_height})]];
 2 
 3 _wp_array = _wp_array + [[_x1, _y1, _height + random 10]];
 4 
 5 _wp_array = _wp_array + [[_x1, _y1, (if (ari_type == "he") then {_height + random 50} else {_height})]];
 6 
 7 if (((_i+1) % 4 == 0) && (_i > 1)) then {sleep 18 + (ceil random 5)} else {sleep 0.5 + random 1.5};
 8 
 9 if (_series < ari_salvos) then {};

Updated by Sickboy over 6 years ago

I have added the sqf.rb and updated the html.rb with the code as listed in sqf.rb
There was nothing else to do right?

Updated by Spooner over 6 years ago

That should be fine. Trying to get RM running locally to test properly, but having some teething problems ;)

There was a modification I made to the css, but that is not needed for RM (I removed text decoration for biki links, but RM already doesn't underline links).

Updated by Sickboy over 6 years ago

Spooner wrote:

That should be fine. Trying to get RM running locally to test properly, but having some teething problems ;)

There was a modification I made to the css, but that is not needed for RM (I removed text decoration for biki links, but RM already doesn't underline links).

Had a splitting head-ache yesterday. I would be honored to help you out today if you are :P

Updated by Squelch over 6 years ago

Updated by Sickboy about 6 years ago

SQF Highlighting works properly in repositories again. Incl biki links.
The problem seems to be solely with the wiki highlighting, probably because the text is formatted / encoded / parsed multiple times.
Hope this gets resolved with some future Redmine updates, otherwise I suppose we can find it ourselves :P

Updated by kju about 6 years ago

Hm still buggy for the example code in here as well as for the repository linked above?!

Updated by Sickboy about 6 years ago

test:
I just tried implementing it into W4, and no singleplayer problems except for missing square brackets when adding to _wp_array, and a slightly off 'reload salvo' message between salvos (which I think can be ignored).

Full script as follows, but doesn't have any post W4 stuff added yet.

  1 // by Xeno
  2 private ["_angle","_center_x","_center_y","_height","_i","_radius","_type","_wp_array","_x1","_xo","_y1","_number_shells","_helper_bomb","_pos","_pod","_arti_distance","_travel_time","_posf","_posb","_posl","_posr","_ang","_caller"];
  3 if (!isServer) exitWith {};
  4 
  5 #include "x_setup.sqf" 
  6 
  7 if (!ari_available) exitWith {};
  8 
  9 _height = 0;
 10 _type = "";
 11 _radius = 30;
 12 _number_shells = 1;
 13 
 14 ari_available = false;
 15 ["ari_available",ari_available] call XSendNetStartScriptClient;
 16 
 17 switch (ari_type) do {
 18     case "flare": {
 19 //        _number_shells = 4;
 20 //        _height = 250;
 21 //        _type = "F_40mm_White";
 22 //        _radius = 70;
 23         _number_shells = 36; //9 rounds of 4 guns
 24         _height = 350;
 25         _type = "F_40mm_White";
 26         _radius = 300;
 27         _caller = delta_1; //NOT VALID FOR DEFAULt DOMINATION
 28         _arix = getPos AriTarget select 0;
 29         _ariy = getPos AriTarget select 1;
 30         _ang = (_arix - (getPos _caller select 0)) atan2 (_ariy - (getPos _caller select 1));
 31         if(abs _ang != _ang) then {angle = _ang + 360};
 32         _posf = [_arix + _radius * sin(_ang), _ariy + _radius * cos(_ang)]; //in front range
 33         _posb = [_arix - _radius * sin(_ang), _ariy - _radius * cos(_ang)]; //behind range
 34         _posl = [_arix + _radius * sin(_ang-90), _ariy + _radius * cos(_ang-90)]; //left lateral
 35         _posr = [_arix + _radius * sin(_ang+90), _ariy + _radius * cos(_ang+90)]; //right lateral
 36     };
 37     case "he": {
 38         _number_shells = 6;
 39         _height = 150;
 40         _type = (if (d_enemy_side == "EAST") then {"Sh_125_HE"} else {"Sh_120_HE"});
 41     };
 42     case "smoke": {
 43 #ifndef __ACE__
 44         _number_shells = 10;
 45 #endif
 46 #ifdef __ACE__
 47         _number_shells = 3;
 48 #endif
 49         _height = 150;
 50         _type = "Smokeshell";
 51     };
 52     case "dpicm": {
 53         _number_shells = 40;
 54         _height = 150;
 55         _type = (if (d_enemy_side == "EAST") then {"G_30mm_HE"} else {"G_40mm_HE"});
 56         _radius = 100;
 57     };
 58 };
 59 
 60 sleep 12.25 + (random 7);
 61 
 62 //_center_x = (position AriTarget) select 0;
 63 //_center_y = (position AriTarget) select 1;
 64 if (ari_type != "flare") then {
 65     _center_x = getPos AriTarget select 0;
 66     _center_y = getPos AriTarget select 1;
 67 };
 68 
 69 #ifndef __TT__
 70 _arti_distance = FLAG_BASE distance (position AriTarget);
 71 #endif
 72 #ifdef __TT__
 73 _arti_distance = WFLAG_BASE distance (position AriTarget);
 74 #endif
 75 _travel_time = _arti_distance / 500;
 76 _first_run = true;
 77 
 78 for "_series" from 1 to ari_salvos do {
 79     _wp_array = [];
 80 //    _angle = floor random 360;
 81 //    _x1 = _center_x - ((random _radius) * sin _angle);
 82 //    _y1 = _center_y - ((random _radius) * cos _angle);
 83 //    _wp_array = _wp_array + [[_x1, _y1, (if (ari_type == "he") then {_height + random 50} else {_height})]];
 84 //    sleep 0.0153; // 0.2
 85     while {count _wp_array < _number_shells} do {
 86         if (ari_type == "flare") then {
 87             {
 88                 _x1 = (_x select 0) - 20 + random 40; //No need for circular randomness
 89                 _y1 = (_x select 1) - 20 + random 40;
 90                 _wp_array = _wp_array + [[_x1, _y1, _height + random 10]];
 91                 sleep 0.0153;
 92             } forEach [_posf, _posb, _posl, _posr];
 93         }
 94         else {
 95             _angle = floor random 360;
 96             _x1 = _center_x - ((random _radius) * sin _angle);
 97             _y1 = _center_y - ((random _radius) * cos _angle);
 98             _wp_array = _wp_array + [[_x1, _y1, (if (ari_type == "he") then {_height + random 50} else {_height})]];
 99             sleep 0.0153;
100         };
101     };
102 
103     if (!X_SPE) then {
104         ["ari1msg",format ["First Artillery salvo %1 on the way...",_series]] call XSendNetStartScriptClient;
105     } else {
106         format ["First Artillery salvo %1 on the way...",_series] call XfHQChat;
107     };
108 
109     sleep _travel_time;
110     if (!X_SPE) then {
111         ["ari1msg",format ["First Artillery Splashdown, Salvo %1",_series],0] call XSendNetStartScriptClient;
112     } else {
113         (format ["First Artillery Splashdown, Salvo %1",_series]) call XfHQChat;
114         if (player distance AriTarget < 1000) then {AriTarget say "Ari";};
115     };
116     switch (ari_type) do {
117 //        case "flare": {
118 //            for "_i" from 0 to (_number_shells - 1) do {
119 //                _type createVehicle (_wp_array select _i);
120 //                sleep 18 + (ceil random 5);
121 //            };
122 //        };
123         case "flare": {
124             sleep 1;
125             _strenght = 8; //Use this until we get flares with proper arty brightness. Maybe ACE can provide such flares for this use?
126             for "_i" from 0 to (_number_shells-1) do {
127                 for "_j" from 0 to (_strenght-1) do {
128                     _type createVehicle [(_wp_array select _i) select 0, (_wp_array select _i) select 1, ((_wp_array select _i) select 2)-_j/100];
129                     sleep 0.002;
130                 };
131                 if (((_i+1) % 4 == 0) && (_i > 1)) then {sleep 18 + (ceil random 5)} else {sleep 0.5 + random 1.5};
132             };
133         };
134         case "he": {
135             for "_i" from 0 to (_number_shells - 1) do {
136                 _type createVehicle (_wp_array select _i);
137                 sleep 0.923 + (random 2);
138             };
139         };
140         case "smoke": {
141             for "_i" from 0 to (_number_shells - 1) do {
142                 _shell = _type createVehicle (_wp_array select _i);
143                 #ifdef __ACE__
144                 [objNull,objNull,objNull,objNull,"SmokeShell",_shell] spawn ace_viewblock_fired;
145                 #endif
146                 #ifndef __ACE__
147                 if (d_found_DMSmokeGrenadeVB) then {
148                     [_shell] spawn X_DM_SMOKE_SHELL;
149                 };
150                 #endif
151                 _xo = ceil random 10;
152                 sleep 0.923 + (_xo / 10);
153             };
154         };
155         case "dpicm": {
156             _pos = [(position AriTarget) select 0, (position AriTarget) select 1, _height];
157             _pod = "Bomb" createVehicle _pos;
158             _pod setPos _pos;
159             _helper_bomb = "M_Ch29_AT" createVehicle _pos;
160             sleep 0.5;
161             deleteVehicle _helper_bomb;
162             for "_i" from 0 to (_number_shells - 1) do {
163                 _type createVehicle (_wp_array select _i);
164                 _xo = ceil random 10;
165                 sleep 0.223 + (_xo / 10);
166             };
167             sleep 2.132;
168             deleteVehicle _pod;
169         };
170     };
171     _wp_array = nil;
172 
173     if (_first_run) then {
174         _first_run = false;
175         ari_type spawn {
176             if (_this in ["flare","he"]) then {
177                 sleep 2.123;
178                 AriTarget execVM "x_scripts\x_arihit.sqf";
179             };
180         };
181     };
182 
183     if (_series < ari_salvos) then {
184         if (!X_SPE) then {
185             ["ari1msg","First Artillery reloading..."] call XSendNetStartScriptClient;
186         } else {
187             "First Artillery reloading..." call XfHQChat;
188         };
189         sleep d_arti_reload_time + random 7;
190     };
191 };
192 
193 sleep 2;
194 
195 if (!X_SPE) then {
196     ["ari1msg","First Artillery fire series ended"] call XSendNetStartScriptClient;
197 } else {
198     "First Artillery fire series ended" call XfHQChat;
199 };
200 
201 ari_salvos spawn {
202     private ["_ari_salvos"];
203     _ari_salvos = _this;
204     sleep (d_arti_available_time + ((_ari_salvos - 1) * 200)) + (random 60);
205     ari_available = true;
206     ["ari_available",ari_available] call XSendNetStartScriptClient;
207 };
208 
209 if (true) exitWith {};

Updated by Xeno about 6 years ago

while {count _wp_array < _number_shells} do {

if (((_i+1) % 4 == 0) && (_i > 1)) then {sleep 18 + (ceil random 5)} else {sleep 0.5 + random 1.5};

if (_series < ari_salvos) then {

if (player distance AriTarget < 1000) then {AriTarget say "Ari";};

_wp_array = _wp_array + //community.bistudio.com/wiki/random">random 10;

_wp_array = _wp_array + //community.bistudio.com/wiki/random">random 50} else {_height});

:(

You have to edit my post to see all the errors.

Updated by Sickboy about 6 years ago

test2

1 _wp_array = _wp_array + [[_x1, _y1, (if (ari_type == "he") then {_height + random 50} else {_height})]];
2 
3 _wp_array = _wp_array + [[_x1, _y1, _height + random 10]];
4 
5 _wp_array = _wp_array + [[_x1, _y1, (if (ari_type == "he") then {_height + random 50} else {_height})]];

Updated by Sickboy about 6 years ago

  • Assignee changed from Sickboy to Spooner

Still some issues as shown on the last post.

Updated by Spooner about 6 years ago

Crap, yeah, sorry. Not the slightest clue as to the cause of that one since it seems to completely depend on where the linked command is placed in the script as to whether it gets corrupted, but I'll take a look.

Updated by Spooner about 6 years ago

Unfortunately, what you are doing there with . to separate your code lines, is a real mess. This is why code tags required pre tags - there is a difference between a block of code and an in-line code snippet. I can't magically tell if you want the code tag as a block or inline (the scanner is only fed what is inside the tag and has to make a best guess of which type of layout is appropriate). If you just put a newline in, before the code end tag, then it will make it a proper indented block code. This is the only way to force a one-line code tag to become a block.

Yeah, another one that has me at a loss. I'll get on it when I have CBA sorted.

Updated by kju about 6 years ago

Fixed the post. Sorry!

Updated by kju about 5 years ago

  • Status changed from Feedback to Closed
  • Assignee deleted (Spooner)

Updated by kju about 5 years ago

  • Category set to Syntax Highlighting

Also available in: Atom PDF