Page 47 of 50

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Tue Oct 25, 2016 10:42 am
by Flake
I probably don't have the full picture of this. I'll look at that in the coming months.

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Thu Oct 27, 2016 12:09 am
by Neocon
I'm not getting any error logs at all, but this happened last night: 20161025(222813): dbd000 Logging in... xxx.xx.xxx.xx
20161025(222813): dbd000 Joined the server.
20161025(222841): dbd000 Login Complete!
20161025(222937): dbd000 took off (MOA_A320NEO)
20161025(224144): dbd000 recursion depth > 20. For OYS safety, connection terminated!
20161025(224144): dbd000 recursion depth > 20. For OYS safety, connection terminated!
20161025(224144): dbd000 recursion depth > 20. For OYS safety, connection terminated!
20161025(224144): dbd000 left the server.
20161025(224144): dbd000 recursion depth > 20. For OYS safety, connection terminated!

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Thu Oct 27, 2016 9:50 pm
by Flake
Actually that's quite interesting. I never considered what changing to Async would do for recursion depth tests.

What I'm going to do after exams is add some exception handling to the main interface and other locations to hopefully stop the program from crashing randomly :)

Then it's onto those AAA/SAM as promised. 8-)

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Fri Oct 28, 2016 7:30 am
by Nodoka Hanamura
That would be soon, IIRC - you said you'd be free in November back when you said you wanted to go for a flight with me one time in the mchat.

Unless I'm misreading/misunderstanding.

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Fri Oct 28, 2016 10:08 am
by Flake
No you are right, and I haven't forgotten. My exams end 14th November. :)

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Sat Oct 29, 2016 9:09 pm
by Barr
Hey remember that problem I had a few months ago where some user planes would not "update" and just fly nonstop, planes would just drop out of the sky and disappear even though the user would report that he's still flying or planes not spawning at all.

Well I experienced it today during the event and so did dave, dan and a few others.

So it may be a open ys issues

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Sat Oct 29, 2016 9:22 pm
by Flake
Still not sure why that's happening. I'll have to investigate...

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Sat Oct 29, 2016 10:05 pm
by Barr
Do you need any sort of logs?

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Sun Oct 30, 2016 12:24 am
by Neocon
Another crash on startup. 20161029(135048): --- Log Created ---
20161029(135048): MESSAGE: Object reference not set to an instance of an object.
20161029(135048): START TRACE:
20161029(135048): METHOD: Void Run(System.String[])
20161029(135048): LINENUMBER: 231
20161029(135048): COLUMNNUMBER: 25
20161029(135048): END TRACE.
20161029(135048):
20161029(135048): Also, OYS crashed while running, with two people online. No error report. Application: OpenYS-ServerMode.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Reflection.TargetInvocationException
Stack:
at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[])
at System.Delegate.DynamicInvokeImpl(System.Object[])
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.RichTextBox.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG ByRef)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG ByRef)
at System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32, Int32)
at System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)
at System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
at OpenYS.OpenYS_Server+Program+<>c__DisplayClass9_0.<Run>b__0()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Thu Nov 03, 2016 10:15 am
by Flake
I'm gunna be honest folks.

I know how to write code, I don't know how to program.

Wait, what?

This video will explain.

https://www.youtube.com/watch?v=tDh1KIh7w-I

My code, is frankly, disgustingly hard to manage for what it is.

I need to build a better system.

I could code up the SAM/AAA but truth be told that would probably be broken too like half the program, I just keep putting bandaids on.

I'll be learning how to code cleanly over the exam period for gits and shiggles. Then I'll come back to the program. Sorry! This is one of those "better in the long run" ideas.

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Thu Nov 03, 2016 1:11 pm
by Neocon
If it makes you feel any better, the 20160302(1613) version is very stable.

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Fri Nov 04, 2016 6:24 am
by Flake
Okay I'm up to speed again.

Most of the program is salvagable, though it will take some refactoring*. During the refactoring* I'll aim to reduce Class Coupling* where high complexity is closely related to crashes. (*New words in my terminology! I must have learned something.)

I'll also make the program more beautiful code wise, and make it more compatible as an API for TCP/IP sockets, YS netcode, and other like stuff.

It's pretty much the same approach I've always had except much cleaner. I've learned to not judge the quality of a code project by the number of lines, that's like measuring aircraft construction progress by measuring weight of raw materials.

Time to get to work.

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Fri Nov 04, 2016 7:39 am
by Dragon_Mech
god speed dear Flake!

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Fri Nov 04, 2016 8:55 am
by WARDC_sOnar
its sound like hyper-speed Dragon_Mech :lol:

I wish you Flake creative inspiration and enthusiasm for work. fingers crossed for your success.

Regards!

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Tue Nov 15, 2016 11:57 am
by Flake
So I've started in building a heavily extensible library for my projects. Makes sense to not continuously re-invent the wheel... But that does mean I have to do it one more time. First step was units of measurement, so far I've got length, mass, volume and temperature conversions, I'll add the rest tomorrow. What the new encapsulation allows me to do is things like 1.Meters() + 5.Kilometers(); or 10.Kilometers().ToMiles(); What's important is I can't do much else that doesn't make sense. Example, I can't do 5.Kilograms() * 7.Kilometers() - the two unit types are different!

What's next? Library implementations of file IO, very low level stuff.

So why the basic stuff first? Because I can build on top of that through repeated inheritance - the DAT file reader will be it's own class as well, which will inherit from the file IO class I will write, see? Thanks to my segmentation and encapsulation, debugging will be more meaningful: "OpenYS.Core" as a method name is useless. "OpenYS.Client.PacketHandler.FromClient.FlightData.SendToAllClients()" is a mouthful, yes, but debugging wise it's so easy for me to see what is wrong.

I'm re-writing code in the following ways:
First, I'm re-classifying classes into seperate namespaces. I'm going to reference areas as I need them using clauses such as "using static Com.OfficerFlake.Libraries.IO.Files;". By packing things into namespaces, code get's much easier to manage as I can use the same name multiple times in the program, much easier to read code. No more silly underscores everywhere.

Second, I'm using the 3 (4) pillars of object oriented coding on my classes: Encapsulation, Inheritance, Abstraction/Polymorphism. If you are a novice coder, who knows the language but needs to jump the gap to making GOOD programs, learn this. My classes are being seperated and common elements identified -> inherited. reduces code-reuce dramaticly, makes the classes much easier to read.

Third, the variables in my classes are being hidden. I am now using properties to control access to variables and how they are accessed. This increases coding safety by making it clear, intrinsicly, how classes and their methods/variables should be used. It also stops you from using them unsafely, which is always a big plus for compatibility, readability and maintainability.

Fourth, the methods in my program are being heavily refactored - I used to follow the old 1999 coding techniques of saving program space by cramming as much calculations onto a line of code as possible (for computing efficiency). yeah that's just not efficient, not easy to read, and just plain wrong. I'm seperating these methods into multiple layers of methods that all work together. Instead of a method that: checks if a file exists, reads from that file, prepares the data as an array; then draws the array to the screen... I instead have methods that: GetAStringArrayFromFile(...); DrawStringToScreen(...) for example. Easy to read from a developer point of view. Oh and I've fixed my variable use convention with the help of ReSharper.

I'll finish today with a quote: "Programming is the art of writing code for humans to understand." Notice that says humans, not machines.

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Tue Nov 15, 2016 12:11 pm
by Nodoka Hanamura
xX_SuperSic58_Xx wrote:I'll finish today with a quote: "Programming is the art of writing code for humans to understand." Notice that says humans, not machines.
I haven't read a line of OYS, but already I know I can't read it.

Beep beep boop.

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Tue Nov 15, 2016 10:10 pm
by C P
Dragon_Mech wrote:god speed dear Flake!

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Wed Nov 23, 2016 12:26 am
by Neocon
Something interesting happened over the weekend. Two things, in fact. First, somebody I will not name here sent an emoticon from Discord and it kicked everybody off of the server. Second, strange things happen when the scheduler resets ground objects. Once it kicked me out of the server. Sunday night it teleported me to an open field.

This all happened using the 20160302(1613) version, so newer versions may not have this affect.

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Wed Nov 23, 2016 4:02 am
by NightRaven
Patrick31337 wrote:First, somebody I will not name here sent an emoticon from Discord and it kicked everybody off of the server.
Hi, that must be me. This has been happening ever since OYS-IRC support was implemented, and I have managed to crash many people's YS from sending my healthy dose of non-UTF-8 emoticons. Maybe Flake can implement some kind of blocking for non supported characters? ¯\_(ツ)_/¯

Re: [PROGRAM] OpenYS - Open Source YSFlight Server!

Posted: Wed Nov 23, 2016 7:22 am
by Nodoka Hanamura
NightRaven wrote:
Patrick31337 wrote:First, somebody I will not name here sent an emoticon from Discord and it kicked everybody off of the server.
Hi, that must be me. This has been happening ever since OYS-IRC support was implemented, and I have managed to crash many people's YS from sending my healthy dose of non-UTF-8 emoticons. Maybe Flake can implement some kind of blocking for non supported characters? ¯\_(ツ)_/¯
It's entirely possible to have a class under chat handling dedicated to filtering out other encodings.
Wouldn't take too many lines of code if done right.