These are chat archives for ikkentim/SampSharp

12th
May 2016
Tim Potze
@ikkentim
May 12 2016 11:55
Yea, there is a package for everything. Need to connect to an IRC server? No need for a plugin, just download a nuget package
Everything is there
Florian van Dillen
@fvandillen
May 12 2016 11:56
Yeah, currently using teamspeak and telegram packages
Tim Potze
@ikkentim
May 12 2016 11:57
Ooh nice, sending telegram notifications to users or only admins for logs
That’s a nice idea by the way :)
Florian van Dillen
@fvandillen
May 12 2016 12:52
Yes, but also controlling certain features via commands that can be issued to the telegram bot.
It allows for two-way communication.
Tim Potze
@ikkentim
May 12 2016 12:52
Nice :O
Florian van Dillen
@fvandillen
May 12 2016 12:52
The webhooks even allow me to force a ingame refresh when certain stuff happens on the panel
Tim Potze
@ikkentim
May 12 2016 12:53
Do you have a webserver running in the GM for the hooks?
Florian van Dillen
@fvandillen
May 12 2016 12:53
No, the webhooks are part of the telegram bot package :)
Tim Potze
@ikkentim
May 12 2016 12:54
ah
Florian van Dillen
@fvandillen
May 12 2016 12:54
I just input the API key and the telegram package takes care of receiving the webhook
Florian van Dillen
@fvandillen
May 12 2016 13:10
I have a little question that you might know from the top of your head
Tim Potze
@ikkentim
May 12 2016 13:10
hit me
Florian van Dillen
@fvandillen
May 12 2016 13:10
I have a enum where I store the different permissions in my group system
/// <summary>
        /// Permissions.
        /// </summary>
        public enum Permission
        {
            /// <summary>
            /// Can administer a group.
            /// </summary>
            GroupAdmin,

            /// <summary>
            /// Can use the group vehicles.
            /// </summary>
            UseVehicles,

            /// <summary>
            /// Can use the group properties.
            /// </summary>
            UseProperties,

            /// <summary>
            /// Can withdraw from group bank accounts.
            /// </summary>
            WithdrawBank,

            /// <summary>
            /// Can deposit into group bank accounts.
            /// </summary>
            DepositBank,

            /// <summary>
            /// Can check the balance of group bank accounts.
            /// </summary>
            BankBalance,

            /// <summary>
            /// Can access the group owned CB channels.
            /// </summary>
            UseCB,

            /// <summary>
            /// Can administer the group owned CB channels.
            /// </summary>
            AdminCB
        }
Tim Potze
@ikkentim
May 12 2016 13:11
You want multiple permissions?
Florian van Dillen
@fvandillen
May 12 2016 13:12
When managing a certain rank in the group system, I show a dialog with these permissions. Once the dialog gets a response, I want to know based on the ListItem which permission it corresponds to.
Tim Potze
@ikkentim
May 12 2016 13:12
Ah, so in you want to get the enum value from an index?
Florian van Dillen
@fvandillen
May 12 2016 13:12
Correct
The listitems are derived from this enum
Tim Potze
@ikkentim
May 12 2016 13:13
By default, enums internal type is int
And by default, they count up from 0
so with the above enum, given you do not change the values with = 100 or something in the future
you can just cast it
(Permission)index
Florian van Dillen
@fvandillen
May 12 2016 13:14
Oh, nice
Tim Potze
@ikkentim
May 12 2016 13:14
This must mean however that the first list item is GroupAdmin
Florian van Dillen
@fvandillen
May 12 2016 13:14
Yes, the listitems are shown in the correct order
So, example, this would work?
var permToRemove = selectedRank.Permissions.Where(p => (int)p.Permission == managePermissionsArgs.ListItem);
Tim Potze
@ikkentim
May 12 2016 13:15
correct
Florian van Dillen
@fvandillen
May 12 2016 13:15
Where p = the permission class
containing a property that is the enum type
nice, will try it out:) thanks
Florian van Dillen
@fvandillen
May 12 2016 13:46
It needed some additional tweaking, but it fully works now, and blazing fast thanks to nhibernate :)
Will invite you on the server to show it once I fully polished it (error checking mostly)
Florian van Dillen
@fvandillen
May 12 2016 13:55
Would it be possible to have C# expose a rest api that I can call? Like a panel that calls server_address/ban/playername?
Florian van Dillen
@fvandillen
May 12 2016 15:55
When working with a tablist dialog versus a list dialog, the internal structure in SampSharp seems different. With ListDialog, I did dialoginstance.items.add( ). Is the TabList simply dialoginstance.add( )?
Florian van Dillen
@fvandillen
May 12 2016 17:15
It appears the tablist dialog simply shows as a regular list dialog..
Florian van Dillen
@fvandillen
May 12 2016 17:28
Code that generates the dialog:
The upper one contains a \t which doesn't work of course.
Tim Potze
@ikkentim
May 12 2016 18:01
I'm back
Are you running 0.6.x or 0.7dev from master?
Think it might be fixed on master, not 100% sure
Florian van Dillen
@fvandillen
May 12 2016 18:40
0.6.2 from release
Tim Potze
@ikkentim
May 12 2016 18:40
Yea i think i've fixed it already in the in-dev version...
Florian van Dillen
@fvandillen
May 12 2016 18:41
Will branch my gamemode and try with your in-dev version.
Need a shower first, ran 15km :smile:
Tim Potze
@ikkentim
May 12 2016 18:41
Be prepared for some migrating stuff. Refactored some stuff since 0.6.2
Florian van Dillen
@fvandillen
May 12 2016 18:42
Yay! Refactoring :D
Tim Potze
@ikkentim
May 12 2016 18:44
Yep... Fixed it in #131 . I'm currently looking into #85
Florian van Dillen
@fvandillen
May 12 2016 19:06
Oh dude if you manage to fix #85 I can finally convince my community management to switch over development to Samp# :D
Tim Potze
@ikkentim
May 12 2016 19:07
I think I might have it working on linux... Just not on windows because....
do you know if you can delete/rename/replace the DLLs of the gamemode while the server is running on linux?
Florian van Dillen
@fvandillen
May 12 2016 19:08
I never ran the server on linux
Tim Potze
@ikkentim
May 12 2016 19:08
on windows you can't, which is annoying
So I'm looking for my options...
I can either create a "reloading"-script which...
would start when you gmx out of a gamemode, then you can replace your gamemode files and gmx again
Or do something with copying the whole gamemode folder... which is much harder than it sounds.
How does that double gmx sound?
I could also make it a separate rcon command
Florian van Dillen
@fvandillen
May 12 2016 19:11
Sounds like a 90's gangster rapper from Los Angeles :P
Tim Potze
@ikkentim
May 12 2016 19:11
:P
but seriously, does it sound acceptable? 1) run rcon command "sampsharpbreak" 2) replace your gamemode files 3) "sampsharpresume"
Florian van Dillen
@fvandillen
May 12 2016 19:13
So actually halting the entire plugin?:P
Tim Potze
@ikkentim
May 12 2016 19:14
Yea well, it stops the gamemode (calls OnGameModeExit and all) and then gives you the time to replace your dlls, and then calls the OnGameModeInit on the new gamemode
The whole point of #85 is to be able to replace your gamemode files
Florian van Dillen
@fvandillen
May 12 2016 19:15
Oh that would be great!
Would players be able to stay connected?
Tim Potze
@ikkentim
May 12 2016 19:16
Yes.
Florian van Dillen
@fvandillen
May 12 2016 19:16
Nice!
If only I could find a way to avoid double RemoveBuildingForPlayer's :P
Tim Potze
@ikkentim
May 12 2016 19:17
PlayerVars will stay
Florian van Dillen
@fvandillen
May 12 2016 19:17
good!!
Tim Potze
@ikkentim
May 12 2016 19:18
In the back sampsharpbreak and resume won't actually restart the (what the server thinks is a) gamemode, but just reboot the sampsharp gamemode
So player vars and whatever variable you can set won't be changed.
Florian van Dillen
@fvandillen
May 12 2016 19:19
That's actually great dude
Tim Potze
@ikkentim
May 12 2016 19:19
The only thing that still hurts is the conversion between pdb and mdb files which is baked into the plugin
Somehow it keeps crashing and doing weird stuff in general
might pull it out and give instructions in the docs on how to convert symbol files
Florian van Dillen
@fvandillen
May 12 2016 19:20
Because one of the huge limitations of our current script is players crashing on gmx due to the double removal of buildings for players/
Oh about those, what do they do and why does xamarin only do mdb and vs only do pdb:P?
Tim Potze
@ikkentim
May 12 2016 19:20
Ah yea... I still don't understand why the game crashes on double removebuilding
Florian van Dillen
@fvandillen
May 12 2016 19:21
That's a client bug
Tim Potze
@ikkentim
May 12 2016 19:21
pdb and mdb are symbol files which contain debug information (such as which instruction is defined on which line of which .cs file)
pdb is used by .NET and mdb by mono
however, the lateset mono version does support the new portable pdb format which is produced by the new roslyn compiler... so i should probably look into this.
Florian van Dillen
@fvandillen
May 12 2016 19:41
Well fuck my life
Tim Potze
@ikkentim
May 12 2016 19:42
:O
Florian van Dillen
@fvandillen
May 12 2016 19:42
Xamarin refuses to open the .sln file on OSX :P
Tim Potze
@ikkentim
May 12 2016 19:42
Worked before for me? Any error message?
Florian van Dillen
@fvandillen
May 12 2016 19:42
Project file not supported
Tim Potze
@ikkentim
May 12 2016 19:42
:(
have you tried project rider yet?
Florian van Dillen
@fvandillen
May 12 2016 19:43
I'm on the closed beta list for project rider
And I know why xamarin refuses
Tim Potze
@ikkentim
May 12 2016 19:44
:/
Florian van Dillen
@fvandillen
May 12 2016 19:44
Aka. U R 2 ADVANCED PLS PAY US
Tim Potze
@ikkentim
May 12 2016 19:44
I got instant mail from jetbrains when i applied, but a friend of mine registered at same time, hasn't received no mail
xamarin studio should be full free since build16
Florian van Dillen
@fvandillen
May 12 2016 19:45
Did you use a specific (academic) domain to register?
Tim Potze
@ikkentim
May 12 2016 19:45
nope, gmail
might have said i was a student, or OS developer... cant remember
Florian van Dillen
@fvandillen
May 12 2016 19:45
Ye, I remember being promised a full version of Xamarin
Tim Potze
@ikkentim
May 12 2016 19:46
oh yea ofc yo ucant open SampSharp project
now i think of it
that's the plugin
you can't edit c++ with xamarin
Florian van Dillen
@fvandillen
May 12 2016 19:46
Oh lol
Gamemode seems to open
I need to compile gamemode right?
Tim Potze
@ikkentim
May 12 2016 19:47
yea
Florian van Dillen
@fvandillen
May 12 2016 19:51
Okay the refactoring seems to be only a little work
Tim Potze
@ikkentim
May 12 2016 19:52
Good :)
Florian van Dillen
@fvandillen
May 12 2016 19:52
Can you get me up to speed with what's changed with the following code?
Tim Potze
@ikkentim
May 12 2016 19:52
GtaPlayer / GtaVehicle were renamed to BasePlayer / BaseVehicle
Controllers were renamed accordingly
hint, download puush :)
may be a bit slow at times, but it's a very good screenshot sharing tool
it will upload your cmd+shift+2/3/4 screenhots, unless you disable it
Florian van Dillen
@fvandillen
May 12 2016 19:54
I have lightshot on windows haha
Tim Potze
@ikkentim
May 12 2016 19:54
puush works on osx
Florian van Dillen
@fvandillen
May 12 2016 19:54
OSX defaults to Dropbox which sucks
Sweet, will download
Tim Potze
@ikkentim
May 12 2016 19:54
can you change screenshot destination on osx?
i think puush expect them to be on your desktop.
puush has none of those annoying ads lightshot has
Florian van Dillen
@fvandillen
May 12 2016 19:59
The text thing for commands, what was that changed into?
Tim Potze
@ikkentim
May 12 2016 19:59
Screenshot?
This message was deleted
btw, player commands is something i've written extensive docs on http://sampsharp.timpotze.nl/player-commands-vnext
Florian van Dillen
@fvandillen
May 12 2016 20:16
Thx! All compilation errors solved.
However, this is when running le gamemode:
Tim Potze
@ikkentim
May 12 2016 20:16
Nice :)
Florian van Dillen
@fvandillen
May 12 2016 20:16
[12/05/2016 22:14:31] Exception thrownOnGameModeInit:
System.NullReferenceException: Object reference not set to an instance of an object
  at SampSharp.GameMode.BaseMode.SetGameModeText (System.String text) [0x00000] in <filename unknown>:0
Tim Potze
@ikkentim
May 12 2016 20:16
:o
Florian van Dillen
@fvandillen
May 12 2016 20:17
I am really only passing some text to it
Tim Potze
@ikkentim
May 12 2016 20:17
I'm looking... let me see
hmm, that means the natives haven't been loaded at that point of time
do you set it in OnInitialized or in the constructor?
Florian van Dillen
@fvandillen
May 12 2016 20:19
During OnInitialized
In my gamemode class which inherits from basemode
protected override void OnInitialized(EventArgs e)
Full stack trace:
[12/05/2016 22:14:31] Exception thrownOnGameModeInit:
System.NullReferenceException: Object reference not set to an instance of an object
  at SampSharp.GameMode.BaseMode.SetGameModeText (System.String text) [0x00000] in <filename unknown>:0 
  at RockStars6.GameMode.OnInitialized (System.EventArgs e) [0x0001c] in /Users/florianvandillen/Development/RockStars6/samp/RockStars6/RockStars6/GameMode.cs:32 
  at SampSharp.GameMode.BaseMode.OnGameModeInit () [0x00000] in <filename unknown>:0
Tim Potze
@ikkentim
May 12 2016 20:21
Could you, in your server.cfg set loglevel to debug?
loglevel debug
Florian van Dillen
@fvandillen
May 12 2016 20:22
Roger, will run again
Tim Potze
@ikkentim
May 12 2016 20:22
it should say something along these lines http://puu.sh/oPBmG/8ad69c8a1c.png
Florian van Dillen
@fvandillen
May 12 2016 20:23
Oh fuck me
Tim Potze
@ikkentim
May 12 2016 20:23
ah you need to update the plugin
probably, right?
Florian van Dillen
@fvandillen
May 12 2016 20:23
YES
Tim Potze
@ikkentim
May 12 2016 20:23
want me to send you a dll or do you have access to a visual studio?
Florian van Dillen
@fvandillen
May 12 2016 20:23
I just noticed looking closely at the output for the debug stuff
If you could send me one, please do
has debug mode enabled, but that shouldn't hurt
Florian van Dillen
@fvandillen
May 12 2016 20:28
It does lol, because my server doesn't has the msvcp140D runtime :smile:
Tim Potze
@ikkentim
May 12 2016 20:28
hold on...
Florian van Dillen
@fvandillen
May 12 2016 20:31
lemme try
aye
It compiles, it uploads, it runs, now joining the game and checking my lovely tab lists :D
Tim Potze
@ikkentim
May 12 2016 20:33
:p all that work for tab lists haha
Florian van Dillen
@fvandillen
May 12 2016 20:34
Yeah, took me a fair bit of time :smile:
Oh well to be fair it was fucking worth it
They look epic
Tim Potze
@ikkentim
May 12 2016 20:35
:P
Florian van Dillen
@fvandillen
May 12 2016 20:35
And more important, the permission system behind it still works
Tim Potze
@ikkentim
May 12 2016 20:35
Hooray!
got the sampsharpstop / start working
Florian van Dillen
@fvandillen
May 12 2016 20:36
Oh nice dude, on windows too?
Found another dialog that needs some tabbing love
Tim Potze
@ikkentim
May 12 2016 20:36
only tested on windows :P
Florian van Dillen
@fvandillen
May 12 2016 20:38
If I specify IEnumerable<string> columns instead of int I can input text above the tablist, right?
Tim Potze
@ikkentim
May 12 2016 20:40
I think so:P
Made it a long while ago
Florian van Dillen
@fvandillen
May 12 2016 20:40
Will test it to make sure
Tim Potze
@ikkentim
May 12 2016 20:41
Here's the latest plugin build with sampsharpstop/sampsharpstart if you are interested https://www.dropbox.com/s/qfub57vjzu8d7dw/SampSharp-plugin-indev-r.zip?dl=0
Florian van Dillen
@fvandillen
May 12 2016 20:42
Oh sheeeeeet, gonna try that one for sure :P
Tomorrow morning, that is
Tim Potze
@ikkentim
May 12 2016 20:42
Was just about to say i'm done for today too
Florian van Dillen
@fvandillen
May 12 2016 20:44
groupManageRanksDialog.Add(groupRank.Name.ToString(), groupRank.RankPower.ToString());
or
groupManageRanksDialog.Add(new string[] {groupRank.Name.ToString(), groupRank.RankPower.ToString()});
Or doesn't it make any difference?
Oh, and if you're interested in security, this might be relevant for you as well
I registered today
Tim Potze
@ikkentim
May 12 2016 21:22
I don't know if it's the same... Can't remember
Florian van Dillen
@fvandillen
May 12 2016 21:22
I used the first one, and it works perfectly
Tim Potze
@ikkentim
May 12 2016 21:23
That conf sounds like fun but really don't have much time around the end of this month
Expecting high levels of stress