These are chat archives for ikkentim/SampSharp

15th
Jan 2017
Oleg
@5LICK
Jan 15 2017 00:28
same problem without docker
It is dificult to fix?
Tim Potze
@ikkentim
Jan 15 2017 13:22
I don't yet know what the problem is
Oleg
@5LICK
Jan 15 2017 15:49
i used gdb for check whats wrong, and i have stacktrace: http://pastebin.com/v2ZSmP1Y (crash moment) and values of local variables: http://pastebin.com/54Rsxr4p
I looked at it and I don't know whats going on here :)
i think problem in the retval = native(amx, params)
bad params or amx or native, or it is linux problem, or mono
Tim Potze
@ikkentim
Jan 15 2017 16:55
do you know which native you're calling here?
Oleg
@5LICK
Jan 15 2017 16:59
it is OnPlayerUpdate
Tim Potze
@ikkentim
Jan 15 2017 17:00
Thats the callback :) Do you know which native ( like SendRconCommand ) you're calling?
Oleg
@5LICK
Jan 15 2017 17:01
also i think, it is maybe GetPlayerName or GetKeys
one minute, i will check it
Tim Potze
@ikkentim
Jan 15 2017 17:02
The locals dump shows the format is "s" (one input string), so that's why i guessed SendRconCommand. GetPlayerName takes an int and a string(output), get keys takes int, out int, out int
hmm, odd, the first crash shows format "R" (reference value)
Oleg
@5LICK
Jan 15 2017 17:58
i repeated debugging, and i not found native name, only handle = 63. Also i switched gamemode to another, and i not had any crashes, but i spawned in the zero coords (xyz) after spawn. Also, i downloaded https://s3-eu-west-1.amazonaws.com/sampsh/ikkentim/SampSharp/287/287.1/bin/libSampSharp.so this lib, and using with my gamemode, i not spawned and saw message about - world out of bounds.
different libs gives different results)
This native goes from OnPlayerUpdate (Grandlarc gamemode)
Michael Kilpatrick
@NewbProgramming
Jan 15 2017 18:58
Fuck fuck fuck a duck, screw a kangaroo, finger bang an orangutan, orgy at the zoo
People at my middle school sang that and it randomly popped in my head as I was reading these messages lol
Aint the human brain a wonder.
Like 10 years ago, I'm 22 now, that's how... how weird it was.
23 now*
Oleg
@5LICK
Jan 15 2017 19:11
:)
if you want, you can connect and look on this 31.131.23.56:7777
Tim Potze
@ikkentim
Jan 15 2017 19:13
yup, out of bounds
Oleg
@5LICK
Jan 15 2017 19:13
sometimes, i can spawn, but in the 0.0.0 coords
Jay
@LVPJay
Jan 15 2017 19:13
just host your server on windows :D
Tim Potze
@ikkentim
Jan 15 2017 19:14
I want it to work on linux though :P will have to do some debugging when I've got time
but indeed, during development, just run it on windows
@LVPJay you've seen my note about times?
Jay
@LVPJay
Jan 15 2017 19:14
Just now yeah, cheers for that :)
Tim Potze
@ikkentim
Jan 15 2017 19:16
really annoying that the standard .net timer crashes :/ at least we know about it
Oleg
@5LICK
Jan 15 2017 19:17
Just i searching alternative for pawn, and one of the criteria it is linux. This API looks very good, but i need linux only :) I will wait when it will be works on linux :)
Michael Kilpatrick
@NewbProgramming
Jan 15 2017 19:32
For timers I store a DateTime variable set for the future and check that OnTick against DateTime.Now

DateTime one_second = DateTime.Now.AddSeconds(1);

DateTime.Now <= one_second

It may be >= I can't really think right now.
Arithmetic operations on the DateTime class gives you a TimeSpan just so you know.
Tim Potze
@ikkentim
Jan 15 2017 19:38
What is the problem with using an actual timer class? Wheels don't need reinventing
Jay
@LVPJay
Jan 15 2017 19:39
^
Michael Kilpatrick
@NewbProgramming
Jan 15 2017 19:40
You said it crashes
That's an alternative.
Jay
@LVPJay
Jan 15 2017 19:40
the built in .Net timer class crashes
SAMPSharp provides an alernative which doesn't crash
Michael Kilpatrick
@NewbProgramming
Jan 15 2017 19:41
Sorry for misunderstanding, I was just trying to give an alternative solution.
Michael Kilpatrick
@NewbProgramming
Jan 15 2017 20:22
@ikkentim How would you do Y_Less's GetXYInFrontOfPlayer in C#?
blob
not sure if that should be a float?
e.g. to keep it consistent with the rotation parameter in BaseVehicle.Create(): http://api.sampsharp.timpotze.nl/html/83b6163c-6b28-7b85-bb3a-fbc7b362615e.htm
Michael Kilpatrick
@NewbProgramming
Jan 15 2017 21:27
I have this but it puts the Camera at the 0.0 0.0 ?? position
blob
People on stackoverflow says Math.Cos already uses Degrees.
I should return a Vector2 for simplicity. lol
Michael Kilpatrick
@NewbProgramming
Jan 15 2017 21:32
blob
Michael Kilpatrick
@NewbProgramming
Jan 15 2017 21:39
Figured out why, was using it on OnPlayerRequestSpawn, and the player isn't spawned yet so the Position values are 0.0 0.0... alright, shit.
Jay
@LVPJay
Jan 15 2017 21:41
nice
you should stick that on the wiki http://sampsharp.timpotze.nl/useful-snippets
I can't believe how awesome, and so much easier it is to code SA-MP gamemodes in C#
I should've done this ages ago :p
Michael Kilpatrick
@NewbProgramming
Jan 15 2017 21:43
How I felt too :P
Jay
@LVPJay
Jan 15 2017 21:45
How are you guys handling DB queries, just writing them raw?
I've never used MySQL connector, but it looks like there is EF support
Just concious that EF may add some extra overhead
Michael Kilpatrick
@NewbProgramming
Jan 15 2017 21:47
I use the System.IO and Newtonsoft.Json
Someone here uses nHibernate, looked pretty good.
This was his demo code
Hmm didn't let me paste
That was the example he showed us a month ago, said it was nHibernate
Tim Potze
@ikkentim
Jan 15 2017 22:14
I use nhibernate as well
Oleg
@5LICK
Jan 15 2017 22:44
i use, but for my game mode i using OrmLite