webMonitor upgrade

Other plugins for extending OpenKore's functionality. This forum is only for posting new plugins and commenting on existing plugins. For support, use the Support forum.

Moderator: Moderators

Message
Author
Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

webMonitor upgrade

#1 Post by Kaspy »

[EN]
Sorry my English, but the person who translated my messages traveled

I'm finishing a major upgrade of that plugin, missing just that: a hook for when the OpenKore load the character be executed and load the numeric value contained in the config-> webMonitorPort

I tried to do so, but failed.
The plugin did not even run.
[...]

Plugins::register('webMonitor', 'an HTTP interface to monitor bots', \&Unload);
my $hook = Plugins::addHook(
['AI_post', \&mainLoop],
['Network::serverConnect/char', \&onConnect, undef],,
);

sub onConnect{
my $port = $config{webMonitorPort};
my $bind = "localhost";


[...]

If you wanted to see how this, download here: https://www.dropbox.com/s/9anksqom8ygul ... itor.rar?m
Extract the plugins folder, leave the bot running and open the page localhost:1025

I'll make a topic here (and in the Brazilian forum) presenting the plugin and running it.


[PT-BR]
Estou terminando uma grande atualização desse plugin (https://openkore.svn.sourceforge.net/sv ... ebMonitor/), faltando apenas isso: um hook para quando o OpenKore carregar o personagem ser executado e carregar o valor numérico contido no config->webMonitorPort

Tentei fazer assim, mas não deu certo.
O plugin nem chegou a ser executado.
[...]

Plugins::register('webMonitor', 'an HTTP interface to monitor bots', \&Unload);
my $hook = Plugins::addHook(
['AI_post', \&mainLoop],
['Network::serverConnect/char', \&onConnect, undef],,
);

sub onConnect{
my $port = $config{webMonitorPort};
my $bind = "localhost";


[...]

Caso queria ver como esta, baixe daqui: https://www.dropbox.com/s/9anksqom8ygul ... itor.rar?m
Extraia na pasta plugins, deixe o bot funcionando e abra a página localhost:1025

Irei fazer um tópico aqui (e no fórum brasileiro) apresentando o plugin e o funcionando dele.
Image

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Hook for when the OpenKore load the character be executed

#2 Post by EternalHarvest »

That rar can't be extracted, how about zip/7z/tar?

What about using "initialized" hook if that's where you want to start it?

Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

Re: Hook for when the OpenKore load the character be executed

#3 Post by Kaspy »

[EN]
In zip format: https://www.dropbox.com/s/89bpk8zvypwk2 ... onitor.zip
Using this, the OpenKore can run normally, except that the plugin fails to run.
package webMonitorPlugin;

# webMonitor - an HTTP interface to monitor bots
# Copyright (C) 2006 kaliwanagan
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#############################################
# [PT-BR] Projeto recontinuado em 2012 por KeplerBR: http://openkore.com.br/index.php?/topic ... pid__19939
# Agradecimentos ao llbranco, ao Ghost, ao iMike e ao Swapmwalker
# Tradução de PT-BR para EN por Swapmwalker

use strict;
use Plugins;
use Settings;
use FindBin qw($RealBin);
use lib "$RealBin/plugins/webMonitor";
use webMonitorServer;
use chatLogWebMonitor;
use richLogWebMonitor;
use Globals;

###
# Initialize some variables as well as plugin hooks
#
my $hook = Plugins::addHook(
['AI_post', \&mainLoop],
['initialized', \&onConnect],
);

my $webserver;

sub onConnect {
my $port = $config{webMonitorPort};

my $bind = "localhost";
$webserver = new webMonitorServer($port, $bind);
}

sub Unload {
Plugins::delHook('AI_post', $hook);
}

###
# Main loop
#
sub mainLoop {
$webserver->iterate;
}

1;


[PT-BR]
Em formato zip: https://www.dropbox.com/s/89bpk8zvypwk2 ... onitor.zip
Usando isso, o OpenKore consegue rodar normalmente, exceto o plugin que não chega a rodar.
package webMonitorPlugin;

# webMonitor - an HTTP interface to monitor bots
# Copyright (C) 2006 kaliwanagan
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#############################################
# [PT-BR] Projeto recontinuado em 2012 por KeplerBR: http://openkore.com.br/index.php?/topic ... pid__19939
# Agradecimentos ao llbranco, ao Ghost, ao iMike e ao Swapmwalker
# Tradução de PT-BR para EN por Swapmwalker

use strict;
use Plugins;
use Settings;
use FindBin qw($RealBin);
use lib "$RealBin/plugins/webMonitor";
use webMonitorServer;
use chatLogWebMonitor;
use richLogWebMonitor;
use Globals;

###
# Initialize some variables as well as plugin hooks
#
my $hook = Plugins::addHook(
['AI_post', \&mainLoop],
['initialized', \&onConnect],
);

my $webserver;

sub onConnect {
my $port = $config{webMonitorPort};

my $bind = "localhost";
$webserver = new webMonitorServer($port, $bind);
}

sub Unload {
Plugins::delHook('AI_post', $hook);
}

###
# Main loop
#
sub mainLoop {
$webserver->iterate;
}

1;
Image

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: webMonitor upgrade

#4 Post by EternalHarvest »

Okay, that's my feedback so far, without comparing it with old webMonitor, so there may be its original misfeatures included. It may be insulting since I would only critic first, but I'm not really against it and it's not a bad thing in general.

-

Code: Select all

-use lib "$RealBin/plugins/webMonitor";
+use lib $Plugins::current_plugin_folder;
- XSS in /handler url.
- HTML/script injection vulnerabilities in NPC names etc.
- Automatic reloading the whole page (which isn't even always enabled in browsers) is a joke.
- "Jump down" buttons? You don't really want to look at the top part first usually.
- Frames don't look useful as they're done now on a screen of a random size. And maybe not really needed.
- No default submit actions for command inputs.
- Doesn't use user's map images from <openkoredirectory>/map which is default directory for some interfaces like Wx (and there is a nice set of maps, for example), and doesn't generate images when no image is available (code for that already exists in Wx interface and needs to be moved to Field or something, so other parts of openkore like webMonitor can use it).
- We do localization with gettext (there's poor but working javascript port I'm familiar with, but it's not needed so far here), not with throwing phrases in all languages at once.
- Which license artwork is under?
- That BR advertisement-like part kinda bugs me. Localization may do that if it wants to.

Actually, I can help a lot with webMonitor, but currently that isn't a good state, let be honest. Maybe it's easier to define features and interface we want and redo it from scratch.

We can also do something really fancy with an interface like Mozilla's BrowserQuest. They're open source so that would help, too.

Do you have any experience with javascript and css frameworks and building web apps? Long poll (Comet), webSockets? Etc?
KeplerBR wrote:

Code: Select all

my $hook = Plugins::addHook(
['AI_post', \&mainLoop],
['initialized', \&onConnect],
);
You need to use Plugins::addHooks if you want to add several hooks at once.

Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

Re: webMonitor upgrade

#5 Post by Kaspy »

EternalHarvest wrote:Okay, that's my feedback so far, without comparing it with old webMonitor, so there may be its original misfeatures included. It may be insulting since I would only critic first, but I'm not really against it and it's not a bad thing in general.
[EN]
Do not worry, I know respect the opinions of others.

[PT-BR]
Não se preocupe, sei respeitar as opiniões dos outros.
EternalHarvest wrote: - XSS in /handler url.
- HTML/script injection vulnerabilities in NPC names etc.
[EN]
In item security, not much thought because, as will be run locally, did not have to think too much but in the plugin, but on the network.

[PT-BR]
No quesito de segurança, não me preocupei muito porque, como vai ser executado localmente, não tem que pensar muito no plugin, mas sim na rede.
EternalHarvest wrote: - Automatic reloading the whole page (which isn't even always enabled in browsers) is a joke.
[EN]
Sorry, but I do not use Ajax, but this can be implemented by others

[PT-BR]
Desculpe, mas não sei usar Ajax, mas isso pode ser implementado por outras pessoas
EternalHarvest wrote: - "Jump down" buttons? You don't really want to look at the top part first usually.
[EN]
I thought of going down automatically, but may be that someone want to see the top and select a would disturb when it was part of the content

[PT-BR]
Pensei em descer automaticamente, mas pode ser que alguém queira ver a parte de cima e atrapalharia quando fosse selecionar uma parte do conteúdo
EternalHarvest wrote: - Frames don't look useful as they're done now on a screen of a random size. And maybe not really needed.
[EN]
Sorry, but I did not understand what he meant.

[PT-BR]
Desculpe, mas não entendi o que quis dizer.
EternalHarvest wrote: - No default submit actions for command inputs.
[EN]
Sorry, but I did not understand what he meant.

[PT-BR]
Desculpe, mas não entendi o que quis dizer.
EternalHarvest wrote: - Doesn't use user's map images from <openkoredirectory>/map which is default directory for some interfaces like Wx (and there is a nice set of maps, for example), and doesn't generate images when no image is available (code for that already exists in Wx interface and needs to be moved to Field or something, so other parts of openkore like webMonitor can use it).
[EN]
I did not know this topic ...
Try to make the map and show posisão player, but I could not ...
I found the source of the WX complicated, but I can try again and include it.

[PT-BR]
Não conhecia esse tópico...
Tente fazer com que mostrasse o mapa e a posisão do jogador, mas não consegui...
Achei a source do WX complicada, mas posso tentar de novo e incluir isso.
EternalHarvest wrote: - We do localization with gettext (there's poor but working javascript port I'm familiar with, but it's not needed so far here), not with throwing phrases in all languages at once.
[EN]
In relation the translation, I can implement the system.

[PT-BR]
Em relação a tradução, posso implementar o sistema.
EternalHarvest wrote: - Which license artwork is under?
[EN]
Icons for skills and the map image, by Gravity.
The image of the index was made by llbranco (http://openkore.com.br/index.php?/user/4749-llbranco/)

[PT-BR]
Os ícones das habilidades e imagem do mapa, pela Gravity.
A imagem da index foi feita pelo llbranco (http://openkore.com.br/index.php?/user/4749-llbranco/)
EternalHarvest wrote: - That BR advertisement-like part kinda bugs me. Localization may do that if it wants to.
[EN]
She would be changed by llbranco, but ruined his computer.
If so, make another or to be erased.

[PT-BR]
Ela ia ser alterada pelo llbranco, mas o computador dele estragou.
Se for o caso, faço outra ou pode ser apagada.
EternalHarvest wrote: Actually, I can help a lot with webMonitor, but currently that isn't a good state, let be honest. Maybe it's easier to define features and interface we want and redo it from scratch.

We can also do something really fancy with an interface like Mozilla's BrowserQuest. They're open source so that would help, too.

Do you have any experience with javascript and css frameworks and building web apps? Long poll (Comet), webSockets? Etc?
[EN]
Having to build from scratch a very discouraged...
I had some time left in this state, but only now decided to divulge.
Now I'm busy building a site for the style this (http://ropd.info/) to server Brazilian.

I was learning web application while riding this plugin.


[PT-BR]
Ter que montar um do zero desanima muito...
Tive algum tempo deixaram neste estado, mas só agora decidiu divulgar.
Agora estou ocupado montando um site estilo este (http://ropd.info/) para o servidor brasileiro.

Eu fui aprendendo aplicação web enquanto montava esse plugin.
Image

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: webMonitor upgrade

#6 Post by EternalHarvest »

KeplerBR wrote:
- XSS in /handler url.
- HTML/script injection vulnerabilities in NPC names etc.
In item security, not much thought because, as will be run locally, did not have to think too much but in the plugin, but on the network.
It doesn't matter if the webMonitor itself is exposed only locally. These issues still apply.
KeplerBR wrote:
EternalHarvest wrote: - No default submit actions for command inputs.
[EN]
Sorry, but I did not understand what he meant.
If you put forms around inputs, they would be submitted on "Enter" key (it doesn't work as it's currently done for some reason).
KeplerBR wrote:
EternalHarvest wrote: - Doesn't use user's map images from <openkoredirectory>/map which is default directory for some interfaces like Wx (and there is a nice set of maps, for example), and doesn't generate images when no image is available (code for that already exists in Wx interface and needs to be moved to Field or something, so other parts of openkore like webMonitor can use it).
[EN]
I did not know this topic ...
Try to make the map and show posisão player, but I could not ...
I found the source of the WX complicated, but I can try again and include it.
Maybe it would be better for me to do some API for that first. We can change that later.

Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

Re: webMonitor upgrade

#7 Post by Kaspy »

EternalHarvest wrote:Maybe it would be better for me to do some API for that first. We can change that later.
[EN]
That is, you want to continue with this version I have?
As will be relative the images that belong to Gravity (icons skills)?

[PT-BR]
Ou seja, você pretende continuar com essa versão que fiz?
Como vai ser em relação as imagens que pertencem a Gravity (ícones das habilidades)?
Image

User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: webMonitor upgrade

#8 Post by kLabMouse »

WOW! At Least Someone Re-Made that RLY Old Plugin.
KeplerBR If you want Access to SVN. Just ask Me or EternalHarvest (Better both), and we will add you to SVN Write List.

Also. I think. Criticism is good while it's not too much. That way, it moves something to be better and more Stable.

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: webMonitor upgrade

#9 Post by EternalHarvest »

I'm only seriously concerned about security issues already mentioned.

Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

Re: webMonitor upgrade

#10 Post by Kaspy »

[EN]
Regarding security, I can see it after I finish the project I'm doing. But it is better to release the left so that it will encourage those who want to continue.

[PT-BR]
Quanto a segurança, poderei ver isso depois que eu acabar o projeto que estou fazendo. Mas é melhor lançar da forma que deixei, irá animar quem quiser continuar.
Image

Locked