Board index FlightGear Development

Fixing mp chat messages

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

Fixing mp chat messages

Postby chrisb » Thu Jun 19, 2014 10:26 am

Hi

I've read through some of the "how to program for fg" documents and it seems very daunting
There are many things that are interesting that I have some experience with, I'm not good at anything in particular so I have no idea where I should start
I currently use fg git and have made some fgdata commits so compiling etc that part is all sorted
Now that I think about, the thing that annoys the absolute crap out of me is the mp chat interface, I have some c++ experience
Can someone point me in the direction of the function that displays messages, I should be able to work from there
Last edited by chrisb on Sun Jun 22, 2014 6:10 am, edited 1 time in total.
chrisb
 
Posts: 136
Joined: Mon Oct 21, 2013 8:46 pm
Location: YLIL, YMML
Callsign: cnb123
Version: git
OS: Win7 64bit

Re: Coding, where to start?? mp chat messages

Postby Hooray » Fri Jun 20, 2014 4:26 pm

It's all Nasal + XML, see $FG_ROOT/gui/dialogs/chat*.xml
and the corresponding code in $FG_ROOT/Nasal/:


gui.nas:1290: { name: "-", desc: "open chat dialog" },
gui.nas:1291: { name: "_", desc: "compose chat message" },
multiplayer.nas:4:# 1) Display chat messages from other aircraft to
multiplayer.nas:7:# 2) Display a complete history of chat via dialog.
multiplayer.nas:9:# 3) Allow chat messages to be written by the user.
multiplayer.nas:21: var msg = mp.node.getNode("sim/multiplay/chat", 1).getValue();
multiplayer.nas:40: # Add the chat to the chat history.
multiplayer.nas:41: if (var history = getprop("/sim/multiplay/chat-history"))
multiplayer.nas:44: setprop("/sim/multiplay/chat-history", msg);
multiplayer.nas:53: setprop("/sim/multiplay/chat", "");
multiplayer.nas:59:var chat_listener = func(n)
multiplayer.nas:77:var prefix = "Chat Message:";
multiplayer.nas:107: setprop("/sim/multiplay/chat", input);
multiplayer.nas:163: me.header = ["chat", " callsign"," code"," model", " brg", func dialog.dist_hdr, func dialog.alt_hdr ~ " ", "ignore" ~ " "];
multiplayer.nas:476: foreach (var menuitem;["mp-chat","mp-chat-menu","mp-list","mp-carrier"])
multiplayer.nas:539: setlistener("/sim/multiplay/chat", chat_listener);
screen.nas:495: if (!getprop("/sim/multiplay/chat-display"))
screen.nas:499: var highlight = getprop("/sim/multiplay/chat_highlight");

You could probably modernize this quite easily by using Nasal+Canvas, i.e. just by looking at the recent commits made by Philosopher (Nasal REPL/scroll-list), TheTom and Zakalawe
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11925
Joined: Tue Mar 25, 2008 8:40 am

Re: Coding, where to start?? mp chat messages

Postby chrisb » Fri Jun 20, 2014 6:03 pm

Thanx, I'll have a look and see what I can do
chrisb
 
Posts: 136
Joined: Mon Oct 21, 2013 8:46 pm
Location: YLIL, YMML
Callsign: cnb123
Version: git
OS: Win7 64bit

Fixing mp chat messages

Postby chrisb » Sun Jun 22, 2014 6:10 am

Features I've added that I think are needed or handy:
Any suggestions??

The single most used thing I do when mp chatting, slow down time
1) Added a dialog in the multiplayer setting to turn slow time feature on and off
Added because from my understanding the plane disappears from "ATC radar" when paused, this solves both problems of not crashing when you are typing a long massage and having your plane remain visible all the time

2) Added option to optionally send mp messages to TTS. I find this handy to alert me of new messages and also reads them out (will say messages over each other)
3) Entering two periods .. counts as end of message, useful when other dialogs e.g. map, are open and you need to send a message, pressing enter closes the dialogs before submitting the message
4) Entering a blank message repeats the last received message
5) Fixed a bug when creating a 2nd massage while the first is still active
6)Tweaked text colors a bit lighter and set a dark 50% transparent background
chrisb
 
Posts: 136
Joined: Mon Oct 21, 2013 8:46 pm
Location: YLIL, YMML
Callsign: cnb123
Version: git
OS: Win7 64bit

Re: Fixing mp chat messages

Postby chrisb » Tue Jun 24, 2014 6:55 am

I dont understand how commit/metging etc works the whole git thing is weird, pull, rebase or merge??? Is it just the widnows smartgit program that is worded badly, the terminology is a bit confusing
Im using smartgit on windows but the commands in the wiki dont seem to work

I created a new branch
added the changes
then did this

Code: Select all
$ git merge mpchat
Updating 3e087c5..990f304
Fast-forward
 Nasal/multiplayer.nas       | 42 +++++++++++++++++++++++++++++++++++-------
 Nasal/screen.nas            |  5 +++--
 gui/dialogs/multiplayer.xml | 45 ++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 82 insertions(+), 10 deletions(-)


Now I cant see the merge request on fgdata github?
chrisb
 
Posts: 136
Joined: Mon Oct 21, 2013 8:46 pm
Location: YLIL, YMML
Callsign: cnb123
Version: git
OS: Win7 64bit

Re: Fixing mp chat messages

Postby Hooray » Tue Jun 24, 2014 9:34 am

merge requests are created via the gitorious web interface - for that, you'd first of all want to push your local branch to a remote branch. This all should be illustrated in the wiki
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11925
Joined: Tue Mar 25, 2008 8:40 am

Re: Fixing mp chat messages

Postby Gijs » Tue Jun 24, 2014 9:49 am

What wiki article were you looking at? Please let us know if it was somewhere on the FlightGear wiki, as just merging your changes to a branch is far from sufficient to create a merge request. This one lists all required steps: http://wiki.flightgear.org/FlightGear_G ... king_edits
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9447
Joined: Tue Jul 03, 2007 2:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Fixing mp chat messages

Postby chrisb » Tue Jun 24, 2014 3:57 pm

I'm following the commands from "Making edits" down as I have a l obviously have a local copy of fgdata
I do the last push command and get this error


Code: Select all
fatal: protocol error: expected old/new/ref, got 'shallow 55754bd6f2bdca629a1150
e103f50fac28675687'
To git@gitorious.org:~chrisb/fg/chrisb-fgdata.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@gitorious.org:~chrisb/fg/chrisb-fgdata.g
it'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. If you did not intend to push that branch, you may want to
hint: specify branches to push or set the 'push.default' configuration variable
hint: to 'simple', 'current' or 'upstream' to push only the current branch.


Do I need to update my remote branch/clone?
chrisb
 
Posts: 136
Joined: Mon Oct 21, 2013 8:46 pm
Location: YLIL, YMML
Callsign: cnb123
Version: git
OS: Win7 64bit

Re: Fixing mp chat messages

Postby Philosopher » Tue Jun 24, 2014 4:43 pm

try git pull origin master --rebase....
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Fixing mp chat messages

Postby chrisb » Tue Jun 24, 2014 5:15 pm

$ git pull origin master --rebase git@gitorious.org:~chrisb/fg/chrisb-fgdata.git

error: unknown option `rebase'
Last edited by chrisb on Tue Jun 24, 2014 5:25 pm, edited 2 times in total.
chrisb
 
Posts: 136
Joined: Mon Oct 21, 2013 8:46 pm
Location: YLIL, YMML
Callsign: cnb123
Version: git
OS: Win7 64bit

Re: Fixing mp chat messages

Postby Philosopher » Tue Jun 24, 2014 5:17 pm

Don't put your repo in there:
$ git pull origin master --rebase
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Fixing mp chat messages

Postby Hooray » Tue Jun 24, 2014 5:17 pm

it's a pull option, so that it after pull
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11925
Joined: Tue Mar 25, 2008 8:40 am

Re: Fixing mp chat messages

Postby chrisb » Tue Jun 24, 2014 5:24 pm

I still get the same error, how does "smart"git which seems pretty dumb know to update my clone, if thats even the problem???

Code: Select all
$ git pull origin master --rebase
error: unknown option `rebase'

I deleted my clone on gitorious and made a new clone

now i get this error

Code: Select all
fatal: protocol error: expected old/new/ref, got 'shallow 55754bd6f2bdca629a1150
e103f50fac28675687'
error: failed to push some refs to 'git@gitorious.org:~chrisb/fg/chrisb-fgdata.g
it'


am i suppose to make another branch and/or commit the files again?

so no i deleted everything, I have a fresh fgdata and im starting from here attempting to put in a merge request
http://wiki.flightgear.org/FlightGear_G ... king_edits
I have created a new clone which this does not say to do
Last edited by chrisb on Tue Jun 24, 2014 5:32 pm, edited 1 time in total.
chrisb
 
Posts: 136
Joined: Mon Oct 21, 2013 8:46 pm
Location: YLIL, YMML
Callsign: cnb123
Version: git
OS: Win7 64bit

Re: Fixing mp chat messages

Postby Philosopher » Tue Jun 24, 2014 5:27 pm

maybe git pull --rebase origin master ;) (order of arguments.... I'm pretty sure this one is correct)

Pushing will come later, but first we want to make sure it's up to date ;).
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Fixing mp chat messages

Postby chrisb » Tue Jun 24, 2014 5:37 pm

$ git pull --rebase origin master
From gitorious.org:fg/fgdata
* branch master -> FETCH_HEAD
Current branch HEAD is up to date.

So now do I overwrtie the files with my changes?
chrisb
 
Posts: 136
Joined: Mon Oct 21, 2013 8:46 pm
Location: YLIL, YMML
Callsign: cnb123
Version: git
OS: Win7 64bit

Next

Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest