Open jonjamcam opened 8 years ago
" We need to remove it from the start of the application and keep it for specific purposes, but that do not affect the overall functioning. "
ok , let's work on that . ^^
"will the architect like this idea?" lol
I tried to isolate the loginservice.cpp without success. It's very much integrated into the whole application functioning. Any idea on how to run jomtobo "offline"?
I noticed too that there's line 18 that points to a local server
//const QString LoginService::SERVER = "http://localhost:8080/vs";
Maybe a faster solution? MAke the server local?
At the immediate no , but if i work on it , yes .
ok , i had a look , the entry point could be : https://github.com/Ezeer/JomTobo/blob/master/Client/src/MainController.cpp#L851
void MainController::tryConnectInNinjamServer(Login::RoomInfo ninjamRoom, QStringList channelsNames, QString password)
that funk takes "Login::RoomInfo" as parameter , so we must find a way to have a valid RoomInfo without the help of the server .
There is two rooms type : https://github.com/Ezeer/JomTobo/blob/master/Client/src/loginserver/LoginService.h#L38 enum class RoomTYPE{NINJAM, REALTIME};
You see that we will need the server for realtime thus .
ok I see it. It is designed like this. To separate ninjam will be a mess....
No , that could be simple , the difficulty is to code in the client the server part that solves the connections ( find the ninjam servers , retrieve rooms infos ) .
these are the server's java source to retrieve ninjam infos : https://github.com/Ezeer/JomTobo/tree/master/Server/src/java/jamtaba/ninjam/public_servers
i need to translate that in c++ if i include them in the client , or php or python if i use a new type of server .with jomtobo .
Remember that jamtaba is based on wahjam. Maybe here's the answer:
https://github.com/wahjam/wahjam
I'm too newbie to understand what is what in the codde....but for you it may be Ezee
that's cool Jon , your idea to use wahjam is a good shortcut , there is already Qt5 server code there : https://github.com/wahjam/wahjam/tree/master/server
i can try to use some of these files to bypass the server by implementing the client .
good! As you can see Wahjam connects to ninjam without the need for this special server architecture
-
eh eh ! lol ... yeah , i just found the files needed to get the ninjam servers stuff : https://github.com/wahjam/wahjam/blob/master/qtclient/NINJAMServerBrowser.h
that should work ... ^^
You da man!
" It's clear why the struggle was so painful Metamorphosis, this is what I changed to and God, I'm so thankful " Read more at http://www.songlyrics.com/nas/you-re-da-man-lyrics/#ULlPVf7c3VqpOGy0.99
;)
lol , the files i want to use were written by tea .... oh lol ! Copyright (C) 2012 Ikkei Shimomura (tea) Ikkei.Shimomura@gmail.com Copyright (C) 2012 Stefan Hajnoczi stefanha@gmail.com
ok ; i created a local branch " serverLess " , i'll push it if i have success on the incoming dayz ...
full circle! lol
yeah , that's what i mean , and what the looper said with alpha and omega ...
can I pull to see?
there is nothing to see yet , and the branch is local for now ( don't need to share my shit but my fruits ^^ ) . Be patient , the code is a long snake , i must get into it and it's a ....
kind of ... ^^
aahha right.....
It's a lot of energy acquired by concentration to moove from A to O , you must know bcdefg etc ... " If you don't know where you go , why you run ? " lol
of course.
O being the result of A on himself ( tip : A is a tool to draw a circle .... ) , i need to find A first . And A is for me :
void MainWindow::initializeLoginService(){
Login::LoginService* loginService = this->mainController->getLoginService();
connect( loginService, SIGNAL(roomsListAvailable(QList<Login::RoomInfo>)), this, SLOT(on_roomsListAvailable(QList<Login::RoomInfo>)));
connect( loginService, SIGNAL(incompatibilityWithServerDetected()), this, SLOT(on_incompatibilityWithServerDetected()));
connect( loginService, SIGNAL(newVersionAvailableForDownload()), this, SLOT(on_newVersionAvailableForDownload()));
connect( loginService, SIGNAL(errorWhenConnectingToServer(QString)), this, SLOT(on_errorConnectingToServer(QString)));
}
i already bypassed two of them to allow jomtobo to connect to the server , now i need to work on :
connect( loginService, SIGNAL(roomsListAvailable(QList<Login::RoomInfo>)), this, SLOT(on_roomsListAvailable(QList<Login::RoomInfo>)));
to behave as if we used the server , to still have the rooms displayed ...
The following code occurs at launch time , just before the busydialog disappear and the rooms get filled :
void MainWindow::on_roomsListAvailable(QList<Login::RoomInfo> publicRooms)
{
hideBusyDialog();
refreshPublicRoomsList(publicRooms);
if(mainController->isPlayingInNinjamRoom())
{
this->ninjamWindow->updateGeoLocations();
//update country flag and country names. This is necessary because the call to webservice used to get country codes and
//country names is not synchronous. So, if country code and name are not cached we receive these data in some seconds.
}
}
i must find what trigger that event , and replace it with my code if it belongs to the server .
i got it ! https://github.com/Ezeer/JomTobo/blob/master/Client/src/loginserver/LoginService.cpp#L285 i change myself ( abracadabra ) in json , to being eat as parameter by : https://github.com/Ezeer/JomTobo/blob/master/Client/src/loginserver/LoginService.cpp#L256
that way i am in the matrix now ... and from there , i see every thing , like the heart of the service : https://github.com/Ezeer/JomTobo/blob/master/Client/src/loginserver/LoginService.cpp#L109
every digital heart beat , there is a request to the server asking for room info :
void LoginService::refreshTimerSlot(){
QUrlQuery query = HttpParamsFactory::createParametersToRefreshRoomsList();
pendingReply = sendCommandToServer(query);
if(pendingReply){
connectNetworkReplySlots(pendingReply, LoginService::Command::REFRESH_ROOMS_LIST);
}
}
perhaps i only need to change the body of that funk , to get info directly from the ninjam server list and not by the jamtaba server .
very good exemple ! ^^
I'm looking at wahjam code but can't get how it connects.
as far as I know the list used is this:
http://autosong.ninjam.com/server-list.php
EDIT: Found Elieser's explanation of how jamtaba connects (28 days ago):
"Guys, Jamtaba connect with jamtaba server and receive a list of public servers and connected musicians. Jamtaba server is requesting this list from 2 sources: http://autosong.ninjam.com/serverlist.php and http://ninbot.com/app/servers.php.
Why 2 sources to make a single list?
In the first link I have the maxUsers from every server. Jamtaba is using this info to disable the "Enter" button when a server is full. Some servers allow 6 users, other allow 8, etc. But in this first link we can't get the users IP, and without user IPs we can't translate the IP to a country name, and show a cool flag for the country. The Ninbot link is returning users IPs, but not the server maxUsers. To have all necessary info jamtaba server is merging this 2 sources.
A third and dirty solution is use this: http://autosong.ninjam.com/server-list.php
In this cockos official site is possible get maxUsers and users IPs, but we need get this infos directly in HTML code [scrapping], not very fun, but possible."
thks ! The connection dialog of wahjam is declared here : https://github.com/wahjam/wahjam/blob/master/qtclient/ConnectDialog.h
and the body of the funks are defined here :
https://github.com/wahjam/wahjam/blob/master/qtclient/ConnectDialog.cpp
but it's not the interesting part for me , the interesting is the core files written by tea . these 4 files i've downloaded and added in serverLess branch , and i will use certainly the php file you posted to get the servers infos.
Is this the part of code where it connects to the list?
public: NINJAMServerBrowser(QNetworkAccessManager manager_, QWidget parent=0); QNetworkReply sendNetworkRequest(const QUrl &url); void parseServerList(QTextStream stream); };
yes .
thx! now I start to see......
So in short.
Jamtaba: connects to jamtaba server(http://jamtaba2.appspot.com/vs) and from here it requests the list from http://autosong.ninjam.com/serverlist.php and http://ninbot.com/app/servers.php.
wahjam: request the list directly from http://autosong.ninjam.com/serverlist.php
yeah , that is a good snapshot . But i must fullfill the needed Login::RoomInfo of jamtaba with the data retrieved by the tea's code , and i'm not sure that the format is the same . Not a problem , but i must check every detail ...
okay , i see that the subject interest you so much , i will push the branch with the new files on it so you could pull and see by yourself how i will make the changes . done here : https://github.com/Ezeer/JomTobo/tree/serverLess
Yes. It's important for me. I understand that the magic of opensource projects is that the code is subject to query by anyone.
My four years of experience with ninjam have been always about freedom. Jamtaba made me question how free I am when using it since this happened, the "Jamtaba kicked me out" thread:
https://github.com/elieserdejesus/JamTaba/issues/124
So now I must understand what is going on behind the scenes, because I see this bottlenecks as going back, not forward.
But this is just my opinion.....
No, the order is :
Did 1st git checkout master and git status:
now git checkout serverLess and then git pull?
ok , do : git pull ( will update your master ) then git checkout serverLess
done.
now testing
good job . i made no changes , just added the files in loginserver . I must let the idea diffuse his light on my mind , as tea on hot water ... lol
Right........For me this thread's been an eye opener.......
in two week's It's going to be 5 years I've been in ninjam!
ah ah ah ah ...
lol and I don't want this happening....
https://www.youtube.com/watch?v=Vpj6Yotdxtg&feature=youtu.be&t=86
oh woaw ! an other very good example ! ah ah ah .... ok , i take a break to reach my dream land where all started for me , and we'll continue that work tomorrow , k ? ^^
thx, man..cya
Ezee!!!! Made QT compile Jamtaba as STATIC!
can you test it plz? (remove .txt)
Jomtobo still doesn't do the trick, tho....
I think you made a great point with this, Ezee. Ninjam sessions do not need this "server" architecture, but it will be necessary for other features like real time rooms.
We need to remove it from the start of the application and keep it for specific purposes, but that do not affect the overall functioning.