The online racing simulator
Cross-Server Chat (HELP)
(15 posts, started , go to first unread)
Cross-Server Chat (HELP)
Is Lapper have feature to make Cross-Server chat?
if yes then how to enable it
thank you!
No, Lapper haven't got such feature, but it can be made using a text file to store/retrieve text, which can be read/written by multiple servers
I was in the mood to tackle this request, so I worked on a cross-server chat this afternoon and came up with a proof of concept.

When typing: !chat
You will bring up a GUI to show the last 5 messages (date,time,message) and a button to compose a short (max. 72 characters) message.
After having composed the message, you will get to see a send button and once that is pressed, the message is stored in the Lapper database (it can be done using a text file as well, but using the storevalue.dbs is a better way to handle this).

Another way to enter a message into the chat is by typing: !chat [write your message here]
Using this method, you can write a longer line of text.

There are some things I want to tackle before I release this proof of concept to the community, but at least I know for sure now it can be done and even isn't too hard to accomplish.
Attached images
cross_server_chat_1.png
cross_server_chat_2.png
cross_server_chat_3.png
cross_server_chat_4.png
Hey,

This is indeed a interesting proof of concept.
While "trying" to fix some old Console bugs. I ran into a consolecommand named 'cmdlfs'. This sents a message to all Lapper instances with the same Group-ID.

#DEF1|gr1|192.168.178.11|29999|./default|default_1.ini|autowork
#DEF1|gr1|192.168.178.12|29998|./default|default_1.ini|autowork
#DEF1|gr1|192.168.178.13|29997|./default|default_1.ini|autowork

Whould it be an idea to add something like this in Lapperscripts as a function like :

<?php 
 BlahFunction
($GroupID,$Text);
?>

And the output will be a Globalmsg() on each instance or something like that.

Let me know your thoughts about this.
Could indeed be a useful function.
Now when I want to do some maintanance and people are indeed driving on several of my servers, I have to go to each LFS console and write a message there (or login on each server and write in chat there).
oke, i shall look into it.
To see, what i can do with it.
It did some more work on the Proof Of Concept (POC) for a cross-chat server addon for Lapper.
See attached script.
As said, it's a proof of concept so don't ask me about, I want this, can you make that, ect. it's just to proof it's possible to have such script and I have no intention (at the moment) to further extend this script.
Let me know if it is (or isn't) working for those who have multiple servers.


Change the extension of the file to .lpr and add it to addonsused.lpr to be able to use it.
Attached images
cross_server_chat.png
Attached files
cross_server_chat.txt - 16 KB - 16 views
Hello,

Sorry, that it tooks so long for the results.
But here it is.

=======TEST METHODE=======

Version of LFSLapper : Experimental V7.0.4.11
Number of GroupsID's : 1
Number of Unique ID's : 3
Number of LFSServers: 3 dedicated servers
Version of LFSServers : 0.6R
============================

=======MY EXPERIENCES=======
When i tried to sent the message, i received an error that the database is locked.

2/20/2018 5:29:50 PM -> The database file is locked
database is locked :
COMMIT TRANSACTION
-----------------------------------------------------------------------------
2/20/2018 5:29:50 PM

Lapper Instance 192.168.178.14/29994 abort!

The database file is locked
database is locked
LFSLapper
bij LFSDbs.DbsAccess.executeNonQuery2(String _command)
bij LFSDbs.DbsAccess.executeNonQuery(String _command)
bij LFSDbs.storedDbs.updateRow2(String key, String value)
bij LFSDbs.storedDbs.updateRow(String key, String value)
bij LFSLapper.LFSClient.setstoredvalue(unionVal val, ArrayList args)
bij GLScript.GLApp.parseBackcall(SetOfVars GVAR, SetOfVars LVAR, unionVal val, ArrayList args)
bij GLScript.Parseur.getval(SetOfVars GVAR, SetOfVars LVAR, executeParsedFunction BC)
bij GLScript.GLApp.retrieveEvalVar(String funcName, TokenParse tkparse, TokenBuffer currTokenBuffer, SetOfVars GVAR, SetOfVars LVAR, Boolean breakFunc, Char& breakCar)
bij GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
bij GLScript.GLApp.privExecuteFunction(String funcName, String[] argsVals)
bij GLScript.GLApp.executeFunction(String funcName, String[] argsVals)
bij Configurator.lexConfigurator.executeFunction(String funcName, infoPlayer pcurrInfoPlayer, String[] par)
bij LFSLapper.LFSClient.managePacket(BTC btc)
bij LFSLapper.LFSClient.Loop(Connect insimConnection)
bij LFSLapper.LFSClient.doloop()
bij LapperInstances.LapperInstance.doConnection()
Int64 executeNonQuery2(System.String)
Closing Instance...
-----------------------------------------------------------------------------

Dont know if this happend on your side aswell.

After restarting Lapper with all the instances, it could sent a message and its displayed in the list, as it should be i think.
So, i joined my second server and typed !chat. The list is empty.
Entered a new message and again i received the same Database lock error. Reloaded lapper again and typed !chat. The list is filled with the saved messages from the other server.

I didnt look into the errormessage yet. Will wait for your response first.

Fun part: after spamming the cmdlfs command in the console. I found a ... is kicked for flooding message.
This is obviously a bug.
Attached images
CrossTest01.jpg
Hmm, seen this error once, but thought it was caused by an external program I use to view/edit the Lapper database.
I haven't done any testing with multiple servers as I assumed it should work, as storedvalue.dbs already is used by multiple Lapper instances (like I have on the AB.nl server (4 LFS servers and all of them have Lapper as well).
Will do some testing tomorrow.
Thank you Yisc[NL] for the progress Smile
if some one need some help for testing just PM me Wink
I couldn't find any time to look into the reported issue yesterday, but did find some time today.
Soon I was able to replicate the problem Bass-Driver reported and I ran into another problem as well.
After some attempts to fix both of them, I succeeded, so here's another version.
I've tested with 2 LFS servers running on the same Lapper and also tested by adding short messages (by pressing 'Click to type a short message (max. 72 char) button) as well as longer messages using: !chat [longer message here]

Changelog Cross-server chat V1.02:

-Fixed a bug that caused displaying empty messages when starting from scratch
-Fixed a bug that caused Lapper to throw messages about database being locked
-Changed GetStoredValue to GetStoredNum where possible to get numbers instead of values

Change the extension of the file to .lpr and add it to addonsused.lpr to be able to use it.
Attached images
cross-server_chat_102.png
Attached files
cross_server_chat.txt - 17.9 KB - 3 views
Thanks for these bugfixes, and your hard work on this script.
At the first look, it works good. But i have discovered some small bugs. Just few small design faults.

EDIT: While writing the list of bugs below, i couldnt reproduce them anymore. Even after a Lapper rebootFrown I think its something is on my end. But i will write the bugs anyway.


01: First textline error when type !chat <Text> again while chatwindow is opened.
02: When joining a another server, enter chatwindow and close it.
The textlines are still there while the background is gone. After Reentering the command and writing a another textmessage.
Everything is fine

Attached images
CrossTest_02_01.jpg
Thanks for testing, I've seen that first thing myself as well, but couldn't reproduce it solidly.
Will have another look and crack at that one.
The other one I haven't seen myself, but I have an idea what causes it (can even be the same cause as the first issue).
I haven't been able to reproduce the mentioned bugs anymore (and I tried seriously).
Still have some ideas how this script could be improved, but don't consider them high priority right now.
Yeah lapper could act weird sometimes. Leaving us reproducing bugs while there arent any bugs at all. Thats what you have to deal with while you working on lapper scripts. Its frustrating and educational at the same time.
Its up to you, if you putt this topic in the 'W.I.P' or the 'Finished' Section of this Lapper forum.
Anyway thanks again for this script. Another great tool. It still suprises what you can build within the Lapper environment.

Cross-Server Chat (HELP)
(15 posts, started )
FGED GREDG RDFGDR GSFDG