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

Improve sector module #509

Open
netfusion opened this issue Feb 19, 2017 · 1 comment
Open

Improve sector module #509

netfusion opened this issue Feb 19, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@netfusion
Copy link
Contributor

Trigger an event on the server to signal the init is done instead of using publicVariable QGVAR(ServerInitDone);

This removes the requirements for client to wait for the variable to change. Instead they can use an event handler.

@netfusion
Copy link
Contributor Author

netfusion commented Feb 19, 2017

Another option/improvement would be to trigger an event every time a sector is created (similar to entityCreated). Provide the created sector as an argument.
Other code could use the sector immediately instead of waiting for all sectors to be created. This could be especially useful if only specific sectors are needed for a task.

This could even be a replacement for the requested serverInitDone-event (see comment above) if all procedures working on sectors are refactored to work on a single sector instead of all at once.

Refactoring example:

[_fncDrawAllSectors, {
    !isNil QGVAR(ServerInitDone) && {GVAR(ServerInitDone)}
}, []] call CFUNC(waitUntil);

becomes

["sectorCreated", {
    params ["_sector"];
    _sector call FUNC(drawSector);
}] call CFUNC(addEventHandler);

@netfusion netfusion added this to the Next Milestone milestone Feb 19, 2017
@Hoegnison Hoegnison modified the milestones: Next Milestone, 0.18, Backlog Feb 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants